Class GSResourceEncoder

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEYWORDS
      Constant KEYWORDS="keywords"
      static java.lang.String METADATA
      Constant METADATA="metadata"
      static java.lang.String METADATALINKS
      Constant METADATALINKS="metadataLinks"
      static java.lang.String NAME
      Constant NAME="name"
      static java.lang.String NATIVENAME
      Constant NATIVENAME="nativeName"
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GSResourceEncoder​(java.lang.String rootName)
      Constructor for GSResourceEncoder.
      protected GSResourceEncoder​(java.lang.String rootName, boolean encodeLists)
      Constructor for GSResourceEncoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void addAbstract​(java.lang.String _abstract)
      Add the 'abstract' node with a text value from 'abstract'
      protected void addDescription​(java.lang.String description)
      Add the 'description' node with a text value from 'description'
      void addKeyword​(java.lang.String keyword)
      addKeyword
      void addKeyword​(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)
      <keywords> <string>WCS</string> <string>ImageMosaic</string> <string>srtm30</string> <string>KEYWORD\@language=LANGUAGE\;\@vocabulary=VOCABULARY\;</string> <string>KEYWORD_2\@vocabulary=VOCABULARY_2\;</string> <string>KEYWORD_3\@language=LANGUAGE_3\;</string> </keywords>
      protected void addLatLonBoundingBox​(double minx, double miny, double maxx, double maxy, java.lang.String crs)
      addLatLonBoundingBox
      protected void addMetadata​(java.lang.String key, XmlElement dimensionInfo)
      addMetadata
      void addMetadata​(java.lang.String key, org.jdom.Element custom)  
      protected void addMetadataDimension​(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)
      addMetadataDimension
      protected void addMetadataDimension​(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)
      Add the metadata for a custom dimension.
      void addMetadataLinkInfo​(GSMetadataLinkInfoEncoder metadataLinkInfo)
      Adds a MetadataLinkInfo to the GeoServer Resource
      void addMetadataLinkInfo​(java.lang.String type, java.lang.String metadataType, java.lang.String content)
      Adds quickly a MetadataLinkInfo to the GeoServer Resource
      void addMetadataString​(java.lang.String key, java.lang.String value)
      addMetadataString
      protected void addName​(java.lang.String name)
      Add the 'name' node with a text value from 'name' REQUIRED to configure a resource
      protected void addNativeBoundingBox​(double minx, double miny, double maxx, double maxy, java.lang.String crs)
      addNativeBoundingBox
      protected void addNativeCRS​(java.lang.String nativeCRS)
      Add the 'nativeCRS' node with a text value from 'nativeCRS'
      protected void addNativeName​(java.lang.String nativename)
      Add the 'nativename' node with a text value from 'name'
      protected void addProjectionPolicy​(GSResourceEncoder.ProjectionPolicy policy)
      NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED
      protected void addSRS​(java.lang.String srs)
      Add the 'SRS' node with a text value from 'srs'
      protected void addTitle​(java.lang.String title)
      Add the 'title' node with a text value from 'title'
      boolean delKeyword​(java.lang.String keyword)
      delete a keyword from the list
      boolean delKeyword​(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)
      delete a keyword from the list
      boolean delMetadata​(java.lang.String key)
      delMetadata
      boolean delMetadataLinkInfo​(java.lang.String metadataURL)
      Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)
      java.lang.String getName()
      getName
      java.lang.String getNativeName()
      Get the nativeName
      void setAbstract​(java.lang.String _abstract)
      Set or modify the 'abstract' node with a text value from 'abstract'
      void setAdvertised​(boolean advertised)
      setAdvertised
      void setDescription​(java.lang.String description)
      Set or modify the 'description' node with a text value from 'description'
      void setEnabled​(boolean enabled)
      setEnabled
      void setLatLonBoundingBox​(double minx, double miny, double maxx, double maxy, java.lang.String crs)
      setLatLonBoundingBox
      void setMetadata​(java.lang.String key, XmlElement dimensionInfo)
      Deprecated.
      Use setMetadataDimension(String, GSDimensionInfoEncoder) this method will be set as protected for internal use only
      void setMetadataDimension​(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)
      setMetadataDimension
      void setMetadataDimension​(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)
      Set the metadata for a custom dimension.
      void setMetadataString​(java.lang.String key, java.lang.String value)
      setMetadataString
      void setName​(java.lang.String name)
      Set or modify the 'name' node with a text value from 'name' REQUIRED to configure a resource
      void setNativeBoundingBox​(double minx, double miny, double maxx, double maxy, java.lang.String crs)
      setNativeBoundingBox
      void setNativeCRS​(java.lang.String nativeCRS)
      Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'
      void setNativeName​(java.lang.String nativename)
      Set or modify the 'nativename' node with a text value from 'name' if not specified, the nativeName will be set with the value of the 'name' node.
      void setProjectionPolicy​(GSResourceEncoder.ProjectionPolicy policy)
      NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED
      void setSRS​(java.lang.String srs)
      Set or modify the 'SRS' node with a text value from 'srs'
      void setTitle​(java.lang.String title)
      Set or modify the 'title' node with a text value from 'title'
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NATIVENAME

        public static final java.lang.String NATIVENAME
        Constant NATIVENAME="nativeName"
        See Also:
        Constant Field Values
      • METADATA

        public static final java.lang.String METADATA
        Constant METADATA="metadata"
        See Also:
        Constant Field Values
      • KEYWORDS

        public static final java.lang.String KEYWORDS
        Constant KEYWORDS="keywords"
        See Also:
        Constant Field Values
      • METADATALINKS

        public static final java.lang.String METADATALINKS
        Constant METADATALINKS="metadataLinks"
        See Also:
        Constant Field Values
    • Constructor Detail

      • GSResourceEncoder

        protected GSResourceEncoder​(java.lang.String rootName)

        Constructor for GSResourceEncoder.

        Parameters:
        rootName - a String object.
      • GSResourceEncoder

        protected GSResourceEncoder​(java.lang.String rootName,
                                    boolean encodeLists)

        Constructor for GSResourceEncoder.

        Parameters:
        rootName - Actually 'feature' or 'coverage'
        encodeLists - a boolean.
        See Also:
        GSFeatureTypeEncoder, GSCoverageEncoder
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)

        setEnabled

        Parameters:
        enabled - a boolean.
      • setAdvertised

        public void setAdvertised​(boolean advertised)

        setAdvertised

        Parameters:
        advertised - true if the resource should be advertised
      • addMetadata

        protected void addMetadata​(java.lang.String key,
                                   XmlElement dimensionInfo)

        addMetadata

        Parameters:
        key - a String object.
        dimensionInfo - a XmlElement object.
      • addMetadata

        public void addMetadata​(java.lang.String key,
                                org.jdom.Element custom)
      • addMetadataDimension

        protected void addMetadataDimension​(java.lang.String key,
                                            GSDimensionInfoEncoder dimensionInfo)

        addMetadataDimension

        Parameters:
        key - a String object.
        dimensionInfo - a GSDimensionInfoEncoder object.
      • addMetadataDimension

        protected void addMetadataDimension​(java.lang.String key,
                                            GSDimensionInfoEncoder dimensionInfo,
                                            boolean custom)
        Add the metadata for a custom dimension.
        Parameters:
        key - the name of the dimension
        dimensionInfo - GSDimensionInfoEncoder with additional information about the dimension
        custom - is the dimension custom or not?
      • setMetadataDimension

        public void setMetadataDimension​(java.lang.String key,
                                         GSDimensionInfoEncoder dimensionInfo)

        setMetadataDimension

        Parameters:
        key - a String object.
        dimensionInfo - a GSDimensionInfoEncoder object.
      • setMetadataString

        public void setMetadataString​(java.lang.String key,
                                      java.lang.String value)

        setMetadataString

        Parameters:
        key - a String object.
        value - a String object.
      • addMetadataString

        public void addMetadataString​(java.lang.String key,
                                      java.lang.String value)

        addMetadataString

        Parameters:
        key - a String object.
        value - a String object.
      • setMetadataDimension

        public void setMetadataDimension​(java.lang.String key,
                                         GSDimensionInfoEncoder dimensionInfo,
                                         boolean custom)
        Set the metadata for a custom dimension.
        Parameters:
        key - the name of the dimension
        dimensionInfo - GSDimensionInfoEncoder with additional information about the dimension
        custom - is the dimension custom or not?
      • delMetadata

        public boolean delMetadata​(java.lang.String key)

        delMetadata

        Parameters:
        key - the name of the metadata to add (f.e.: elevation, time)
        Returns:
        true if something is removed, false otherwise
      • addKeyword

        public void addKeyword​(java.lang.String keyword)

        addKeyword

        Parameters:
        keyword - a String object.
      • addKeyword

        public void addKeyword​(java.lang.String keyword,
                               java.lang.String language,
                               java.lang.String vocabulary)
        
         <keywords>
          <string>WCS</string>
          <string>ImageMosaic</string>
          <string>srtm30</string>
          <string>KEYWORD\@language=LANGUAGE\;\@vocabulary=VOCABULARY\;</string>
          <string>KEYWORD_2\@vocabulary=VOCABULARY_2\;</string>
          <string>KEYWORD_3\@language=LANGUAGE_3\;</string> </keywords>
         
        Parameters:
        keyword - mandatory keyword ('\' characters are not permitted)
        language - optional parameter
        vocabulary - optional parameter
      • delKeyword

        public boolean delKeyword​(java.lang.String keyword)
        delete a keyword from the list
        Parameters:
        keyword - a String object.
        Returns:
        true if something is removed, false otherwise
      • delKeyword

        public boolean delKeyword​(java.lang.String keyword,
                                  java.lang.String language,
                                  java.lang.String vocabulary)
        delete a keyword from the list
        Parameters:
        keyword - a String object.
        language - a String object.
        vocabulary - a String object.
        Returns:
        true if something is removed, false otherwise
      • addMetadataLinkInfo

        public void addMetadataLinkInfo​(java.lang.String type,
                                        java.lang.String metadataType,
                                        java.lang.String content)
        Adds quickly a MetadataLinkInfo to the GeoServer Resource
        Parameters:
        type - a String object.
        metadataType - a String object.
        content - a String object.
      • delMetadataLinkInfo

        public boolean delMetadataLinkInfo​(java.lang.String metadataURL)
        Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)
        Parameters:
        metadataURL - a String object.
        Returns:
        true if something is removed, false otherwise
      • addName

        protected void addName​(java.lang.String name)
        Add the 'name' node with a text value from 'name' REQUIRED to configure a resource
        Parameters:
        name - a String object.
      • setName

        public void setName​(java.lang.String name)
        Set or modify the 'name' node with a text value from 'name' REQUIRED to configure a resource
        Parameters:
        name - a String object.
      • getName

        public java.lang.String getName()

        getName

        Returns:
        a String object.
      • addNativeName

        protected void addNativeName​(java.lang.String nativename)
        Add the 'nativename' node with a text value from 'name'
        Parameters:
        nativename - a String object.
      • setNativeName

        public void setNativeName​(java.lang.String nativename)
        Set or modify the 'nativename' node with a text value from 'name' if not specified, the nativeName will be set with the value of the 'name' node.
        Parameters:
        nativename - a String object.
      • getNativeName

        public java.lang.String getNativeName()
        Get the nativeName
        Returns:
        a String object.
      • addDescription

        protected void addDescription​(java.lang.String description)
        Add the 'description' node with a text value from 'description'
        Parameters:
        description - a String object.
      • setDescription

        public void setDescription​(java.lang.String description)
        Set or modify the 'description' node with a text value from 'description'
        Parameters:
        description - a String object.
      • addAbstract

        protected void addAbstract​(java.lang.String _abstract)
        Add the 'abstract' node with a text value from 'abstract'
        Parameters:
        _abstract - a String object.
      • setAbstract

        public void setAbstract​(java.lang.String _abstract)
        Set or modify the 'abstract' node with a text value from 'abstract'
        Parameters:
        _abstract - a String object.
      • addTitle

        protected void addTitle​(java.lang.String title)
        Add the 'title' node with a text value from 'title'
        Parameters:
        title - a String object.
      • setTitle

        public void setTitle​(java.lang.String title)
        Set or modify the 'title' node with a text value from 'title'
        Parameters:
        title - a String object.
      • addSRS

        protected void addSRS​(java.lang.String srs)
        Add the 'SRS' node with a text value from 'srs'
        Parameters:
        srs - a String object.
      • setSRS

        public void setSRS​(java.lang.String srs)
        Set or modify the 'SRS' node with a text value from 'srs'
        Parameters:
        srs - a String object.
      • addNativeCRS

        protected void addNativeCRS​(java.lang.String nativeCRS)
        Add the 'nativeCRS' node with a text value from 'nativeCRS'
        Parameters:
        nativeCRS - a String object.
      • setNativeCRS

        public void setNativeCRS​(java.lang.String nativeCRS)
        Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'
        Parameters:
        nativeCRS - a String object.
      • addLatLonBoundingBox

        protected void addLatLonBoundingBox​(double minx,
                                            double miny,
                                            double maxx,
                                            double maxy,
                                            java.lang.String crs)

        addLatLonBoundingBox

        Parameters:
        minx - a double.
        maxy - a double.
        maxx - a double.
        miny - a double.
        crs - a String object.
      • setLatLonBoundingBox

        public void setLatLonBoundingBox​(double minx,
                                         double miny,
                                         double maxx,
                                         double maxy,
                                         java.lang.String crs)

        setLatLonBoundingBox

        Parameters:
        minx - a double.
        miny - a double.
        maxx - a double.
        maxy - a double.
        crs - a String object.
      • addNativeBoundingBox

        protected void addNativeBoundingBox​(double minx,
                                            double miny,
                                            double maxx,
                                            double maxy,
                                            java.lang.String crs)

        addNativeBoundingBox

        Parameters:
        minx - a double.
        maxy - a double.
        maxx - a double.
        miny - a double.
        crs - a String object.
      • setNativeBoundingBox

        public void setNativeBoundingBox​(double minx,
                                         double miny,
                                         double maxx,
                                         double maxy,
                                         java.lang.String crs)

        setNativeBoundingBox

        Parameters:
        minx - a double.
        miny - a double.
        maxx - a double.
        maxy - a double.
        crs - a String object.