Class CmsTagReplaceSettings


  • public final class CmsTagReplaceSettings
    extends java.lang.Object
    Bean to hold the settings needed for the operation of replacing HTML Tags of xmlpage resources in the OpenCms VFS.

    Since:
    6.1.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROPERTY_CONTENTOOLS_TAGREPLACE
      Property for the tag-replace contentool to know the files that have been processed before in case of early terminaton in previous runs.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsTagReplaceSettings​(org.opencms.file.CmsObject cms)
      Bean constructor with cms object for path validation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Set getDeleteTags()
      Returns the Set<Tag> to delete from transformed output.
      java.lang.String getPropertyValueTagReplaceID()
      Returns the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.
      java.util.SortedMap getReplacements()
      Returns the replacements to perform in form of a comma-separated List of "key=value" tokens.
      java.lang.String getWorkPath()
      Returns the path under which files will be processed recursively.
      protected boolean replace​(org.htmlparser.Tag tag)
      Transforms the given Tag into the one it has to become by changing it's name and/or attributes.
      void setPropertyValueTagReplaceID​(java.lang.String propertyValueTagreplaceID)
      Sets the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.
      void setReplacements​(java.util.SortedMap replacements)
      Sets the replacements to perform in form of a comma-separated List of "key=value" tokens.
      void setWorkPath​(java.lang.String workPath)
      Sets the path under which files will be processed recursively.
      • Methods inherited from class java.lang.Object

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

      • PROPERTY_CONTENTOOLS_TAGREPLACE

        public static final java.lang.String PROPERTY_CONTENTOOLS_TAGREPLACE
        Property for the tag-replace contentool to know the files that have been processed before in case of early terminaton in previous runs.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CmsTagReplaceSettings

        public CmsTagReplaceSettings​(org.opencms.file.CmsObject cms)
        Bean constructor with cms object for path validation.

        Parameters:
        cms - used to test the working path for valididty.
    • Method Detail

      • getReplacements

        public java.util.SortedMap getReplacements()
        Returns the replacements to perform in form of a comma-separated List of "key=value" tokens.

        Returns:
        the replacements to perform in form of a comma-separated List of "key=value" tokens.
      • getWorkPath

        public java.lang.String getWorkPath()
        Returns the path under which files will be processed recursively.

        Returns:
        the path under which files will be processed recursively.
      • setPropertyValueTagReplaceID

        public void setPropertyValueTagReplaceID​(java.lang.String propertyValueTagreplaceID)
                                          throws org.opencms.main.CmsIllegalArgumentException
        Sets the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.

        Parameters:
        propertyValueTagreplaceID - the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.
        Throws:
        org.opencms.main.CmsIllegalArgumentException - if the argument is not valid.
      • setReplacements

        public void setReplacements​(java.util.SortedMap replacements)
                             throws org.opencms.main.CmsIllegalArgumentException
        Sets the replacements to perform in form of a comma-separated List of "key=value" tokens.

        Parameters:
        replacements - the replacements to perform in form of a comma-separated List of "key=value" tokens.
        Throws:
        org.opencms.main.CmsIllegalArgumentException - if the argument is not valid.
      • setWorkPath

        public void setWorkPath​(java.lang.String workPath)
                         throws org.opencms.main.CmsIllegalArgumentException
        Sets the path under which files will be processed recursively.

        Parameters:
        workPath - the path under which files will be processed recursively.
        Throws:
        org.opencms.main.CmsIllegalArgumentException - if the argument is not valid.
      • getDeleteTags

        protected java.util.Set getDeleteTags()
        Returns the Set<Tag> to delete from transformed output.

        Returns:
        the Set<Tag> to delete from transformed output.
      • replace

        protected boolean replace​(org.htmlparser.Tag tag)
        Transforms the given Tag into the one it has to become by changing it's name and/or attributes.

        Parameters:
        tag - the tag to be transformed.
        Returns:
        true if the given tag was modified, false else.