Package systems.dmx.topicmaps
Class TopicmapsPlugin
- java.lang.Object
-
- systems.dmx.core.osgi.PluginActivator
-
- systems.dmx.topicmaps.TopicmapsPlugin
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
,PluginContext
,PreSendTopic
,EventListener
,TopicmapCustomizer
,TopicmapsService
public class TopicmapsPlugin extends PluginActivator implements TopicmapsService, TopicmapCustomizer, PreSendTopic
-
-
Field Summary
-
Fields inherited from class systems.dmx.core.osgi.PluginActivator
bundle, dmx, mf
-
Fields inherited from interface systems.dmx.topicmaps.TopicmapsService
DEFAULT_TOPICMAP_NAME, DEFAULT_TOPICMAP_TYPE_URI
-
-
Constructor Summary
Constructors Constructor Description TopicmapsPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssocToTopicmap(long topicmapId, long assocId, ViewProps viewProps)
Adds an association to a topicmap.void
addRelatedTopicToTopicmap(long topicmapId, long topicId, long assocId, ViewProps viewProps)
void
addTopicToTopicmap(long topicmapId, long topicId, int x, int y, boolean visibility)
Convenience method to add a topic with the standard view properties.void
addTopicToTopicmap(long topicmapId, long topicId, ViewProps viewProps)
Adds a topic to a topicmap.Topic
createTopicmap(String name, String topicmapTypeUri, ViewProps viewProps)
void
customizeTopic(RelatedTopic topic, ViewProps viewProps)
Note: as Topicmap is not a DMXObject no PRE_SEND event is fired, so for customizing the topicmap we use a TopicmapCustomizer.Assoc
getAssocMapcontext(long topicmapId, long assocId)
ViewProps
getAssocViewProps(long topicmapId, long assocId)
Retrieves an assoc's standard view properties: "visibility" and "pinned".Topicmap
getTopicmap(long topicmapId, boolean includeChildren)
Fetches a topicmap from DB.InputStream
getTopicmapAndTopicInWebclient()
Assoc
getTopicMapcontext(long topicmapId, long topicId)
InputStream
getTopicmapInWebclient()
List<RelatedTopic>
getTopicmapTopics(long objectId)
Returns all topicmaps which contain the given topic/assoc.ViewProps
getTopicViewProps(long topicmapId, long topicId)
Retrieves a topic's standard view properties: "x", "y", "visibility", "pinned", "width", and "height".void
hideAssocs(long topicmapId, IdList assocIds)
void
hideMulti(long topicmapId, IdList topicIds, IdList assocIds)
void
hideTopics(long topicmapId, IdList topicIds)
void
preInstall()
void
preSendTopic(Topic topic)
Always send a Topicmap topic complete with child topics.void
registerTopicmapCustomizer(TopicmapCustomizer customizer)
void
registerTopicmapType(TopicmapType topicmapType)
void
setAssocViewProps(long topicmapId, long assocId, ViewProps viewProps)
void
setAssocVisibility(long topicmapId, long assocId, boolean visibility)
Convenience method to update the "dmx.topicmaps.visibility" standard view property.void
setTopicmapViewport(long topicmapId, int panX, int panY, double zoom)
void
setTopicPosition(long topicmapId, long topicId, int x, int y)
Convenience method to update the "dmx.topicmaps.x" and "dmx.topicmaps.y" standard view properties.void
setTopicPositions(long topicmapId, TopicCoords coords)
void
setTopicViewProps(long topicmapId, long topicId, ViewProps viewProps)
void
setTopicVisibility(long topicmapId, long topicId, boolean visibility)
Convenience method to update the "dmx.topicmaps.visibility" standard view property.void
unregisterTopicmapCustomizer(TopicmapCustomizer customizer)
-
Methods inherited from class systems.dmx.core.osgi.PluginActivator
getBundleContext, getPluginName, getStaticResource, getUri, init, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
-
-
-
-
Method Detail
-
createTopicmap
public Topic createTopicmap(String name, String topicmapTypeUri, ViewProps viewProps)
- Specified by:
createTopicmap
in interfaceTopicmapsService
- Returns:
- the created Topicmap topic.
-
getTopicmap
public Topicmap getTopicmap(long topicmapId, boolean includeChildren)
Description copied from interface:TopicmapsService
Fetches a topicmap from DB.- Specified by:
getTopicmap
in interfaceTopicmapsService
includeChildren
- if true the topics contained in the topicmap will include their child topics.
-
getTopicmapTopics
public List<RelatedTopic> getTopicmapTopics(long objectId)
Description copied from interface:TopicmapsService
Returns all topicmaps which contain the given topic/assoc. Only those topicmaps are returned in which the given topic/assoc is visible (not hidden). TODO: rename to findTopicmaps() or something likes this- Specified by:
getTopicmapTopics
in interfaceTopicmapsService
- Parameters:
objectId
- a topic ID or an assoc ID- Returns:
- topics of type Topicmap
-
addTopicToTopicmap
public void addTopicToTopicmap(long topicmapId, long topicId, int x, int y, boolean visibility)
Description copied from interface:TopicmapsService
Convenience method to add a topic with the standard view properties.- Specified by:
addTopicToTopicmap
in interfaceTopicmapsService
-
addTopicToTopicmap
public void addTopicToTopicmap(long topicmapId, long topicId, ViewProps viewProps)
Description copied from interface:TopicmapsService
Adds a topic to a topicmap. If the topic is added already an exception is thrown.- Specified by:
addTopicToTopicmap
in interfaceTopicmapsService
-
addAssocToTopicmap
public void addAssocToTopicmap(long topicmapId, long assocId, ViewProps viewProps)
Description copied from interface:TopicmapsService
Adds an association to a topicmap. If the association is added already an exception is thrown.- Specified by:
addAssocToTopicmap
in interfaceTopicmapsService
-
addRelatedTopicToTopicmap
public void addRelatedTopicToTopicmap(long topicmapId, long topicId, long assocId, ViewProps viewProps)
- Specified by:
addRelatedTopicToTopicmap
in interfaceTopicmapsService
-
getTopicViewProps
public ViewProps getTopicViewProps(long topicmapId, long topicId)
Description copied from interface:TopicmapsService
Retrieves a topic's standard view properties: "x", "y", "visibility", "pinned", "width", and "height". The latter 2 are optional, the returned view props object will contain these only if available in DB.- Specified by:
getTopicViewProps
in interfaceTopicmapsService
-
getAssocViewProps
public ViewProps getAssocViewProps(long topicmapId, long assocId)
Description copied from interface:TopicmapsService
Retrieves an assoc's standard view properties: "visibility" and "pinned".- Specified by:
getAssocViewProps
in interfaceTopicmapsService
-
getTopicMapcontext
public Assoc getTopicMapcontext(long topicmapId, long topicId)
- Specified by:
getTopicMapcontext
in interfaceTopicmapsService
-
getAssocMapcontext
public Assoc getAssocMapcontext(long topicmapId, long assocId)
- Specified by:
getAssocMapcontext
in interfaceTopicmapsService
-
setTopicViewProps
public void setTopicViewProps(long topicmapId, long topicId, ViewProps viewProps)
- Specified by:
setTopicViewProps
in interfaceTopicmapsService
-
setAssocViewProps
public void setAssocViewProps(long topicmapId, long assocId, ViewProps viewProps)
- Specified by:
setAssocViewProps
in interfaceTopicmapsService
-
setTopicPosition
public void setTopicPosition(long topicmapId, long topicId, int x, int y)
Description copied from interface:TopicmapsService
Convenience method to update the "dmx.topicmaps.x" and "dmx.topicmaps.y" standard view properties.- Specified by:
setTopicPosition
in interfaceTopicmapsService
-
setTopicPositions
public void setTopicPositions(long topicmapId, TopicCoords coords)
- Specified by:
setTopicPositions
in interfaceTopicmapsService
-
setTopicVisibility
public void setTopicVisibility(long topicmapId, long topicId, boolean visibility)
Description copied from interface:TopicmapsService
Convenience method to update the "dmx.topicmaps.visibility" standard view property.- Specified by:
setTopicVisibility
in interfaceTopicmapsService
-
setAssocVisibility
public void setAssocVisibility(long topicmapId, long assocId, boolean visibility)
Description copied from interface:TopicmapsService
Convenience method to update the "dmx.topicmaps.visibility" standard view property. ### FIXME: idempotence? If the associationn is not contained in the topicmap nothing is performed.- Specified by:
setAssocVisibility
in interfaceTopicmapsService
-
hideTopics
public void hideTopics(long topicmapId, IdList topicIds)
- Specified by:
hideTopics
in interfaceTopicmapsService
-
hideAssocs
public void hideAssocs(long topicmapId, IdList assocIds)
- Specified by:
hideAssocs
in interfaceTopicmapsService
-
hideMulti
public void hideMulti(long topicmapId, IdList topicIds, IdList assocIds)
- Specified by:
hideMulti
in interfaceTopicmapsService
-
setTopicmapViewport
public void setTopicmapViewport(long topicmapId, int panX, int panY, double zoom)
- Specified by:
setTopicmapViewport
in interfaceTopicmapsService
-
registerTopicmapType
public void registerTopicmapType(TopicmapType topicmapType)
- Specified by:
registerTopicmapType
in interfaceTopicmapsService
-
registerTopicmapCustomizer
public void registerTopicmapCustomizer(TopicmapCustomizer customizer)
- Specified by:
registerTopicmapCustomizer
in interfaceTopicmapsService
-
unregisterTopicmapCustomizer
public void unregisterTopicmapCustomizer(TopicmapCustomizer customizer)
- Specified by:
unregisterTopicmapCustomizer
in interfaceTopicmapsService
-
getTopicmapInWebclient
public InputStream getTopicmapInWebclient()
-
getTopicmapAndTopicInWebclient
public InputStream getTopicmapAndTopicInWebclient()
-
customizeTopic
public void customizeTopic(RelatedTopic topic, ViewProps viewProps)
Note: as Topicmap is not a DMXObject no PRE_SEND event is fired, so for customizing the topicmap we use a TopicmapCustomizer.- Specified by:
customizeTopic
in interfaceTopicmapCustomizer
-
preSendTopic
public void preSendTopic(Topic topic)
Always send a Topicmap topic complete with child topics. Clients need them in order to render a maptype specific icon.- Specified by:
preSendTopic
in interfacePreSendTopic
-
preInstall
public void preInstall()
- Specified by:
preInstall
in interfacePluginContext
- Overrides:
preInstall
in classPluginActivator
-
-