/** * @return a new WCService */ public WCService buildService() { wcsService = new WCService(); ServiceConfiguration wcsConf = ServiceConfigurationXMLAdapter.parse( workspace, metadata ); RasterDataContainerFactory.setDefaultLoadingPolicy( LoadingPolicy.CACHED ); defaultOptions = wcsConf.getSupportOptions(); if ( defaultOptions == null ) { defaultOptions = new SupportOptions(); } // if the list of outputformats is not defined by the config, use all available formats. List<String> defaultFormats = defaultOptions.getOutputFormat(); if ( defaultFormats.isEmpty() ) { defaultFormats.addAll( RasterFactory.getAllSupportedWritingFormats() ); Collections.sort( defaultFormats ); } for ( Coverage coverage : wcsConf.getCoverage() ) { try { wcsService.addCoverage( extractCoverage( coverage ) ); } catch ( ServiceInitException ex ) { LOG.error( "unable to load coverage: {}", ex.getMessage(), ex ); } } return wcsService; }
@Override public void init( DeegreeServicesMetadataType serviceMetadata, DeegreeServiceControllerType mainConf, Object controllerConf ) { LOG.info( "Checking for JOGL." ); JOGLChecker.check(); LOG.info( "JOGL status check successful." ); identification = serviceMetadata.getServiceIdentification(); provider = serviceMetadata.getServiceProvider(); DeegreeWPVS cfg = (DeegreeWPVS) controllerConf; NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "wpvs", "http://www.deegree.org/services/wpvs" ); try { publishedInformation = cfg.getPublishedInformation(); parsePublishedInformation( nsContext, publishedInformation ); ServiceConfiguration sc = cfg.getServiceConfiguration(); service = new PerspectiveViewService( metadata.getLocation(), sc, workspace ); } catch ( ServiceInitException e ) { throw new ResourceInitException( e.getMessage(), e ); } }