public class WorkspacesPlugin extends PluginActivator implements WorkspacesService, IntroduceTopicTypeListener, IntroduceAssociationTypeListener, PostCreateTopicListener, PostCreateAssociationListener
Modifier and Type | Field and Description |
---|---|
private FacetsService |
facetsService |
private Logger |
logger |
private static String |
PROP_WORKSPACE_ID |
private TopicmapsService |
topicmapsService |
bundle, dms
DEEPAMEHTA_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 Topic> topics,
long workspaceId) |
void |
assignToWorkspace(DeepaMehtaObject object,
long workspaceId)
Assigns the given object to the given workspace.
|
Directives |
assignToWorkspace(long objectId,
long workspaceId) |
void |
assignTypeToWorkspace(Type 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) |
ResultList<RelatedTopic> |
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.
|
boolean |
isAssignedToWorkspace(long objectId,
long workspaceId)
Checks weather the given topic or association is assigned to the given workspace.
|
private boolean |
isDeepaMehtaStandardType(Type 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.
|
private boolean |
workspaceAssignmentIsSuppressed(DeepaMehtaObject object)
Returns true if standard workspace assignment is currently suppressed for the current thread.
|
private long |
workspaceId() |
private long |
workspaceIdForType(Type type)
Returns the ID of the DeepaMehta workspace or -1 to signal abortion of type introduction.
|
getBundleContext, getPluginName, getStaticResource, getUri, init, preInstall, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
private static final String PROP_WORKSPACE_ID
private FacetsService facetsService
private TopicmapsService topicmapsService
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 ResultList<RelatedTopic> getAssignedTopics(long workspaceId, String topicTypeUri)
WorkspacesService
getAssignedTopics
in interface WorkspacesService
public Topic getAssignedWorkspace(long objectId)
WorkspacesService
getAssignedWorkspace
in interface WorkspacesService
null
if no workspace is assigned.public boolean isAssignedToWorkspace(long objectId, long workspaceId)
WorkspacesService
isAssignedToWorkspace
in interface WorkspacesService
public Directives assignToWorkspace(long objectId, long workspaceId)
public void assignToWorkspace(DeepaMehtaObject object, long workspaceId)
WorkspacesService
assignToWorkspace
in interface WorkspacesService
public void assignTypeToWorkspace(Type type, long workspaceId)
WorkspacesService
assignTypeToWorkspace
in interface WorkspacesService
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
private long workspaceId()
private long workspaceIdForType(Type type)
private long getAssignedWorkspaceId(long objectId)
private void _assignToWorkspace(DeepaMehtaObject object, long workspaceId)
private boolean isDeepaMehtaStandardType(Type type)
private boolean isWorkspaceDescription(Topic topic)
private boolean isWorkspaceAssignment(Association assoc)
private Topic getDeepaMehtaWorkspace()
private void applyWorkspaceFilter(Iterator<? extends Topic> topics, long workspaceId)
private void checkArgument(long topicId)
private boolean workspaceAssignmentIsSuppressed(DeepaMehtaObject object)
private String info(DeepaMehtaObject object)
Copyright © 2015. All Rights Reserved.