org.geoserver.catalog.Keyword.setLanguage()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.geoserver.catalog.Keyword.setLanguage()方法的一些代码示例,展示了Keyword.setLanguage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keyword.setLanguage()方法的具体详情如下:
包路径:org.geoserver.catalog.Keyword
类名称:Keyword
方法名:setLanguage

Keyword.setLanguage介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

/**
 * Helper method that adds some tests keywords to a layer group. The provided layer group name
 * should not be NULL, if the layer group cannot be found an exception will be throw.
 */
protected void addKeywordsToLayerGroup(String layerGroupName) {
  // create a list of keywords
  List<KeywordInfo> keywords = new ArrayList<>();
  Keyword keyword1 = new Keyword("keyword1");
  keyword1.setLanguage("en");
  keyword1.setVocabulary("vocabulary1");
  keywords.add(keyword1);
  Keyword keyword2 = new Keyword("keyword2");
  keyword2.setLanguage("pt");
  keyword2.setVocabulary("vocabulary2");
  keywords.add(keyword2);
  // add keywords to a layer group
  LayerGroupInfo layerGroup = getCatalog().getLayerGroupByName(layerGroupName);
  if (layerGroup == null) {
    // targeted layer group doesn't exists
    throw new RuntimeException(
        String.format("Layer group '%s' doesn't exists.", layerGroupName));
  }
  layerGroup.getKeywords().addAll(keywords);
  getCatalog().save(layerGroup);
}

代码示例来源:origin: org.geoserver/gs-restconfig

keyword1.setLanguage("en");
keyword1.setVocabulary("vocabulary1");
Keyword keyword2 = new Keyword("keyword2");
keyword2.setLanguage("pt");
keyword2.setVocabulary("vocabulary2");

代码示例来源:origin: org.geoserver/gs-restconfig

keyword1.setLanguage("en");
keyword1.setVocabulary("vocabulary1");
Keyword keyword2 = new Keyword("keyword2");
keyword2.setLanguage("pt");
keyword2.setVocabulary("vocabulary2");

相关文章