Package org.ametys.cms.transformation
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe state of the checkstatic final recordRepresent the result of a consistency check -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URIResolverExtensionPointThe ametys uri resolverprotected HttpUrlUtilsThe URL utilsprotected VersionsHandlerThe version handlerstatic final StringConstants for the special external type for outgoing referencesstatic final StringAvalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConsistencyChecker.CheckReport_checkHTTPLink(String linkValue, boolean shortTest) Test an http linkcheckConsistency(String referenceType, String referenceValue, String contentId, String dataPath, boolean quickTest) Check the consistency of a referenceGet the label of a reference.voidservice(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon role -
CONSISTENCY_EXTERNAL_REFERENCE_TYPE
Constants for the special external type for outgoing references- See Also:
-
_uriResolverEP
The ametys uri resolver -
_versionsHandler
The version handler -
_urlUtils
The URL utils
-
-
Constructor Details
-
ConsistencyChecker
public ConsistencyChecker()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- 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 testcontentId- The id of the content containing the referencedataPath- The path of the data containing the referencequickTest- 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 testcontentId- The id of the content containing the referencedataPath- The path of the data containing the reference- Returns:
- the element label.
-
_checkHTTPLink
Test an http link- Parameters:
linkValue- The http url to testshortTest- true to make a short test (with short timeout)- Returns:
- The state. UNKNOWN if test cannot be done fully
-