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 voidaddAssocToTopicmap(long topicmapId, long assocId, ViewProps viewProps)Adds an association to a topicmap.voidaddRelatedTopicToTopicmap(long topicmapId, long topicId, long assocId, ViewProps viewProps)voidaddTopicToTopicmap(long topicmapId, long topicId, int x, int y, boolean visibility)Convenience method to add a topic with the standard view properties.voidaddTopicToTopicmap(long topicmapId, long topicId, ViewProps viewProps)Adds a topic to a topicmap.TopiccreateTopicmap(String name, String topicmapTypeUri, ViewProps viewProps)voidcustomizeTopic(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.AssocgetAssocMapcontext(long topicmapId, long assocId)ViewPropsgetAssocViewProps(long topicmapId, long assocId)Retrieves an assoc's standard view properties: "visibility" and "pinned".TopicmapgetTopicmap(long topicmapId, boolean includeChildren)Fetches a topicmap from DB.InputStreamgetTopicmapAndTopicInWebclient()AssocgetTopicMapcontext(long topicmapId, long topicId)InputStreamgetTopicmapInWebclient()List<RelatedTopic>getTopicmapTopics(long objectId)Returns all topicmaps which contain the given topic/assoc.ViewPropsgetTopicViewProps(long topicmapId, long topicId)Retrieves a topic's standard view properties: "x", "y", "visibility", "pinned", "width", and "height".voidhideAssocs(long topicmapId, IdList assocIds)voidhideMulti(long topicmapId, IdList topicIds, IdList assocIds)voidhideTopics(long topicmapId, IdList topicIds)voidpreInstall()voidpreSendTopic(Topic topic)Always send a Topicmap topic complete with child topics.voidregisterTopicmapCustomizer(TopicmapCustomizer customizer)voidregisterTopicmapType(TopicmapType topicmapType)voidsetAssocViewProps(long topicmapId, long assocId, ViewProps viewProps)voidsetAssocVisibility(long topicmapId, long assocId, boolean visibility)Convenience method to update the "dmx.topicmaps.visibility" standard view property.voidsetTopicmapViewport(long topicmapId, int panX, int panY, double zoom)voidsetTopicPosition(long topicmapId, long topicId, int x, int y)Convenience method to update the "dmx.topicmaps.x" and "dmx.topicmaps.y" standard view properties.voidsetTopicPositions(long topicmapId, TopicCoords coords)voidsetTopicViewProps(long topicmapId, long topicId, ViewProps viewProps)voidsetTopicVisibility(long topicmapId, long topicId, boolean visibility)Convenience method to update the "dmx.topicmaps.visibility" standard view property.voidunregisterTopicmapCustomizer(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:
createTopicmapin interfaceTopicmapsService- Returns:
- the created Topicmap topic.
-
getTopicmap
public Topicmap getTopicmap(long topicmapId, boolean includeChildren)
Description copied from interface:TopicmapsServiceFetches a topicmap from DB.- Specified by:
getTopicmapin interfaceTopicmapsServiceincludeChildren- if true the topics contained in the topicmap will include their child topics.
-
getTopicmapTopics
public List<RelatedTopic> getTopicmapTopics(long objectId)
Description copied from interface:TopicmapsServiceReturns 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:
getTopicmapTopicsin 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:TopicmapsServiceConvenience method to add a topic with the standard view properties.- Specified by:
addTopicToTopicmapin interfaceTopicmapsService
-
addTopicToTopicmap
public void addTopicToTopicmap(long topicmapId, long topicId, ViewProps viewProps)Description copied from interface:TopicmapsServiceAdds a topic to a topicmap. If the topic is added already an exception is thrown.- Specified by:
addTopicToTopicmapin interfaceTopicmapsService
-
addAssocToTopicmap
public void addAssocToTopicmap(long topicmapId, long assocId, ViewProps viewProps)Description copied from interface:TopicmapsServiceAdds an association to a topicmap. If the association is added already an exception is thrown.- Specified by:
addAssocToTopicmapin interfaceTopicmapsService
-
addRelatedTopicToTopicmap
public void addRelatedTopicToTopicmap(long topicmapId, long topicId, long assocId, ViewProps viewProps)- Specified by:
addRelatedTopicToTopicmapin interfaceTopicmapsService
-
getTopicViewProps
public ViewProps getTopicViewProps(long topicmapId, long topicId)
Description copied from interface:TopicmapsServiceRetrieves 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:
getTopicViewPropsin interfaceTopicmapsService
-
getAssocViewProps
public ViewProps getAssocViewProps(long topicmapId, long assocId)
Description copied from interface:TopicmapsServiceRetrieves an assoc's standard view properties: "visibility" and "pinned".- Specified by:
getAssocViewPropsin interfaceTopicmapsService
-
getTopicMapcontext
public Assoc getTopicMapcontext(long topicmapId, long topicId)
- Specified by:
getTopicMapcontextin interfaceTopicmapsService
-
getAssocMapcontext
public Assoc getAssocMapcontext(long topicmapId, long assocId)
- Specified by:
getAssocMapcontextin interfaceTopicmapsService
-
setTopicViewProps
public void setTopicViewProps(long topicmapId, long topicId, ViewProps viewProps)- Specified by:
setTopicViewPropsin interfaceTopicmapsService
-
setAssocViewProps
public void setAssocViewProps(long topicmapId, long assocId, ViewProps viewProps)- Specified by:
setAssocViewPropsin interfaceTopicmapsService
-
setTopicPosition
public void setTopicPosition(long topicmapId, long topicId, int x, int y)Description copied from interface:TopicmapsServiceConvenience method to update the "dmx.topicmaps.x" and "dmx.topicmaps.y" standard view properties.- Specified by:
setTopicPositionin interfaceTopicmapsService
-
setTopicPositions
public void setTopicPositions(long topicmapId, TopicCoords coords)- Specified by:
setTopicPositionsin interfaceTopicmapsService
-
setTopicVisibility
public void setTopicVisibility(long topicmapId, long topicId, boolean visibility)Description copied from interface:TopicmapsServiceConvenience method to update the "dmx.topicmaps.visibility" standard view property.- Specified by:
setTopicVisibilityin interfaceTopicmapsService
-
setAssocVisibility
public void setAssocVisibility(long topicmapId, long assocId, boolean visibility)Description copied from interface:TopicmapsServiceConvenience 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:
setAssocVisibilityin interfaceTopicmapsService
-
hideTopics
public void hideTopics(long topicmapId, IdList topicIds)- Specified by:
hideTopicsin interfaceTopicmapsService
-
hideAssocs
public void hideAssocs(long topicmapId, IdList assocIds)- Specified by:
hideAssocsin interfaceTopicmapsService
-
hideMulti
public void hideMulti(long topicmapId, IdList topicIds, IdList assocIds)- Specified by:
hideMultiin interfaceTopicmapsService
-
setTopicmapViewport
public void setTopicmapViewport(long topicmapId, int panX, int panY, double zoom)- Specified by:
setTopicmapViewportin interfaceTopicmapsService
-
registerTopicmapType
public void registerTopicmapType(TopicmapType topicmapType)
- Specified by:
registerTopicmapTypein interfaceTopicmapsService
-
registerTopicmapCustomizer
public void registerTopicmapCustomizer(TopicmapCustomizer customizer)
- Specified by:
registerTopicmapCustomizerin interfaceTopicmapsService
-
unregisterTopicmapCustomizer
public void unregisterTopicmapCustomizer(TopicmapCustomizer customizer)
- Specified by:
unregisterTopicmapCustomizerin 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:
customizeTopicin 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:
preSendTopicin interfacePreSendTopic
-
preInstall
public void preInstall()
- Specified by:
preInstallin interfacePluginContext- Overrides:
preInstallin classPluginActivator
-
-