Package org.ametys.cms.content.version
Class AbstractCompareContentVersionClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.cms.content.version.AbstractCompareContentVersionClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
CompareContentWithLiveVersionClientSideElement
public abstract class AbstractCompareContentVersionClientSideElement extends StaticClientSideElement
ClientSideElement
for the button for comparing a content between two version
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description protected CompareVersionHelper
_compareVersionHelper
The compare version helperprotected AmetysObjectResolver
_resolver
The Ametys object resolver-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description AbstractCompareContentVersionClientSideElement()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Optional<String>
getBaseVersion(VersionAwareAmetysObject versionable)
Gets the base version of comparison.protected abstract String
getVersionToCompare(VersionAwareAmetysObject versionable)
Gets the version to compare.Map<String,Object>
isComparable(String contentId)
Gets comparison-information about the given content
Information is if the content is comparable with its last validation version and the concerned versions.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_compareVersionHelper
protected CompareVersionHelper _compareVersionHelper
The compare version helper
-
-
Constructor Detail
-
AbstractCompareContentVersionClientSideElement
public AbstractCompareContentVersionClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
isComparable
public Map<String,Object> isComparable(String contentId)
Gets comparison-information about the given content
Information is if the content is comparable with its last validation version and the concerned versions.- Parameters:
contentId
- The content id- Returns:
- The information
-
getVersionToCompare
protected abstract String getVersionToCompare(VersionAwareAmetysObject versionable)
Gets the version to compare. By default, it is the current one.- Parameters:
versionable
- TheVersionAwareAmetysObject
- Returns:
- the source version
-
getBaseVersion
protected abstract Optional<String> getBaseVersion(VersionAwareAmetysObject versionable)
Gets the base version of comparison.- Parameters:
versionable
- TheVersionAwareAmetysObject
- Returns:
- the base version
-
-