Search in sources :

Example 71 with ServerHierarchyType

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

the class ServerParentTreeNodeOverTime method enforceUserHasPermissionSetParents.

public void enforceUserHasPermissionSetParents(String childCode, boolean asCR) {
    final Collection<ServerHierarchyType> hierarchyTypes = this.getHierarchies();
    ServerGeoObjectType childType = ServerGeoObjectType.get(childCode);
    for (ServerHierarchyType hierarchyType : hierarchyTypes) {
        final List<ServerParentTreeNode> entries = this.getEntries(hierarchyType);
        for (ServerParentTreeNode entry : entries) {
            final ServerGeoObjectIF parent = entry.getGeoObject();
            if (asCR) {
                ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChildCR(hierarchyType.getOrganization().getCode(), parent.getType(), childType);
            } else {
                ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(hierarchyType.getOrganization().getCode(), parent.getType(), childType);
            }
        }
    }
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) ServerParentTreeNode(net.geoprism.registry.model.ServerParentTreeNode) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType)

Example 72 with ServerHierarchyType

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

the class UpdateParentView method execute.

@Override
public void execute(VertexServerGeoObject go) {
    final ServerHierarchyType hierarchyType = ServerHierarchyType.get(this.getHierarchyCode());
    SortedSet<EdgeObject> looseVotc = go.getEdges(hierarchyType);
    for (UpdateValueOverTimeView vot : this.valuesOverTime) {
        ((UpdateParentValueOverTimeView) vot).executeParent(this, go, looseVotc);
    }
    // The edge work has already been applied at this point. We just need to validate what's in the DB
    this.validateValuesOverTime(looseVotc);
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) EdgeObject(com.runwaysdk.business.graph.EdgeObject)

Example 73 with ServerHierarchyType

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

the class XMLImporter method createServerHierarchyType.

private ServerHierarchyType createServerHierarchyType(Organization organization, Element elem) {
    String code = elem.getAttribute("code");
    LocalizedValue label = this.getLabel(elem);
    LocalizedValue description = this.getDescription(elem);
    String progress = elem.getAttribute("progress");
    String disclaimer = elem.getAttribute("disclaimer");
    String accessConstraints = elem.getAttribute("accessConstraints");
    String useConstraints = elem.getAttribute("useConstraints");
    String acknowledgement = elem.getAttribute("acknowledgement");
    HierarchyType type = new HierarchyType(code, label, description, organization.getCode());
    type.setProgress(progress);
    type.setDisclaimer(disclaimer);
    type.setAccessConstraints(accessConstraints);
    type.setUseConstraints(useConstraints);
    type.setAcknowledgement(acknowledgement);
    ServiceFactory.getHierarchyPermissionService().enforceCanCreate(organization.getCode());
    return new ServerHierarchyTypeBuilder().createHierarchyType(type);
}
Also used : LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) HierarchyType(org.commongeoregistry.adapter.metadata.HierarchyType) ServerHierarchyTypeBuilder(net.geoprism.registry.conversion.ServerHierarchyTypeBuilder)

Example 74 with ServerHierarchyType

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

the class XMLImporter method createHierarchies.

private List<ServerElement> createHierarchies(Organization organization, Document doc) {
    LinkedList<ServerElement> list = new LinkedList<ServerElement>();
    NodeList nList = doc.getElementsByTagName("hierarchy");
    for (int i = 0; i < nList.getLength(); i++) {
        Node nNode = nList.item(i);
        if (nNode.getNodeType() == Node.ELEMENT_NODE) {
            Element elem = (Element) nNode;
            ServerHierarchyType type = createServerHierarchyType(organization, elem);
            list.add(type);
            this.cache.put(type.getCode(), type);
            this.addChildren(type, RootGeoObjectType.INSTANCE, elem);
        }
    }
    return list;
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node) ServerElement(net.geoprism.registry.model.ServerElement) Element(org.w3c.dom.Element) ServerElement(net.geoprism.registry.model.ServerElement) LinkedList(java.util.LinkedList)

Example 75 with ServerHierarchyType

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

the class TestHierarchyTypeInfo method deleteInTrans.

@Transaction
private void deleteInTrans() {
    ServerHierarchyType serverHOT = getServerObject(true);
    if (serverHOT != null) {
        serverHOT.delete();
    }
    this.serverObj = null;
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Aggregations

ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)86 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)55 Request (com.runwaysdk.session.Request)38 JsonObject (com.google.gson.JsonObject)20 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)18 Test (org.junit.Test)17 JsonArray (com.google.gson.JsonArray)16 LinkedList (java.util.LinkedList)14 List (java.util.List)14 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)12 GeoObjectType (org.commongeoregistry.adapter.metadata.GeoObjectType)12 GeoObject (org.commongeoregistry.adapter.dataaccess.GeoObject)11 AttributeType (org.commongeoregistry.adapter.metadata.AttributeType)11 Locale (java.util.Locale)10 Point (com.vividsolutions.jts.geom.Point)9 ServerParentTreeNode (net.geoprism.registry.model.ServerParentTreeNode)9 MdBusinessDAO (com.runwaysdk.dataaccess.metadata.MdBusinessDAO)8 MdBusiness (com.runwaysdk.system.metadata.MdBusiness)8 InheritedHierarchyAnnotation (net.geoprism.registry.InheritedHierarchyAnnotation)8 Organization (net.geoprism.registry.Organization)8