当前位置: 首页>>代码示例>>Java>>正文


Java GeoServerRESTPublisher类代码示例

本文整理汇总了Java中it.geosolutions.geoserver.rest.GeoServerRESTPublisher的典型用法代码示例。如果您正苦于以下问题:Java GeoServerRESTPublisher类的具体用法?Java GeoServerRESTPublisher怎么用?Java GeoServerRESTPublisher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GeoServerRESTPublisher类属于it.geosolutions.geoserver.rest包,在下文中一共展示了GeoServerRESTPublisher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteStyle

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
/**
 * Delete style.
 *
 * @param styleToDelete the style to delete
 * @return true, if successful
 */
@Override
public boolean deleteStyle(StyleWrapper styleToDelete) {
    if (styleToDelete == null) {
        return false;
    }

    boolean result = false;
    GeoServerRESTManager manager = GeoServerRESTManagerFactory.getManager(connection);
    GeoServerRESTPublisher publisher = manager.getPublisher();

    if (publisher != null) {
        if (isDefaultWorkspace(styleToDelete.getWorkspace())) {
            result = publisher.removeStyle(styleToDelete.getStyle());
        } else {
            result = publisher.removeStyleInWorkspace(styleToDelete.getWorkspace(),
                    styleToDelete.getStyle());
        }
    }

    return result;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:GeoServerClient.java

示例2: deleteWorkspace

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
/**
 * Delete workspace.
 *
 * @param workspaceName the workspace name
 * @return true, if successful
 */
@Override
public boolean deleteWorkspace(String workspaceName) {
    if (workspaceName == null) {
        return false;
    }

    boolean result = false;
    GeoServerRESTManager manager = GeoServerRESTManagerFactory.getManager(connection);
    GeoServerRESTPublisher publisher = manager.getPublisher();

    if (publisher != null) {
        if (isDefaultWorkspace(workspaceName)) {
            ConsoleManager.getInstance().error(this, Localisation.getString(
                    GeoServerClient.class, "GeoServerClient.cannotDeleteDefaultWorkspace"));
        } else {
            result = publisher.removeWorkspace(workspaceName, false);
        }
    }

    return result;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:GeoServerClient.java

示例3: publish

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "shapefile publish", help = "Publish a shapefile.")
public boolean publish(
        @CliOption(key = "workspace", mandatory = true, help = "The workspace") String workspace,
        @CliOption(key = "datastore", mandatory = false, help = "The datastore") String datastore,
        @CliOption(key = "layer", mandatory = false, help = "The layer name") String layer,
        @CliOption(key = "file", mandatory = true, help = "The zipped shapefile") File file,
        @CliOption(key = "srs", mandatory = false, unspecifiedDefaultValue = "EPSG:4326", help = "The EPSG srs code") String srs,
        @CliOption(key = "style", mandatory = false, help = "The style") String style
) throws Exception {
    String baseName = file.getName().substring(0, file.getName().lastIndexOf(".zip"));
    if (datastore == null) {
        datastore = baseName;
    }
    if (layer == null) {
        layer = baseName;
    }
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    return publisher.publishShp(workspace, datastore, layer, file, srs, style);
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:20,代码来源:ShapefileCommands.java

示例4: publishWorkspace

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
public void publishWorkspace()
{
  try
  {
    GeoServerRESTPublisher publisher = GeoserverProperties.getPublisher();
    
    // IMPORTANT: The URI must match the namespace of the store or rendering doesn't work
    if (publisher.createWorkspace(GeoserverProperties.getWorkspace(), new URI(GeoserverProperties.getWorkspace())))
    {
      log.info("Created the workspace [" + GeoserverProperties.getWorkspace() + "].");
    }
    else
    {
      log.warn("Failed to create the workspace [" + GeoserverProperties.getWorkspace() + "].");
    }
  }
  catch (URISyntaxException e)
  {
    throw new ConfigurationException("The URI [" + GeoserverProperties.getWorkspace() + "] is invalid.", e);
  }
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:22,代码来源:GeoserverRestService.java

示例5: publishStyle

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
public boolean publishStyle(String styleName, String body, boolean force)
{
  GeoServerRESTPublisher publisher = GeoserverProperties.getPublisher();

  if (force && styleExists(styleName))
  {
    publisher.removeStyle(styleName, true);
  }

  if (publisher.publishStyle(body, styleName, true))
  {
    log.info("Published the SLD [" + styleName + "].");
    return true;
  }
  else
  {
    log.warn("Failed to publish the SLD [" + styleName + "].");
    return false;
  }
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:21,代码来源:GeoserverRestService.java

示例6: removeLayer

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
/**
 * Removes the layer from geoserver.
 * 
 * @param layer
 * @return
 */
public void removeLayer(String layer)
{
  if (GeoserverFacade.layerExists(layer))
  {
    String workspace = GeoserverProperties.getWorkspace();
    GeoServerRESTPublisher publisher = GeoserverProperties.getPublisher();

    if (publisher.removeLayer(workspace, layer))
    {
      log.info("Removed the layer for [" + layer + "].");
    }
    else
    {
      log.warn("Failed to remove the layer for [" + layer + "].");
    }
  }
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:24,代码来源:GeoserverRestService.java

示例7: updateLayerStyles

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
/**
 * Update layer styles.
 *
 * @param layer the original layer
 * @return true, if successful
 */
@Override
public boolean updateLayerStyles(GeoServerLayer layer) {
    if (layer == null) {
        return false;
    }

    StyleWrapper updatedStyle = layer.getStyle();

    boolean ok = false;
    GeoServerRESTManager manager = GeoServerRESTManagerFactory.getManager(connection);
    GeoServerRESTPublisher publisher = manager.getPublisher();

    if (publisher != null) {
        GSLayerEncoder layerEncoder = new GSLayerEncoder();

        String defaultStyle;
        if (isDefaultWorkspace(updatedStyle.getWorkspace())) {
            defaultStyle = updatedStyle.getStyle();
        } else {
            defaultStyle = updatedStyle.getWorkspace() + ":" + updatedStyle.getStyle();
        }
        layerEncoder.setDefaultStyle(defaultStyle);
        ok = publisher.configureLayer(layer.getLayerWorkspace(), layer.getLayerName(),
                layerEncoder);
    }

    return ok;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:35,代码来源:GeoServerClient.java

示例8: reset

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "geoserver reset", help = "Reset Geoserver's configuration.")
public boolean reset() {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    return publisher.reset();
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:6,代码来源:GeoserverCommands.java

示例9: publishFromDB

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@Override
public boolean publishFromDB(String tableName, String srs) {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(GEOSERVER_URL, GEOSERVER_USERNAME, GEOSERVER_PASS);

    GSLayerEncoder layerEncoder = new GSLayerEncoder();
    layerEncoder.setEnabled(true);
    layerEncoder.setQueryable(true);
    layerEncoder.setDefaultStyle(GEOSERVER_DEFAULT_STYLE);

    GSFeatureTypeEncoder featureTypeEncoder = new GSFeatureTypeEncoder();
    featureTypeEncoder.setSRS((srs == null) ? GEOSERVER_DEFAULT_SRS : srs);
    featureTypeEncoder.setName(tableName);

    return publisher.publishDBLayer(GEOSERVER_DEFAULT_WS, GEOSERVER_DEFAULT_STORAGE, featureTypeEncoder, layerEncoder);
}
 
开发者ID:VKrava,项目名称:postgis-geoserver-connector,代码行数:16,代码来源:GeoserverPublisher.java

示例10: delete

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "style delete", help = "Delete a style.")
public boolean delete(
        @CliOption(key = "name", mandatory = true, help = "The name") String name,
        @CliOption(key = "workspace", mandatory = false, help = "The workspace") String workspace,
        @CliOption(key = "purge", mandatory = false, help = "Whether to delete the SLD File from the server or not", unspecifiedDefaultValue = "false") boolean purge
) throws Exception {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    if (workspace == null) {
        return publisher.removeStyle(name, purge);
    } else {
        return removeStyle(name, workspace, purge);
    }
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:14,代码来源:StyleCommands.java

示例11: create

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "style create", help = "Create a style.")
public boolean create(
        @CliOption(key = "name", mandatory = true, help = "The name") String name,
        @CliOption(key = "workspace", mandatory = false, help = "The workspace") String workspace,
        @CliOption(key = "file", mandatory = true, help = "The SLD File") File sldFile
) throws Exception {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    if (workspace == null) {
        return publisher.publishStyle(sldFile, name);
    } else {
        return publishStyle(sldFile, name, workspace);
    }
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:14,代码来源:StyleCommands.java

示例12: modify

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "style modify", help = "Update a style.")
public boolean modify(
        @CliOption(key = "name", mandatory = true, help = "The name") String name,
        @CliOption(key = "workspace", mandatory = false, help = "The workspace") String workspace,
        @CliOption(key = "file", mandatory = true, help = "The SLD File") File sldFile
) throws Exception {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    if (workspace == null) {
        return publisher.updateStyle(sldFile, name);
    } else {
        return updateStyle(sldFile, name, workspace);
    }
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:14,代码来源:StyleCommands.java

示例13: backup

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "geoserver backup", help = "Backup Geoserver's configuration.")
public boolean backup(
        @CliOption(key = "directory", mandatory = true, help = "The backup ") String backupDir,
        @CliOption(key = "includedata", mandatory = false, unspecifiedDefaultValue = "false", help = "The include data flag") boolean includeData,
        @CliOption(key = "includegwc", mandatory = false, unspecifiedDefaultValue = "false", help = "The include GWC flag") boolean includeGwc,
        @CliOption(key = "includelog", mandatory = false, unspecifiedDefaultValue = "false", help = "The include log files flag") boolean includeLog
) {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    String result = publisher.backup(backupDir, includeData, includeGwc, includeLog);
    return result != null;
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:12,代码来源:GeoserverCommands.java

示例14: restore

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "geoserver restore", help = "Restore Geoserver's configuration from a backup directory.")
public boolean restore(
        @CliOption(key = "directory", mandatory = true, help = "The backup ") String backupDir
) {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    String result = publisher.restore(backupDir);
    return result != null;
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:9,代码来源:GeoserverCommands.java

示例15: create

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; //导入依赖的package包/类
@CliCommand(value = "workspace create", help = "Create a workspace.")
public boolean create(
        @CliOption(key = "name", mandatory = true, help = "The name") String name
) throws Exception {
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());
    return publisher.createWorkspace(name);
}
 
开发者ID:jericks,项目名称:geoserver-shell,代码行数:8,代码来源:WorkspaceCommands.java


注:本文中的it.geosolutions.geoserver.rest.GeoServerRESTPublisher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。