Class ConsistencyChecker

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.transformation.ConsistencyChecker
All Implemented Interfaces:
Component, LogEnabled, Serviceable

Consistency checker component. Checks the state of the links extracted as outgoing references for a content.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • checkConsistency

      public ConsistencyChecker.CheckReport checkConsistency(String referenceType, String referenceValue, String contentId, String dataPath, boolean quickTest)
      Check the consistency of a reference
      Parameters:
      referenceType - The type of the reference to test (can be 'attachment', 'explorer', 'metadata', '__external', etc...)
      referenceValue - The value of the reference to test
      contentId - The id of the content containing the reference
      dataPath - The path of the data containing the reference
      quickTest - true to make a quick test, that means that long tests will return UNKNOWN immediately.
      Returns:
      CHECK enum value
    • getLabel

      public I18nizableText getLabel(String referenceType, String referenceValue, String contentId, String dataPath)
      Get the label of a reference.
      Parameters:
      referenceType - The type of the reference to test (can be 'attachment', 'explorer', 'metadata', '__external', etc...)
      referenceValue - The value of the reference to test
      contentId - The id of the content containing the reference
      dataPath - The path of the data containing the reference
      Returns:
      the element label.
    • _checkHTTPLink

      protected ConsistencyChecker.CheckReport _checkHTTPLink(String linkValue, boolean shortTest)
      Test an http link
      Parameters:
      linkValue - The http url to test
      shortTest - true to make a short test (with short timeout)
      Returns:
      The state. UNKNOWN if test cannot be done fully