public class WorkspacesPlugin extends PluginActivator implements WorkspacesService, IntroduceTopicTypeListener, IntroduceAssociationTypeListener, PostCreateTopicListener, PostCreateAssociationListener, PreDeleteTopicListener
| Modifier and Type | Field and Description |
|---|---|
private ConfigService |
configService |
private FacetsService |
facetsService |
private Logger |
logger |
private static String |
PROP_WORKSPACE_ID |
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, dm4, mfDEEPAMEHTA_WORKSPACE_NAME, DEEPAMEHTA_WORKSPACE_SHARING_MODE, DEEPAMEHTA_WORKSPACE_URI| Constructor and Description |
|---|
WorkspacesPlugin() |
| Modifier and Type | Method and Description |
|---|---|
private void |
_assignToWorkspace(DeepaMehtaObject object,
long workspaceId) |
private void |
applyWorkspaceFilter(Iterator<? extends DeepaMehtaObject> objects,
long workspaceId) |
void |
assignToWorkspace(DeepaMehtaObject object,
long workspaceId)
Assigns the given object to the given workspace.
|
DirectivesResponse |
assignToWorkspace(long objectId,
long workspaceId) |
void |
assignTypeToWorkspace(DeepaMehtaType type,
long workspaceId)
Assigns the given type and all its view configuration topics to the given workspace.
|
private void |
checkArgument(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 |
getDeepaMehtaWorkspace()
Returns the DeepaMehta workspace or throws an exception if it doesn't exist.
|
Topic |
getWorkspace(String uri)
Returns a workspace by URI.
|
private String |
info(DeepaMehtaObject object) |
void |
introduceAssociationType(AssociationType assocType)
Takes care the DeepaMehta standard types (and their parts) get an assignment to the DeepaMehta workspace.
|
void |
introduceTopicType(TopicType topicType)
Takes care the DeepaMehta standard types (and their parts) get an assignment to the DeepaMehta workspace.
|
private boolean |
isDeepaMehtaStandardType(DeepaMehtaType 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(DeepaMehtaObject object)
Returns true if standard workspace assignment is currently suppressed for the current thread.
|
private long |
workspaceId() |
private long |
workspaceIdForType(DeepaMehtaType type)
Returns the ID of the DeepaMehta workspace or -1 to signal abortion of type introduction.
|
getBundleContext, getPluginName, getStaticResource, getUri, init, publishFileSystem, serviceArrived, serviceGone, setCoreService, start, stop, toStringprivate 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 static final String PROP_WORKSPACE_ID
private FacetsService facetsService
private TopicmapsService topicmapsService
private ConfigService configService
public WorkspacesPlugin()
public Topic createWorkspace(String name, String uri, SharingMode sharingMode)
createWorkspace in interface WorkspacesServiceuri - may be nullpublic Topic getWorkspace(String uri)
WorkspacesServicegetWorkspace in interface WorkspacesServicepublic Topic getAssignedWorkspace(long objectId)
WorkspacesServicegetAssignedWorkspace in interface WorkspacesServicenull if no workspace is assigned.public DirectivesResponse assignToWorkspace(long objectId, long workspaceId)
public void assignToWorkspace(DeepaMehtaObject object, long workspaceId)
WorkspacesServiceassignToWorkspace in interface WorkspacesServicepublic void assignTypeToWorkspace(DeepaMehtaType type, long workspaceId)
WorkspacesServiceassignTypeToWorkspace in interface WorkspacesServicepublic List<Topic> getAssignedTopics(long workspaceId)
WorkspacesServicegetAssignedTopics in interface WorkspacesServicepublic List<Association> getAssignedAssociations(long workspaceId)
WorkspacesServicegetAssignedAssociations in interface WorkspacesServicepublic List<Topic> getAssignedTopics(long workspaceId, String topicTypeUri)
WorkspacesServicegetAssignedTopics in interface WorkspacesServicepublic List<Association> getAssignedAssociations(long workspaceId, String assocTypeUri)
WorkspacesServicegetAssignedAssociations in interface WorkspacesServicepublic void preInstall()
preInstall in interface PluginContextpreInstall in class PluginActivatorpublic void shutdown()
shutdown in interface PluginContextshutdown in class PluginActivatorpublic void introduceTopicType(TopicType topicType)
introduceTopicType in interface IntroduceTopicTypeListenerpublic void introduceAssociationType(AssociationType assocType)
introduceAssociationType in interface IntroduceAssociationTypeListenerpublic void postCreateTopic(Topic topic)
postCreateTopic in interface PostCreateTopicListenerpublic void postCreateAssociation(Association assoc)
postCreateAssociation in interface PostCreateAssociationListenerpublic void preDeleteTopic(Topic topic)
preDeleteTopic in interface PreDeleteTopicListenerprivate long workspaceId()
private long workspaceIdForType(DeepaMehtaType type)
private long getAssignedWorkspaceId(long objectId)
private void _assignToWorkspace(DeepaMehtaObject object, long workspaceId)
private void deleteWorkspaceContent(long workspaceId)
private boolean isDeepaMehtaStandardType(DeepaMehtaType type)
private boolean isWorkspaceDescription(Topic topic)
private boolean isWorkspaceAssignment(Association assoc)
private Topic getDeepaMehtaWorkspace()
private void applyWorkspaceFilter(Iterator<? extends DeepaMehtaObject> objects, long workspaceId)
private void checkArgument(long topicId)
private boolean workspaceAssignmentIsSuppressed(DeepaMehtaObject object)
private String info(DeepaMehtaObject object)
Copyright © 2016. All Rights Reserved.