Package systems.dmx.workspaces
Class WorkspacesPlugin
- java.lang.Object
-
- systems.dmx.core.osgi.PluginActivator
-
- systems.dmx.workspaces.WorkspacesPlugin
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
,PluginContext
,IntroduceAssocType
,IntroduceRoleType
,IntroduceTopicType
,PostCreateAssoc
,PostCreateTopic
,EventListener
,WorkspacesService
public class WorkspacesPlugin extends PluginActivator implements WorkspacesService, IntroduceTopicType, IntroduceAssocType, IntroduceRoleType, PostCreateTopic, PostCreateAssoc
-
-
Field Summary
-
Fields inherited from class systems.dmx.core.osgi.PluginActivator
bundle, dmx, mf
-
Fields inherited from interface systems.dmx.workspaces.WorkspacesService
DMX_WORKSPACE_NAME, DMX_WORKSPACE_SHARING_MODE, DMX_WORKSPACE_URI, PROP_WORKSPACE_ID
-
-
Constructor Summary
Constructors Constructor Description WorkspacesPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assignRoleTypeToWorkspace(RoleType roleType, long workspaceId)
Assigns a role type as well as its "parts" to a workspace.DirectivesResponse
assignToWorkspace(long objectId, long workspaceId)
void
assignToWorkspace(DMXObject object, long workspaceId)
Assigns an object to a workspace.void
assignTypeToWorkspace(DMXType type, long workspaceId)
Assigns a type as well as its "parts" to a workspace.Topic
createWorkspace(String name, String uri, SharingMode sharingMode)
void
deleteWorkspace(long workspaceId)
List<Assoc>
getAssignedAssocs(long workspaceId)
Returns all associations assigned to the given workspace.List<Assoc>
getAssignedAssocs(long workspaceId, String assocTypeUri)
Returns all associations of the given type that are assigned to the given workspace.List<Topic>
getAssignedTopics(long workspaceId)
Returns all topics assigned to the given workspace.List<Topic>
getAssignedTopics(long workspaceId, String topicTypeUri)
Returns all topics of the given type that are assigned to the given workspace.Topic
getAssignedWorkspace(long objectId)
Returns the workspace the given topic/association is assigned to.Topic
getWorkspace(String uri)
Returns a workspace by URI.void
introduceAssocType(AssocType assocType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.void
introduceRoleType(RoleType roleType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.void
introduceTopicType(TopicType topicType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.void
postCreateAssoc(Assoc assoc)
Standard workspace assignment for assocs.void
postCreateTopic(Topic topic)
Standard workspace assignment for topics.void
preInstall()
void
shutdown()
-
Methods inherited from class systems.dmx.core.osgi.PluginActivator
getBundleContext, getPluginName, getStaticResource, getUri, init, publishFileSystem, serviceArrived, serviceGone, setCoreService, start, stop, toString
-
-
-
-
Method Detail
-
createWorkspace
public Topic createWorkspace(String name, String uri, SharingMode sharingMode)
- Specified by:
createWorkspace
in interfaceWorkspacesService
uri
- may be null
-
deleteWorkspace
public void deleteWorkspace(long workspaceId)
- Specified by:
deleteWorkspace
in interfaceWorkspacesService
-
getWorkspace
public Topic getWorkspace(String uri)
Description copied from interface:WorkspacesService
Returns a workspace by URI. This is a privileged method: READ permission for the workspace is not required. ### TODO: why is this a privileged method?- Specified by:
getWorkspace
in interfaceWorkspacesService
- Returns:
- The workspace (a topic of type "Workspace").
-
getAssignedWorkspace
public Topic getAssignedWorkspace(long objectId)
Description copied from interface:WorkspacesService
Returns the workspace the given topic/association is assigned to.- Specified by:
getAssignedWorkspace
in interfaceWorkspacesService
- Parameters:
objectId
- a topic ID, or an association ID- Returns:
- The assigned workspace (a topic of type "Workspace"),
or
null
if no workspace is assigned.
-
assignToWorkspace
public DirectivesResponse assignToWorkspace(long objectId, long workspaceId)
-
assignToWorkspace
public void assignToWorkspace(DMXObject object, long workspaceId)
Description copied from interface:WorkspacesService
Assigns an object to a workspace.- Specified by:
assignToWorkspace
in interfaceWorkspacesService
workspaceId
- The ID of the workspace to assign the object to. If -1 is given an existing workspace assignment is removed.
-
assignTypeToWorkspace
public void assignTypeToWorkspace(DMXType type, long workspaceId)
Description copied from interface:WorkspacesService
Assigns a type as well as its "parts" to a workspace. In particular:- the type
- the type's view config
- the direct comp defs (not recursively)
- the direct comp def's view configs
- Specified by:
assignTypeToWorkspace
in interfaceWorkspacesService
workspaceId
- The ID of the workspace to assign the type (and its parts) to. If -1 is given the existing workspace assignments are removed.
-
assignRoleTypeToWorkspace
public void assignRoleTypeToWorkspace(RoleType roleType, long workspaceId)
Description copied from interface:WorkspacesService
Assigns a role type as well as its "parts" to a workspace. In particular:- the role type
- the role type's view config
- Specified by:
assignRoleTypeToWorkspace
in interfaceWorkspacesService
workspaceId
- The ID of the workspace to assign the role type (and its parts) to. If -1 is given the existing workspace assignments are removed.
-
getAssignedTopics
public List<Topic> getAssignedTopics(long workspaceId)
Description copied from interface:WorkspacesService
Returns all topics assigned to the given workspace.- Specified by:
getAssignedTopics
in interfaceWorkspacesService
-
getAssignedAssocs
public List<Assoc> getAssignedAssocs(long workspaceId)
Description copied from interface:WorkspacesService
Returns all associations assigned to the given workspace.- Specified by:
getAssignedAssocs
in interfaceWorkspacesService
-
getAssignedTopics
public List<Topic> getAssignedTopics(long workspaceId, String topicTypeUri)
Description copied from interface:WorkspacesService
Returns all topics of the given type that are assigned to the given workspace.- Specified by:
getAssignedTopics
in interfaceWorkspacesService
-
getAssignedAssocs
public List<Assoc> getAssignedAssocs(long workspaceId, String assocTypeUri)
Description copied from interface:WorkspacesService
Returns all associations of the given type that are assigned to the given workspace.- Specified by:
getAssignedAssocs
in interfaceWorkspacesService
-
preInstall
public void preInstall()
- Specified by:
preInstall
in interfacePluginContext
- Overrides:
preInstall
in classPluginActivator
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacePluginContext
- Overrides:
shutdown
in classPluginActivator
-
introduceTopicType
public void introduceTopicType(TopicType topicType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace. This is important in conjunction with access control. Note: type introduction is aborted if at least one of these conditions apply: - A workspace cookie is present. In this case the type gets its workspace assignment the regular way (this plugin's post-create listeners). This happens e.g. when a type is created interactively in the Webclient. - The type is not a DMX standard type. In this case the 3rd-party plugin developer is responsible for doing the workspace assignment (in case the type is created programmatically while a migration). DM can't know to which workspace a 3rd-party type belongs to. A type is regarded a DMX standard type if its URI begins with "dmx."- Specified by:
introduceTopicType
in interfaceIntroduceTopicType
-
introduceAssocType
public void introduceAssocType(AssocType assocType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace. This is important in conjunction with access control. Note: type introduction is aborted if at least one of these conditions apply: - A workspace cookie is present. In this case the type gets its workspace assignment the regular way (this plugin's post-create listeners). This happens e.g. when a type is created interactively in the Webclient. - The type is not a DMX standard type. In this case the 3rd-party plugin developer is responsible for doing the workspace assignment (in case the type is created programmatically while a migration). DM can't know to which workspace a 3rd-party type belongs to. A type is regarded a DMX standard type if its URI begins with "dmx."- Specified by:
introduceAssocType
in interfaceIntroduceAssocType
-
introduceRoleType
public void introduceRoleType(RoleType roleType)
Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace. This is important in conjunction with access control. Note: type introduction is aborted if at least one of these conditions apply: - A workspace cookie is present. In this case the type gets its workspace assignment the regular way (this plugin's post-create listeners). This happens e.g. when a type is created interactively in the Webclient. - The type is not a DMX standard type. In this case the 3rd-party plugin developer is responsible for doing the workspace assignment (in case the type is created programmatically while a migration). DM can't know to which workspace a 3rd-party type belongs to. A type is regarded a DMX standard type if its URI begins with "dmx."- Specified by:
introduceRoleType
in interfaceIntroduceRoleType
-
postCreateTopic
public void postCreateTopic(Topic topic)
Standard workspace assignment for topics.- Specified by:
postCreateTopic
in interfacePostCreateTopic
-
postCreateAssoc
public void postCreateAssoc(Assoc assoc)
Standard workspace assignment for assocs.- Specified by:
postCreateAssoc
in interfacePostCreateAssoc
-
-