use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationService method getAncestorTree.
@Request(RequestType.SESSION)
public JsonObject getAncestorTree(String sessionId, String classificationCode, String rootCode, String code, Integer pageSize) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification child = Classification.get(type, code);
return child.getAncestorTree(rootCode, pageSize).toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationService method getChildren.
@Request(RequestType.SESSION)
public JsonObject getChildren(String sessionId, String classificationCode, String code, Integer pageSize, Integer pageNumber) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
if (code != null) {
Classification parent = Classification.get(type, code);
return parent.getChildren(pageSize, pageNumber).toJSON();
}
Classification root = type.getRoot();
List<Classification> roots = new LinkedList<Classification>();
if (root != null) {
roots.add(root);
}
return new Page<Classification>(roots.size(), pageNumber, pageSize, roots).toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationService method addChild.
@Request(RequestType.SESSION)
public void addChild(String sessionId, String classificationCode, String parentCode, String childCode) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification parent = Classification.get(type, parentCode);
Classification child = Classification.get(type, childCode);
parent.addChild(child);
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeService method update.
@Request(RequestType.SESSION)
public JsonObject update(String sessionId, String json) {
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
String code = object.get(DirectedAcyclicGraphType.CODE).getAsString();
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.getByCode(code);
type.update(object);
return type.toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeService method remove.
@Request(RequestType.SESSION)
public void remove(String sessionId, String code) {
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.getByCode(code);
type.delete();
}
Aggregations