public class WorkspacesPlugin extends PluginActivator implements WorkspacesService, IntroduceTopicTypeListener, IntroduceAssociationTypeListener, PostCreateTopicListener, PostCreateAssociationListener, PreDeleteTopicListener
Modifier and Type | Class and Description |
---|---|
private class |
WorkspacesPlugin.Messenger |
Modifier and Type | Field and Description |
---|---|
private ConfigService |
configService |
private FacetsService |
facetsService |
private Logger |
logger |
private WorkspacesPlugin.Messenger |
me |
private javax.servlet.http.HttpServletRequest |
request |
private static boolean |
SHARING_MODE_COLLABORATIVE_ENABLED |
private static boolean |
SHARING_MODE_COMMON_ENABLED |
private static boolean |
SHARING_MODE_CONFIDENTIAL_ENABLED |
private static boolean |
SHARING_MODE_PRIVATE_ENABLED |
private static boolean |
SHARING_MODE_PUBLIC_ENABLED |
private TopicmapsService |
topicmapsService |
bundle, dmx, mf
DMX_WORKSPACE_NAME, DMX_WORKSPACE_SHARING_MODE, DMX_WORKSPACE_URI, PROP_WORKSPACE_ID
Constructor and Description |
---|
WorkspacesPlugin() |
Modifier and Type | Method and Description |
---|---|
private void |
_assignToWorkspace(DMXObject object,
long workspaceId) |
private void |
applyWorkspaceFilter(Iterator<? extends DMXObject> objects,
long workspaceId) |
void |
assignToWorkspace(DMXObject object,
long workspaceId)
Assigns the given object to the given workspace.
|
DirectivesResponse |
assignToWorkspace(long objectId,
long workspaceId) |
void |
assignTypeToWorkspace(DMXType type,
long workspaceId)
Assigns the given type and all its view configuration topics to the given workspace.
|
private void |
checkWorkspaceId(long topicId)
Checks if the topic with the specified ID exists and is a Workspace.
|
Topic |
createWorkspace(String name,
String uri,
SharingMode sharingMode) |
private void |
deleteWorkspaceContent(long workspaceId) |
List<Association> |
getAssignedAssociations(long workspaceId)
Returns all associations assigned to the given workspace.
|
List<Association> |
getAssignedAssociations(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 a topic or association is assigned to.
|
private long |
getAssignedWorkspaceId(long objectId) |
private Topic |
getDMXWorkspace()
Returns the DMX workspace or throws an exception if it doesn't exist.
|
Topic |
getWorkspace(String uri)
Returns a workspace by URI.
|
private String |
info(DMXObject object) |
void |
introduceAssociationType(AssociationType assocType)
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.
|
private boolean |
isDMXStandardType(DMXType type) |
private boolean |
isWorkspaceAssignment(Association assoc) |
private boolean |
isWorkspaceDescription(Topic topic) |
void |
postCreateAssociation(Association assoc)
Assigns every created association to the current workspace.
|
void |
postCreateTopic(Topic topic)
Assigns every created topic to the current workspace.
|
void |
preDeleteTopic(Topic topic)
When a workspace is about to be deleted its entire content must be deleted.
|
void |
preInstall() |
void |
shutdown() |
private boolean |
workspaceAssignmentIsSuppressed(DMXObject object)
Returns true if standard workspace assignment is currently suppressed for the current thread.
|
private long |
workspaceId() |
private long |
workspaceIdForType(DMXType type)
Returns the ID of the DMX workspace or -1 to signal abortion of type introduction.
|
getBundleContext, getPluginName, getStaticResource, getUri, init, publishFileSystem, serviceArrived, serviceGone, setCoreService, start, stop, toString
private static final boolean SHARING_MODE_PRIVATE_ENABLED
private static final boolean SHARING_MODE_CONFIDENTIAL_ENABLED
private static final boolean SHARING_MODE_COLLABORATIVE_ENABLED
private static final boolean SHARING_MODE_PUBLIC_ENABLED
private static final boolean SHARING_MODE_COMMON_ENABLED
private FacetsService facetsService
private TopicmapsService topicmapsService
private ConfigService configService
@Context private javax.servlet.http.HttpServletRequest request
private WorkspacesPlugin.Messenger me
public WorkspacesPlugin()
public Topic createWorkspace(String name, String uri, SharingMode sharingMode)
createWorkspace
in interface WorkspacesService
uri
- may be nullpublic Topic getWorkspace(String uri)
WorkspacesService
getWorkspace
in interface WorkspacesService
public Topic getAssignedWorkspace(long objectId)
WorkspacesService
getAssignedWorkspace
in interface WorkspacesService
null
if no workspace is assigned.public DirectivesResponse assignToWorkspace(long objectId, long workspaceId)
public void assignToWorkspace(DMXObject object, long workspaceId)
WorkspacesService
assignToWorkspace
in interface WorkspacesService
public void assignTypeToWorkspace(DMXType type, long workspaceId)
WorkspacesService
assignTypeToWorkspace
in interface WorkspacesService
public List<Topic> getAssignedTopics(long workspaceId)
WorkspacesService
getAssignedTopics
in interface WorkspacesService
public List<Association> getAssignedAssociations(long workspaceId)
WorkspacesService
getAssignedAssociations
in interface WorkspacesService
public List<Topic> getAssignedTopics(long workspaceId, String topicTypeUri)
WorkspacesService
getAssignedTopics
in interface WorkspacesService
public List<Association> getAssignedAssociations(long workspaceId, String assocTypeUri)
WorkspacesService
getAssignedAssociations
in interface WorkspacesService
public void preInstall()
preInstall
in interface PluginContext
preInstall
in class PluginActivator
public void shutdown()
shutdown
in interface PluginContext
shutdown
in class PluginActivator
public void introduceTopicType(TopicType topicType)
introduceTopicType
in interface IntroduceTopicTypeListener
public void introduceAssociationType(AssociationType assocType)
introduceAssociationType
in interface IntroduceAssociationTypeListener
public void postCreateTopic(Topic topic)
postCreateTopic
in interface PostCreateTopicListener
public void postCreateAssociation(Association assoc)
postCreateAssociation
in interface PostCreateAssociationListener
public void preDeleteTopic(Topic topic)
preDeleteTopic
in interface PreDeleteTopicListener
private long workspaceId()
private long workspaceIdForType(DMXType type)
private long getAssignedWorkspaceId(long objectId)
private void _assignToWorkspace(DMXObject object, long workspaceId)
private void deleteWorkspaceContent(long workspaceId)
private boolean isDMXStandardType(DMXType type)
private boolean isWorkspaceDescription(Topic topic)
private boolean isWorkspaceAssignment(Association assoc)
private Topic getDMXWorkspace()
private void applyWorkspaceFilter(Iterator<? extends DMXObject> objects, long workspaceId)
private void checkWorkspaceId(long topicId)
private boolean workspaceAssignmentIsSuppressed(DMXObject object)
Copyright © 2018. All Rights Reserved.