001    package de.deepamehta.plugins.workspaces.service;
002    
003    import de.deepamehta.core.DeepaMehtaObject;
004    import de.deepamehta.core.RelatedTopic;
005    import de.deepamehta.core.Topic;
006    import de.deepamehta.core.Type;
007    import de.deepamehta.core.service.PluginService;
008    
009    import java.util.List;
010    
011    
012    
013    public interface WorkspacesService extends PluginService {
014    
015        /**
016         * Fetches the workspaces the specified object is assigned to.
017         */
018        List<RelatedTopic> getAssignedWorkspaces(DeepaMehtaObject object);
019    
020        /**
021         * Checks weather the specified topic is assigned to the specified workspace
022         */
023        boolean isAssignedToWorkspace(Topic topic, long workspaceId);
024    
025        // ---
026    
027        /**
028         * Fetches the default workspace ("DeepaMehta").
029         *
030         * @return  The default workspace (a topic of type "Workspace" / "dm4.workspaces.workspace"),
031         *          or <code>null</code> if it doesn't exist.
032         *          Note: the default workspace is NOT required to exist ### TODO: think about it
033         */
034        Topic getDefaultWorkspace();
035    
036        // ---
037    
038        /**
039         * Assigns the specified object to a workspace.
040         */
041        void assignToWorkspace(DeepaMehtaObject object, long workspaceId);
042    
043        /**
044         * Assigns the specified type and all its view configuration topics to a workspace.
045         */
046        void assignTypeToWorkspace(Type type, long workspaceId);
047    
048        // ---
049    
050        Topic createWorkspace(String name);
051    
052        Topic createWorkspace(String name, String uri);
053    }