Search in sources :

Example 1 with GraphType

use of net.geoprism.registry.model.GraphType in project geoprism-registry by terraframe.

the class ETLService method importEdgeJson.

@Request(RequestType.SESSION)
public void importEdgeJson(String sessionId, String relationshipType, String graphTypeCode, Date startDate, Date endDate, InputStream stream) {
    try {
        GraphType graphType = GraphType.getByCode(relationshipType, graphTypeCode);
        EdgeJsonImporter importer = new EdgeJsonImporter(stream, graphType, startDate, endDate);
        importer.importData();
    } catch (JsonSyntaxException | IOException e) {
        throw new ProgrammingErrorException(e);
    }
}
Also used : JsonSyntaxException(com.google.gson.JsonSyntaxException) GraphType(net.geoprism.registry.model.GraphType) IOException(java.io.IOException) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException) Request(com.runwaysdk.session.Request)

Example 2 with GraphType

use of net.geoprism.registry.model.GraphType in project geoprism-registry by terraframe.

the class GraphService method getChildren.

@Request(RequestType.SESSION)
public JsonObject getChildren(String sessionId, String parentCode, String parentGeoObjectTypeCode, String graphTypeCode, Boolean recursive, Date date) {
    ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
    ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
    GraphType graphType = this.getGraphType(graphTypeCode);
    // ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
    // parent.getType(), child.getType());
    ServerGraphNode node = parent.getGraphChildren(graphType, recursive, date);
    return node.toJSON();
}
Also used : ServerGeoObjectService(net.geoprism.registry.geoobject.ServerGeoObjectService) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) GraphType(net.geoprism.registry.model.GraphType) ServerGraphNode(net.geoprism.registry.model.ServerGraphNode) Request(com.runwaysdk.session.Request)

Example 3 with GraphType

use of net.geoprism.registry.model.GraphType in project geoprism-registry by terraframe.

the class GraphService method removeChild.

@Request(RequestType.SESSION)
public void removeChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Date startDate, Date endDate) {
    ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
    ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
    ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
    GraphType graphType = this.getGraphType(graphTypeCode);
    // ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
    // parent.getType(), child.getType());
    parent.removeGraphChild(child, graphType, startDate, endDate);
}
Also used : ServerGeoObjectService(net.geoprism.registry.geoobject.ServerGeoObjectService) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) GraphType(net.geoprism.registry.model.GraphType) Request(com.runwaysdk.session.Request)

Example 4 with GraphType

use of net.geoprism.registry.model.GraphType in project geoprism-registry by terraframe.

the class GraphService method addChild.

@Request(RequestType.SESSION)
public JsonObject addChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Date startDate, Date endDate) {
    ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
    ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
    ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
    GraphType graphType = this.getGraphType(graphTypeCode);
    // ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
    // parent.getType(), child.getType());
    ServerGraphNode node = parent.addGraphChild(child, graphType, startDate, endDate);
    return node.toJSON();
}
Also used : ServerGeoObjectService(net.geoprism.registry.geoobject.ServerGeoObjectService) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) GraphType(net.geoprism.registry.model.GraphType) ServerGraphNode(net.geoprism.registry.model.ServerGraphNode) Request(com.runwaysdk.session.Request)

Example 5 with GraphType

use of net.geoprism.registry.model.GraphType in project geoprism-registry by terraframe.

the class GraphService method getParents.

@Request(RequestType.SESSION)
public JsonObject getParents(String sessionId, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Boolean recursive, Date date) {
    ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
    ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
    GraphType graphType = this.getGraphType(graphTypeCode);
    // ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
    // parent.getType(), child.getType());
    ServerGraphNode node = child.getGraphParents(graphType, recursive, date);
    return node.toJSON();
}
Also used : ServerGeoObjectService(net.geoprism.registry.geoobject.ServerGeoObjectService) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) GraphType(net.geoprism.registry.model.GraphType) ServerGraphNode(net.geoprism.registry.model.ServerGraphNode) Request(com.runwaysdk.session.Request)

Aggregations

Request (com.runwaysdk.session.Request)7 GraphType (net.geoprism.registry.model.GraphType)7 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)5 ServerGeoObjectService (net.geoprism.registry.geoobject.ServerGeoObjectService)4 ServerGraphNode (net.geoprism.registry.model.ServerGraphNode)4 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 HashSet (java.util.HashSet)2 DirectedAcyclicGraphType (net.geoprism.registry.DirectedAcyclicGraphType)2 UndirectedGraphType (net.geoprism.registry.UndirectedGraphType)2 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)2 VertexServerGeoObject (net.geoprism.registry.model.graph.VertexServerGeoObject)2 GeoObjectTypePermissionServiceIF (net.geoprism.registry.permission.GeoObjectTypePermissionServiceIF)2 JsonElement (com.google.gson.JsonElement)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)1 RequestType (com.runwaysdk.session.RequestType)1 IOException (java.io.IOException)1 Date (java.util.Date)1 Set (java.util.Set)1