public static Description fromJaxb( List<LanguageStringType> titles, List<LanguageStringType> abstracts, List<KeywordsType> keywords ) { Description desc = new Description( null, null, null, null ); if ( titles != null ) { desc.setTitles( map( titles, LANG_LANG_MAPPER ) ); } if ( abstracts != null ) { desc.setAbstracts( map( abstracts, LANG_LANG_MAPPER ) ); } if ( keywords != null ) { desc.setKeywords( map( keywords, KW_MAPPER ) ); } return desc; }
private void mergeDescription( Description desc ) { if ( desc != null ) { if ( description.getTitles() == null || description.getTitles().isEmpty() ) { description.setTitles( desc.getTitles() ); } if ( description.getAbstracts() == null || description.getAbstracts().isEmpty() ) { description.setAbstracts( desc.getAbstracts() ); } if ( description.getKeywords() == null || description.getKeywords().isEmpty() ) { description.setKeywords( desc.getKeywords() ); } } }
/** * Creates a new {@link Description} instance. * * @param name * name of the object, can be <code>null</code> * @param titles * (multilingual) titles for the object, can be <code>null</code> * @param abstracts * (multilingual) abstracts for the object, can be <code>null</code> * @param keywords * (multilingual) keywords for the object, can be <code>null</code> */ public Description( String name, List<LanguageString> titles, List<LanguageString> abstracts, List<Pair<List<LanguageString>, CodeType>> keywords ) { this.name = name; setTitles( titles ); setAbstracts( abstracts ); setKeywords( keywords ); }
private Theme buildAutoTheme( Map<String, LayerStore> stores ) { Description desc = new Description( null, Collections.singletonList( new LanguageString( "root", null ) ), null, null ); LayerMetadata md = new LayerMetadata( null, desc, new SpatialMetadata( null, Collections.<ICRS> emptyList() ) ); List<Theme> themes = new ArrayList<Theme>(); for ( Entry<String, LayerStore> e : stores.entrySet() ) { themes.add( buildAutoTheme( e.getKey(), e.getValue() ) ); } return new StandardTheme( md, themes, new ArrayList<Layer>(), metadata ); }
final Description description = layerMetadata.getDescription(); if ( description != null ) { if ( description.getTitles() != null ) { titles.addAll( description.getTitles() ); if ( description.getAbstracts() != null ) { abstracts.addAll( description.getAbstracts() ); if ( description.getKeywords() != null ) { keywords.addAll( description.getKeywords() );
return new ServiceIdentification( description.getName(), description.getTitles(), description.getAbstracts(), null, serviceType, serviceTypeVersions, profiles, fees, constraints );
if ( !idOnly ) { Description desc = md.getDescription(); LanguageString title = desc.getTitle( null ); if ( title != null ) { writeElement( writer, OWS110_NS, "Title", title.getString() ); LanguageString abs = desc.getAbstract( null ); if ( abs != null ) { writeElement( writer, OWS110_NS, "Abstract", abs.getString() ); exportKeyWords110New( writer, desc.getKeywords() ); if ( env != null ) { env = getWgs84Envelope( env );
private Theme buildAutoTheme( String id, LayerStore store ) { Description desc = new Description( id, singletonList( new LanguageString( id, null ) ), null, null ); LayerMetadata md = new LayerMetadata( null, desc, new SpatialMetadata( null, Collections.<ICRS> emptyList() ) ); List<Theme> themes = new ArrayList<Theme>(); for ( Layer l : store.getAll() ) { themes.add( buildAutoTheme( l ) ); } return new StandardTheme( md, themes, new ArrayList<Layer>(), metadata ); }
Description desc = new Description( null, null, null, null ); desc.setTitles( singletonList( new LanguageString( title, null ) ) ); if ( abstract_ != null ) { desc.setAbstracts( singletonList( new LanguageString( abstract_, null ) ) ); desc.setKeywords( keywords );
static LayerMetadata buildMetadataForAutoMode( FeatureStore store, FeatureType ft, String name ) { List<ICRS> crs = new ArrayList<ICRS>(); Envelope envelope = null; try { envelope = store.getEnvelope( ft.getName() ); } catch ( Throwable e ) { LOG.debug( "Could not get envelope from feature store: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } if ( envelope != null ) { crs.add( envelope.getCoordinateSystem() ); } SpatialMetadata smd = new SpatialMetadata( envelope, crs ); Description desc = new Description( name, Collections.singletonList( new LanguageString( name, null ) ), null, null ); LayerMetadata md = new LayerMetadata( name, desc, smd ); md.getFeatureTypes().add( ft ); return md; }
return new Description( null, titles, abstracts, keywords );
LayerStore createFromAutoLayers( AutoLayers cfg ) { String cid = cfg.getCoverageStoreId(); String sid = cfg.getStyleStoreId(); Coverage cov = workspace.getResource( CoverageProvider.class, cid ); StyleStore sstore = null; if ( sid != null ) { sstore = workspace.getResource( StyleStoreProvider.class, sid ); } SpatialMetadata smd = new SpatialMetadata( cov.getEnvelope(), Collections.singletonList( cov.getCoordinateSystem() ) ); Description desc = new Description( cid, Collections.singletonList( new LanguageString( cid, null ) ), null, null ); LayerMetadata md = new LayerMetadata( cid, desc, smd ); md.getFeatureTypes().add( buildFeatureType() ); if ( sstore != null ) { for ( Style s : sstore.getAll( cid ) ) { md.getStyles().put( s.getName(), s ); } } Layer l = new CoverageLayer( md, cov instanceof AbstractRaster ? (AbstractRaster) cov : null, cov instanceof MultiResolutionRaster ? (MultiResolutionRaster) cov : null ); return new SingleLayerStore( l, metadata ); }