Search in sources :

Example 1 with GeoServerWPSClient

use of com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClient in project sldeditor by robward-scisys.

the class RenderTransformationManager method getRenderTransform.

/**
 * Gets the render transform.
 *
 * @param connection the connection
 * @return the render transform
 */
public List<ProcessBriefType> getRenderTransform(GeoServerConnection connection) {
    GeoServerWPSClientInterface client = new GeoServerWPSClient(connection);
    client.getCapabilities();
    List<ProcessBriefType> functionList = client.getRenderTransformations(DataTypeEnum.E_VECTOR);
    functionList = client.getRenderTransformations(DataTypeEnum.E_RASTER);
    return functionList;
}
Also used : GeoServerWPSClient(com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClient) GeoServerWPSClientInterface(com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClientInterface) ProcessBriefType(net.opengis.wps10.ProcessBriefType)

Example 2 with GeoServerWPSClient

use of com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClient in project sldeditor by robward-scisys.

the class RenderTransformationDialog method populateFunctionList.

/**
 * Populate function list.
 *
 * @param selectedItem the selected item
 */
private void populateFunctionList(String selectedItem) {
    GeoServerConnection connection = connectionMap.get(selectedItem);
    String message = String.format("%s : %s", Localisation.getString(RenderTransformationDialog.class, "RenderTransformationDialog.tryingToConnect"), connection.getUrl().toString());
    showMessage(message, false);
    // Make sure the above messages are displayed by trying to connect to
    // a WPS server in a separate thread.
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            client = new GeoServerWPSClient(connection);
            if (client.getCapabilities()) {
                availableFunctionList = client.getRenderTransformations(DataTypeEnum.E_VECTOR);
                functionListModel.removeAllElements();
                populateBuiltInProcessFunctions();
                for (ProcessBriefType function : availableFunctionList) {
                    functionListModel.addElement(function.getIdentifier().getValue());
                }
                // Clear info field
                showMessage("", false);
            } else {
                // Show error message
                showMessage(Localisation.getString(RenderTransformationDialog.class, "RenderTransformationDialog.errorFailedToConnect"), true);
            }
            // Make ui available again
            updateButtonState(true);
        }
    });
}
Also used : GeoServerWPSClient(com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClient) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) ProcessBriefType(net.opengis.wps10.ProcessBriefType)

Aggregations

GeoServerWPSClient (com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClient)2 ProcessBriefType (net.opengis.wps10.ProcessBriefType)2 GeoServerConnection (com.sldeditor.common.data.GeoServerConnection)1 GeoServerWPSClientInterface (com.sldeditor.extension.filesystem.geoserver.client.GeoServerWPSClientInterface)1