de.deepamehta.plugins.workspaces
Class WorkspacesPlugin

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by de.deepamehta.plugins.workspaces.WorkspacesPlugin
All Implemented Interfaces:
PluginContext, IntroduceAssociationTypeListener, IntroduceTopicTypeListener, PostCreateAssociationListener, PostCreateTopicListener, Listener, PluginService, WorkspacesService, BundleActivator

public class WorkspacesPlugin
extends PluginActivator
implements WorkspacesService, IntroduceTopicTypeListener, IntroduceAssociationTypeListener, PostCreateTopicListener, PostCreateAssociationListener


Field Summary
private static String DEFAULT_WORKSPACE_NAME
           
private static String DEFAULT_WORKSPACE_URI
           
private  FacetsService facetsService
           
private  Logger logger
           
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
WorkspacesPlugin()
           
 
Method Summary
private  void _assignToWorkspace(DeepaMehtaObject object, long workspaceId)
           
 void assignToWorkspace(DeepaMehtaObject object, long workspaceId)
          Assigns the specified object to a workspace.
 void assignTypeToWorkspace(Type type, long workspaceId)
          Assigns the specified type and all its view configuration topics to a workspace.
private  void checkArgument(long topicId)
          Checks if the topic with the specified ID exists and is a Workspace.
 Topic createWorkspace(String name)
           
 Topic createWorkspace(String name, String uri)
           
private  Topic fetchDefaultWorkspace()
           
 List<RelatedTopic> getAssignedWorkspaces(DeepaMehtaObject object)
          Fetches the workspaces the specified object is assigned to.
 Topic getDefaultWorkspace()
          Fetches the default workspace ("DeepaMehta").
 void introduceAssociationType(AssociationType assocType, ClientState clientState)
           
 void introduceTopicType(TopicType topicType, ClientState clientState)
           
 boolean isAssignedToWorkspace(Topic topic, long workspaceId)
          Checks weather the specified topic is assigned to the specified workspace
private  boolean isDeepaMehtaStandardType(Type type)
           
 void postCreateAssociation(Association assoc, ClientState clientState, Directives directives)
          Every created association is assigned to the current workspace.
 void postCreateTopic(Topic topic, ClientState clientState, Directives directives)
          Every created topic is assigned to the current workspace.
 void postInstall()
          Creates the "Default" workspace.
 void serviceArrived(PluginService service)
           
 void serviceGone(PluginService service)
           
private  long workspaceId(ClientState clientState)
           
private  long workspaceIdForType(Type type, ClientState clientState)
           
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, init, publishDirectory, setCoreService, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WORKSPACE_NAME

private static final String DEFAULT_WORKSPACE_NAME
See Also:
Constant Field Values

DEFAULT_WORKSPACE_URI

private static final String DEFAULT_WORKSPACE_URI
See Also:
Constant Field Values

facetsService

private FacetsService facetsService

logger

private Logger logger
Constructor Detail

WorkspacesPlugin

public WorkspacesPlugin()
Method Detail

getAssignedWorkspaces

public List<RelatedTopic> getAssignedWorkspaces(DeepaMehtaObject object)
Description copied from interface: WorkspacesService
Fetches the workspaces the specified object is assigned to.

Specified by:
getAssignedWorkspaces in interface WorkspacesService

isAssignedToWorkspace

public boolean isAssignedToWorkspace(Topic topic,
                                     long workspaceId)
Description copied from interface: WorkspacesService
Checks weather the specified topic is assigned to the specified workspace

Specified by:
isAssignedToWorkspace in interface WorkspacesService

getDefaultWorkspace

public Topic getDefaultWorkspace()
Description copied from interface: WorkspacesService
Fetches the default workspace ("DeepaMehta").

Specified by:
getDefaultWorkspace in interface WorkspacesService
Returns:
The default workspace (a topic of type "Workspace" / "dm4.workspaces.workspace"), or null if it doesn't exist. Note: the default workspace is NOT required to exist ### TODO: think about it

assignToWorkspace

public void assignToWorkspace(DeepaMehtaObject object,
                              long workspaceId)
Description copied from interface: WorkspacesService
Assigns the specified object to a workspace.

Specified by:
assignToWorkspace in interface WorkspacesService

assignTypeToWorkspace

public void assignTypeToWorkspace(Type type,
                                  long workspaceId)
Description copied from interface: WorkspacesService
Assigns the specified type and all its view configuration topics to a workspace.

Specified by:
assignTypeToWorkspace in interface WorkspacesService

createWorkspace

public Topic createWorkspace(String name)
Specified by:
createWorkspace in interface WorkspacesService

createWorkspace

public Topic createWorkspace(String name,
                             String uri)
Specified by:
createWorkspace in interface WorkspacesService

postInstall

public void postInstall()
Creates the "Default" workspace.

Specified by:
postInstall in interface PluginContext
Overrides:
postInstall in class PluginActivator

serviceArrived

public void serviceArrived(PluginService service)
Specified by:
serviceArrived in interface PluginContext
Overrides:
serviceArrived in class PluginActivator

serviceGone

public void serviceGone(PluginService service)
Specified by:
serviceGone in interface PluginContext
Overrides:
serviceGone in class PluginActivator

introduceTopicType

public void introduceTopicType(TopicType topicType,
                               ClientState clientState)
Specified by:
introduceTopicType in interface IntroduceTopicTypeListener

introduceAssociationType

public void introduceAssociationType(AssociationType assocType,
                                     ClientState clientState)
Specified by:
introduceAssociationType in interface IntroduceAssociationTypeListener

postCreateTopic

public void postCreateTopic(Topic topic,
                            ClientState clientState,
                            Directives directives)
Every created topic is assigned to the current workspace.

Specified by:
postCreateTopic in interface PostCreateTopicListener

postCreateAssociation

public void postCreateAssociation(Association assoc,
                                  ClientState clientState,
                                  Directives directives)
Every created association is assigned to the current workspace.

Specified by:
postCreateAssociation in interface PostCreateAssociationListener

workspaceId

private long workspaceId(ClientState clientState)

workspaceIdForType

private long workspaceIdForType(Type type,
                                ClientState clientState)

_assignToWorkspace

private void _assignToWorkspace(DeepaMehtaObject object,
                                long workspaceId)

fetchDefaultWorkspace

private Topic fetchDefaultWorkspace()

isDeepaMehtaStandardType

private boolean isDeepaMehtaStandardType(Type type)

checkArgument

private void checkArgument(long topicId)
Checks if the topic with the specified ID exists and is a Workspace. If not, an exception is thrown.



Copyright © 2013. All Rights Reserved.