Search in sources :

Example 6 with ServerParentTreeNodeOverTime

use of net.geoprism.registry.view.ServerParentTreeNodeOverTime in project geoprism-registry by terraframe.

the class SetParentAction method execute.

@Override
public void execute() {
    ServerGeoObjectService service = new ServerGeoObjectService();
    ServerGeoObjectIF child = service.getGeoObjectByCode(this.getChildCode(), this.getChildTypeCode());
    ServerParentTreeNodeOverTime ptnOt = ServerParentTreeNodeOverTime.fromJSON(child.getType(), this.getJson());
    child.setParents(ptnOt);
}
Also used : ServerGeoObjectService(net.geoprism.registry.geoobject.ServerGeoObjectService) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerParentTreeNodeOverTime(net.geoprism.registry.view.ServerParentTreeNodeOverTime)

Example 7 with ServerParentTreeNodeOverTime

use of net.geoprism.registry.view.ServerParentTreeNodeOverTime 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();
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerParentTreeNodeOverTime(net.geoprism.registry.view.ServerParentTreeNodeOverTime)

Example 8 with ServerParentTreeNodeOverTime

use of net.geoprism.registry.view.ServerParentTreeNodeOverTime in project geoprism-registry by terraframe.

the class RegistryService method newGeoObjectInstanceOverTime.

@Request(RequestType.SESSION)
public String newGeoObjectInstanceOverTime(String sessionId, String typeCode) {
    final ServerGeoObjectType type = ServerGeoObjectType.get(typeCode);
    ServerGeoObjectIF go = service.newInstance(type);
    go.setInvalid(false);
    final GeoObjectOverTime goot = go.toGeoObjectOverTime();
    ServerParentTreeNodeOverTime pot = go.getParentsOverTime(null, true);
    HierarchyService.filterHierarchiesFromPermissions(type, pot);
    /**
     * Serialize the GeoObject and add it to the response
     */
    JsonObject response = new JsonObject();
    response.add("geoObject", goot.toJSON());
    response.add("hierarchies", pot.toJSON());
    return response.toString();
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) JsonObject(com.google.gson.JsonObject) GeoObjectOverTime(org.commongeoregistry.adapter.dataaccess.GeoObjectOverTime) ServerParentTreeNodeOverTime(net.geoprism.registry.view.ServerParentTreeNodeOverTime) Request(com.runwaysdk.session.Request) OAuthClientRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest)

Example 9 with ServerParentTreeNodeOverTime

use of net.geoprism.registry.view.ServerParentTreeNodeOverTime in project geoprism-registry by terraframe.

the class ChangeRequestServiceTest method testCreateGeoObjectCR_Json.

@Request
private String[] testCreateGeoObjectCR_Json() throws Exception {
    final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    sdf.setTimeZone(GeoRegistryUtil.SYSTEM_TIMEZONE);
    final Date newStartDate = sdf.parse(NEW_START_DATE);
    final Date newEndDate = sdf.parse(NEW_END_DATE);
    String[] ret = new String[2];
    ServerParentTreeNodeOverTime ptnot = new ServerParentTreeNodeOverTime(FastTestDataset.PROVINCE.getServerObject());
    ServerParentTreeNode childNode = new ServerParentTreeNode(null, FastTestDataset.HIER_ADMIN.getServerObject(), newStartDate, newEndDate, null);
    childNode.addParent(new ServerParentTreeNode(FastTestDataset.CAMBODIA.getServerObject(), FastTestDataset.HIER_ADMIN.getServerObject(), newStartDate, newEndDate, null));
    ptnot.add(FastTestDataset.HIER_ADMIN.getServerObject(), childNode);
    ret[0] = ptnot.toJSON().toString();
    ret[1] = TEST_NEW_PROVINCE.newGeoObjectOverTime(ServiceFactory.getAdapter()).toJSON().toString();
    return ret;
}
Also used : ServerParentTreeNode(net.geoprism.registry.model.ServerParentTreeNode) ServerParentTreeNodeOverTime(net.geoprism.registry.view.ServerParentTreeNodeOverTime) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Request(com.runwaysdk.session.Request) ChangeRequest(net.geoprism.registry.action.ChangeRequest)

Aggregations

ServerParentTreeNodeOverTime (net.geoprism.registry.view.ServerParentTreeNodeOverTime)9 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)6 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)5 GeoObjectOverTime (org.commongeoregistry.adapter.dataaccess.GeoObjectOverTime)4 JsonObject (com.google.gson.JsonObject)3 ServerGeoObjectService (net.geoprism.registry.geoobject.ServerGeoObjectService)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 Request (com.runwaysdk.session.Request)2 Date (java.util.Date)2 ChangeRequest (net.geoprism.registry.action.ChangeRequest)2 ServerParentTreeNode (net.geoprism.registry.model.ServerParentTreeNode)2 EdgeObject (com.runwaysdk.business.graph.EdgeObject)1 GraphObject (com.runwaysdk.business.graph.GraphObject)1 GraphQuery (com.runwaysdk.business.graph.GraphQuery)1 VertexObject (com.runwaysdk.business.graph.VertexObject)1 MdEdgeDAOIF (com.runwaysdk.dataaccess.MdEdgeDAOIF)1 MdVertexDAOIF (com.runwaysdk.dataaccess.MdVertexDAOIF)1 LineString (com.vividsolutions.jts.geom.LineString)1 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)1 MultiPoint (com.vividsolutions.jts.geom.MultiPoint)1