use of net.geoprism.registry.InvalidMasterListException in project geoprism-registry by terraframe.
the class ListTypeService method createVersion.
@Request(RequestType.SESSION)
public JsonObject createVersion(String sessionId, String oid, String metadata) {
ListTypeEntry entry = ListTypeEntry.get(oid);
ListType listType = entry.getListType();
if (!listType.isValid()) {
throw new InvalidMasterListException();
}
this.enforceWritePermissions(listType);
String version = entry.publish(metadata);
((Session) Session.getCurrentSession()).reloadPermissions();
return JsonParser.parseString(version).getAsJsonObject();
// return entry.toJSON(false);
}
use of net.geoprism.registry.InvalidMasterListException in project geoprism-registry by terraframe.
the class ListTypeService method applyVersion.
@Request(RequestType.SESSION)
public JsonObject applyVersion(String sessionId, String oid, String metadata) {
ListTypeVersion version = ListTypeVersion.get(oid);
ListType listType = version.getListType();
if (!listType.isValid()) {
throw new InvalidMasterListException();
}
this.enforceWritePermissions(listType);
version.appLock();
try {
version.parse(JsonParser.parseString(metadata).getAsJsonObject());
} finally {
version.apply();
}
return version.toJSON(false);
}
Aggregations