Class A_CmsAttributeDiff
- java.lang.Object
-
- org.opencms.ui.dialogs.history.diff.A_CmsAttributeDiff
-
- All Implemented Interfaces:
I_CmsDiffProvider
- Direct Known Subclasses:
CmsAttributeDiff
,CmsPropertyDiff
public abstract class A_CmsAttributeDiff extends java.lang.Object implements I_CmsDiffProvider
Abstract super class for displaying differences between a set of properties / attributes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
A_CmsAttributeDiff.IsAttributeDifference
Predicate used to check if an attribute comparison bean actually represents a difference.
-
Constructor Summary
Constructors Constructor Description A_CmsAttributeDiff()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<com.vaadin.ui.Component>
diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2)
Optionally returns a comparison component to display for the given resource versions.static java.util.List<CmsAttributeComparison>
filterDifferent(java.util.List<CmsAttributeComparison> comps)
Only selects the attributes comparisons that actually represent differences.abstract java.lang.String
getCaption()
Gets the caption.abstract java.util.List<CmsAttributeComparison>
getDifferences(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2)
Gets the attribute comparison beans representing the differences.static java.lang.String
getVersionString(CmsHistoryResourceBean bean)
Builds a version string which can be used by CmsResourceComparison from a history resource bean.static CmsResource
readResource(CmsObject cms, CmsHistoryResourceBean bean)
Reads a historical resource for a history resource bean.
-
-
-
Constructor Detail
-
A_CmsAttributeDiff
public A_CmsAttributeDiff()
-
-
Method Detail
-
filterDifferent
public static java.util.List<CmsAttributeComparison> filterDifferent(java.util.List<CmsAttributeComparison> comps)
Only selects the attributes comparisons that actually represent differences.- Parameters:
comps
- the attribute comparisons- Returns:
- the list of attribute comparisons which correspond to actual differences
-
getVersionString
public static java.lang.String getVersionString(CmsHistoryResourceBean bean)
Builds a version string which can be used by CmsResourceComparison from a history resource bean.This is not really a user-readable string, it is meant for internal usage.
- Parameters:
bean
- the history resource bean- Returns:
- the version string
-
readResource
public static CmsResource readResource(CmsObject cms, CmsHistoryResourceBean bean) throws CmsException
Reads a historical resource for a history resource bean.- Parameters:
cms
- the CMS contextbean
- the history resource bean- Returns:
- the historical resource
- Throws:
CmsException
- if something goes wrong
-
diff
public com.google.common.base.Optional<com.vaadin.ui.Component> diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException
Description copied from interface:I_CmsDiffProvider
Optionally returns a comparison component to display for the given resource versions.If no value is returned, then no widget is displayed.
- Specified by:
diff
in interfaceI_CmsDiffProvider
- Parameters:
cms
- the CMS contextv1
- bean representing the first versionv2
- bean representing the second version- Returns:
- the optional component to display
- Throws:
CmsException
- if something goes wrong- See Also:
I_CmsDiffProvider.diff(org.opencms.file.CmsObject, org.opencms.gwt.shared.CmsHistoryResourceBean, org.opencms.gwt.shared.CmsHistoryResourceBean)
-
getCaption
public abstract java.lang.String getCaption()
Gets the caption.- Returns:
- the caption
-
getDifferences
public abstract java.util.List<CmsAttributeComparison> getDifferences(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException
Gets the attribute comparison beans representing the differences.- Parameters:
cms
- the CMS contextv1
- history bean representing the first versionv2
- history bean representing the second version- Returns:
- the list of attribute comparisons for the given versions
- Throws:
CmsException
- if something goes wrong
-
-