Class CmsResourceComparison

java.lang.Object
org.opencms.workplace.comparison.CmsResourceComparison
Direct Known Subclasses:
CmsXmlDocumentComparison

public class CmsResourceComparison extends Object
Comparison of two OpenCms resources.

  • Field Details

  • Constructor Details

  • Method Details

    • compareAttributes

      public static List<CmsAttributeComparison> compareAttributes(CmsObject cms, CmsResource resource1, CmsResource resource2)
      Helper method that collects all meta attributes of the two file versions and finds out, which of the attributes were added, removed, modified or remain unchanged.

      Parameters:
      cms - the CmsObject to use
      resource1 - the first resource to read the properties from
      resource2 - the second resource to read the properties from
      Returns:
      a list of the compared attributes
    • compareProperties

      public static List<CmsAttributeComparison> compareProperties(CmsObject cms, CmsResource resource1, String version1, CmsResource resource2, String version2) throws CmsException
      Helper method that finds out, which of the properties were added, removed, modified or remain unchanged.

      Parameters:
      cms - the CmsObject to use
      resource1 - the first resource to read the properties from
      version1 - the version of the first resource
      resource2 - the second resource to read the properties from
      version2 - the version of the second resource
      Returns:
      a list of the compared attributes
      Throws:
      CmsException - if something goes wrong