|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.loader.CmsDefaultTemplateContextProvider
public class CmsDefaultTemplateContextProvider
Example implementation of a template context provider for deciding between a desktop template and a mobile template.
The template JSP paths are read from a file "templatecontext.properties" in the classpath.
| Constructor Summary | |
|---|---|
CmsDefaultTemplateContextProvider()
Default constructor. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,CmsTemplateContext> |
getAllContexts()
Gets a map of all template contexts, with the template context names as keys. |
java.lang.String |
getConfigurationPropertyPath()
Returns the absolute VFS path, where the configuration property file is stored. |
java.lang.String |
getEditorStyleSheet(CmsObject cms,
java.lang.String editedResourcePath)
Returns the style sheet to be used for the editor. |
CmsMessageContainer |
getMessageContainerDesktop()
Returns the message container. |
CmsMessageContainer |
getMessageContainerMobile()
Returns the message container. |
java.lang.String |
getOverrideCookieName()
Gets the name of the cookie which should be used for overriding the template context. |
CmsTemplateContext |
getTemplateContext(CmsObject cms,
javax.servlet.http.HttpServletRequest request,
CmsResource resource)
Determines the template context from the current CMS context, request, and resource. |
void |
initialize(CmsObject cms)
Initializes the context provider using a CMS object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CmsDefaultTemplateContextProvider()
| Method Detail |
|---|
public java.util.Map<java.lang.String,CmsTemplateContext> getAllContexts()
I_CmsTemplateContextProvider
getAllContexts in interface I_CmsTemplateContextProviderI_CmsTemplateContextProvider.getAllContexts()public java.lang.String getConfigurationPropertyPath()
The configuration property file must have the following format:
null what will trigger the default behavior:Extends this class, override this method and return the absolute VFS path where OpenCms should lookup the property file, in order to configure the template JSP inside OpenCms.
public java.lang.String getEditorStyleSheet(CmsObject cms,
java.lang.String editedResourcePath)
I_CmsTemplateContextProvider
getEditorStyleSheet in interface I_CmsTemplateContextProvidercms - the current CMS contexteditedResourcePath - the path of the edited resource
I_CmsTemplateContextProvider.getEditorStyleSheet(org.opencms.file.CmsObject, java.lang.String)public CmsMessageContainer getMessageContainerDesktop()
public CmsMessageContainer getMessageContainerMobile()
public java.lang.String getOverrideCookieName()
I_CmsTemplateContextProvider
getOverrideCookieName in interface I_CmsTemplateContextProviderI_CmsTemplateContextProvider.getOverrideCookieName()
public CmsTemplateContext getTemplateContext(CmsObject cms,
javax.servlet.http.HttpServletRequest request,
CmsResource resource)
I_CmsTemplateContextProvider
getTemplateContext in interface I_CmsTemplateContextProvidercms - the CMS contextrequest - the current requestresource - the resource being rendered
I_CmsTemplateContextProvider.getTemplateContext(org.opencms.file.CmsObject, javax.servlet.http.HttpServletRequest, org.opencms.file.CmsResource)public void initialize(CmsObject cms)
I_CmsTemplateContextProvider
initialize in interface I_CmsTemplateContextProvidercms - the current CMS contextI_CmsTemplateContextProvider.initialize(org.opencms.file.CmsObject)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||