Class CmsTagReplaceSettings

java.lang.Object
org.opencms.workplace.tools.content.CmsTagReplaceSettings

public final class CmsTagReplaceSettings extends 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 Details

  • Constructor Details

    • 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 Details

    • getPropertyValueTagReplaceID

      Returns the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.

      Returns:
      the value of the shared PROPERTY_CONTENTOOLS_TAGREPLACE to set on resources that have been processed with these settings.
    • 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 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(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(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(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 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.