Commit 21f8f0e1 authored by Jörg Richter's avatar Jörg Richter

CoreService API: rename 5-param `getAssoc()` method (#341)

BREAKING CHANGE

Rename 1 method in systems.dmx.core.service.CoreService

    Assoc getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
    ->
    Assoc getAssocBetweenTopicAndTopic(...)
parent 487ec2c5
Pipeline #10055 passed with stages
in 8 minutes and 12 seconds
......@@ -266,8 +266,8 @@ public final class AccessLayer {
}
}
AssocModelImpl getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1,
String roleTypeUri2) {
AssocModelImpl getAssocBetweenTopicAndTopic(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1,
String roleTypeUri2) {
String info = "assocTypeUri=\"" + assocTypeUri + "\", topic1Id=" + topic1Id + ", topic2Id=" + topic2Id +
", roleTypeUri1=\"" + roleTypeUri1 + "\", roleTypeUri2=\"" + roleTypeUri2 + "\"";
try {
......
......@@ -161,8 +161,10 @@ public class CoreServiceImpl implements CoreService {
}
@Override
public Assoc getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2) {
AssocModelImpl assoc = al.getAssoc(assocTypeUri, topic1Id, topic2Id, roleTypeUri1, roleTypeUri2);
public Assoc getAssocBetweenTopicAndTopic(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1,
String roleTypeUri2) {
AssocModelImpl assoc = al.getAssocBetweenTopicAndTopic(assocTypeUri, topic1Id, topic2Id, roleTypeUri1,
roleTypeUri2);
return assoc != null ? assoc.instantiate() : null;
}
......
......@@ -97,7 +97,8 @@ class TopicImpl extends DMXObjectImpl implements Topic {
@Override
public final Assoc getAssoc(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri,
long othersTopicId) {
AssocModelImpl assoc = al.getAssoc(assocTypeUri, getId(), othersTopicId, myRoleTypeUri, othersRoleTypeUri);
AssocModelImpl assoc = al.getAssocBetweenTopicAndTopic(assocTypeUri, getId(), othersTopicId, myRoleTypeUri,
othersRoleTypeUri);
return assoc != null ? assoc.instantiate() : null;
}
......
......@@ -685,7 +685,8 @@ class ValueIntegrator {
String assocTypeUri = compDef.getInstanceLevelAssocTypeUri();
if (childTopic != null) {
// TODO: assoc parents?
AssocModelImpl assoc = al.getAssoc(assocTypeUri, parent.id, childTopic.id, PARENT, CHILD);
AssocModelImpl assoc = al.getAssocBetweenTopicAndTopic(assocTypeUri, parent.id, childTopic.id, PARENT,
CHILD);
if (assoc != null) {
// update memory
parent.getChildTopics().set(
......
......@@ -144,7 +144,8 @@ public interface CoreService {
*
* @param assocTypeUri Assoc type filter. Pass <code>null</code> to switch filter off.
*/
Assoc getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2);
Assoc getAssocBetweenTopicAndTopic(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1,
String roleTypeUri2);
Assoc getAssocBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri,
String assocRoleTypeUri);
......
......@@ -144,7 +144,7 @@ public class FacetsPlugin extends PluginActivator implements FacetsService {
@Override
public boolean hasFacet(long topicId, String facetTypeUri, long facetTopicId) {
String assocTypeUri = getCompDef(facetTypeUri).getInstanceLevelAssocTypeUri();
Assoc assoc = dmx.getAssoc(assocTypeUri, topicId, facetTopicId, PARENT, CHILD);
Assoc assoc = dmx.getAssocBetweenTopicAndTopic(assocTypeUri, topicId, facetTopicId, PARENT, CHILD);
return assoc != null;
}
......
......@@ -125,7 +125,8 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
@Override
public Assoc getTopicMapcontext(long topicmapId, long topicId) {
return dmx.getAssoc(TOPICMAP_CONTEXT, topicmapId, topicId, ROLE_TYPE_TOPICMAP, ROLE_TYPE_CONTENT);
return dmx.getAssocBetweenTopicAndTopic(TOPICMAP_CONTEXT, topicmapId, topicId, ROLE_TYPE_TOPICMAP,
ROLE_TYPE_CONTENT);
}
@Override
......
......@@ -177,7 +177,7 @@ public class WebservicePlugin extends PluginActivator {
public Assoc getAssoc(@PathParam("assoc_type_uri") String assocTypeUri,
@PathParam("topic1_id") long topic1Id, @PathParam("topic2_id") long topic2Id,
@PathParam("role_type1_uri") String roleTypeUri1, @PathParam("role_type2_uri") String roleTypeUri2) {
return dmx.getAssoc(assocTypeUri, topic1Id, topic2Id, roleTypeUri1, roleTypeUri2);
return dmx.getAssocBetweenTopicAndTopic(assocTypeUri, topic1Id, topic2Id, roleTypeUri1, roleTypeUri2);
}
// ---
......
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