use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ChangeRequestService method update.
@Request(RequestType.SESSION)
public JsonObject update(String sessionId, String cr) {
JsonObject obj = JsonParser.parseString(cr).getAsJsonObject();
String oid = obj.get("oid").getAsString();
JsonArray actions = obj.get("actions").getAsJsonArray();
String notes = obj.get("contributorNotes").getAsString();
ChangeRequest current = ChangeRequest.get(oid);
ServerGeoObjectService service = new ServerGeoObjectService();
service.updateChangeRequest(current, notes, actions);
return current.getDetails();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ChangeRequestService method implementDecisions.
@Request(RequestType.SESSION)
public JsonObject implementDecisions(String sessionId, String request) {
ChangeRequest input = ChangeRequest.fromJSON(request);
ChangeRequest current = ChangeRequest.get(JsonParser.parseString(request).getAsJsonObject().get("oid").getAsString());
if (!this.permService.getPermissions(current).containsAll(Arrays.asList(ChangeRequestPermissionAction.EXECUTE, ChangeRequestPermissionAction.WRITE_APPROVAL_STATUS, ChangeRequestPermissionAction.WRITE))) {
throw new CGRPermissionException();
}
current.execute(input.getMaintainerNotes(), input.getAdditionalNotes());
return current.getDetails();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ChangeRequestService method reject.
@Request(RequestType.SESSION)
public void reject(String sessionId, String request) {
ChangeRequest input = ChangeRequest.fromJSON(request);
ChangeRequest current = ChangeRequest.get(JsonParser.parseString(request).getAsJsonObject().get("oid").getAsString());
if (!this.permService.getPermissions(current).containsAll(Arrays.asList(ChangeRequestPermissionAction.WRITE, ChangeRequestPermissionAction.WRITE_APPROVAL_STATUS, ChangeRequestPermissionAction.READ, ChangeRequestPermissionAction.READ_DETAILS))) {
throw new CGRPermissionException();
}
current.reject(input.getMaintainerNotes(), input.getAdditionalNotes());
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationService method apply.
@Request(RequestType.SESSION)
public JsonObject apply(String sessionId, String classificationCode, String parentCode, JsonObject object, boolean isNew) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification parent = parentCode != null ? Classification.get(type, parentCode) : null;
Classification classification = Classification.construct(type, object, isNew);
classification.populate(object);
classification.apply(parent);
// Return the refreshed copy of the geoObject
return classification.toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationService method move.
@Request(RequestType.SESSION)
public void move(String sessionId, String classificationCode, String code, String parentCode) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification classification = Classification.get(type, code);
Classification newParent = Classification.get(type, parentCode);
classification.move(newParent);
}
Aggregations