Package org.ametys.cms.content.compare
Class ContentComparator
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.cms.content.compare.ContentComparator
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ContentComparator extends AbstractLogEnabled implements Component, Serviceable
Object used to compare two contents
-
-
Constructor Summary
Constructors Constructor Description ContentComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentComparatorResult
compare(Content content1, Content content2)
Compare 2 contents, for all their common attributes (contents with different contentTypes are rejected)ContentComparatorResult
compare(Content content1, Content content2, boolean strictCompare)
Compare 2 contents, for all their common attributesContentComparatorResult
compare(Content content1, Content content2, String viewName)
Compare 2 contents, filtering with a view (contents with different contentTypes are rejected)ContentComparatorResult
compare(Content content1, Content content2, String viewName, boolean strictCompare)
Compare 2 contents, filtering with a viewvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
ContentComparator
public ContentComparator()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
compare
public ContentComparatorResult compare(Content content1, Content content2) throws AmetysRepositoryException, IOException
Compare 2 contents, for all their common attributes (contents with different contentTypes are rejected)- Parameters:
content1
- 1st contentcontent2
- new content- Returns:
ContentComparatorResult
- Throws:
AmetysRepositoryException
- repository exceptionIOException
- IO exception
-
compare
public ContentComparatorResult compare(Content content1, Content content2, boolean strictCompare) throws AmetysRepositoryException, IOException
Compare 2 contents, for all their common attributes- Parameters:
content1
- 1st contentcontent2
- new contentstrictCompare
- true to reject contents with different content types- Returns:
ContentComparatorResult
- Throws:
AmetysRepositoryException
- repository exceptionIOException
- IO exception
-
compare
public ContentComparatorResult compare(Content content1, Content content2, String viewName) throws AmetysRepositoryException, IOException
Compare 2 contents, filtering with a view (contents with different contentTypes are rejected)- Parameters:
content1
- 1st contentcontent2
- new contentviewName
- name of the view- Returns:
ContentComparatorResult
- Throws:
AmetysRepositoryException
- repository exceptionIOException
- IO exception
-
compare
public ContentComparatorResult compare(Content content1, Content content2, String viewName, boolean strictCompare) throws AmetysRepositoryException, IOException
Compare 2 contents, filtering with a view- Parameters:
content1
- 1st contentcontent2
- new contentviewName
- name of the viewstrictCompare
- true to reject contents with different content types- Returns:
ContentComparatorResult
- Throws:
AmetysRepositoryException
- repository exceptionIOException
- IO exception
-
-