use of org.commongeoregistry.adapter.metadata.CustomSerializer in project geoprism-registry by terraframe.
the class RegistryController method getGeoObject.
/**
* Returns a GeoObject with the given uid.
*
* @pre @post
*
* @param uid
* The UID of the GeoObject.
*
* @returns a GeoObject in GeoJSON format with the given uid. @throws
*/
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = RegistryUrls.GEO_OBJECT_GET)
public ResponseIF getGeoObject(ClientRequestIF request, @RequestParamter(name = RegistryUrls.GEO_OBJECT_GET_PARAM_ID) String id, @RequestParamter(name = RegistryUrls.GEO_OBJECT_GET_PARAM_TYPE_CODE) String typeCode, @RequestParamter(name = "date") String date) throws JSONException {
GeoObject geoObject = this.registryService.getGeoObject(request.getSessionId(), id, typeCode, GeoRegistryUtil.parseDate(date, true));
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(geoObject.toJSON(serializer));
}
use of org.commongeoregistry.adapter.metadata.CustomSerializer in project geoprism-registry by terraframe.
the class RegistryController method updateOrganization.
/**
* Update organization.
*
* @param sessionId
* @param json
*/
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = "orgainization/update")
public ResponseIF updateOrganization(ClientRequestIF request, @RequestParamter(name = "json", required = true) String json) {
OrganizationDTO org = this.registryService.updateOrganization(request.getSessionId(), json);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(org.toJSON(serializer));
}
use of org.commongeoregistry.adapter.metadata.CustomSerializer in project geoprism-registry by terraframe.
the class RegistryController method getGeoObjectOverTime.
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = RegistryUrls.GEO_OBJECT_TIME_GET)
public ResponseIF getGeoObjectOverTime(ClientRequestIF request, @RequestParamter(name = RegistryUrls.GEO_OBJECT_TIME_GET_PARAM_ID) String id, @RequestParamter(name = RegistryUrls.GEO_OBJECT_TIME_GET_PARAM_TYPE_CODE) String typeCode) throws JSONException {
GeoObjectOverTime geoObject = this.registryService.getGeoObjectOverTime(request.getSessionId(), id, typeCode);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(geoObject.toJSON(serializer));
}
use of org.commongeoregistry.adapter.metadata.CustomSerializer in project geoprism-registry by terraframe.
the class RegistryController method updateHierarchyType.
/**
* Updates the given {@link HierarchyType} represented as JSON.
*
* @param sessionId
* @param gtJSON
* JSON of the {@link HierarchyType} to be updated.
*/
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = RegistryUrls.HIERARCHY_TYPE_UPDATE)
public ResponseIF updateHierarchyType(ClientRequestIF request, @RequestParamter(name = "htJSON", required = true) String htJSON) {
HierarchyType hierarchyType = ServiceFactory.getHierarchyService().updateHierarchyType(request.getSessionId(), htJSON);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(hierarchyType.toJSON(serializer));
}
use of org.commongeoregistry.adapter.metadata.CustomSerializer in project geoprism-registry by terraframe.
the class RegistryController method createGeoObjectOverTime.
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = RegistryUrls.GEO_OBJECT_TIME_CREATE)
public ResponseIF createGeoObjectOverTime(ClientRequestIF request, @RequestParamter(name = RegistryUrls.GEO_OBJECT_TIME_CREATE_PARAM_GEOOBJECT) String jGeoObj) {
GeoObjectOverTime geoObject = this.registryService.createGeoObjectOverTime(request.getSessionId(), jGeoObj);
CustomSerializer serializer = this.registryService.serializer(request.getSessionId());
return new RestBodyResponse(geoObject.toJSON(serializer));
}
Aggregations