Search in sources :

Example 1 with ServerGraphNode

use of net.geoprism.registry.model.ServerGraphNode 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 2 with ServerGraphNode

use of net.geoprism.registry.model.ServerGraphNode 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 3 with ServerGraphNode

use of net.geoprism.registry.model.ServerGraphNode 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)3 ServerGeoObjectService (net.geoprism.registry.geoobject.ServerGeoObjectService)3 GraphType (net.geoprism.registry.model.GraphType)3 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)3 ServerGraphNode (net.geoprism.registry.model.ServerGraphNode)3