Class CmsContentCheckResource


  • public class CmsContentCheckResource
    extends java.lang.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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addError​(java.lang.String error)
      Adds a new error to the list of errors for this resource.
      void addErrors​(java.util.List errors)
      Adds a list of errors to the list of errors for this resource.
      void addWarning​(java.lang.String warning)
      Adds a new warning to the list of warnings for this resource.
      void addWarnings​(java.util.List warnings)
      Adds a list of warnings to the list of warnings for this resource.
      byte[] getContent()
      Gets the encapuslated file content.
      java.util.List getErrors()
      Gets the list of all errors found during the content checks for this resource.
      org.opencms.file.CmsResource getResource()
      Gets the encapsulated CmsResource.
      java.lang.String getResourceName()
      Gets the root path of the encapsulated CmsResource.
      java.util.List getWarnings()
      Gets the list of all warnings found during the content checks for this resource.
      org.opencms.xml.content.CmsXmlContent getXmlContent()
      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 Detail

      • CmsContentCheckResource

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

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

      • addError

        public void addError​(java.lang.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​(java.util.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​(java.lang.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​(java.util.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 java.util.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

        public java.lang.String getResourceName()
        Gets the root path of the encapsulated CmsResource.

        Returns:
        root path of the encapsulated CmsResource
      • getWarnings

        public java.util.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