Search in sources :

Example 1 with GPGeoserverLayerGroupBody

use of org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody in project geo-platform by geosdi.

the class GPGeoserverLayerGroupsConnectorStoreV22XTest method toBody.

/**
 * @return {@link GPGeoserverLayerGroupBody}
 */
GPGeoserverLayerGroupBody toBody(String theName, String theTitle) {
    GPGeoserverLayerGroupBody layerGroupBody = new GPGeoserverLayerGroupBody();
    layerGroupBody.setName(theName);
    layerGroupBody.setTitle(theTitle);
    layerGroupBody.setMode(CONTAINER);
    // layerGroupBody.setWorkspace(new GeoserverCreateWorkspaceBody("topp"));
    layerGroupBody.setBounds(new GPGeoserverLatLonBoundingBox() {

        {
            super.setMaxx(-73.907005);
            super.setMaxy(40.882078);
            super.setMinx(-74.047185);
            super.setMiny(40.679648);
            super.setCrs("EPSG:4326");
        }
    });
    GPGeoserverLayerGroupPublishables layerGroupBodyPublishables = new GPGeoserverLayerGroupPublishables();
    List<GPGeoserverLayerPublished> layers = Lists.newArrayList();
    layers.add(new GPGeoserverLayerPublished() {

        {
            super.setLayerName("tiger:giant_polygon");
        }
    });
    // layers.add(new GPGeoserverLayerPublished() {
    // {
    // super.setLayerName("topp:states");
    // }
    // });
    layers.add(new GPGeoserverLayerPublished() {

        {
            super.setLayerName("tiger:poly_landmarks");
        }
    });
    layerGroupBodyPublishables.setLayers(layers);
    layerGroupBody.setLayers(layerGroupBodyPublishables);
    return layerGroupBody;
}
Also used : GPGeoserverLayerGroupPublishables(org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerGroupPublishables) GPGeoserverLayerGroupBody(org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) GPGeoserverLayerPublished(org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerPublished)

Example 2 with GPGeoserverLayerGroupBody

use of org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody in project geo-platform by geosdi.

the class GPGeoserverCreateLayerGroupRequest method prepareHttpEntity.

/**
 * @return {@link HttpEntity}
 */
@Override
protected HttpEntity prepareHttpEntity() throws Exception {
    GPGeoserverLayerGroupBody layerGroupBody = this.body.get();
    checkArgument(layerGroupBody != null, "The Parameter layerGroupBody must not be null.");
    String layerGroupBodyString = jacksonSupport.getDefaultMapper().writeValueAsString(layerGroupBody);
    logger.debug("#############################LAYER_GROUP_BODY : \n{}\n", layerGroupBodyString);
    return new StringEntity(layerGroupBodyString, APPLICATION_JSON);
}
Also used : StringEntity(org.apache.hc.core5.http.io.entity.StringEntity) GPGeoserverLayerGroupBody(org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody)

Example 3 with GPGeoserverLayerGroupBody

use of org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody in project geo-platform by geosdi.

the class GPGeoserverCreateWorkspaceLayerGroupRequest method prepareHttpEntity.

/**
 * @return {@link HttpEntity}
 */
@Override
protected HttpEntity prepareHttpEntity() throws Exception {
    GPGeoserverLayerGroupBody layerGroupBody = this.body.get();
    checkArgument(layerGroupBody != null, "The Parameter layerGroupBody must not be null.");
    String layerGroupBodyString = jacksonSupport.getDefaultMapper().writeValueAsString(layerGroupBody);
    logger.debug("#############################LAYER_GROUP_BODY : \n{}\n", layerGroupBodyString);
    return new StringEntity(layerGroupBodyString, APPLICATION_JSON);
}
Also used : StringEntity(org.apache.hc.core5.http.io.entity.StringEntity) GPGeoserverLayerGroupBody(org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody)

Example 4 with GPGeoserverLayerGroupBody

use of org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody in project geo-platform by geosdi.

the class GPGeoserverBaseUpdateLayerGroupRequest method prepareHttpEntity.

/**
 * @return {@link HttpEntity}
 */
@Override
protected HttpEntity prepareHttpEntity() throws Exception {
    GPGeoserverLayerGroupBody layerGroupBody = this.body.get();
    checkArgument(layerGroupBody != null, "The Parameter layerGroupBody must not be null");
    String layerGroupBodyString = jacksonSupport.getDefaultMapper().writeValueAsString(layerGroupBody);
    logger.debug("#############################LAYER_GROUP_BODY : \n{}\n", layerGroupBodyString);
    return new StringEntity(layerGroupBodyString, APPLICATION_JSON);
}
Also used : StringEntity(org.apache.hc.core5.http.io.entity.StringEntity) GPGeoserverLayerGroupBody(org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody)

Example 5 with GPGeoserverLayerGroupBody

use of org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody in project geo-platform by geosdi.

the class GPGeoserverLayerGroupsConnectorStoreV220XTest method toBody.

/**
 * @return {@link GPGeoserverLayerGroupBody}
 */
GPGeoserverLayerGroupBody toBody(String theName, String theTitle) {
    GPGeoserverLayerGroupBody layerGroupBody = new GPGeoserverLayerGroupBody();
    layerGroupBody.setName(theName);
    layerGroupBody.setTitle(theTitle);
    layerGroupBody.setMode(CONTAINER);
    // layerGroupBody.setWorkspace(new GeoserverCreateWorkspaceBody("topp"));
    layerGroupBody.setBounds(new GPGeoserverLatLonBoundingBox() {

        {
            super.setMaxx(-73.907005);
            super.setMaxy(40.882078);
            super.setMinx(-74.047185);
            super.setMiny(40.679648);
            super.setCrs("EPSG:4326");
        }
    });
    GPGeoserverLayerGroupPublishables layerGroupBodyPublishables = new GPGeoserverLayerGroupPublishables();
    List<GPGeoserverLayerPublished> layers = Lists.newArrayList();
    layers.add(new GPGeoserverLayerPublished() {

        {
            super.setLayerName("tiger:giant_polygon");
        }
    });
    // layers.add(new GPGeoserverLayerPublished() {
    // {
    // super.setLayerName("topp:states");
    // }
    // });
    layers.add(new GPGeoserverLayerPublished() {

        {
            super.setLayerName("tiger:poly_landmarks");
        }
    });
    layerGroupBodyPublishables.setLayers(layers);
    layerGroupBody.setLayers(layerGroupBodyPublishables);
    return layerGroupBody;
}
Also used : GPGeoserverLayerGroupPublishables(org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerGroupPublishables) GPGeoserverLayerGroupBody(org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) GPGeoserverLayerPublished(org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerPublished)

Aggregations

GPGeoserverLayerGroupBody (org.geosdi.geoplatform.connector.geoserver.model.layergroups.GPGeoserverLayerGroupBody)5 StringEntity (org.apache.hc.core5.http.io.entity.StringEntity)3 GPGeoserverLatLonBoundingBox (org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox)2 GPGeoserverLayerGroupPublishables (org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerGroupPublishables)2 GPGeoserverLayerPublished (org.geosdi.geoplatform.connector.geoserver.model.layergroups.publishables.GPGeoserverLayerPublished)2