use of net.geoprism.registry.view.action.AbstractUpdateAttributeView in project geoprism-registry by terraframe.
the class UpdateAttributeAction method execute.
@Override
public void execute() {
ChangeRequest cr = this.getAllRequest().next();
ServerGeoObjectType type = ServerGeoObjectType.get(cr.getGeoObjectTypeCode());
VertexServerGeoObject go = new VertexGeoObjectStrategy(type).getGeoObjectByCode(cr.getGeoObjectCode());
AbstractUpdateAttributeView view = UpdateAttributeViewJsonAdapters.deserialize(this.getJson(), this.getAttributeName(), type);
view.execute(go);
if (!this.getAttributeName().equals(UpdateAttributeViewJsonAdapters.PARENT_ATTR_NAME)) {
String attributeName = this.getAttributeName();
if (attributeName.equals("geometry")) {
attributeName = go.getGeometryAttributeName();
}
ValueOverTimeCollection votc = go.getValuesOverTime(attributeName);
votc.reorder();
go.apply(false);
}
}
use of net.geoprism.registry.view.action.AbstractUpdateAttributeView in project geoprism-registry by terraframe.
the class ServerGeoObjectService method executeActions.
public void executeActions(final ServerGeoObjectType type, final VertexServerGeoObject go, final JsonArray jaActions) {
for (int i = 0; i < jaActions.size(); ++i) {
JsonObject action = jaActions.get(i).getAsJsonObject();
String attributeName = action.get("attributeName").getAsString();
JsonObject attributeDiff = action.get("attributeDiff").getAsJsonObject();
AbstractUpdateAttributeView view = UpdateAttributeViewJsonAdapters.deserialize(attributeDiff.toString(), attributeName, type);
view.execute(go);
}
go.apply(false);
}
Aggregations