use of net.geoprism.registry.model.graph.VertexServerGeoObject in project geoprism-registry by terraframe.
the class BusinessObject method getGeoObject.
public VertexServerGeoObject getGeoObject() {
String oid = this.vertex.getObjectValue(BusinessType.GEO_OBJECT);
if (oid != null) {
VertexObject geoVertex = VertexObject.get(GeoVertex.CLASS, oid);
MdVertexDAOIF mdVertex = (MdVertexDAOIF) geoVertex.getMdClass();
ServerGeoObjectType vertexType = ServerGeoObjectType.get(mdVertex);
return new VertexServerGeoObject(vertexType, geoVertex);
}
return null;
}
use of net.geoprism.registry.model.graph.VertexServerGeoObject in project geoprism-registry by terraframe.
the class VertexGeoObjectQuery 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;
}
use of net.geoprism.registry.model.graph.VertexServerGeoObject in project geoprism-registry by terraframe.
the class VertexSelectGeoObjectQuery method getSingleResult.
public ServerGeoObjectIF getSingleResult() {
GraphQuery<VertexObject> query = this.getQuery();
VertexObject vertex = query.getSingleResult();
if (vertex != null) {
return new VertexServerGeoObject(type, vertex, this.date);
}
return null;
}
use of net.geoprism.registry.model.graph.VertexServerGeoObject in project geoprism-registry by terraframe.
the class VertexSelectGeoObjectQuery method getResults.
public List<VertexServerGeoObject> getResults() {
List<VertexServerGeoObject> list = new LinkedList<VertexServerGeoObject>();
GraphQuery<VertexObject> query = this.getQuery();
List<VertexObject> results = query.getResults();
for (VertexObject result : results) {
list.add(new VertexServerGeoObject(type, result, this.date));
}
return list;
}
use of net.geoprism.registry.model.graph.VertexServerGeoObject in project geoprism-registry by terraframe.
the class LocationService method getGeoObjects.
// @Request(RequestType.SESSION)
// public LocationInformation getLocationInformation(String sessionId, String code, String typeCode, Date date, String childTypeCode, String hierarchyCode)
// {
// LocationInformation information = new LocationInformation();
//
// ServerGeoObjectIF go = this.service.getGeoObjectByCode(code, typeCode);
// go.setDate(date);
//
// ServerGeoObjectType type = go.getType();
// List<ServerHierarchyType> hierarchies = type.getHierarchies();
//
// ServerHierarchyType hierarchy = null;
//
// if (hierarchyCode == null || hierarchyCode.length() == 0)
// {
// hierarchy = hierarchies.get(0);
// }
// else
// {
// hierarchy = ServerHierarchyType.get(hierarchyCode);
// }
//
// List<ServerGeoObjectType> childTypes = type.getChildren(hierarchy);
// ServerGeoObjectType childType = null;
//
// if (childTypes.size() > 0)
// {
// /*
// * If a typeCode is given and it is an option based on the hierarchy than
// * use that type otherwise use the first type code
// */
// childType = childTypes.get(0);
//
// if (childTypeCode != null && childTypeCode.length() > 0)
// {
// for (ServerGeoObjectType child : childTypes)
// {
// if (child.getCode().equals(childTypeCode))
// {
// childType = child;
// }
// }
// }
// }
//
// if (childType != null)
// {
// information.setChildType(childType.getType());
//
// List<VertexServerGeoObject> children = this.getGeoObjects(go.getCode(), childType.getCode(), hierarchy.getCode(), date);
//
// for (VertexServerGeoObject child : children)
// {
// information.addChild(child.toGeoObject());
// }
// }
//
// information.setChildTypes(childTypes);
// information.setHierarchies(hierarchies);
// information.setHierarchy(hierarchy.getCode());
// information.setEntity(go.toGeoObject());
//
// return information;
// }
// @Request(RequestType.SESSION)
// public JsonObject getChildrenGeoJson(String sessionId, String typeCode,
// String parentId, String hierarchyCode)
// {
// List<VertexServerGeoObject> children = parentId != null ?
// this.getGeoObjects(typeCode, parentId, hierarchyCode) :
// this.getGeoObjects(typeCode);
//
// return children;
// }
private List<VertexServerGeoObject> getGeoObjects(String typeCode, Date date) {
ServerGeoObjectType type = ServerGeoObjectType.get(typeCode);
MdVertexDAOIF mdVertex = type.getMdVertex();
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdVertex.getDBClassName());
statement.append(" ORDER BY code");
GraphQuery<VertexObject> query = new GraphQuery<VertexObject>(statement.toString());
List<VertexObject> vObjects = query.getResults();
List<VertexServerGeoObject> response = new LinkedList<VertexServerGeoObject>();
for (VertexObject vObject : vObjects) {
VertexServerGeoObject vSGO = new VertexServerGeoObject(type, vObject);
vSGO.setDate(date);
response.add(vSGO);
}
return response;
}
Aggregations