Search in sources :

Example 1 with RESTStyleList

use of it.geosolutions.geoserver.rest.decoder.RESTStyleList in project sldeditor by robward-scisys.

the class GeoServerClient method parseStyleInDefaultWorkspace.

/**
 * Parses the style in default workspace.
 *
 * @param reader the reader
 * @param count the count
 * @param styleList the style list
 * @return the int
 */
private int parseStyleInDefaultWorkspace(GeoServerRESTReader reader, int count, List<StyleWrapper> styleList) {
    // Read styles not in a workspace
    RESTStyleList geoServerStyleList = reader.getStyles();
    for (String style : geoServerStyleList.getNames()) {
        StyleWrapper newStyleWrapper = new StyleWrapper(DEFAULT_WORKSPACE_NAME, style);
        styleList.add(newStyleWrapper);
        if (parentObj != null) {
            parentObj.readStylesProgress(connection, count, count);
        }
        count++;
    }
    return count;
}
Also used : StyleWrapper(com.sldeditor.common.data.StyleWrapper) RESTStyleList(it.geosolutions.geoserver.rest.decoder.RESTStyleList)

Example 2 with RESTStyleList

use of it.geosolutions.geoserver.rest.decoder.RESTStyleList in project sldeditor by robward-scisys.

the class GeoServerClient method parseStyleInWorkspace.

/**
 * Parses the style in workspace.
 *
 * @param reader the reader
 * @param styleMap the style map
 * @param count the count
 * @param workspaceName the workspace name
 * @return the int
 */
private int parseStyleInWorkspace(GeoServerRESTReader reader, Map<String, List<StyleWrapper>> styleMap, int count, String workspaceName) {
    List<StyleWrapper> styleList;
    if (workspaceName != null) {
        RESTStyleList geoServerWorkspaceStyleList = reader.getStyles(workspaceName);
        styleList = new ArrayList<StyleWrapper>();
        for (String style : geoServerWorkspaceStyleList.getNames()) {
            StyleWrapper newStyleWrapper = new StyleWrapper(workspaceName, style);
            styleList.add(newStyleWrapper);
            if (parentObj != null) {
                parentObj.readStylesProgress(connection, count, count);
            }
            count++;
        }
        styleMap.put(workspaceName, styleList);
    }
    return count;
}
Also used : StyleWrapper(com.sldeditor.common.data.StyleWrapper) RESTStyleList(it.geosolutions.geoserver.rest.decoder.RESTStyleList)

Aggregations

StyleWrapper (com.sldeditor.common.data.StyleWrapper)2 RESTStyleList (it.geosolutions.geoserver.rest.decoder.RESTStyleList)2