Package org.javlo.context
Class ContentContext
- java.lang.Object
-
- org.javlo.context.ContentContext
-
- Direct Known Subclasses:
TestContentContext
public class ContentContext extends Object
- Author:
- pvanderm
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ContentContext(ContentContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAjaxData(String key, String value)add a ajax zone for update.voidaddAjaxInsideZone(String id, String xhtml)add a ajax zone for update.voidaddAjaxZone(String id, String xhtml)add a ajax zone for update.Map<String,Object>getAjaxData()get Ajax data map.Map<String,String>getAjaxInsideZone()get Ajax zone that will be updated.Map<? extends Object,? extends Object>getAjaxMap()Map<String,String>getAjaxZone()get Ajax zone that will be updated.StringgetArea()ObjectgetAttribute(String key)ContentContextBeangetBean()intgetColumnableDepth()intgetColumnableSize(int depth)static ContentContextgetContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)static ContentContextgetContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath)static ContentContextgetContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath, boolean pageManagement)ContentContextgetContentContextForInternalLink()static ContentContextgetContentContextNoPageManagement(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)StringgetContentLanguage()Deprecated.Prefer use ofgetRequestContentLanguage().ContentContextgetContextForAbsoluteURL()ContentContextgetContextForAjax()List<ContentContext>getContextForAllLanguage()ContentContextgetContextForDefaultLanguage()StringgetContextLanguage()get the edit language in edit mode and view language if other mode.ContentContextgetContextNotEmpty(MenuElement page)return a context with at least one element (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.ContentContextgetContextOnPage(MenuElement page)StringgetContextRequestLanguage()get the edit language in edit mode and view language if other mode.ContentContextgetContextWidthOtherRequestLanguage(String lang)ContentContextgetContextWidthTitle(MenuElement page)return a context with at least one title (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.ContentContextgetContextWithArea(String area)ContentContextgetContextWithContent(MenuElement page)return a context with real content (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.ContentContextgetContextWithContentDEBUG(MenuElement page)return a context with language (if exist), it can be change the language (and only this) of the current context). this method use only the default language list.ContentContextgetContextWithContentNeverNull(MenuElement page)return a context with language (if exist), it can be change the language (and only this) of the current context). this method use only the default language list.ContentContextgetContextWithInternalURL()ContentContextgetContextWithOtherFormat(String format)ContentContextgetContextWithOtherRenderMode(int mode)ContentContextgetContextWithoutArea()StringgetCookieLanguage()StringgetCurrentAdminUserId()UsergetCurrentEditUser()MenuElementgetCurrentPage()MenuElementgetCurrentPageCached()TemplategetCurrentTemplate()List<Template>getCurrentTemplates()UsergetCurrentUser()StringgetCurrentUserId()get the current user id.StringgetCurrentUserIdNeverNull()return a identifiant for the user (session id can be use if no user logged)DevicegetDevice()List<String>getDeviceNames()get all device accessible from current template.URLgetDMZServerInter()intgetEditMode()static ContentContextgetEmptyContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)get ContentContext without globalContextStringgetForcePageTitle()StringgetFormat()get the page format.ContentContextgetFreeContentContext()static ContentContextgetFreeContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)return free content ctx, context not linked to a specific page, use in imagetransform servlet or something like that.GlobalContextgetGlobalContext()StringgetHomePageURL()StringgetHostName()intgetHostPort()StringgetInputTrackingKey()static StringgetInputTrackingKey(javax.servlet.http.HttpSession session)StringgetLanguage()StringgetLocalCountry()LocalegetLocale()StringgetMainLanguage()return the language of the inititial request (if language has changed)ContentContextgetMasterContentContext()ContentContextgetNewContentContext()StringgetParentURL()StringgetPath()StringgetPathPrefix()StringgetPathPrefix(javax.servlet.http.HttpServletRequest request)static StringgetPathPrefix(GlobalContext globalContext, javax.servlet.http.HttpServletRequest request)StringgetRealRemoteIp()StringgetRealRemoteIp(boolean anonymised)static StringgetRealRemoteIp(javax.servlet.http.HttpServletRequest request)static StringgetRealRemoteIp(javax.servlet.http.HttpServletRequest request, boolean anonymised)StringgetRemoteIp()intgetRenderMode()static StringgetRenderModeKey(int mode)javax.servlet.http.HttpServletRequestgetRequest()StringgetRequestContentLanguage()StringgetRequestContentLanguageRAW()intgetRequestCountOnSession()RequestServicegetRequestService()javax.servlet.http.HttpServletResponsegetResponse()Map<String,AjaxHelper.ScheduledRender>getScheduledAjaxInsideZone()javax.servlet.ServletContextgetServletContext()javax.servlet.http.HttpSessiongetSession()StringgetSpecialContentRenderer()StringgetSpecificJson()for return a specific ajax respones from dedicaded action.intgetTitleDepth()IURLFactorygetURLFactory()StringgetURLProtocolPrefix()StringgetVirtualArea()create a area to render content with other rules than area of content.MenuElementgetVirtualCurrentPage()booleanisAbsoluteURL()booleanisActionServlet()booleanisAjax()booleanisArray()booleanisAsEditMode()booleanisAsModifyMode()booleanisAsPageMode()booleanisAsPreviewMode()booleanisAsTimeMode()booleanisAsViewMode()booleanisCanUndo()booleanisCheckContentArea()booleanisClearSession()booleanisClosePopup()booleanisComponentCache()static booleanisContentContext(javax.servlet.http.HttpServletRequest request)check if there are a contentcontext in the requestbooleanisContentFound()booleanisContentStatic()booleanisEdit()booleanisEdition()booleanisEditPreview()edit from a preview pagestatic booleanisEditPreview(javax.servlet.http.HttpServletRequest request)booleanisExport()render component from export servelt (for expose only one component).booleanisForceCorrectPath()booleanisForceGlobalContext()booleanisFree()no need template and link to page context.booleanisHostDefineSite()static booleanisHostDefineSite(javax.servlet.http.HttpServletRequest request)booleanisInteractiveMode()booleanisInternalURL()don't use proxy for rendering (URL don't use getProxyPrefix on globalContext)booleanisLikeEditRenderMode()check if mode is assimilable to edit mode.booleanisLikeViewRenderMode()check if mode is assimilable to view mode.booleanisMobile()booleanisNeedRefresh()booleanisNoCache()booleanisOnlyArea()booleanisPageAssociation()booleanisPageRequest()return if the current request is for a page access and not a resource (jsp, img, js...)booleanisPostRequest()booleanisPreview()booleanisPreviewEditionMode()return true if content is editable in preview modebooleanisPreviewOnly()return true if render mode in preview only (no tools displayed, like view mode with preview data)booleanisProd()booleanisRefreshParent()booleanisResourceGZip()return true if link can be linked to gzipbooleanisStopRendering()booleanisTakeScreenShort()booleanisTime()booleanisTrackingContext()true if the current request must be tracked.booleanisUserWebSiteManager()current user (edit or view) can manager the current site.booleanisViewPrefix()booleanisVisible()booleanisVisualMode()static voidmain(String[] args)booleanmirrorDone(String id)voidrelease()protected voidresetCache()voidresetCurrentPageCached()voidresetDMZServerInter()reset DMZ for force local absolute URL.voidscheduleAjaxInsideZone(String id, String uri, Map<String,Object> attributes)Schedule an ajax zone for update.voidsendRedirect(String url)redirect.voidsetAbsoluteURL(boolean isAbsoluteURL)voidsetActionServlet(boolean actionServlet)ContentContextsetAjax(boolean ajax)voidsetAjaxMap(Map<? extends Object,? extends Object> ajaxMap)voidsetAllLanguage(String lg)setLanguage, setContentLanguage and setRequestContentLanguage with a lgvoidsetArea(String area)voidsetArray(boolean array)voidsetAttribute(String key, Object obj)voidsetCheckContentArea(boolean checkContentArea)voidsetClearSession(boolean clearSession)voidsetClosePopup(boolean closePopup)voidsetColumnableDepth(int columnableDepth)voidsetColumnableSize(int columnableSize, int depth)voidsetComponentCache(boolean componentCache)voidsetContentContent(ContentContext ctx)booleansetContentContextIfNeeded(Object object)set content context if Object implement interface INeedContentContext.voidsetContentFound(boolean contentFound)voidsetContentLanguage(String lg)voidsetContextRequestLanguage(String lg)voidsetCookieLanguage(String lang)voidsetCurrentPageCached(MenuElement currentPageCached)voidsetCurrentTemplate(Template template)booleansetCurrentTemplateId(String templateId)set the current template with id.voidsetDefaultArea()voidsetDevice(Device device)voidsetEdit(boolean b)Deprecated.use setRenderMode()voidsetEditPreview(boolean editPreview)voidsetExport(boolean export)voidsetForceCorrectPath(boolean forceCorrectPath)voidsetForceGlobalContext(GlobalContext forceGlobalContext)voidsetForcePageTitle(String forcePageTitle)voidsetForcePathPrefix(String forcePathPrefix)static voidsetForcePathPrefix(javax.servlet.ServletRequest request, String forcePathPrefix)ContentContextsetFormat(String format)force formatvoidsetFree(boolean free)no need template and link to page context.static voidsetHostDefineSite(javax.servlet.http.HttpServletRequest request, boolean hostDefineSite)voidsetHostName(String inHost)voidsetHostPort(int port)voidsetInternalURL(boolean internalURL)voidsetLanguage(String lg)voidsetMainLanguage(String mainLanguage)voidsetNeedRefresh(boolean needRefresh)voidsetNoCache(boolean noCache)voidsetPageAssociation(boolean pageAssociation)voidsetPageRequest(boolean pageRequest)voidsetParentURL(String parentURL)voidsetPath(String newPath)voidsetPostRequest(boolean postRequest)voidsetPreview(boolean b)Deprecated.use setRenderMode()voidsetProd(Boolean prod)voidsetRefreshParent(boolean refreshParent)voidsetRenderMode(int renderMode)voidsetRequest(javax.servlet.http.HttpServletRequest request)voidsetRequestContentLanguage(String lg)voidsetResponse(javax.servlet.http.HttpServletResponse response)voidsetSpecialContentRenderer(String specialContent)voidsetSpecificJson(String specifixAjax)voidsetStopRendering(boolean stopRendering)voidsetTitleDepth(int titleDepth)voidsetURLFactory(IURLFactory urlFactory)voidsetURLProtocolPrefix(String protocol)voidsetViewPrefix(boolean viewPrefix)voidsetVirtualArea(String virtualArea)voidsetVirtualCurrentPage(MenuElement virtualCurrentPage)voidsetVisible(boolean b)voidstoreInRequest(javax.servlet.http.HttpServletRequest request)voidtoStream(OutputStream outStream)trace info on streamStringtoString()
-
-
-
Field Detail
-
COUNT_REQUEST_BY_SESSION_KEY
public static final String COUNT_REQUEST_BY_SESSION_KEY
- See Also:
- Constant Field Values
-
PREVIEW_ONLY_MODE
public static final String PREVIEW_ONLY_MODE
- See Also:
- Constant Field Values
-
PREVIEW_EDIT_PARAM
public static final String PREVIEW_EDIT_PARAM
- See Also:
- Constant Field Values
-
TAKE_SCREENSHOT
public static final String TAKE_SCREENSHOT
- See Also:
- Constant Field Values
-
TAKE_SCREENSHOT_PAGE_NAME
public static final String TAKE_SCREENSHOT_PAGE_NAME
- See Also:
- Constant Field Values
-
EDIT_MODE
public static final int EDIT_MODE
- See Also:
- Constant Field Values
-
VIEW_MODE
public static final int VIEW_MODE
- See Also:
- Constant Field Values
-
PREVIEW_MODE
public static final int PREVIEW_MODE
- See Also:
- Constant Field Values
-
PAGE_MODE
public static final int PAGE_MODE
- See Also:
- Constant Field Values
-
MAILING_MODE
public static final int MAILING_MODE
- See Also:
- Constant Field Values
-
TIME_MODE
public static final int TIME_MODE
- See Also:
- Constant Field Values
-
MODULE_MODE
public static final int MODULE_MODE
- See Also:
- Constant Field Values
-
POST_MODE
public static final int POST_MODE
- See Also:
- Constant Field Values
-
GET_MODE
public static final int GET_MODE
- See Also:
- Constant Field Values
-
MODULE_DESKTOP_SPECIAL_MODE
public static final int MODULE_DESKTOP_SPECIAL_MODE
- See Also:
- Constant Field Values
-
MODULE_MOBILE_SPECIAL_MODE
public static final int MODULE_MOBILE_SPECIAL_MODE
- See Also:
- Constant Field Values
-
FORWARD_PATH_REQUEST_KEY
public static final String FORWARD_PATH_REQUEST_KEY
- See Also:
- Constant Field Values
-
FORWARD_AJAX
public static final String FORWARD_AJAX
- See Also:
- Constant Field Values
-
FORCE_MODE_PARAMETER_NAME
public static final String FORCE_MODE_PARAMETER_NAME
- See Also:
- Constant Field Values
-
CHANGE_AREA_ATTRIBUTE_NAME
public static final String CHANGE_AREA_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
FORCE_ABSOLUTE_URL
public static final String FORCE_ABSOLUTE_URL
- See Also:
- Constant Field Values
-
CHARACTER_ENCODING
public static String CHARACTER_ENCODING
-
CHARSET_DEFAULT
public static Charset CHARSET_DEFAULT
-
PRODUCT_NAME
public static String PRODUCT_NAME
-
FORCED_CONTENT_PREFIX
public static String FORCED_CONTENT_PREFIX
-
NO_DMZ_PARAM_NAME
public static final String NO_DMZ_PARAM_NAME
param for render content with link to local server and not DMZ server.- See Also:
- Constant Field Values
-
CLEAR_SESSION_PARAM
public static final String CLEAR_SESSION_PARAM
- See Also:
- Constant Field Values
-
logger
protected static Logger logger
create a static logger.
-
CONTEXT_REQUEST_KEY
public static String CONTEXT_REQUEST_KEY
-
currentPageCached
public WeakReference<MenuElement> currentPageCached
-
contentExistForContext
public Boolean contentExistForContext
-
editPreview
public Boolean editPreview
-
-
Constructor Detail
-
ContentContext
public ContentContext(ContentContext ctx)
-
-
Method Detail
-
getRequestCountOnSession
public int getRequestCountOnSession()
-
getFreeContentContext
public static ContentContext getFreeContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
return free content ctx, context not linked to a specific page, use in imagetransform servlet or something like that.- Parameters:
request-response-- Returns:
- Throws:
Exception
-
getContentContext
public static ContentContext getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
getContentContextNoPageManagement
public static ContentContext getContentContextNoPageManagement(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
getContentContextForInternalLink
public ContentContext getContentContextForInternalLink()
-
getContentContext
public static ContentContext getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath) throws Exception
- Throws:
Exception
-
getInputTrackingKey
public String getInputTrackingKey()
-
getInputTrackingKey
public static String getInputTrackingKey(javax.servlet.http.HttpSession session)
-
getContentContext
public static ContentContext getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath, boolean pageManagement) throws Exception
- Parameters:
request-response-correctPath- true for search real page and construct new path with this page.- Returns:
- Throws:
Exception
-
isContentContext
public static boolean isContentContext(javax.servlet.http.HttpServletRequest request)
check if there are a contentcontext in the request- Parameters:
request-- Returns:
-
getRenderModeKey
public static String getRenderModeKey(int mode)
-
getEmptyContentContext
public static ContentContext getEmptyContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
get ContentContext without globalContext- Parameters:
request-response-- Returns:
- Throws:
Exception
-
getArea
public String getArea()
-
getContentLanguage
@Deprecated public String getContentLanguage()
Deprecated.Prefer use ofgetRequestContentLanguage().- Returns:
- Throws:
Exception
-
getFreeContentContext
public ContentContext getFreeContentContext()
-
getContextForAllLanguage
public List<ContentContext> getContextForAllLanguage()
-
getContextWithoutArea
public ContentContext getContextWithoutArea()
-
getContextWithOtherFormat
public ContentContext getContextWithOtherFormat(String format)
-
getContextWithArea
public ContentContext getContextWithArea(String area)
-
getContextWithOtherRenderMode
public ContentContext getContextWithOtherRenderMode(int mode)
-
getContextForAjax
public ContentContext getContextForAjax()
-
getContextWidthOtherRequestLanguage
public ContentContext getContextWidthOtherRequestLanguage(String lang)
-
getContextWithInternalURL
public ContentContext getContextWithInternalURL()
-
getContextLanguage
public String getContextLanguage()
get the edit language in edit mode and view language if other mode.- Returns:
-
getContextWithContent
public ContentContext getContextWithContent(MenuElement page) throws Exception
return a context with real content (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.- Returns:
- null if no content found.
- Throws:
Exception
-
getContextNotEmpty
public ContentContext getContextNotEmpty(MenuElement page) throws Exception
return a context with at least one element (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.- Returns:
- null if no content found.
- Throws:
Exception
-
getContextWidthTitle
public ContentContext getContextWidthTitle(MenuElement page) throws Exception
return a context with at least one title (if exist), it can be change the language (and only this) of the current context. this method use only the default language list.- Returns:
- null if no content found.
- Throws:
Exception
-
getContextWithContentDEBUG
public ContentContext getContextWithContentDEBUG(MenuElement page) throws Exception
return a context with language (if exist), it can be change the language (and only this) of the current context). this method use only the default language list.- Returns:
- null if no content found.
- Throws:
Exception
-
getContextWithContentNeverNull
public ContentContext getContextWithContentNeverNull(MenuElement page) throws Exception
return a context with language (if exist), it can be change the language (and only this) of the current context). this method use only the default language list.- Returns:
- null if no content found.
- Throws:
Exception
-
getContextOnPage
public ContentContext getContextOnPage(MenuElement page) throws Exception
- Throws:
Exception
-
getContextForAbsoluteURL
public ContentContext getContextForAbsoluteURL()
-
getContextRequestLanguage
public String getContextRequestLanguage()
get the edit language in edit mode and view language if other mode.- Returns:
-
setContextRequestLanguage
public void setContextRequestLanguage(String lg)
-
getContextForDefaultLanguage
public ContentContext getContextForDefaultLanguage()
-
getCookieLanguage
public String getCookieLanguage()
-
getCurrentPage
public MenuElement getCurrentPage() throws Exception
- Throws:
Exception
-
getCurrentPageCached
public MenuElement getCurrentPageCached()
-
getDevice
public Device getDevice()
-
isMobile
public boolean isMobile()
-
getDeviceNames
public List<String> getDeviceNames() throws Exception
get all device accessible from current template.- Returns:
- Throws:
Exception
-
getDMZServerInter
public URL getDMZServerInter()
-
resetDMZServerInter
public void resetDMZServerInter()
reset DMZ for force local absolute URL.
-
getHostName
public String getHostName()
-
getHostPort
public int getHostPort()
-
getLanguage
public String getLanguage()
- Returns:
-
getLocale
public Locale getLocale()
-
getPath
public String getPath()
- Returns:
- a logical path
-
getRenderMode
public int getRenderMode()
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Returns:
-
getSession
public javax.servlet.http.HttpSession getSession()
-
getServletContext
public javax.servlet.ServletContext getServletContext()
-
getRequestService
public RequestService getRequestService()
-
getRequestContentLanguage
public String getRequestContentLanguage()
-
getRequestContentLanguageRAW
public String getRequestContentLanguageRAW()
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
- Returns:
-
sendRedirect
public void sendRedirect(String url) throws IOException
redirect.- Parameters:
url-- Throws:
IOException
-
getSpecialContentRenderer
public String getSpecialContentRenderer()
-
getURLFactory
public IURLFactory getURLFactory()
-
setURLFactory
public void setURLFactory(IURLFactory urlFactory)
-
getURLProtocolPrefix
public String getURLProtocolPrefix()
-
isAbsoluteURL
public boolean isAbsoluteURL()
-
isAjax
public boolean isAjax()
-
isArray
public boolean isArray()
-
isAsModifyMode
public boolean isAsModifyMode()
-
isAsPreviewMode
public boolean isAsPreviewMode()
-
isAsTimeMode
public boolean isAsTimeMode()
-
isAsPageMode
public boolean isAsPageMode()
-
isAsEditMode
public boolean isAsEditMode()
-
isAsViewMode
public boolean isAsViewMode()
-
isVisualMode
public boolean isVisualMode()
-
isTrackingContext
public boolean isTrackingContext()
true if the current request must be tracked.- Returns:
-
isEdit
public boolean isEdit()
- Returns:
- true if editable context
-
isInteractiveMode
public boolean isInteractiveMode()
-
isNeedRefresh
public boolean isNeedRefresh()
-
isPreview
public boolean isPreview()
-
isTime
public boolean isTime()
-
isPreviewOnly
public boolean isPreviewOnly()
return true if render mode in preview only (no tools displayed, like view mode with preview data)- Returns:
-
isPreviewEditionMode
public boolean isPreviewEditionMode()
return true if content is editable in preview mode- Returns:
-
isViewPrefix
public boolean isViewPrefix()
-
setViewPrefix
public void setViewPrefix(boolean viewPrefix)
-
isVisible
public boolean isVisible()
- Returns:
-
resetCache
protected void resetCache()
-
setAbsoluteURL
public void setAbsoluteURL(boolean isAbsoluteURL)
-
setAjax
public ContentContext setAjax(boolean ajax)
-
isPageRequest
public boolean isPageRequest()
return if the current request is for a page access and not a resource (jsp, img, js...)- Returns:
-
setPageRequest
public void setPageRequest(boolean pageRequest)
-
setAllLanguage
public void setAllLanguage(String lg)
setLanguage, setContentLanguage and setRequestContentLanguage with a lg- Parameters:
lg-
-
setArea
public void setArea(String area)
-
setDefaultArea
public void setDefaultArea()
-
setArray
public void setArray(boolean array)
-
setContentLanguage
public void setContentLanguage(String lg)
-
setCookieLanguage
public void setCookieLanguage(String lang)
-
setCurrentPageCached
public void setCurrentPageCached(MenuElement currentPageCached) throws Exception
- Throws:
Exception
-
resetCurrentPageCached
public void resetCurrentPageCached()
-
setDevice
public void setDevice(Device device)
-
setEdit
@Deprecated public void setEdit(boolean b)
Deprecated.use setRenderMode()- Parameters:
b-
-
setHostName
public void setHostName(String inHost)
-
setHostPort
public void setHostPort(int port)
-
setLanguage
public void setLanguage(String lg)
- Parameters:
lg-
-
setNeedRefresh
public void setNeedRefresh(boolean needRefresh)
-
setPath
public void setPath(String newPath)
- Parameters:
string- a logical path
-
setPreview
@Deprecated public void setPreview(boolean b)
Deprecated.use setRenderMode()- Parameters:
b-
-
setRenderMode
public void setRenderMode(int renderMode)
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
- Parameters:
request-
-
setRequestContentLanguage
public void setRequestContentLanguage(String lg)
-
setResponse
public void setResponse(javax.servlet.http.HttpServletResponse response)
- Parameters:
response-
-
setSpecialContentRenderer
public void setSpecialContentRenderer(String specialContent)
-
setURLProtocolPrefix
public void setURLProtocolPrefix(String protocol)
-
setVisible
public void setVisible(boolean b)
- Parameters:
b-
-
storeInRequest
public void storeInRequest(javax.servlet.http.HttpServletRequest request)
-
toStream
public void toStream(OutputStream outStream)
trace info on stream- Parameters:
out-
-
getCurrentUser
public User getCurrentUser()
-
getCurrentEditUser
public User getCurrentEditUser()
-
getCurrentUserId
public String getCurrentUserId()
get the current user id. That can be the edit user or the view user.- Returns:
-
getCurrentAdminUserId
public String getCurrentAdminUserId()
-
getCurrentUserIdNeverNull
public String getCurrentUserIdNeverNull()
return a identifiant for the user (session id can be use if no user logged)
-
getAjaxInsideZone
public Map<String,String> getAjaxInsideZone()
get Ajax zone that will be updated.- Returns:
- a map with html id as key and xhtml as value.
-
getAjaxData
public Map<String,Object> getAjaxData()
get Ajax data map.- Returns:
- a map with html id as key and xhtml as value.
-
getScheduledAjaxInsideZone
public Map<String,AjaxHelper.ScheduledRender> getScheduledAjaxInsideZone()
-
addAjaxData
public void addAjaxData(String key, String value)
add a ajax zone for update.- Parameters:
id- a xhtml idxhtml- the new content of the zone
-
addAjaxInsideZone
public void addAjaxInsideZone(String id, String xhtml)
add a ajax zone for update.- Parameters:
id- a xhtml idxhtml- the new content of the zone
-
scheduleAjaxInsideZone
public void scheduleAjaxInsideZone(String id, String uri, Map<String,Object> attributes)
Schedule an ajax zone for update. The uri will be called after the prepare() of the current module actions.- Parameters:
id- a xhtml idxhtml- the new content of the zone
-
getAjaxZone
public Map<String,String> getAjaxZone()
get Ajax zone that will be updated.- Returns:
- a map with html id as key and xhtml as value.
-
addAjaxZone
public void addAjaxZone(String id, String xhtml)
add a ajax zone for update.- Parameters:
id- a xhtml idxhtml- the new content of the zone
-
isLikeViewRenderMode
public boolean isLikeViewRenderMode()
check if mode is assimilable to view mode.- Returns:
- true if mode use "view" data. (page, time...)
-
isLikeEditRenderMode
public boolean isLikeEditRenderMode()
check if mode is assimilable to edit mode.- Returns:
- true if mode use "edit" data. (preview)
-
getFormat
public String getFormat()
get the page format.- Returns:
- sample : pdf, html, png...
-
setFormat
public ContentContext setFormat(String format)
force format- Parameters:
format- sample : pdf, html, png...
-
setCurrentTemplateId
public boolean setCurrentTemplateId(String templateId)
set the current template with id.- Parameters:
templateId-- Returns:
- false if template not found else true
-
setCurrentTemplate
public void setCurrentTemplate(Template template)
-
isResourceGZip
public boolean isResourceGZip() throws Exceptionreturn true if link can be linked to gzip- Throws:
Exception
-
isFree
public boolean isFree()
no need template and link to page context.- Returns:
-
setFree
public void setFree(boolean free)
no need template and link to page context.- Parameters:
tree-
-
getHomePageURL
public String getHomePageURL()
-
main
public static void main(String[] args)
-
getPathPrefix
public String getPathPrefix()
-
getPathPrefix
public String getPathPrefix(javax.servlet.http.HttpServletRequest request)
-
getPathPrefix
public static String getPathPrefix(GlobalContext globalContext, javax.servlet.http.HttpServletRequest request)
-
isHostDefineSite
public boolean isHostDefineSite()
-
isHostDefineSite
public static boolean isHostDefineSite(javax.servlet.http.HttpServletRequest request)
-
setHostDefineSite
public static void setHostDefineSite(javax.servlet.http.HttpServletRequest request, boolean hostDefineSite)
-
release
public void release()
-
isRefreshParent
public boolean isRefreshParent()
-
setRefreshParent
public void setRefreshParent(boolean refreshParent)
-
getParentURL
public String getParentURL()
-
setParentURL
public void setParentURL(String parentURL)
-
isClosePopup
public boolean isClosePopup()
-
setClosePopup
public void setClosePopup(boolean closePopup)
-
isEdition
public boolean isEdition()
-
isEditPreview
public boolean isEditPreview()
edit from a preview page- Returns:
-
setEditPreview
public void setEditPreview(boolean editPreview)
-
isEditPreview
public static boolean isEditPreview(javax.servlet.http.HttpServletRequest request)
-
setForcePathPrefix
public static void setForcePathPrefix(javax.servlet.ServletRequest request, String forcePathPrefix)
-
setForcePathPrefix
public void setForcePathPrefix(String forcePathPrefix)
-
isExport
public boolean isExport()
render component from export servelt (for expose only one component).- Returns:
-
setExport
public void setExport(boolean export)
-
getGlobalContext
public GlobalContext getGlobalContext()
-
setForceGlobalContext
public void setForceGlobalContext(GlobalContext forceGlobalContext)
-
isForceGlobalContext
public boolean isForceGlobalContext()
-
isContentFound
public boolean isContentFound()
-
setContentFound
public void setContentFound(boolean contentFound)
-
setContentContextIfNeeded
public boolean setContentContextIfNeeded(Object object)
set content context if Object implement interface INeedContentContext.- Parameters:
object- a object, if object don't implement INeedContentContext interface this method do nothing.- Returns:
- true if object implement INeedContentContext, false otherwise.
-
setVirtualCurrentPage
public void setVirtualCurrentPage(MenuElement virtualCurrentPage)
-
getVirtualCurrentPage
public MenuElement getVirtualCurrentPage()
-
getVirtualArea
public String getVirtualArea()
create a area to render content with other rules than area of content.- Returns:
-
setVirtualArea
public void setVirtualArea(String virtualArea)
-
isPageAssociation
public boolean isPageAssociation()
-
setPageAssociation
public void setPageAssociation(boolean pageAssociation)
-
getSpecificJson
public String getSpecificJson()
for return a specific ajax respones from dedicaded action.- Returns:
-
setSpecificJson
public void setSpecificJson(String specifixAjax)
-
getEditMode
public int getEditMode()
-
isComponentCache
public boolean isComponentCache()
-
setComponentCache
public void setComponentCache(boolean componentCache)
-
isInternalURL
public boolean isInternalURL()
don't use proxy for rendering (URL don't use getProxyPrefix on globalContext)- Returns:
-
setInternalURL
public void setInternalURL(boolean internalURL)
-
isCheckContentArea
public boolean isCheckContentArea()
-
setCheckContentArea
public void setCheckContentArea(boolean checkContentArea)
-
isPostRequest
public boolean isPostRequest()
-
setPostRequest
public void setPostRequest(boolean postRequest)
-
getTitleDepth
public int getTitleDepth()
-
setTitleDepth
public void setTitleDepth(int titleDepth)
-
isClearSession
public boolean isClearSession()
-
setClearSession
public void setClearSession(boolean clearSession)
-
getRemoteIp
public String getRemoteIp()
-
getRealRemoteIp
public String getRealRemoteIp()
-
getRealRemoteIp
public static String getRealRemoteIp(javax.servlet.http.HttpServletRequest request)
-
getRealRemoteIp
public String getRealRemoteIp(boolean anonymised)
-
getRealRemoteIp
public static String getRealRemoteIp(javax.servlet.http.HttpServletRequest request, boolean anonymised)
-
isForceCorrectPath
public boolean isForceCorrectPath()
-
setForceCorrectPath
public void setForceCorrectPath(boolean forceCorrectPath)
-
getNewContentContext
public ContentContext getNewContentContext()
-
setContentContent
public void setContentContent(ContentContext ctx)
-
getBean
public ContentContextBean getBean()
-
getMasterContentContext
public ContentContext getMasterContentContext() throws IOException
- Throws:
IOException
-
isUserWebSiteManager
public boolean isUserWebSiteManager()
current user (edit or view) can manager the current site.- Returns:
-
isContentStatic
public boolean isContentStatic()
-
isStopRendering
public boolean isStopRendering()
-
setStopRendering
public void setStopRendering(boolean stopRendering)
-
isOnlyArea
public boolean isOnlyArea()
-
isTakeScreenShort
public boolean isTakeScreenShort()
-
getColumnableSize
public int getColumnableSize(int depth)
-
setColumnableSize
public void setColumnableSize(int columnableSize, int depth)
-
getMainLanguage
public String getMainLanguage()
return the language of the inititial request (if language has changed)- Returns:
- null if the page displayed is the language asked by the visitor, the language of the visitor otherwise.
-
setMainLanguage
public void setMainLanguage(String mainLanguage)
-
mirrorDone
public boolean mirrorDone(String id)
-
isActionServlet
public boolean isActionServlet()
-
setActionServlet
public void setActionServlet(boolean actionServlet)
-
getColumnableDepth
public int getColumnableDepth()
-
setColumnableDepth
public void setColumnableDepth(int columnableDepth)
-
isNoCache
public boolean isNoCache()
-
setNoCache
public void setNoCache(boolean noCache)
-
getLocalCountry
public String getLocalCountry()
-
isProd
public boolean isProd()
-
setProd
public void setProd(Boolean prod)
-
getForcePageTitle
public String getForcePageTitle()
-
setForcePageTitle
public void setForcePageTitle(String forcePageTitle)
-
-