Class GlobalContentConsistencyGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.cms.content.consistency.GlobalContentConsistencyGenerator
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Initializable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
GlobalContentConsistencyGenerator
public class GlobalContentConsistencyGenerator extends ServiceableGenerator implements Initializable
Generate content with consistency information.
Parameters:- short-test: set to true to make a short test, false to make a full one (default false).
- omit-consistent: set to true to omit consistent contents and generate only contents with unknown or failed consistency information (default false).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGlobalContentConsistencyGenerator.ConsistencyExpressionExpression which tests if contents have consistency informations.
-
Field Summary
Fields Modifier and Type Field Description protected AbstractCacheManager_cacheManagerCacheManager used to create and get cacheprotected ConsistencyChecker_consistencyCheckerThe consistency checkerprotected ContentTypeExtensionPoint_cTypeExtPtThe content type extension pointprotected ContentTypesHelper_cTypesHelperHelper for content typesprotected AmetysObjectResolver_resolverThe ametys object resolver.protected UserManager_userManagerThe user manager-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
-
Constructor Summary
Constructors Constructor Description GlobalContentConsistencyGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AmetysObjectIterable<Content>_getContents()Get the contents with inconsistency information.protected void_saxAdditionalContentAttributes(Content content, AttributesImpl atts)Sax additional data on the contentprotected void_saxContentConsistency(Content content, int successCount, int unknownCount, int unauthorizedCount, int notFoundCount, int serverErrorCount)Generate information on content consistency.voidgenerate()protected StringgetName(UserIdentity userIdentity)Get the user namevoidinitialize()voidservice(ServiceManager serviceManager)-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver.
-
_consistencyChecker
protected ConsistencyChecker _consistencyChecker
The consistency checker
-
_userManager
protected UserManager _userManager
The user manager
-
_cTypeExtPt
protected ContentTypeExtensionPoint _cTypeExtPt
The content type extension point
-
_cTypesHelper
protected ContentTypesHelper _cTypesHelper
Helper for content types
-
_cacheManager
protected AbstractCacheManager _cacheManager
CacheManager used to create and get cache
-
-
Constructor Detail
-
GlobalContentConsistencyGenerator
public GlobalContentConsistencyGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
generate
public void generate() throws IOException, SAXException, ProcessingException
- Specified by:
generatein interfaceGenerator- Throws:
IOExceptionSAXExceptionProcessingException
-
_getContents
protected AmetysObjectIterable<Content> _getContents()
Get the contents with inconsistency information.- Returns:
- an iterator on contents.
-
_saxContentConsistency
protected void _saxContentConsistency(Content content, int successCount, int unknownCount, int unauthorizedCount, int notFoundCount, int serverErrorCount) throws SAXException
Generate information on content consistency.- Parameters:
content- the content.successCount- the count of consistent information.unknownCount- the count of information of unknown consistency.unauthorizedCount- the count of unauthorized links.notFoundCount- the count of not found links.serverErrorCount- the count of inconsistent information.- Throws:
SAXException- if an errors occurs generating the data.
-
_saxAdditionalContentAttributes
protected void _saxAdditionalContentAttributes(Content content, AttributesImpl atts)
Sax additional data on the content- Parameters:
content- the content.atts- the attributes the will be saxed?
-
getName
protected String getName(UserIdentity userIdentity)
Get the user name- Parameters:
userIdentity- the user- Returns:
- the user name
-
-