Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageStoreInfo


                }

               
                String timeMetadata = null;

                CoverageStoreInfo csinfo = cv.getStore();
               
                if(csinfo == null)
                    throw new WcsException("Unable to acquire coverage store resource for coverage: " + cv.getName());
               
                AbstractGridCoverage2DReader reader = null;
                try {
                    reader = (AbstractGridCoverage2DReader) catalog.getResourcePool().getGridCoverageReader(csinfo, GeoTools.getDefaultHints());
                } catch (IOException e) {
                    LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
                }
               
                if(reader == null)
                    throw new WcsException("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());

                final String[] metadataNames = reader.getMetadataNames();
               
                if (metadataNames != null && metadataNames.length > 0) {
                    // TIME DIMENSION
View Full Code Here


         *
         * @param lonLatEnvelope
         */
        private void handleLonLatEnvelope(CoverageInfo ci, ReferencedEnvelope referencedEnvelope) {

            CoverageStoreInfo csinfo = ci.getStore();
           
            if(csinfo == null)
                throw new WcsException("Unable to acquire coverage store resource for coverage: " + ci.getName());
           
            AbstractGridCoverage2DReader reader = null;
            try {
                reader = (AbstractGridCoverage2DReader) ci.getGridCoverageReader(null, GeoTools.getDefaultHints());
            } catch (IOException e) {
                LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
            }
           
            if(reader == null)
                throw new WcsException("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());

            final String[] metadataNames = reader.getMetadataNames();
           

            String timeMetadata = null;
View Full Code Here

        private void handleDomain(CoverageInfo ci) throws Exception {
            String timeMetadata = null;
            String elevationMetadata = null;

            CoverageStoreInfo csinfo = ci.getStore();
           
            if(csinfo == null)
                throw new WcsException("Unable to acquire coverage store resource for coverage: " + ci.getName());
           
            AbstractGridCoverage2DReader reader = null;
            try {
                reader = (AbstractGridCoverage2DReader) ci.getGridCoverageReader(null, GeoTools.getDefaultHints());
            } catch (IOException e) {
                LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
            }
           
            if(reader == null)
                throw new WcsException("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());

            final String[] metadataNames = reader.getMetadataNames();
           
            if (metadataNames != null && metadataNames.length > 0) {
                // TIME DIMENSION
View Full Code Here

                if (catalog == null)
                    throw new RuntimeException("Unable to acquire catalog resource for layer: "
                            + layer.getName());

                CoverageStoreInfo csinfo = cvinfo.getStore();

                if (csinfo == null)
                    throw new RuntimeException(
                            "Unable to acquire coverage store resource for layer: "
                                    + layer.getName());

                AbstractGridCoverage2DReader reader = null;
                try {
                    reader = (AbstractGridCoverage2DReader) catalog.getResourcePool()
                            .getGridCoverageReader(csinfo, GeoTools.getDefaultHints());
                } catch (Throwable t) {
                    LOGGER.severe("Unable to acquire a reader for this coverage with format: "
                            + csinfo.getFormat().getName());
                }

                if (reader == null)
                    throw new RuntimeException(
                            "Unable to acquire a reader for this coverage with format: "
                                    + csinfo.getFormat().getName());

                final String[] metadataNames = reader.getMetadataNames();

                if (metadataNames != null && metadataNames.length > 0) {
                    // TIME DIMENSION
View Full Code Here

        testAddWorkspace();
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        assertEquals(0, dao.getStoresByWorkspace(ws, CoverageStoreInfo.class).size());
       
        CoverageStoreInfo cs = dao.getCatalog().getFactory().createCoverageStore();
        cs.setWorkspace(ws);
        cs.setName("widgets");
        dao.add(cs);
    
        assertEquals(1, dao.getStoresByWorkspace(ws, CoverageStoreInfo.class).size());
    }
View Full Code Here

    public void testModifyCoverageStore() throws Exception {
        testAddCoverageStore();
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        CoverageStoreInfo cs = dao.getStoreByName( ws, "widgets", CoverageStoreInfo.class );
        cs.setName("foo");
        dao.save(cs);
       
        assertNull(dao.getStoreByName( ws, "widgets", CoverageStoreInfo.class));
        assertNotNull(dao.getStoreByName( ws, "foo", CoverageStoreInfo.class));
    }
View Full Code Here

        testAddCoverageStore();
        assertEquals(1, dao.getStores(CoverageStoreInfo.class).size());
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        CoverageStoreInfo cs = dao.getStoreByName( ws, "widgets", CoverageStoreInfo.class );
        dao.remove(cs);
       
        assertNull(dao.getStoreByName( ws, "widgets", CoverageStoreInfo.class ));
        assertEquals(0, dao.getStores(CoverageStoreInfo.class).size());
    }
View Full Code Here

    @Test
    public void testAddCoverage() throws Exception {
        testAddCoverageStore();
        testAddNamespace();
       
        CoverageStoreInfo ds =
            dao.getStoreByName(dao.getWorkspaceByName("acme"), "widgets", CoverageStoreInfo.class );
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
       
        assertNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
       
View Full Code Here

    public void testGetCoverage() throws Exception {
        testAddCoverage();
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        CoverageStoreInfo ds = dao.getStoreByName(ws, "widgets", CoverageStoreInfo.class);
       
        assertNotNull(dao.getResourceByStore(ds, "anvil", CoverageInfo.class));
        assertEquals(1, dao.getResourcesByStore(ds, CoverageInfo.class).size());
       
        assertNotNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
View Full Code Here

    public ArcSDECoverageStoreEditPanel(final String componentId, final Form storeEditForm) {
        super(componentId, storeEditForm);

        final IModel model = storeEditForm.getModel();
        setDefaultModel(model);
        final CoverageStoreInfo storeInfo = (CoverageStoreInfo) storeEditForm.getModelObject();
        {
            Map<String, String> existingParameters = parseConnectionParameters(storeInfo);
            Map<String, Serializable> connectionParameters = storeInfo.getConnectionParameters();
            connectionParameters.putAll(existingParameters);
        }

        final IModel paramsModel = new PropertyModel(model, "connectionParameters");

        addConnectionPrototypePanel(storeInfo);

        // server, port, instance, user, pwd
        server = addTextPanel(paramsModel, SERVER_PARAM);
        port = addTextPanel(paramsModel, PORT_PARAM);
        instance = addTextPanel(paramsModel, INSTANCE_PARAM);
        user = addTextPanel(paramsModel, USER_PARAM);
        password = addPasswordPanel(paramsModel);

        server.setOutputMarkupId(true);
        port.setOutputMarkupId(true);
        instance.setOutputMarkupId(true);
        user.setOutputMarkupId(true);
        password.setOutputMarkupId(true);

        table = addRasterTable(storeInfo, paramsModel);

        /*
         * Listen to form submission and update the model's URL
         */
        storeEditForm.add(new IFormValidator() {
            private static final long serialVersionUID = 1L;

            public FormComponent[] getDependentFormComponents() {
                return new FormComponent[] { server, port, instance, user, password, table };
            }

            public void validate(final Form form) {
                CoverageStoreInfo storeInfo = (CoverageStoreInfo) form.getModelObject();
                final String serverVal = server.getValue();
                final String portVal = port.getValue();
                final String instanceVal = instance.getValue();
                final String userVal = user.getValue();
                final String passwordVal = password.getValue();
                final String tableVal = table.getValue();

                StringBuilder urlb = new StringBuilder("sde://");

                urlb.append(userVal).append(":").append(passwordVal).append("@");
                urlb.append(serverVal).append(":").append(portVal).append("/");
                if (instanceVal != null && instanceVal.trim().length() > 0) {
                    urlb.append(instanceVal);
                }
                urlb.append("#").append(tableVal);
                String coverageUrl = urlb.toString();
                LOGGER.info("Coverage URL: '" + coverageUrl + "'");
                storeInfo.setURL(coverageUrl);
            }

        });
    }
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.CoverageStoreInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.