Search in sources :

Example 1 with FilterDescribeFeatureResponse

use of org.geosdi.geoplatform.gui.client.command.filter.basic.FilterDescribeFeatureResponse in project geo-platform by geosdi.

the class FilterDescribeFeatureCommand method execute.

@Override
public FilterDescribeFeatureResponse execute(FilterDescribeFeatureRequest request, HttpServletRequest httpServletRequest) {
    try {
        logger.debug("##################### Executing {} Command", this.getClass().getSimpleName());
        List<GPLayerAttributes> attributeList = Lists.newArrayList();
        try {
            List<LayerAttribute> result = this.geoPlatformPublishClient.describeFeatureType(request.getLayerName()).getLayerAttributes();
            for (LayerAttribute layerAttribute : result) {
                GPLayerAttributes gpLayerAttributes = new GPLayerAttributes();
                gpLayerAttributes.setAttributeType(layerAttribute.getType());
                gpLayerAttributes.setAttributeValue(layerAttribute.getValue());
                attributeList.add(gpLayerAttributes);
            }
        } catch (ResourceNotFoundFault rnff) {
            throw new GeoPlatformException(rnff.getMessage());
        }
        logger.debug("#################### Found {} ", attributeList);
        return new FilterDescribeFeatureResponse(Lists.<GPLayerAttributes>newArrayList(attributeList));
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new GeoPlatformException(ex.getMessage());
    }
}
Also used : FilterDescribeFeatureResponse(org.geosdi.geoplatform.gui.client.command.filter.basic.FilterDescribeFeatureResponse) GPLayerAttributes(org.geosdi.geoplatform.gui.model.tree.GPLayerAttributes) LayerAttribute(org.geosdi.geoplatform.responce.LayerAttribute) ResourceNotFoundFault(org.geosdi.geoplatform.exception.ResourceNotFoundFault) GeoPlatformException(org.geosdi.geoplatform.gui.global.GeoPlatformException) GeoPlatformException(org.geosdi.geoplatform.gui.global.GeoPlatformException)

Example 2 with FilterDescribeFeatureResponse

use of org.geosdi.geoplatform.gui.client.command.filter.basic.FilterDescribeFeatureResponse in project geo-platform by geosdi.

the class CASFilterDescribeFeatureCommand method execute.

@Override
public FilterDescribeFeatureResponse execute(FilterDescribeFeatureRequest request, HttpServletRequest httpServletRequest) {
    logger.debug("##################### Executing {} Command", this.getClass().getSimpleName());
    List<GPLayerAttributes> attributeList = Lists.<GPLayerAttributes>newArrayList();
    try {
        List<LayerAttribute> result = this.casPublisherService.describeFeatureType(request.getLayerName()).getLayerAttributes();
        for (LayerAttribute layerAttribute : result) {
            GPLayerAttributes gpLayerAttributes = new GPLayerAttributes();
            gpLayerAttributes.setAttributeType(layerAttribute.getType());
            gpLayerAttributes.setAttributeValue(layerAttribute.getValue());
            attributeList.add(gpLayerAttributes);
        }
    } catch (ResourceNotFoundFault rnff) {
        throw new GeoPlatformException(rnff.getMessage());
    }
    logger.debug("#################### Found {} ", attributeList);
    return new FilterDescribeFeatureResponse(Lists.newArrayList(attributeList));
}
Also used : FilterDescribeFeatureResponse(org.geosdi.geoplatform.gui.client.command.filter.basic.FilterDescribeFeatureResponse) GPLayerAttributes(org.geosdi.geoplatform.gui.model.tree.GPLayerAttributes) LayerAttribute(org.geosdi.geoplatform.responce.LayerAttribute) ResourceNotFoundFault(org.geosdi.geoplatform.exception.ResourceNotFoundFault) GeoPlatformException(org.geosdi.geoplatform.gui.global.GeoPlatformException)

Aggregations

ResourceNotFoundFault (org.geosdi.geoplatform.exception.ResourceNotFoundFault)2 FilterDescribeFeatureResponse (org.geosdi.geoplatform.gui.client.command.filter.basic.FilterDescribeFeatureResponse)2 GeoPlatformException (org.geosdi.geoplatform.gui.global.GeoPlatformException)2 GPLayerAttributes (org.geosdi.geoplatform.gui.model.tree.GPLayerAttributes)2 LayerAttribute (org.geosdi.geoplatform.responce.LayerAttribute)2