Examples of LayerGroupInfoImpl


Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        resolveCollections(layer);
    }

    protected void resolve(LayerGroupInfo layerGroup) {
        resolveCollections(layerGroup);
        LayerGroupInfoImpl lg = (LayerGroupInfoImpl) layerGroup;

        for (int i = 0; i < lg.getLayers().size(); i++) {
            LayerInfo l = lg.getLayers().get(i);
            LayerInfo resolved = ResolvingProxy.resolve(this, l);
            resolve(resolved);
            lg.getLayers().set(i, resolved);
        }

        for (int i = 0; i < lg.getStyles().size(); i++) {
            StyleInfo s = lg.getStyles().get(i);
            if (s != null) {
                StyleInfo resolved = ResolvingProxy.resolve(this, s);
                ((StyleInfoImpl)resolved).setCatalog(this);
                lg.getStyles().set(i, resolved);
            }
        }

    }
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

       
        @Override
        public Object doUnmarshal(Object result, HierarchicalStreamReader reader,
                UnmarshallingContext context) {

            LayerGroupInfoImpl lgi = (LayerGroupInfoImpl) super
                    .doUnmarshal(result, reader, context);
           
            if (lgi.getMode() ==  null) {
                lgi.setMode(Mode.SINGLE);
            }
           
            lgi.convertLegacyLayers();
           
            MetadataMap metadata = lgi.getMetadata();
           
            /**
             * If we're upgrading from a 2.2.x server we have to read
             * property 'title' from metadata
             */
            if (lgi.getTitle() == null && metadata != null) {
                String title = metadata.get("title", String.class);
                if (title != null) {
                    lgi.setTitle(title);
                    metadata.remove("title");
                }
            }

            /**
             * If we're upgrading from a 2.2.x server we have to read
             * property 'abstract' from metadata
             */
            if (lgi.getAbstract() == null && metadata != null) {
                String abstractTxt = metadata.get("abstract", String.class);
                if (abstractTxt != null) {
                    lgi.setAbstract(abstractTxt);
                    metadata.remove("abstract");
                }
            }           
           
            if (lgi.getAuthorityURLs() == null && metadata != null) {
                String serialized = metadata.get("authorityURLs", String.class);
                List<AuthorityURLInfo> authorities;
                if (serialized == null) {
                    authorities = new ArrayList<AuthorityURLInfo>(1);
                } else {
                    authorities = AuthorityURLInfoInfoListConverter.fromString(serialized);
                }
                lgi.setAuthorityURLs(authorities);
            }
            if (lgi.getIdentifiers() == null && metadata != null) {
                String serialized = metadata.get("identifiers", String.class);
                List<LayerIdentifierInfo> identifiers;
                if (serialized == null) {
                    identifiers = new ArrayList<LayerIdentifierInfo>(1);
                } else {
                    identifiers = LayerIdentifierInfoListConverter.fromString(serialized);
                }
                lgi.setIdentifiers(identifiers);
            }
            return lgi;
        }
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

    @Test
    public void testTimeContinuousInEarthObservationRootLayer() throws Exception {
        setupRasterDimension(WATTEMP, ResourceInfo.TIME, DimensionPresentation.CONTINUOUS_INTERVAL, null, null, null);
       
        LayerInfo rootLayer = getCatalog().getLayerByName("watertemp");
        LayerGroupInfo eoProduct = new LayerGroupInfoImpl();
        eoProduct.setName("EO Sample");
        eoProduct.setMode(LayerGroupInfo.Mode.EO);
        eoProduct.setRootLayer(rootLayer);
        eoProduct.setRootLayerStyle(rootLayer.getDefaultStyle());
       
        CatalogBuilder catBuilder = new CatalogBuilder(getCatalog());
        catBuilder.calculateLayerGroupBounds(eoProduct);
       
        eoProduct.getLayers().add(rootLayer);
        getCatalog().add(eoProduct);
        try {
            Document dom = dom(get("wms?request=getCapabilities&version=1.1.1"), false);
            // print(dom);           
           
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        assertEquals(defaultVectorInfo, info);
    }

    @Test
    public void testCreateLayerGroupInfo() {
        LayerGroupInfoImpl group = mockGroup("testGroup", mockLayer("testLayer",new String[]{}, LayerInfoImpl.Type.RASTER));

        defaults.getDefaultOtherCacheFormats().clear();
        defaults.getDefaultOtherCacheFormats().add("image/png8");
        defaults.getDefaultOtherCacheFormats().add("image/jpeg");

        GeoServerTileLayerInfo expected = TileLayerInfoUtil.create(defaults);
        expected.setId(group.getId());
        expected.setName(GWC.tileLayerName(group));

        GeoServerTileLayerInfo info = TileLayerInfoUtil.loadOrCreate(group, defaults);
        assertNotNull(info);
        assertEquals(expected, info);
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        assertEquals(ImmutableSet.of("style1", "style2"), actual.cachedStyles());
    }

    @Test
    public void testCreateLayerGroup() {
        LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1",new String[]{}, LayerInfoImpl.Type.RASTER), mockLayer("L2",new String[]{}, LayerInfoImpl.Type.RASTER));

        GeoServerTileLayerInfo info = defaultVectorInfo;
        info.setId(lg.getId());
        info.setName(GWC.tileLayerName(lg));
        info.getMimeFormats().clear();
        info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats());

        GeoServerTileLayerInfo actual;
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        assertEquals(ImmutableSet.of("style1", "style2"), actual.cachedStyles());
    }

    @Test
    public void testLoadLayerGroup() {
        LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1", new String[]{}, LayerInfoImpl.Type.RASTER), mockLayer("L2", new String[]{}, LayerInfoImpl.Type.RASTER));

        assertNull(LegacyTileLayerInfoLoader.load(lg));
        GeoServerTileLayerInfo info = defaultVectorInfo;
        info.getMimeFormats().clear();
        info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats());

        LegacyTileLayerInfoLoader.save(info, lg.getMetadata());

        GeoServerTileLayerInfo actual;
        actual = LegacyTileLayerInfoLoader.load(lg);

        info.setId(lg.getId());
        info.setName(GWC.tileLayerName(lg));
        assertEquals(info, actual);
    }
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        assertEquals(info, actual);
    }

    @Test
    public void testClear() {
        LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1", new String[]{}, LayerInfoImpl.Type.RASTER), mockLayer("L2", new String[]{}, LayerInfoImpl.Type.RASTER));

        assertNull(LegacyTileLayerInfoLoader.load(lg));
        GeoServerTileLayerInfo info = defaultVectorInfo;
        info.getMimeFormats().clear();
        info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats());

        LegacyTileLayerInfoLoader.save(info, lg.getMetadata());

        GeoServerTileLayerInfo actual;
        actual = LegacyTileLayerInfoLoader.load(lg);
        assertNotNull(actual);

        LegacyTileLayerInfoLoader.clear(lg.getMetadata());
        assertNull(LegacyTileLayerInfoLoader.load(lg));
    }
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

    public void testTimeContinuousInEarthObservationRootLayer() throws Exception {
        setupVectorDimension(ResourceInfo.TIME, "time", DimensionPresentation.CONTINUOUS_INTERVAL,
                null, null, null);
       
        LayerInfo rootLayer = getCatalog().getLayerByName("TimeElevation");
        LayerGroupInfo eoProduct = new LayerGroupInfoImpl();
        eoProduct.setName("EO Sample");
        eoProduct.setMode(LayerGroupInfo.Mode.EO);
        eoProduct.setRootLayer(rootLayer);
        eoProduct.setRootLayerStyle(rootLayer.getDefaultStyle());
       
        CatalogBuilder catBuilder = new CatalogBuilder(getCatalog());
        catBuilder.calculateLayerGroupBounds(eoProduct);
       
        eoProduct.getLayers().add(rootLayer);
        getCatalog().add(eoProduct);
        try {
            Document dom = dom(get("wms?request=getCapabilities&version=1.1.1"), false);
            print(dom);           
           
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

        alternateStyle2.setName("alternateStyle-2");
        Set<StyleInfo> alternateStyles = new HashSet<StyleInfo>(Arrays.asList(alternateStyle1,
                alternateStyle2));
        layerInfo.setStyles(alternateStyles);

        layerGroup = new LayerGroupInfoImpl();
        final String layerGroupId = "mock-layergroup-id";
        layerGroup.setId(layerGroupId);
        layerGroup.setName("MockLayerGroup");
        layerGroup.setTitle("Group title");
        layerGroup.setAbstract("Group abstract");
View Full Code Here

Examples of org.geoserver.catalog.impl.LayerGroupInfoImpl

            ((StyleInfoImpl)entity).setCatalog(catalog);
        }
        else if (entity instanceof LayerGroupInfoImpl) {
            //hack to get around default styles being represented by null
            //TODO: see if we can coax the hibernate mappings into doing this for us
            LayerGroupInfoImpl lg = (LayerGroupInfoImpl) entity;
            if (lg.getStyles().isEmpty()) {
                for (LayerInfo l : lg.getLayers()) {
                    lg.getStyles().add(null);
                }
            }
        }
        else if (entity instanceof ServiceInfoImpl) {
            ((ServiceInfoImpl)entity).setGeoServer(geoServer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.