Package org.ametys.site
Class GeneratePageAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.site.GeneratePageAction
- All Implemented Interfaces:
 Component,LogEnabled,Serviceable,ThreadSafe,Action
Call the BO for getting a page content and stores it in the local cache.
- 
Field Summary
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected void_copyHeaders(Request request, Response response, org.apache.http.HttpResponse cmsResponse, String[] names) Copy some response headers from the back-office.protected CacheAccessCounterGet the cache access counterprotected CacheAccessManagerGet the cache access managerprotected void_writePageOnDisk(String decodedPage, org.apache.http.HttpResponse cmsResponse) Read the page from the back-office response and write it into the cache.act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected FileGet the cache file to write for the corresponding page.voidservice(ServiceManager sManager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger 
- 
Constructor Details
- 
GeneratePageAction
public GeneratePageAction() 
 - 
 - 
Method Details
- 
service
- Specified by:
 servicein interfaceServiceable- Overrides:
 servicein classServiceableAction- Throws:
 ServiceException
 - 
_getCacheAccessCounter
Get the cache access counter- Returns:
 - the CacheAccessCounter
 
 - 
_getCacheAccessManager
Get the cache access manager- Returns:
 - the CacheAccessManager
 
 - 
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception  - 
_copyHeaders
protected void _copyHeaders(Request request, Response response, org.apache.http.HttpResponse cmsResponse, String[] names) Copy some response headers from the back-office.- Parameters:
 request- the front-office client request.response- the front-office client response.cmsResponse- the response from the back-office.names- the header names.
 - 
_writePageOnDisk
protected void _writePageOnDisk(String decodedPage, org.apache.http.HttpResponse cmsResponse) throws IOException Read the page from the back-office response and write it into the cache.- Parameters:
 decodedPage- the page path.cmsResponse- the back-office response, containing the page.- Throws:
 IOException- if an error occurs writing the page into the cache.
 - 
getFile
Get the cache file to write for the corresponding page.- Parameters:
 root- the cache root folder.pagePath- the page path.- Returns:
 - a valid file.
 
 
 -