de.deepamehta.plugins.tags
Class TaggingPlugin
java.lang.Object
de.deepamehta.core.osgi.PluginActivator
de.deepamehta.plugins.tags.TaggingPlugin
- All Implemented Interfaces:
- PluginContext, PluginService, TaggingService, org.osgi.framework.BundleActivator
public class TaggingPlugin
- extends PluginActivator
- implements TaggingService
A basic plugin-service for fetching topics in DeepaMehta 4 by type and one or many tags.
- Version:
- 1.3.8 compatible with DeepaMehta 4.4
- Author:
- Malte Reißig ()
Methods inherited from class de.deepamehta.core.osgi.PluginActivator |
getBundleContext, getPluginName, getStaticResource, getUri, init, postInstall, publishDirectory, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString |
log
private Logger log
CHILD_URI
private static final String CHILD_URI
- See Also:
- Constant Field Values
PARENT_URI
private static final String PARENT_URI
- See Also:
- Constant Field Values
AGGREGATION
private static final String AGGREGATION
- See Also:
- Constant Field Values
TAG_URI
public static final String TAG_URI
- See Also:
- Constant Field Values
TAG_LABEL_URI
public static final String TAG_LABEL_URI
- See Also:
- Constant Field Values
TAG_DEFINITION_URI
public static final String TAG_DEFINITION_URI
- See Also:
- Constant Field Values
VIEW_RELATED_COUNT_URI
public static final String VIEW_RELATED_COUNT_URI
- See Also:
- Constant Field Values
VIEW_CSS_CLASS_COUNT_URI
public static final String VIEW_CSS_CLASS_COUNT_URI
- See Also:
- Constant Field Values
TaggingPlugin
public TaggingPlugin()
getTopicsByTagAndTypeURI
public ResultList<RelatedTopic> getTopicsByTagAndTypeURI(long tagId,
String relatedTopicTypeUri)
- Fetches all topics of given type "aggregating" the "Tag" with the given
tagId
.
- Specified by:
getTopicsByTagAndTypeURI
in interface TaggingService
- Parameters:
tagId
- An id ot a "dm4.tags.tag"-TopicrelatedTopicTypeUri
- A type_uri of a composite (e.g. "org.deepamehta.resources.resource")
which aggregates one or many "dm4.tags.tag".
Note: This method provides actually no real benefit for developers familiar with the
getRelatedTopics() of the deepamehta-core API. It's just a convenient call.
getTopicsByTagsAndTypeUri
public ResultList<RelatedTopic> getTopicsByTagsAndTypeUri(String tags,
String relatedTopicTypeUri)
- Fetches all topics of given type "aggregating" all given "Tag"-
Topics
.
- Specified by:
getTopicsByTagsAndTypeUri
in interface TaggingService
- Parameters:
tags
- A JSONObject containing JSONArray ("tags") of "Tag"-Topics is expected
(e.g. { "tags": [ { "id": 1234 } ] }).relatedTopicTypeUri
- A type_uri of a composite (e.g. "org.deepamehta.resources.resource")
which must aggregate one or many "dm4.tags.tag".
getViewTagsModelWithRelatedCount
public String getViewTagsModelWithRelatedCount(String relatedTopicTypeUri)
- Getting {"value", "type_uri", "id" and "related_count:"} values of (interesting) topics in range.
- Specified by:
getViewTagsModelWithRelatedCount
in interface TaggingService
- Parameters:
relatedTopicTypeUri
- Type URI of related Topic Type
createTagTopic
public Topic createTagTopic(String name,
String definition)
- Specified by:
createTagTopic
in interface TaggingService
getTagTopic
public Topic getTagTopic(String name,
boolean caseSensitive)
- Specified by:
getTagTopic
in interface TaggingService
enrichTopicViewModelAboutRelatedCount
private void enrichTopicViewModelAboutRelatedCount(Topic resource,
int count)
- Private Helper Methods
enrichTopicViewModelAboutCSSClass
private void enrichTopicViewModelAboutCSSClass(Topic resource,
int related_count)
hasRelatedTopicTag
private boolean hasRelatedTopicTag(RelatedTopic resource,
long tagId)
Copyright © 2014. All Rights Reserved.