use of com.runwaysdk.session.ReadPermissionException in project geoprism-registry by terraframe.
the class VertexServerGeoObject method apply.
@Override
public void apply(boolean isImport) {
if (!isImport && !this.vertex.isNew() && !this.getType().isGeometryEditable() && this.vertex.isModified(this.getGeometryAttributeName())) {
throw new GeometryUpdateException();
}
if (this.vertex.isNew() || this.vertex.getObjectValue(GeoVertex.CREATEDATE) == null) {
this.vertex.setValue(GeoVertex.CREATEDATE, new Date());
}
this.vertex.setValue(GeoVertex.LASTUPDATEDATE, new Date());
if (this.getInvalid() == null) {
this.setInvalid(false);
}
this.validate();
try {
this.getVertex().apply();
} catch (CreatePermissionException ex) {
CreateGeoObjectPermissionException goex = new CreateGeoObjectPermissionException();
goex.setGeoObjectType(this.getType().getLabel().getValue());
goex.setOrganization(this.getType().getOrganization().getDisplayLabel().getValue());
throw goex;
} catch (WritePermissionException ex) {
WriteGeoObjectPermissionException goex = new WriteGeoObjectPermissionException();
goex.setGeoObjectType(this.getType().getLabel().getValue());
goex.setOrganization(this.getType().getOrganization().getDisplayLabel().getValue());
throw goex;
} catch (ReadPermissionException ex) {
ReadGeoObjectPermissionException goex = new ReadGeoObjectPermissionException();
goex.setGeoObjectType(this.getType().getLabel().getValue());
goex.setOrganization(this.getType().getOrganization().getDisplayLabel().getValue());
throw goex;
}
if (!this.getInvalid()) {
new SearchService().insert(this);
} else {
new SearchService().remove(this.getCode());
}
}
Aggregations