use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class ServerGeoObjectService method removeChild.
@Request(RequestType.SESSION)
public void removeChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String hierarchyCode, Date startDate, Date endDate) {
ServerGeoObjectIF parent = this.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
ServerGeoObjectIF child = this.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
ServerHierarchyType ht = ServerHierarchyType.get(hierarchyCode);
ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanRemoveChild(ht.getOrganization().getCode(), parent.getType(), child.getType());
parent.removeChild(child, hierarchyCode, startDate, endDate);
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class ServerGeoObjectService method split.
@Transaction
public ServerGeoObjectIF split(GeoObjectSplitView view) {
ServerGeoObjectType type = ServerGeoObjectType.get(view.getTypeCode());
ServerGeoObjectStrategyIF strategy = this.getStrategy(type);
final ServerGeoObjectIF source = strategy.getGeoObjectByCode(view.getSourceCode());
source.setDate(view.getDate());
ServerGeoObjectIF target = strategy.newInstance();
target.setDate(view.getDate());
target.populate(source.toGeoObject(view.getDate()), view.getDate(), view.getDate());
target.setCode(view.getTargetCode());
target.setDisplayLabel(view.getLabel());
target.apply(false);
final ServerParentTreeNode sNode = source.getParentGeoObjects(null, false, view.getDate());
final List<ServerParentTreeNode> sParents = sNode.getParents();
for (ServerParentTreeNode sParent : sParents) {
final ServerGeoObjectIF parent = sParent.getGeoObject();
final ServerHierarchyType hierarchyType = sParent.getHierarchyType();
target.addParent(parent, hierarchyType, view.getDate(), null);
}
return target;
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class ServerGeoObjectService method addChild.
@Request(RequestType.SESSION)
public ParentTreeNode addChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String hierarchyCode, Date startDate, Date endDate) {
ServerGeoObjectIF parent = this.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
ServerGeoObjectIF child = this.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
ServerHierarchyType ht = ServerHierarchyType.get(hierarchyCode);
ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(), parent.getType(), child.getType());
return parent.addChild(child, ht, startDate, endDate).toNode(false);
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class HierarchyService method getHierarchiesForGeoObjectOverTimeInReq.
public JsonArray getHierarchiesForGeoObjectOverTimeInReq(String code, String typeCode) {
ServerGeoObjectIF geoObject = ServiceFactory.getGeoObjectService().getGeoObjectByCode(code, typeCode);
ServerParentTreeNodeOverTime pot = geoObject.getParentsOverTime(null, true);
filterHierarchiesFromPermissions(geoObject.getType(), pot);
return pot.toJSON();
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class BasicVertexQuery method getResults.
public List<ServerGeoObjectIF> getResults() {
List<ServerGeoObjectIF> list = new LinkedList<ServerGeoObjectIF>();
GraphQuery<VertexObject> query = this.getQuery();
List<VertexObject> results = query.getResults();
for (VertexObject result : results) {
list.add(new VertexServerGeoObject(type, result, this.date));
}
return list;
}
Aggregations