Search in sources :

Example 6 with GeoServerRESTReader

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

the class GeoServerClient method refreshWorkspace.

/**
 * Refresh workspace.
 *
 * @param workspaceName the workspace name
 */
@Override
public void refreshWorkspace(String workspaceName) {
    GeoServerRESTManager manager = GeoServerRESTManagerFactory.getManager(connection);
    if (manager != null) {
        GeoServerRESTReader reader = manager.getReader();
        if (reader != null) {
            Map<String, List<StyleWrapper>> styleMap = new LinkedHashMap<String, List<StyleWrapper>>();
            int count = 1;
            List<StyleWrapper> styleList = new ArrayList<StyleWrapper>();
            if (workspaceName.compareTo(DEFAULT_WORKSPACE_NAME) == 0) {
                count = parseStyleInDefaultWorkspace(reader, count, styleList);
                styleMap.put(DEFAULT_WORKSPACE_NAME, styleList);
            } else {
                // Read styles from workspace
                count = parseStyleInWorkspace(reader, styleMap, count, workspaceName);
            }
            if (parentObj != null) {
                parentObj.readStylesComplete(connection, styleMap, true);
            }
        }
    }
}
Also used : GeoServerRESTReader(it.geosolutions.geoserver.rest.GeoServerRESTReader) StyleWrapper(com.sldeditor.common.data.StyleWrapper) ArrayList(java.util.ArrayList) RESTStyleList(it.geosolutions.geoserver.rest.decoder.RESTStyleList) ArrayList(java.util.ArrayList) List(java.util.List) RESTLayerList(it.geosolutions.geoserver.rest.decoder.RESTLayerList) GeoServerRESTManager(it.geosolutions.geoserver.rest.GeoServerRESTManager) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

GeoServerRESTReader (it.geosolutions.geoserver.rest.GeoServerRESTReader)6 GeoServerRESTManager (it.geosolutions.geoserver.rest.GeoServerRESTManager)5 Gson (com.google.gson.Gson)1 StyleWrapper (com.sldeditor.common.data.StyleWrapper)1 ItemManager (gov.usgs.cida.coastalhazards.jpa.ItemManager)1 StatusManager (gov.usgs.cida.coastalhazards.jpa.StatusManager)1 Item (gov.usgs.cida.coastalhazards.model.Item)1 Status (gov.usgs.cida.coastalhazards.model.util.Status)1 StatusName (gov.usgs.cida.coastalhazards.model.util.Status.StatusName)1 GeoServerRESTPublisher (it.geosolutions.geoserver.rest.GeoServerRESTPublisher)1 RESTLayerList (it.geosolutions.geoserver.rest.decoder.RESTLayerList)1 RESTStyleList (it.geosolutions.geoserver.rest.decoder.RESTStyleList)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 TreeMap (java.util.TreeMap)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1