Package org.geoserver.catalog

Examples of org.geoserver.catalog.ResourceInfo


        // The datastore namespace may have changed and resources with the same name may already
        // exist...
        StringBuilder sb = new StringBuilder();
        for (ResourceInfo res : configuredResources) {
            ResourceInfo existing = catalog.getResourceByName(newNamespace, res.getName(),
                    ResourceInfo.class);
            if (existing != null) {
                sb.append(existing.getName()).append(" ");
            }
        }
        if (sb.length() > 0) {
            String message = "The following resources already exist on the same namespace: "
                    + sb.toString();
View Full Code Here


                // remove link
                AjaxLink link = new AjaxLink("removeLink", item.getModel()) {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        ResourceInfo ri = (ResourceInfo) resourceModel.getObject();
                        ri.getMetadataLinks().remove(getModelObject());
                        updateLinksVisibility();
                        target.addComponent(container);
                    }
                   
                };
                item.add(link);
            }

        };
        // this is necessary to avoid loosing item contents on edit/validation checks
        links.setReuseItems(true);
        table.add(links);
       
        // the no metadata links label
        noMetadata = new Label("noLinks", new ResourceModel("noMetadataLinksSoFar"));
        container.add(noMetadata);
        updateLinksVisibility();
       
        // add new link button
        AjaxButton button = new AjaxButton("addlink") {

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                ResourceInfo ri = (ResourceInfo) resourceModel.getObject();
                MetadataLinkInfo link = ri.getCatalog().getFactory().createMetadataLink();;
                link.setMetadataType(LINK_TYPES.get(0));
                link.setType("text/plain");
                ri.getMetadataLinks().add(link);
                updateLinksVisibility();
               
                target.addComponent(container);
            }
           
View Full Code Here

        };
        add(button);
    }

    private void updateLinksVisibility() {
        ResourceInfo ri = (ResourceInfo) getModelObject();
        boolean anyLink = ri.getMetadataLinks().size() > 0;
        table.setVisible(anyLink);
        noMetadata.setVisible(!anyLink);
    }
View Full Code Here

                bm.setName( (String) baseMap.get( "baseMapTitle" ) );
               
                //process base map layers
                List<String> layerNames = (List) baseMap.get( "baseMapLayers");
                for ( String layerName : layerNames ) {
                    ResourceInfo resource = null;
                    if ( layerName.contains( ":" ) ) {
                        String[] qname = layerName.split( ":" );
                        resource = catalog.getResourceByName( qname[0],qname[1], ResourceInfo.class );
                    }
                    else {
View Full Code Here

        if (obj == null)
            return false;
        if (!( obj instanceof ResourceInfo) )
            return false;
       
        final ResourceInfo other = (ResourceInfo) obj;
        if (_abstract == null) {
            if (other.getAbstract() != null)
                return false;
        } else if (!_abstract.equals(other.getAbstract()))
            return false;
        if (alias == null) {
            if (other.getAlias() != null)
                return false;
        } else if (!alias.equals(other.getAlias()))
            return false;
        if (description == null) {
            if (other.getDescription() != null)
                return false;
        } else if (!description.equals(other.getDescription()))
            return false;
        if (enabled != other.isEnabled())
            return false;
        if (id == null) {
            if (other.getId() != null)
                return false;
        } else if (!id.equals(other.getId()))
            return false;
        if (keywords == null) {
            if (other.getKeywords() != null)
                return false;
        } else if (!keywords.equals(other.getKeywords()))
            return false;
        if (latLonBoundingBox == null) {
            if (other.getLatLonBoundingBox() != null)
                return false;
        } else if (!latLonBoundingBox.equals(other.getLatLonBoundingBox()))
            return false;
        if (metadataLinks == null) {
            if (other.getMetadataLinks() != null)
                return false;
        } else if (!metadataLinks.equals(other.getMetadataLinks()))
            return false;
        if (name == null) {
            if (other.getName() != null)
                return false;
        } else if (!name.equals(other.getName()))
            return false;
        if (namespace == null) {
            if (other.getNamespace() != null)
                return false;
        } else if (!namespace.equals(other.getNamespace()))
            return false;
        if (nativeBoundingBox == null) {
            if (other.getNativeBoundingBox() != null)
                return false;
        } else if (!nativeBoundingBox.equals(other.getNativeBoundingBox()))
            return false;
        if (nativeCRS == null) {
            if (other.getNativeCRS() != null)
                return false;
        } else if (!CRS.equalsIgnoreMetadata(nativeCRS, other.getNativeCRS()))
            return false;
        if (nativeName == null) {
            if (other.getNativeName() != null)
                return false;
        } else if (!nativeName.equals(other.getNativeName()))
            return false;
        if (projectionPolicy == null) {
            if (other.getProjectionPolicy() != null)
                return false;
        } else if (!projectionPolicy.equals(other.getProjectionPolicy()))
            return false;
        if (srs == null) {
            if (other.getSRS() != null)
                return false;
        } else if (!srs.equals(other.getSRS() ))
            return false;
        if (store == null) {
            if (other.getStore() != null)
                return false;
        } else if (!store.equals(other.getStore()))
            return false;
        if (title == null) {
            if (other.getTitle() != null)
                return false;
        } else if (!title.equals(other.getTitle()))
            return false;
        return true;
    }
View Full Code Here

    }

    public MapLayerInfo(LayerInfo layerInfo) {
        this.layerInfo = layerInfo;
        this.remoteFeatureSource = null;
        ResourceInfo resource = layerInfo.getResource();

        // handle InlineFeatureStuff
        this.name = resource.getPrefixedName();
        this.label = resource.getTitle();
        this.description = resource.getAbstract();

        this.type = layerInfo.getType().getCode();
    }
View Full Code Here

     * @return Envelope the feature source bounds.
     * @throws Exception
     */
    public ReferencedEnvelope getBoundingBox() throws Exception {
        if (layerInfo != null) {
            ResourceInfo resource = layerInfo.getResource();
            ReferencedEnvelope bbox = resource.boundingBox();
            // if(bbox == null){
            // bbox = resource.getLatLonBoundingBox();
            // }
            return bbox;
        } else if (this.type == TYPE_REMOTE_VECTOR) {
View Full Code Here

     * @throws IOException
     *             when an error occurs
     */
    public ReferencedEnvelope getLatLongBoundingBox() throws IOException {
        if (layerInfo != null) {
            ResourceInfo resource = layerInfo.getResource();
            return resource.getLatLonBoundingBox();
        }

        throw new UnsupportedOperationException("getLatLongBoundingBox not "
                + "implemented for remote sources");
    }
View Full Code Here

     */
    public boolean isCachingEnabled() {
        if (layerInfo == null) {
            return false;
        }
        ResourceInfo resource = layerInfo.getResource();
        Boolean cachingEnabled = resource.getMetadata().get("cachingEnabled",Boolean.class);
        return cachingEnabled == null ? false : cachingEnabled.booleanValue();
    }
View Full Code Here

     */
    public int getCacheMaxAge() {
        if (layerInfo == null) {
            return 0;
        }
        ResourceInfo resource = layerInfo.getResource();
        Integer val = resource.getMetadata().get("cacheAgeMax",Integer.class);
        return val == null ? 0 : val;
    }
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.ResourceInfo

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.