Package com.day.cq.commons
Class DiffInfo
java.lang.Object
com.day.cq.commons.DiffInfo
- Direct Known Subclasses:
DiffInfo
The
DiffInfo can be used by components
to display a diff to a previous version.
A component has access to the diff information by
calling Adaptable.adaptTo(Class) with this
class as the argument.- Since:
- 5.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe general information about the diff -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the content to diff.getDiffOutput(DiffService service, String current, String oldText, boolean isRichText) Helper method to generate the diff output.getType()Return the type information.static ResourcegetVersionedResource(Resource res, String versionLabel) Helper method that returns the versioned counterpart of the given resource with the specified version label.
-
Field Details
-
DATE_DEFAULT
-
-
Constructor Details
-
DiffInfo
-
-
Method Details
-
getContent
Return the content to diff.- Returns:
- The content or
null
-
getType
Return the type information.- Returns:
- The type information.
-
getDiffOutput
public String getDiffOutput(DiffService service, String current, String oldText, boolean isRichText) Helper method to generate the diff output.- Parameters:
service- The diff service.current- The current text (right).oldText- The old text (left).isRichText- Is this rich text?- Returns:
- The complete output or null.
-
getVersionedResource
Helper method that returns the versioned counterpart of the given resource with the specified version label. The label can be a version name, a version label or a version date.- Parameters:
res- the resourceversionLabel- the version specifier- Returns:
- the versioned resource or
null
-