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

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

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

Keyword.<init>介绍

暂无

代码示例

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

@Override
public Object fromString(String str) {
  Matcher m = RE.matcher(str);
  if (!m.matches()) {
    throw new IllegalArgumentException(
        String.format("%s does not match regular expression: %s", str, RE));
  }
  KeywordInfo kw = new Keyword(m.group(1));
  if (m.group(2) != null) {
    kw.setLanguage(m.group(2));
  }
  if (m.group(3) != null) {
    kw.setVocabulary(m.group(3));
  }
  return kw;
}

代码示例来源:origin: stackoverflow.com

if (stem != null) {
 Keyword keyword = find(keywords, new Keyword(stem.replaceAll("-0", "-")));

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

if (keywords != null) {
  for (String kw : keywords) {
    service.getKeywords().add(new Keyword(kw));

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

continue;
ftinfo.getKeywords().add(new Keyword(kw));

代码示例来源: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: geoserver/geoserver

cinfo.setName(specifiedName);
  cinfo.setTitle(specifiedName);
  cinfo.getKeywords().add(new Keyword(specifiedName));
} else {
  String name = reader.getGridCoverageNames()[0];
  cinfo.setName(name);
  cinfo.setTitle(name);
  cinfo.getKeywords().add(new Keyword(name));
cinfo.getKeywords().add(new Keyword("WCS"));
cinfo.getKeywords().add(new Keyword(format.getName()));

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

@Test
public void testFullTextSearchAddedKeyword() {
  ft.getKeywords().add(new Keyword("air_temp"));
  ft.getKeywords().add(new Keyword("temperatureAir"));
  l.setResource(ft);
  addLayer();
  LayerInfo lproxy = catalog.getLayer(l.getId());
  FeatureTypeInfo ftproxy = (FeatureTypeInfo) lproxy.getResource();
  ftproxy.getKeywords().add(new Keyword("newKeyword"));
  catalog.save(ftproxy);
  Filter filter = Predicates.fullTextSearch("newKeyword");
  assertEquals(newHashSet(ftproxy), asSet(catalog.list(FeatureTypeInfo.class, filter)));
  assertEquals(newHashSet(lproxy), asSet(catalog.list(LayerInfo.class, filter)));
}

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

coverage.setDescription(cInfoReader.description());
for (String kw : cInfoReader.keywords()) {
  coverage.getKeywords().add(new Keyword(kw));

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

@Test
public void testMetadataFromFeatueSource() throws Exception {
  CatalogBuilder cb = new CatalogBuilder(getCatalog());
  cb.setStore(cb.buildDataStore("fooStore"));
  FeatureType ft = createMock(FeatureType.class);
  expect(ft.getName()).andReturn(new NameImpl("foo")).anyTimes();
  expect(ft.getCoordinateReferenceSystem()).andReturn(null).anyTimes();
  expect(ft.getGeometryDescriptor()).andReturn(null).anyTimes();
  replay(ft);
  ResourceInfo rInfo = createMock(ResourceInfo.class);
  expect(rInfo.getTitle()).andReturn("foo title");
  expect(rInfo.getDescription()).andReturn("foo description");
  expect(rInfo.getKeywords())
      .andReturn(new LinkedHashSet<String>(Arrays.asList("foo", "bar", "baz", "")))
      .anyTimes();
  replay(rInfo);
  FeatureSource fs = createMock(FeatureSource.class);
  expect(fs.getSchema()).andReturn(ft).anyTimes();
  expect(fs.getInfo()).andReturn(rInfo).anyTimes();
  expect(fs.getName()).andReturn(ft.getName()).anyTimes();
  replay(fs);
  FeatureTypeInfo ftInfo = cb.buildFeatureType(fs);
  assertEquals("foo title", ftInfo.getTitle());
  assertEquals("foo description", ftInfo.getDescription());
  assertTrue(ftInfo.getKeywords().contains(new Keyword("foo")));
  assertTrue(ftInfo.getKeywords().contains(new Keyword("bar")));
  assertTrue(ftInfo.getKeywords().contains(new Keyword("baz")));
}

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

for (String kw : layer.getKeywords()) {
  if (kw != null) {
    wli.getKeywords().add(new Keyword(kw));

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

for (String kw : layer.getKeywords()) {
  if (kw != null) {
    wli.getKeywords().add(new Keyword(kw));

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

expect(r.getKeywords()).andReturn((List) Arrays.asList(new Keyword(name))).anyTimes();
expect(r.isEnabled()).andReturn(true).anyTimes();
expect(r.isAdvertised()).andReturn(true).anyTimes();

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

coverage.setEnabled(true);
coverage.getAlias().add("alias");
coverage.getKeywords().add(new Keyword("key"));
MetadataLinkInfoImpl metadataLink = new MetadataLinkInfoImpl();
metadataLink.setAbout("about");

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

@Test
public void testFullTextSearchKeywords() {
  ft.getKeywords().add(new Keyword("air_temp"));
  ft.getKeywords().add(new Keyword("temperatureAir"));
  cv.getKeywords().add(new Keyword("dwpt_dprs"));
  cv.getKeywords().add(new Keyword("temperatureDewpointDepression"));

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

featureType.setAbstract(ftInfoReader.abstrct());
for (String kw : ftInfoReader.keywords()) {
  featureType.getKeywords().add(new Keyword(kw));

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

@Test
public void testAddFeatureType() {
  assertTrue(catalog.getFeatureTypes().isEmpty());
  addFeatureType();
  assertEquals(1, catalog.getFeatureTypes().size());
  FeatureTypeInfo ft2 = catalog.getFactory().createFeatureType();
  try {
    catalog.add(ft2);
    fail("adding with no name should throw exception");
  } catch (Exception e) {
  }
  ft2.setName("ft2Name");
  try {
    catalog.add(ft2);
    fail("adding with no store should throw exception");
  } catch (Exception e) {
  }
  ft2.setStore(ds);
  ft2.getKeywords().add(new Keyword("keyword"));
  catalog.add(ft2);
  FeatureTypeInfo ft3 = catalog.getFactory().createFeatureType();
  ft3.setName("ft3Name");
  try {
    catalog.getFeatureTypes().add(ft3);
    fail("adding directly should throw an exception");
  } catch (Exception e) {
  }
}

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

@Test
public void testModifyFeatureType() {
  addFeatureType();
  FeatureTypeInfo ft2 = catalog.getFeatureTypeByName(ft.getName());
  ft2.setDescription("ft2Description");
  ft2.getKeywords().add(new Keyword("ft2"));
  FeatureTypeInfo ft3 = catalog.getFeatureTypeByName(ft.getName());
  assertEquals("ftName", ft3.getName());
  assertEquals("ftDescription", ft3.getDescription());
  assertTrue(ft3.getKeywords().isEmpty());
  catalog.save(ft2);
  ft3 = catalog.getFeatureTypeByName(ft.getName());
  assertEquals(ft2, ft3);
  assertEquals("ft2Description", ft3.getDescription());
  assertEquals(1, ft3.getKeywords().size());
}

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

FeatureTypeInfo ft3 = newFeatureType("ft3", ds);
ft2.getKeywords().add(new Keyword("keyword1"));
ft2.getKeywords().add(new Keyword("keyword2"));

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

ft1.getKeywords().add(new Keyword("kw1_ft1"));
ft1.getKeywords().add(new Keyword("kw2_ft1"));
ft1.getKeywords().add(new Keyword("repeatedKw"));
ft2.getKeywords().add(new Keyword("kw1_ft2"));
ft2.getKeywords().add(new Keyword("kw2_ft2"));
ft2.getKeywords().add(new Keyword("repeatedKw"));

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

featureType.getKeywords().add(new Keyword(name));
featureType.setEnabled(true);
featureType.setProjectionPolicy(

相关文章