com.gentics.cr.cms
Class CMSRequestProcessor

java.lang.Object
  extended by com.gentics.cr.RequestProcessor
      extended by com.gentics.cr.cms.CMSRequestProcessor
Direct Known Subclasses:
DummyCMSRequestProcessor, PortletSessionCMSRequestProcessor

public abstract class CMSRequestProcessor
extends com.gentics.cr.RequestProcessor

The Class CMSRequestProcessor.

 

Field Summary
private static com.sun.jersey.api.client.WebResource base
          Web Resource base object.
private static String BINARY_OBJECT_TYPE
          File object type.
private  com.sun.jersey.api.client.Client client
          REST API Client.
private static String CMS_BASE_URI_KEY
          Config key for the base uri.
private static String FOLDER_OBJECT_TYPE
          Folder object type.
protected static org.apache.log4j.Logger log
          The logger.
private static String OBJECT_PREFIX
          Object prefix.
private static String PAGE_OBJECT_TYPE
          Page object type.
private  String restBaseUri
          REST base uri.
private  int retryCount
          Retry count.
private static String RETRYCOUNT_KEY
          The Constant RETRYCOUNT_KEY.
 
Fields inherited from class com.gentics.cr.RequestProcessor
config, CONTENTCACHE_KEY, HIGHLIGHT_QUERY_KEY, LINKS_PATTERN, META_RESOLVABLE_KEY, plinkProc, resolvables
 
Constructor Summary
CMSRequestProcessor(com.gentics.cr.CRConfig config)
          Creates a new instance of this requestProcessor.
 
Method Summary
protected  com.gentics.cr.CRResolvableBean createCRResolvableBean(com.gentics.contentnode.rest.model.Folder folder, String[] folderAttributeArray)
          Create CRResolvableBean for the corresponding folder.
 void finalize()
           
private  String getIdFromContentid(String contentid)
          Extracts the id from a contentid.
 Collection<com.gentics.cr.CRResolvableBean> getObjects(com.gentics.cr.CRRequest request, boolean doNavigation)
           
private  Collection<com.gentics.cr.CRResolvableBean> getObjects(com.gentics.cr.CRRequest request, boolean doNavigation, int currentRetryNumber)
          Gets the objects.
abstract  RESTAPISessionCredentialStore getSessionStore(com.gentics.cr.CRConfig config)
          Fetches the credential store from the session.
protected  com.gentics.cr.CRResolvableBean loadFolder(String id, boolean doNavigation)
          Loads a folder object from the rest api.
private  com.gentics.cr.CRResolvableBean loadPage(String id)
          Loads a page object from the rest api.
 
Methods inherited from class com.gentics.cr.RequestProcessor
fillAttributes, fillAttributes, getBeanByURL, getContent, getContentByUrl, getFirstMatchingResolvable, getNavigation, getObjects, prefixHostRelativeLinks, replacePlinks, toCRResolvableBeanCollection, toCRResolvableBeanCollection, toResolvableCollection, toResolvableCollection
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
The logger.


CMS_BASE_URI_KEY

private static final String CMS_BASE_URI_KEY
Config key for the base uri.

See Also:
Constant Field Values

RETRYCOUNT_KEY

private static final String RETRYCOUNT_KEY
The Constant RETRYCOUNT_KEY.

See Also:
Constant Field Values

FOLDER_OBJECT_TYPE

private static final String FOLDER_OBJECT_TYPE
Folder object type.

See Also:
Constant Field Values

BINARY_OBJECT_TYPE

private static final String BINARY_OBJECT_TYPE
File object type.

See Also:
Constant Field Values

PAGE_OBJECT_TYPE

private static final String PAGE_OBJECT_TYPE
Page object type.

See Also:
Constant Field Values

OBJECT_PREFIX

private static final String OBJECT_PREFIX
Object prefix.

See Also:
Constant Field Values

restBaseUri

private String restBaseUri
REST base uri.


client

private com.sun.jersey.api.client.Client client
REST API Client.


retryCount

private int retryCount
Retry count.


base

private static com.sun.jersey.api.client.WebResource base
Web Resource base object.

Constructor Detail

CMSRequestProcessor

public CMSRequestProcessor(com.gentics.cr.CRConfig config)
                    throws com.gentics.cr.exceptions.CRException
Creates a new instance of this requestProcessor.

Parameters:
config - the config
Throws:
com.gentics.cr.exceptions.CRException - the cR exception
Method Detail

getObjects

public Collection<com.gentics.cr.CRResolvableBean> getObjects(com.gentics.cr.CRRequest request,
                                                              boolean doNavigation)
                                                       throws com.gentics.cr.exceptions.CRException
Specified by:
getObjects in class com.gentics.cr.RequestProcessor
Throws:
com.gentics.cr.exceptions.CRException

getObjects

private Collection<com.gentics.cr.CRResolvableBean> getObjects(com.gentics.cr.CRRequest request,
                                                               boolean doNavigation,
                                                               int currentRetryNumber)
                                                        throws com.gentics.cr.exceptions.CRException
Gets the objects.

Parameters:
request - the request
doNavigation - the do navigation
currentRetryNumber - the current retry number
Returns:
the objects
Throws:
com.gentics.cr.exceptions.CRException - the cR exception

loadFolder

protected com.gentics.cr.CRResolvableBean loadFolder(String id,
                                                     boolean doNavigation)
                                              throws CMSRESTAuthenticationRequiredException
Loads a folder object from the rest api.

Parameters:
id - id of the folder
Returns:
folder object
Throws:
CMSRESTAuthenticationRequiredException - the cMSREST authentication required exception

createCRResolvableBean

protected com.gentics.cr.CRResolvableBean createCRResolvableBean(com.gentics.contentnode.rest.model.Folder folder,
                                                                 String[] folderAttributeArray)
                                                          throws CMSRESTAuthenticationRequiredException
Create CRResolvableBean for the corresponding folder.

Parameters:
folder - Folder object.
folderAttributeArray - Array containing configured folder attributes.
Returns:
CRResolvableBean bean.
Throws:
CMSRESTAuthenticationRequiredException

loadPage

private com.gentics.cr.CRResolvableBean loadPage(String id)
                                          throws CMSRESTAuthenticationRequiredException
Loads a page object from the rest api.

Parameters:
id - id of the page
Returns:
folder object
Throws:
CMSRESTAuthenticationRequiredException - the cMSREST authentication required exception

finalize

public void finalize()
Specified by:
finalize in class com.gentics.cr.RequestProcessor

getIdFromContentid

private String getIdFromContentid(String contentid)
Extracts the id from a contentid.

Parameters:
contentid - the contentid
Returns:
id

getSessionStore

public abstract RESTAPISessionCredentialStore getSessionStore(com.gentics.cr.CRConfig config)
Fetches the credential store from the session.

Parameters:
config - the config
Returns:
RESTAPISessionCredentialHelper


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.