Search in sources :

Example 1 with UpdateElementType

use of org.geosdi.geoplatform.xml.wfs.v110.UpdateElementType in project geo-platform by geosdi.

the class TransactionUpdate method getOperation.

/**
 * @param request
 * @return {@link Object}
 * @throws Exception
 */
@Override
public Object getOperation(@Nonnull(when = NEVER) WFSTransactionRequest request) throws Exception {
    checkArgument(request != null, "The Parameter request must not be null.");
    checkArgument(request.getTypeName() != null, "The Parameter typeName must not be null.");
    checkArgument(((request.getFID() != null) && !(request.getFID().trim().isEmpty())), "The Parameter fid must not be null.");
    UpdateElementType elementType = new UpdateElementType();
    elementType.setTypeName(request.getTypeName());
    List<PropertyType> properties = super.getPropertyToUpdate(request.getAttributes());
    elementType.setProperty(properties);
    if (request.getSRS() != null) {
        elementType.setSrsName(request.getSRS());
    }
    elementType.setInputFormat(request.getInputFormat() != null ? request.getInputFormat() : "x-application/gml:3");
    FeatureIdType fid = new FeatureIdType();
    fid.setFid(request.getFID());
    FilterType filter = new FilterType();
    filter.setId(asList(filterFactory.createFeatureId(fid)));
    elementType.setFilter(filter);
    return elementType;
}
Also used : FilterType(org.geosdi.geoplatform.xml.filter.v110.FilterType) PropertyType(org.geosdi.geoplatform.xml.wfs.v110.PropertyType) UpdateElementType(org.geosdi.geoplatform.xml.wfs.v110.UpdateElementType) FeatureIdType(org.geosdi.geoplatform.xml.filter.v110.FeatureIdType)

Aggregations

FeatureIdType (org.geosdi.geoplatform.xml.filter.v110.FeatureIdType)1 FilterType (org.geosdi.geoplatform.xml.filter.v110.FilterType)1 PropertyType (org.geosdi.geoplatform.xml.wfs.v110.PropertyType)1 UpdateElementType (org.geosdi.geoplatform.xml.wfs.v110.UpdateElementType)1