Search in sources :

Example 26 with ServerGeoObjectIF

use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.

the class RegistryService method updateGeoObject.

@Request(RequestType.SESSION)
public GeoObject updateGeoObject(String sessionId, String jGeoObj, Date startDate, Date endDate) {
    GeoObject geoObject = GeoObject.fromJSON(adapter, jGeoObj);
    ServerGeoObjectIF object = service.apply(geoObject, startDate, endDate, false, false);
    return object.toGeoObject(startDate);
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) GeoObject(org.commongeoregistry.adapter.dataaccess.GeoObject) Request(com.runwaysdk.session.Request) OAuthClientRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest)

Example 27 with ServerGeoObjectIF

use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.

the class RegistryService method getGeoObjectByCode.

@Request(RequestType.SESSION)
public GeoObject getGeoObjectByCode(String sessionId, String code, String typeCode, Date date) {
    ServerGeoObjectIF object = service.getGeoObjectByCode(code, typeCode, true);
    ServiceFactory.getGeoObjectPermissionService().enforceCanRead(object.getType().getOrganization().getCode(), object.getType());
    return object.toGeoObject(date);
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) Request(com.runwaysdk.session.Request) OAuthClientRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest)

Example 28 with ServerGeoObjectIF

use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.

the class RegistryService method getGeoObjectOverTime.

@Request(RequestType.SESSION)
public GeoObjectOverTime getGeoObjectOverTime(String sessionId, String id, String typeCode) {
    ServerGeoObjectIF object = this.service.getGeoObject(id, typeCode);
    if (object == null) {
        net.geoprism.registry.DataNotFoundException ex = new net.geoprism.registry.DataNotFoundException();
        ex.setTypeLabel(GeoObjectMetadata.get().getClassDisplayLabel());
        ex.setDataIdentifier(id);
        ex.setAttributeLabel(GeoObjectMetadata.get().getAttributeDisplayLabel(DefaultAttribute.UID.getName()));
        throw ex;
    }
    ServiceFactory.getGeoObjectPermissionService().enforceCanRead(object.getType().getOrganization().getCode(), object.getType());
    return object.toGeoObjectOverTime();
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) Request(com.runwaysdk.session.Request) OAuthClientRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest)

Example 29 with ServerGeoObjectIF

use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.

the class RelationshipVisualizationService method processChildNode.

private void processChildNode(ServerChildGraphNode root, GraphType graphType, JsonArray jaEdges, JsonArray jaVerticies, Set<String> setVerticies) {
    final ServerGeoObjectIF vertexGo = root.getGeoObject();
    root.getChildren().forEach(node -> {
        if (node.getOid() != null) {
            ServerGeoObjectIF relatedGO = node.getGeoObject();
            if (!setVerticies.contains(relatedGO.getCode())) {
                jaVerticies.add(serializeVertex(relatedGO, "CHILD"));
                setVerticies.add(relatedGO.getCode());
            }
            if (!setVerticies.contains(node.getOid())) {
                jaEdges.add(serializeEdge(vertexGo, relatedGO, graphType, node));
            }
        }
        this.processChildNode(node, graphType, jaEdges, jaVerticies, setVerticies);
    });
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF)

Example 30 with ServerGeoObjectIF

use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.

the class TestGeoObjectInfo method apply.

/**
 * Applies the GeoObject which is represented by this test data into the
 * database.
 *
 * @postcondition Subsequent calls to this.getBusiness will return the
 *                business object which stores additional CGR attributes on
 *                this GeoObject
 * @postcondition Subsequent calls to this.getGeoEntity will return the
 *                GeoEntity which backs this GeoObject
 * @postcondition The applied GeoObject's status will be equal to ACTIVE
 */
@Request
public void apply() {
    ServerGeoObjectIF localServerGO = applyInTrans(date);
    this.registryId = localServerGO.getUid();
    this.isNew = false;
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) Request(com.runwaysdk.session.Request)

Aggregations

ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)106 Request (com.runwaysdk.session.Request)68 Test (org.junit.Test)43 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)28 ServerGeoObjectService (net.geoprism.registry.geoobject.ServerGeoObjectService)23 ValueOverTime (com.runwaysdk.dataaccess.graph.attributes.ValueOverTime)18 ValueOverTimeCollection (com.runwaysdk.dataaccess.graph.attributes.ValueOverTimeCollection)18 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)16 Date (java.util.Date)15 GeoObject (org.commongeoregistry.adapter.dataaccess.GeoObject)15 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)13 LinkedList (java.util.LinkedList)11 OAuthClientRequest (org.apache.oltu.oauth2.client.request.OAuthClientRequest)10 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)10 AttributeType (org.commongeoregistry.adapter.metadata.AttributeType)10 JsonObject (com.google.gson.JsonObject)9 VertexObject (com.runwaysdk.business.graph.VertexObject)9 ChangeRequest (net.geoprism.registry.action.ChangeRequest)9 ServerParentTreeNode (net.geoprism.registry.model.ServerParentTreeNode)9 VertexServerGeoObject (net.geoprism.registry.model.graph.VertexServerGeoObject)9