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 void
addAjaxData(String key, String value)
add a ajax zone for update.void
addAjaxInsideZone(String id, String xhtml)
add a ajax zone for update.void
addAjaxZone(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.String
getArea()
Object
getAttribute(String key)
ContentContextBean
getBean()
int
getColumnableDepth()
int
getColumnableSize(int depth)
static ContentContext
getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
static ContentContext
getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath)
static ContentContext
getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath, boolean pageManagement)
ContentContext
getContentContextForInternalLink()
static ContentContext
getContentContextNoPageManagement(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
String
getContentLanguage()
Deprecated.Prefer use ofgetRequestContentLanguage()
.ContentContext
getContextForAbsoluteURL()
ContentContext
getContextForAjax()
List<ContentContext>
getContextForAllLanguage()
ContentContext
getContextForDefaultLanguage()
String
getContextLanguage()
get the edit language in edit mode and view language if other mode.ContentContext
getContextNotEmpty(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.ContentContext
getContextOnPage(MenuElement page)
String
getContextRequestLanguage()
get the edit language in edit mode and view language if other mode.ContentContext
getContextWidthOtherRequestLanguage(String lang)
ContentContext
getContextWidthTitle(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.ContentContext
getContextWithArea(String area)
ContentContext
getContextWithContent(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.ContentContext
getContextWithContentDEBUG(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.ContentContext
getContextWithContentNeverNull(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.ContentContext
getContextWithInternalURL()
ContentContext
getContextWithOtherFormat(String format)
ContentContext
getContextWithOtherRenderMode(int mode)
ContentContext
getContextWithoutArea()
String
getCookieLanguage()
String
getCurrentAdminUserId()
User
getCurrentEditUser()
MenuElement
getCurrentPage()
MenuElement
getCurrentPageCached()
Template
getCurrentTemplate()
List<Template>
getCurrentTemplates()
User
getCurrentUser()
String
getCurrentUserId()
get the current user id.String
getCurrentUserIdNeverNull()
return a identifiant for the user (session id can be use if no user logged)Device
getDevice()
List<String>
getDeviceNames()
get all device accessible from current template.URL
getDMZServerInter()
int
getEditMode()
static ContentContext
getEmptyContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
get ContentContext without globalContextString
getForcePageTitle()
String
getFormat()
get the page format.ContentContext
getFreeContentContext()
static ContentContext
getFreeContentContext(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.GlobalContext
getGlobalContext()
String
getHomePageURL()
String
getHostName()
int
getHostPort()
String
getInputTrackingKey()
static String
getInputTrackingKey(javax.servlet.http.HttpSession session)
String
getLanguage()
String
getLocalCountry()
Locale
getLocale()
String
getMainLanguage()
return the language of the inititial request (if language has changed)ContentContext
getMasterContentContext()
ContentContext
getNewContentContext()
String
getParentURL()
String
getPath()
String
getPathPrefix()
String
getPathPrefix(javax.servlet.http.HttpServletRequest request)
static String
getPathPrefix(GlobalContext globalContext, javax.servlet.http.HttpServletRequest request)
String
getRealRemoteIp()
String
getRealRemoteIp(boolean anonymised)
static String
getRealRemoteIp(javax.servlet.http.HttpServletRequest request)
static String
getRealRemoteIp(javax.servlet.http.HttpServletRequest request, boolean anonymised)
String
getRemoteIp()
int
getRenderMode()
static String
getRenderModeKey(int mode)
javax.servlet.http.HttpServletRequest
getRequest()
String
getRequestContentLanguage()
String
getRequestContentLanguageRAW()
int
getRequestCountOnSession()
RequestService
getRequestService()
javax.servlet.http.HttpServletResponse
getResponse()
Map<String,AjaxHelper.ScheduledRender>
getScheduledAjaxInsideZone()
javax.servlet.ServletContext
getServletContext()
javax.servlet.http.HttpSession
getSession()
String
getSpecialContentRenderer()
String
getSpecificJson()
for return a specific ajax respones from dedicaded action.int
getTitleDepth()
IURLFactory
getURLFactory()
String
getURLProtocolPrefix()
String
getVirtualArea()
create a area to render content with other rules than area of content.MenuElement
getVirtualCurrentPage()
boolean
isAbsoluteURL()
boolean
isActionServlet()
boolean
isAjax()
boolean
isArray()
boolean
isAsEditMode()
boolean
isAsModifyMode()
boolean
isAsPageMode()
boolean
isAsPreviewMode()
boolean
isAsTimeMode()
boolean
isAsViewMode()
boolean
isCanUndo()
boolean
isCheckContentArea()
boolean
isClearSession()
boolean
isClosePopup()
boolean
isComponentCache()
static boolean
isContentContext(javax.servlet.http.HttpServletRequest request)
check if there are a contentcontext in the requestboolean
isContentFound()
boolean
isContentStatic()
boolean
isEdit()
boolean
isEdition()
boolean
isEditPreview()
edit from a preview pagestatic boolean
isEditPreview(javax.servlet.http.HttpServletRequest request)
boolean
isExport()
render component from export servelt (for expose only one component).boolean
isForceCorrectPath()
boolean
isForceGlobalContext()
boolean
isFree()
no need template and link to page context.boolean
isHostDefineSite()
static boolean
isHostDefineSite(javax.servlet.http.HttpServletRequest request)
boolean
isInteractiveMode()
boolean
isInternalURL()
don't use proxy for rendering (URL don't use getProxyPrefix on globalContext)boolean
isLikeEditRenderMode()
check if mode is assimilable to edit mode.boolean
isLikeViewRenderMode()
check if mode is assimilable to view mode.boolean
isMobile()
boolean
isNeedRefresh()
boolean
isNoCache()
boolean
isOnlyArea()
boolean
isPageAssociation()
boolean
isPageRequest()
return if the current request is for a page access and not a resource (jsp, img, js...)boolean
isPostRequest()
boolean
isPreview()
boolean
isPreviewEditionMode()
return true if content is editable in preview modeboolean
isPreviewOnly()
return true if render mode in preview only (no tools displayed, like view mode with preview data)boolean
isProd()
boolean
isRefreshParent()
boolean
isResourceGZip()
return true if link can be linked to gzipboolean
isStopRendering()
boolean
isTakeScreenShort()
boolean
isTime()
boolean
isTrackingContext()
true if the current request must be tracked.boolean
isUserWebSiteManager()
current user (edit or view) can manager the current site.boolean
isViewPrefix()
boolean
isVisible()
boolean
isVisualMode()
static void
main(String[] args)
boolean
mirrorDone(String id)
void
release()
protected void
resetCache()
void
resetCurrentPageCached()
void
resetDMZServerInter()
reset DMZ for force local absolute URL.void
scheduleAjaxInsideZone(String id, String uri, Map<String,Object> attributes)
Schedule an ajax zone for update.void
sendRedirect(String url)
redirect.void
setAbsoluteURL(boolean isAbsoluteURL)
void
setActionServlet(boolean actionServlet)
ContentContext
setAjax(boolean ajax)
void
setAjaxMap(Map<? extends Object,? extends Object> ajaxMap)
void
setAllLanguage(String lg)
setLanguage, setContentLanguage and setRequestContentLanguage with a lgvoid
setArea(String area)
void
setArray(boolean array)
void
setAttribute(String key, Object obj)
void
setCheckContentArea(boolean checkContentArea)
void
setClearSession(boolean clearSession)
void
setClosePopup(boolean closePopup)
void
setColumnableDepth(int columnableDepth)
void
setColumnableSize(int columnableSize, int depth)
void
setComponentCache(boolean componentCache)
void
setContentContent(ContentContext ctx)
boolean
setContentContextIfNeeded(Object object)
set content context if Object implement interface INeedContentContext.void
setContentFound(boolean contentFound)
void
setContentLanguage(String lg)
void
setContextRequestLanguage(String lg)
void
setCookieLanguage(String lang)
void
setCurrentPageCached(MenuElement currentPageCached)
void
setCurrentTemplate(Template template)
boolean
setCurrentTemplateId(String templateId)
set the current template with id.void
setDefaultArea()
void
setDevice(Device device)
void
setEdit(boolean b)
Deprecated.use setRenderMode()void
setEditPreview(boolean editPreview)
void
setExport(boolean export)
void
setForceCorrectPath(boolean forceCorrectPath)
void
setForceGlobalContext(GlobalContext forceGlobalContext)
void
setForcePageTitle(String forcePageTitle)
void
setForcePathPrefix(String forcePathPrefix)
static void
setForcePathPrefix(javax.servlet.ServletRequest request, String forcePathPrefix)
ContentContext
setFormat(String format)
force formatvoid
setFree(boolean free)
no need template and link to page context.static void
setHostDefineSite(javax.servlet.http.HttpServletRequest request, boolean hostDefineSite)
void
setHostName(String inHost)
void
setHostPort(int port)
void
setInternalURL(boolean internalURL)
void
setLanguage(String lg)
void
setMainLanguage(String mainLanguage)
void
setNeedRefresh(boolean needRefresh)
void
setNoCache(boolean noCache)
void
setPageAssociation(boolean pageAssociation)
void
setPageRequest(boolean pageRequest)
void
setParentURL(String parentURL)
void
setPath(String newPath)
void
setPostRequest(boolean postRequest)
void
setPreview(boolean b)
Deprecated.use setRenderMode()void
setProd(Boolean prod)
void
setRefreshParent(boolean refreshParent)
void
setRenderMode(int renderMode)
void
setRequest(javax.servlet.http.HttpServletRequest request)
void
setRequestContentLanguage(String lg)
void
setResponse(javax.servlet.http.HttpServletResponse response)
void
setSpecialContentRenderer(String specialContent)
void
setSpecificJson(String specifixAjax)
void
setStopRendering(boolean stopRendering)
void
setTitleDepth(int titleDepth)
void
setURLFactory(IURLFactory urlFactory)
void
setURLProtocolPrefix(String protocol)
void
setViewPrefix(boolean viewPrefix)
void
setVirtualArea(String virtualArea)
void
setVirtualCurrentPage(MenuElement virtualCurrentPage)
void
setVisible(boolean b)
void
storeInRequest(javax.servlet.http.HttpServletRequest request)
void
toStream(OutputStream outStream)
trace info on streamString
toString()
-
-
-
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 Exception
return 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)
-
-