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 voidassignRoleTypeToWorkspace(RoleType roleType, long workspaceId)Assigns a role type as well as its "parts" to a workspace.DirectivesResponseassignToWorkspace(long objectId, long workspaceId)voidassignToWorkspace(DMXObject object, long workspaceId)Assigns an object to a workspace.voidassignTypeToWorkspace(DMXType type, long workspaceId)Assigns a type as well as its "parts" to a workspace.TopiccreateWorkspace(String name, String uri, SharingMode sharingMode)voiddeleteWorkspace(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.TopicgetAssignedWorkspace(long objectId)Returns the workspace the given topic/association is assigned to.TopicgetWorkspace(String uri)Returns a workspace by URI.voidintroduceAssocType(AssocType assocType)Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.voidintroduceRoleType(RoleType roleType)Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.voidintroduceTopicType(TopicType topicType)Takes care the DMX standard types (and their parts) get an assignment to the DMX workspace.voidpostCreateAssoc(Assoc assoc)Standard workspace assignment for assocs.voidpostCreateTopic(Topic topic)Standard workspace assignment for topics.voidpreInstall()voidshutdown()-
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:
createWorkspacein interfaceWorkspacesServiceuri- may be null
-
deleteWorkspace
public void deleteWorkspace(long workspaceId)
- Specified by:
deleteWorkspacein interfaceWorkspacesService
-
getWorkspace
public Topic getWorkspace(String uri)
Description copied from interface:WorkspacesServiceReturns 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:
getWorkspacein interfaceWorkspacesService- Returns:
- The workspace (a topic of type "Workspace").
-
getAssignedWorkspace
public Topic getAssignedWorkspace(long objectId)
Description copied from interface:WorkspacesServiceReturns the workspace the given topic/association is assigned to.- Specified by:
getAssignedWorkspacein interfaceWorkspacesService- Parameters:
objectId- a topic ID, or an association ID- Returns:
- The assigned workspace (a topic of type "Workspace"),
or
nullif no workspace is assigned.
-
assignToWorkspace
public DirectivesResponse assignToWorkspace(long objectId, long workspaceId)
-
assignToWorkspace
public void assignToWorkspace(DMXObject object, long workspaceId)
Description copied from interface:WorkspacesServiceAssigns an object to a workspace.- Specified by:
assignToWorkspacein interfaceWorkspacesServiceworkspaceId- 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:WorkspacesServiceAssigns 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:
assignTypeToWorkspacein interfaceWorkspacesServiceworkspaceId- 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:WorkspacesServiceAssigns a role type as well as its "parts" to a workspace. In particular:- the role type
- the role type's view config
- Specified by:
assignRoleTypeToWorkspacein interfaceWorkspacesServiceworkspaceId- 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:WorkspacesServiceReturns all topics assigned to the given workspace.- Specified by:
getAssignedTopicsin interfaceWorkspacesService
-
getAssignedAssocs
public List<Assoc> getAssignedAssocs(long workspaceId)
Description copied from interface:WorkspacesServiceReturns all associations assigned to the given workspace.- Specified by:
getAssignedAssocsin interfaceWorkspacesService
-
getAssignedTopics
public List<Topic> getAssignedTopics(long workspaceId, String topicTypeUri)
Description copied from interface:WorkspacesServiceReturns all topics of the given type that are assigned to the given workspace.- Specified by:
getAssignedTopicsin interfaceWorkspacesService
-
getAssignedAssocs
public List<Assoc> getAssignedAssocs(long workspaceId, String assocTypeUri)
Description copied from interface:WorkspacesServiceReturns all associations of the given type that are assigned to the given workspace.- Specified by:
getAssignedAssocsin interfaceWorkspacesService
-
preInstall
public void preInstall()
- Specified by:
preInstallin interfacePluginContext- Overrides:
preInstallin classPluginActivator
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacePluginContext- Overrides:
shutdownin 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:
introduceTopicTypein 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:
introduceAssocTypein 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:
introduceRoleTypein interfaceIntroduceRoleType
-
postCreateTopic
public void postCreateTopic(Topic topic)
Standard workspace assignment for topics.- Specified by:
postCreateTopicin interfacePostCreateTopic
-
postCreateAssoc
public void postCreateAssoc(Assoc assoc)
Standard workspace assignment for assocs.- Specified by:
postCreateAssocin interfacePostCreateAssoc
-
-