use of net.geoprism.registry.model.ServerGeoObjectIF 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();
}
use of net.geoprism.registry.model.ServerGeoObjectIF 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);
}
use of net.geoprism.registry.model.ServerGeoObjectIF 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();
}
use of net.geoprism.registry.model.ServerGeoObjectIF 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();
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class ListTypeService method record.
@Request(RequestType.SESSION)
public JsonObject record(String sessionId, String oid, String uid) {
ListTypeVersion version = ListTypeVersion.get(oid);
if (version.getWorking()) {
ListType type = version.getListType();
if (type.doesActorHaveExploratoryPermission()) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
format.setTimeZone(GeoRegistryUtil.SYSTEM_TIMEZONE);
ServerGeoObjectType geoObjectType = type.getGeoObjectType();
ServerGeoObjectIF geoObject = new ServerGeoObjectService().getGeoObject(uid, geoObjectType.getCode());
JsonObject object = new JsonObject();
object.addProperty("recordType", "GEO_OBJECT");
object.add("type", geoObject.getType().toJSON(new DefaultSerializer()));
object.addProperty("code", geoObject.getCode());
object.addProperty(ListTypeVersion.FORDATE, format.format(version.getForDate()));
// Add geometry so we can zoom to it
object.add("geoObject", geoObject.toGeoObject(version.getForDate()).toJSON());
return object;
}
}
return version.record(uid);
}
Aggregations