public class TaggingPlugin extends de.deepamehta.core.osgi.PluginActivator implements TaggingService
DEFINITION_URI, LABEL_URI, TAG| Constructor and Description |
|---|
TaggingPlugin() |
| Modifier and Type | Method and Description |
|---|---|
de.deepamehta.core.Topic |
createTagTopic(String name,
String definition,
boolean caseSensitive)
Creates a topic of type "dm4.tags.tag" after checking for existence by name and trimming the name.
|
de.deepamehta.core.Topic |
getTagTopic(String name,
boolean caseSensitive)
Returns a topic (typeUri="dm4.tags.tag") with the given name.
|
List<de.deepamehta.core.RelatedTopic> |
getTopicsByTagAndTypeURI(long tagId,
String relatedTopicTypeUri)
Convenience method to fetch a list of topics (of a given
Topic Type) using the "Tag"
with the given topic id. |
List<de.deepamehta.core.RelatedTopic> |
getTopicsByTagsAndTypeUri(String tags,
String relatedTopicTypeUri)
Convenience method to fetch a list of topics (of a given
Topic Type) using a list of "Tags". |
List<TagViewModel> |
getViewTagsModelWithRelatedCount(String relatedTopicTypeUri)
Generate a JSONArray with properties helpful to produce an interactive tag cloud.
|
public List<de.deepamehta.core.RelatedTopic> getTopicsByTagAndTypeURI(long tagId, String relatedTopicTypeUri)
Topic Type) using the "Tag"
with the given topic id.
Note: This method provides no real benefit for developers familiar with the getRelatedTopics() of the
deepamehta-core API. It's just a convenient call.getTopicsByTagAndTypeURI in interface TaggingServicetagId - A topic id ot a "dm4.tags.tag"-TopicrelatedTopicTypeUri - A Topic Type URI identifying a type of topics. The Topic Type
Definition is expected to have an Aggregation Definition with
cardinality set to Many to the Topic Type Tag (typeUri="dm4.tags.tag").RelatedTopics of the given type (identified by typeUri) and associated with the given Tag (identified by topic id).public List<de.deepamehta.core.RelatedTopic> getTopicsByTagsAndTypeUri(String tags, String relatedTopicTypeUri)
Topic Type) using a list of "Tags".getTopicsByTagsAndTypeUri in interface TaggingServicetags - A String of a JSONObject containing a JSONArray (under the
key="tags") of "dm4.tags.tag"-Topics is expected.
For example: "{ "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".RelatedTopics of the given type (identified by typeUri) and associated with a list of tags (identified by string encoded JSON Array of topic ids).public List<TagViewModel> getViewTagsModelWithRelatedCount(String relatedTopicTypeUri)
getViewTagsModelWithRelatedCount in interface TaggingServicerelatedTopicTypeUri - Type URI of related Topic Type counted.public de.deepamehta.core.Topic createTagTopic(String name, String definition, boolean caseSensitive) throws IllegalArgumentException
IllegalArgumentException is
thrown.createTagTopic in interface TaggingServicename - Label of the tag.definition - Definition the label stands for.caseSensitive - If false does existence check for tag applying .toLowerCase()IllegalArgumentExceptionpublic de.deepamehta.core.Topic getTagTopic(String name, boolean caseSensitive)
getTagTopic in interface TaggingServicename - label of given tagcaseSensitive - flag if to use toLowerCase when gettingnull if no topic was found under the given name.Copyright © 2018. All rights reserved.