Fixed issue
This commit is contained in:
parent
0cb473a01b
commit
bce7332e3f
|
@ -89,16 +89,7 @@ public abstract class Record extends CKANPackage {
|
|||
}
|
||||
|
||||
public abstract String getType();
|
||||
|
||||
|
||||
public void setGRSFUUID(String grsfUUID) {
|
||||
this.grsfUUID = grsfUUID;
|
||||
}
|
||||
|
||||
public String getGRSFUUID() {
|
||||
return this.grsfUUID;
|
||||
}
|
||||
|
||||
public JsonNode elaborate(JsonNode node) throws Exception {
|
||||
FreeMarker freeMarker = new FreeMarker();
|
||||
Template tsTemplate = freeMarker.getTemplate("timeseries.ftl");
|
||||
|
|
|
@ -115,28 +115,28 @@ public class BaseRESTAPIs<R extends Record> {
|
|||
String ret = record.create(json);
|
||||
|
||||
ResponseBuilder responseBuilder = Response.status(Status.CREATED).entity(ret);
|
||||
responseBuilder = addLocation(responseBuilder, record.getGRSFUUID());
|
||||
responseBuilder = addLocation(responseBuilder, record.getName());
|
||||
return responseBuilder.type(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8).build();
|
||||
}
|
||||
|
||||
public String read(String id) {
|
||||
setCalledMethod("GET /" + COLLECTION_PARAMETER + "/{" + ID_PARAMETER + "}");
|
||||
Record record = getInstance();
|
||||
record.setGRSFUUID(id);
|
||||
record.setName(id);
|
||||
return record.read();
|
||||
}
|
||||
|
||||
public String update(String id, String json) {
|
||||
setCalledMethod("PUT /" + COLLECTION_PARAMETER + "/{" + ID_PARAMETER + "}");
|
||||
Record record = getInstance();
|
||||
record.setGRSFUUID(id);
|
||||
record.setName(id);
|
||||
return record.update(json);
|
||||
}
|
||||
|
||||
public String patch(String id, String json) {
|
||||
setCalledMethod("PATCH /" + COLLECTION_PARAMETER + "/{" + ID_PARAMETER + "}");
|
||||
Record record = getInstance();
|
||||
record.setGRSFUUID(id);
|
||||
record.setName(id);
|
||||
return record.patch(json);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ public class BaseRESTAPIs<R extends Record> {
|
|||
setCalledMethod("DELETE /" + COLLECTION_PARAMETER + "/{" + ID_PARAMETER + "}");
|
||||
}
|
||||
Record record = getInstance();
|
||||
record.setGRSFUUID(id);
|
||||
record.setName(id);
|
||||
record.delete(purge);
|
||||
return Response.status(Status.NO_CONTENT).build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue