Search in sources :

Example 36 with Request

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();
}
Also used : Classification(net.geoprism.registry.model.Classification) ClassificationType(net.geoprism.registry.model.ClassificationType) Request(com.runwaysdk.session.Request)

Example 37 with Request

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();
}
Also used : Classification(net.geoprism.registry.model.Classification) ClassificationType(net.geoprism.registry.model.ClassificationType) LinkedList(java.util.LinkedList) Request(com.runwaysdk.session.Request)

Example 38 with Request

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);
}
Also used : Classification(net.geoprism.registry.model.Classification) ClassificationType(net.geoprism.registry.model.ClassificationType) Request(com.runwaysdk.session.Request)

Example 39 with Request

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();
}
Also used : DirectedAcyclicGraphType(net.geoprism.registry.DirectedAcyclicGraphType) JsonObject(com.google.gson.JsonObject) Request(com.runwaysdk.session.Request)

Example 40 with Request

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();
}
Also used : DirectedAcyclicGraphType(net.geoprism.registry.DirectedAcyclicGraphType) Request(com.runwaysdk.session.Request)

Aggregations

Request (com.runwaysdk.session.Request)340 Test (org.junit.Test)145 JsonObject (com.google.gson.JsonObject)85 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)73 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)73 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)53 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)40 JsonArray (com.google.gson.JsonArray)36 Date (java.util.Date)33 ChangeRequest (net.geoprism.registry.action.ChangeRequest)32 OAuthClientRequest (org.apache.oltu.oauth2.client.request.OAuthClientRequest)31 QueryFactory (com.runwaysdk.query.QueryFactory)30 ValueOverTime (com.runwaysdk.dataaccess.graph.attributes.ValueOverTime)26 ValueOverTimeCollection (com.runwaysdk.dataaccess.graph.attributes.ValueOverTimeCollection)22 ListType (net.geoprism.registry.ListType)21 SimpleDateFormat (java.text.SimpleDateFormat)19 Classification (net.geoprism.registry.model.Classification)19 VertexServerGeoObject (net.geoprism.registry.model.graph.VertexServerGeoObject)19 ClassificationTypeTest (net.geoprism.registry.classification.ClassificationTypeTest)17 TransitionEvent (net.geoprism.registry.graph.transition.TransitionEvent)17