use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ExternalSystemService method remove.
@Request(RequestType.SESSION)
public void remove(String sessionId, String oid) {
ExternalSystem system = ExternalSystem.get(oid);
Organization organization = system.getOrganization();
ServiceFactory.getRolePermissionService().enforceRA(organization.getCode());
if (system instanceof DHIS2ExternalSystem) {
DHIS2ExternalSystem dhis2Sys = (DHIS2ExternalSystem) system;
if (dhis2Sys.getOauthServer() != null) {
OauthServer dbServer = dhis2Sys.getOauthServer();
dbServer.delete();
}
}
system.delete();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class GraphService method getChildren.
@Request(RequestType.SESSION)
public JsonObject getChildren(String sessionId, String parentCode, String parentGeoObjectTypeCode, String graphTypeCode, Boolean recursive, Date date) {
ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
GraphType graphType = this.getGraphType(graphTypeCode);
// ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
// parent.getType(), child.getType());
ServerGraphNode node = parent.getGraphChildren(graphType, recursive, date);
return node.toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class GraphService method removeChild.
@Request(RequestType.SESSION)
public void removeChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Date startDate, Date endDate) {
ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
GraphType graphType = this.getGraphType(graphTypeCode);
// ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
// parent.getType(), child.getType());
parent.removeGraphChild(child, graphType, startDate, endDate);
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class GraphService method addChild.
@Request(RequestType.SESSION)
public JsonObject addChild(String sessionId, String parentCode, String parentGeoObjectTypeCode, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Date startDate, Date endDate) {
ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
ServerGeoObjectIF parent = service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
GraphType graphType = this.getGraphType(graphTypeCode);
// ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
// parent.getType(), child.getType());
ServerGraphNode node = parent.addGraphChild(child, graphType, startDate, endDate);
return node.toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class GraphService method getParents.
@Request(RequestType.SESSION)
public JsonObject getParents(String sessionId, String childCode, String childGeoObjectTypeCode, String graphTypeCode, Boolean recursive, Date date) {
ServerGeoObjectService service = ServiceFactory.getGeoObjectService();
ServerGeoObjectIF child = service.getGeoObjectByCode(childCode, childGeoObjectTypeCode, true);
GraphType graphType = this.getGraphType(graphTypeCode);
// ServiceFactory.getGeoObjectRelationshipPermissionService().enforceCanAddChild(ht.getOrganization().getCode(),
// parent.getType(), child.getType());
ServerGraphNode node = child.getGraphParents(graphType, recursive, date);
return node.toJSON();
}
Aggregations