Class CmsContentCheckResource

java.lang.Object
org.opencms.workplace.tools.content.check.CmsContentCheckResource

public class CmsContentCheckResource extends Object
This object encapuslates a CmsResource, its content and unmarshalled xml content for processing in the content check plugins.

Since:
6.1.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsContentCheckResource(org.opencms.file.CmsResource res)
    Constructor, creates an CmsContentCheckResource object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a new error to the list of errors for this resource.
    void
    addErrors(List errors)
    Adds a list of errors to the list of errors for this resource.
    void
    addWarning(String warning)
    Adds a new warning to the list of warnings for this resource.
    void
    addWarnings(List warnings)
    Adds a list of warnings to the list of warnings for this resource.
    byte[]
    Gets the encapuslated file content.
    Gets the list of all errors found during the content checks for this resource.
    org.opencms.file.CmsResource
    Gets the encapsulated CmsResource.
    Gets the root path of the encapsulated CmsResource.
    Gets the list of all warnings found during the content checks for this resource.
    org.opencms.xml.content.CmsXmlContent
    Gets the encapuslated and unmarshalled xml content.
    void
    upgradeContent(org.opencms.file.CmsObject cms)
    Loads the content of the encapsulated CmsResource and stores it within the CmsContentCheckResource.
    void
    upgradeXmlContent(org.opencms.file.CmsObject cms)
    Unmarshalls the content of the encapsulated CmsResource and stores it within the CmsContentCheckResource.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CmsContentCheckResource

      public CmsContentCheckResource(org.opencms.file.CmsResource res)
      Constructor, creates an CmsContentCheckResource object.

      Parameters:
      res - the CmsResource to encapsulate in the CmsContentCheckResource.
  • Method Details

    • addError

      public void addError(String error)
      Adds a new error to the list of errors for this resource.

      Parameters:
      error - the error message to be added
    • addErrors

      public void addErrors(List errors)
      Adds a list of errors to the list of errors for this resource.

      Parameters:
      errors - the error messages to be added
    • addWarning

      public void addWarning(String warning)
      Adds a new warning to the list of warnings for this resource.

      Parameters:
      warning - the warning message to be added
    • addWarnings

      public void addWarnings(List warnings)
      Adds a list of warnings to the list of warnings for this resource.

      Parameters:
      warnings - the error messages to be added
    • getContent

      public byte[] getContent()
      Gets the encapuslated file content.

      Returns:
      the byte array holding the file content
    • getErrors

      public List getErrors()
      Gets the list of all errors found during the content checks for this resource.

      Returns:
      List of erros, delivered as strings
    • getResource

      public org.opencms.file.CmsResource getResource()
      Gets the encapsulated CmsResource.

      Returns:
      the CmsResource
    • getResourceName

      Gets the root path of the encapsulated CmsResource.

      Returns:
      root path of the encapsulated CmsResource
    • getWarnings

      public List getWarnings()
      Gets the list of all warnings found during the content checks for this resource.

      Returns:
      List of warnings, delivered as strings
    • getXmlContent

      public org.opencms.xml.content.CmsXmlContent getXmlContent()
      Gets the encapuslated and unmarshalled xml content.

      Returns:
      the unmarshalled xml content
    • upgradeContent

      public void upgradeContent(org.opencms.file.CmsObject cms) throws org.opencms.main.CmsException
      Loads the content of the encapsulated CmsResource and stores it within the CmsContentCheckResource. If the content is already existing, it is not loaded again.

      Parameters:
      cms - the CmsObject
      Throws:
      org.opencms.main.CmsException - if loading of the content fails
    • upgradeXmlContent

      public void upgradeXmlContent(org.opencms.file.CmsObject cms) throws org.opencms.main.CmsException
      Unmarshalls the content of the encapsulated CmsResource and stores it within the CmsContentCheckResource. If the xmlcontent is already existing, it is not unmarshalled again.

      Parameters:
      cms - the CmsObject
      Throws:
      org.opencms.main.CmsException - if loading of the content fails