Commit cf5e9d68 authored by Jörg Richter's avatar Jörg Richter

Topicmaps API: add `TOPICMAP` to `TopicmapsConstants` (#14)

parent 4664d690
Pipeline #5875 passed with stages
in 2 minutes and 46 seconds
......@@ -8,7 +8,7 @@ class DefaultTopicmapType implements TopicmapType, TopicmapsConstants {
@Override
public String getUri() {
return "dmx.topicmaps.topicmap";
return TOPICMAP;
}
@Override
......
......@@ -4,6 +4,9 @@ package systems.dmx.topicmaps;
public interface TopicmapsConstants {
// topic type
static final String TOPICMAP = "dmx.topicmaps.topicmap";
// content assoc
static final String TOPICMAP_CONTEXT = "dmx.topicmaps.topicmap_context";
static final String ROLE_TYPE_TOPICMAP = "dmx.core.default";
......
......@@ -87,7 +87,7 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
@QueryParam("private") boolean isPrivate) {
logger.info("Creating topicmap \"" + name + "\" (topicmapTypeUri=\"" + topicmapTypeUri + "\", isPrivate=" +
isPrivate +")");
Topic topicmapTopic = dmx.createTopic(mf.newTopicModel("dmx.topicmaps.topicmap", mf.newChildTopicsModel()
Topic topicmapTopic = dmx.createTopic(mf.newTopicModel(TOPICMAP, mf.newChildTopicsModel()
.put("dmx.topicmaps.topicmap_name", name)
.put("dmx.topicmaps.topicmap_type_uri", topicmapTypeUri)
.put("dmx.topicmaps.private", isPrivate)
......@@ -142,7 +142,7 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
try {
List<RelatedTopic> topicmapTopics = new ArrayList();
for (RelatedTopic topic : dmx.getObject(objectId).getRelatedTopics(TOPICMAP_CONTEXT, ROLE_TYPE_CONTENT,
ROLE_TYPE_TOPICMAP, "dmx.topicmaps.topicmap")) {
ROLE_TYPE_TOPICMAP, TOPICMAP)) {
if (visibility(topic.getRelatingAssociation())) {
topicmapTopics.add(topic);
}
......
......@@ -10,12 +10,12 @@ import java.util.List;
public interface TopicmapsService {
public interface TopicmapsService extends TopicmapsConstants {
// ------------------------------------------------------------------------------------------------------- Constants
static final String DEFAULT_TOPICMAP_NAME = "untitled";
static final String DEFAULT_TOPICMAP_TYPE_URI = "dmx.topicmaps.topicmap";
static final String DEFAULT_TOPICMAP_TYPE_URI = TOPICMAP;
// -------------------------------------------------------------------------------------------------- Public Methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment