use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class HierarchyController method removeFromHierarchy.
/**
* Removes the {@link GeoObjectType} with the given child code from the parent
* {@link GeoObjectType} with the given code for the given
* {@link HierarchyType} code.
*
* @param sessionId
* @param hierarchyCode
* code of the {@link HierarchyType} the child is being added to.
* @param parentGeoObjectTypeCode
* parent {@link GeoObjectType}.
* @param childGeoObjectTypeCode
* child {@link GeoObjectType}.
*/
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = "remove")
public ResponseIF removeFromHierarchy(ClientRequestIF request, @RequestParamter(name = "hierarchyCode", required = true) String hierarchyCode, @RequestParamter(name = "parentGeoObjectTypeCode", required = true) String parentGeoObjectTypeCode, @RequestParamter(name = "childGeoObjectTypeCode", required = true) String childGeoObjectTypeCode) {
HierarchyType ht = ServiceFactory.getHierarchyService().removeFromHierarchy(request.getSessionId(), hierarchyCode, parentGeoObjectTypeCode, childGeoObjectTypeCode, true);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(ht.toJSON(serializer));
}
use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class ListTypeController method apply.
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = "apply")
public ResponseIF apply(ClientRequestIF request, @RequestParamter(name = "list", required = true) String listJSON) {
JsonObject list = JsonParser.parseString(listJSON).getAsJsonObject();
JsonObject response = this.service.apply(request.getSessionId(), list);
return new RestBodyResponse(response);
}
use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class RegistryAccountController method getRolesForUser.
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON)
public ResponseIF getRolesForUser(ClientRequestIF request, @RequestParamter(name = "userOID", required = true) String userOID) throws JSONException {
RegistryRole[] roles = this.accountService.getRolesForUser(request.getSessionId(), userOID);
JsonArray rolesJSONArray = this.createRoleMap(roles);
return new RestBodyResponse(rolesJSONArray);
}
use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class RegistryController method getGeoObjectOverTimeByCode.
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = RegistryUrls.GEO_OBJECT_TIME_GET_CODE)
public ResponseIF getGeoObjectOverTimeByCode(ClientRequestIF request, @RequestParamter(name = RegistryUrls.GEO_OBJECT_TIME_GET_CODE_PARAM_CODE) String code, @RequestParamter(name = RegistryUrls.GEO_OBJECT_TIME_GET_CODE_PARAM_TYPE_CODE) String typeCode) throws JSONException {
GeoObjectOverTime geoObject = this.registryService.getGeoObjectOverTimeByCode(request.getSessionId(), code, typeCode);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(geoObject.toJSON(serializer));
}
use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class RegistryController method createHierarchyType.
/**
* Create the {@link HierarchyType} from the given JSON.
*
* @param sessionId
* @param htJSON
* JSON of the {@link HierarchyType} to be created.
*/
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = RegistryUrls.HIERARCHY_TYPE_CREATE)
public ResponseIF createHierarchyType(ClientRequestIF request, @RequestParamter(name = "htJSON", required = true) String htJSON) {
HierarchyType hierarchyType = ServiceFactory.getHierarchyService().createHierarchyType(request.getSessionId(), htJSON);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(hierarchyType.toJSON(serializer));
}
Aggregations