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);
}
}
}
}
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);
}
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);
}
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;
}
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;
}
Aggregations