public class ContentContext extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CHANGE_AREA_ATTRIBUTE_NAME |
static String |
CHARACTER_ENCODING |
static Charset |
CHARSET_DEFAULT |
static String |
CLEAR_SESSION_PARAM |
Boolean |
contentExistForContext |
static String |
CONTEXT_REQUEST_KEY |
WeakReference<MenuElement> |
currentPageCached |
static int |
EDIT_MODE |
Boolean |
editPreview |
static String |
FORCE_ABSOLUTE_URL |
static String |
FORCE_MODE_PARAMETER_NAME |
static String |
FORCED_CONTENT_PREFIX |
static String |
FORWARD_AJAX |
static String |
FORWARD_PATH_REQUEST_KEY |
protected static Logger |
logger
create a static logger.
|
static int |
MAILING_MODE |
static int |
MODULE_MODE |
static String |
NO_DMZ_PARAM_NAME
param for render content with link to local server and not DMZ server.
|
static int |
PAGE_MODE |
static String |
PREVIEW_EDIT_PARAM |
static int |
PREVIEW_MODE |
static String |
PREVIEW_ONLY_MODE |
static String |
PRODUCT_NAME |
static String |
TAKE_SCREENSHOT |
static int |
TIME_MODE |
static int |
VIEW_MODE |
Constructor and Description |
---|
ContentContext(ContentContext ctx) |
Modifier and Type | Method and 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() |
ContentContextBean |
getBean() |
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) |
ContentContext |
getContentContextForInternalLink() |
String |
getContentLanguage()
Deprecated.
Prefer use of
getRequestContentLanguage() . |
ContentContext |
getContextForAbsoluteURL() |
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() |
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 globalContext
|
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 |
getLanguage() |
Locale |
getLocale() |
ContentContext |
getMasterContentContext() |
ContentContext |
getNewContentContext() |
String |
getParentURL() |
String |
getPath() |
String |
getPathPrefix() |
static String |
getPathPrefix(GlobalContext globalContext,
javax.servlet.http.HttpServletRequest request) |
String |
getPathPrefix(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() |
RequestService |
getRequestService() |
javax.servlet.http.HttpServletResponse |
getResponse() |
Map<String,AjaxHelper.ScheduledRender> |
getScheduledAjaxInsideZone() |
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()
use for render page with some references to other page (sample :
mirrorPage, renderImage with filter rule of the template of mirror
component and not source page).
|
boolean |
isAbsoluteURL() |
boolean |
isAjax() |
boolean |
isArray() |
boolean |
isAsEditMode() |
boolean |
isAsModifyMode() |
boolean |
isAsPageMode() |
boolean |
isAsPreviewMode() |
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 request
|
boolean |
isContentFound() |
boolean |
isContentStatic() |
boolean |
isEdit() |
boolean |
isEdition() |
boolean |
isEditPreview()
edit from a preview page
|
static 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 |
isNeedRefresh() |
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 |
isPreviewOnly()
return true if render mode in preview only (no tools displayed, like view mode with preview data)
|
boolean |
isRefreshParent() |
boolean |
isResourceGZip()
return true if link can be linked to gzip
|
boolean |
isStopRendering() |
boolean |
isTakeScreenShort() |
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) |
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 |
setAjax(boolean ajax) |
void |
setAjaxMap(Map<? extends Object,? extends Object> ajaxMap) |
void |
setAllLanguage(String lg)
setLanguage, setContentLanguage and setRequestContentLanguage with a lg
|
void |
setArea(String area) |
void |
setArray(boolean array) |
void |
setCheckContentArea(boolean checkContentArea) |
void |
setClearSession(boolean clearSession) |
void |
setClosePopup(boolean closePopup) |
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) |
static void |
setForcePathPrefix(javax.servlet.ServletRequest request,
String forcePathPrefix) |
void |
setForcePathPrefix(String forcePathPrefix) |
void |
setFormat(String format)
force format
|
void |
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 |
setNeedRefresh(boolean needRefresh) |
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 |
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 stream
|
String |
toString() |
public static final String PREVIEW_ONLY_MODE
public static final String PREVIEW_EDIT_PARAM
public static final String TAKE_SCREENSHOT
public static final int EDIT_MODE
public static final int VIEW_MODE
public static final int PREVIEW_MODE
public static final int PAGE_MODE
public static final int MAILING_MODE
public static final int TIME_MODE
public static final int MODULE_MODE
public static final String FORWARD_PATH_REQUEST_KEY
public static final String FORWARD_AJAX
public static final String FORCE_MODE_PARAMETER_NAME
public static final String CHANGE_AREA_ATTRIBUTE_NAME
public static final String FORCE_ABSOLUTE_URL
public static String CHARACTER_ENCODING
public static Charset CHARSET_DEFAULT
public static String PRODUCT_NAME
public static String FORCED_CONTENT_PREFIX
public static final String NO_DMZ_PARAM_NAME
public static final String CLEAR_SESSION_PARAM
protected static Logger logger
public static String CONTEXT_REQUEST_KEY
public WeakReference<MenuElement> currentPageCached
public Boolean contentExistForContext
public Boolean editPreview
public ContentContext(ContentContext ctx)
public static ContentContext getFreeContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
request
- response
- Exception
public static ContentContext getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Exception
public ContentContext getContentContextForInternalLink()
public static ContentContext getContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean correctPath) throws Exception
request
- response
- correctPath
- true for search real page and construct new path with this
page.Exception
public static boolean isContentContext(javax.servlet.http.HttpServletRequest request)
request
- public static String getRenderModeKey(int mode)
public static ContentContext getEmptyContentContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
request
- response
- Exception
public String getArea()
@Deprecated public String getContentLanguage()
getRequestContentLanguage()
.Exception
public ContentContext getFreeContentContext()
public List<ContentContext> getContextForAllLanguage()
public ContentContext getContextWithoutArea()
public ContentContext getContextWithOtherFormat(String format)
public ContentContext getContextWithArea(String area)
public ContentContext getContextWithOtherRenderMode(int mode)
public ContentContext getContextWidthOtherRequestLanguage(String lang)
public ContentContext getContextWithInternalURL()
public String getContextLanguage()
public ContentContext getContextWithContent(MenuElement page) throws Exception
Exception
public ContentContext getContextNotEmpty(MenuElement page) throws Exception
Exception
public ContentContext getContextWidthTitle(MenuElement page) throws Exception
Exception
public ContentContext getContextWithContentDEBUG(MenuElement page) throws Exception
Exception
public ContentContext getContextWithContentNeverNull(MenuElement page) throws Exception
Exception
public ContentContext getContextOnPage(MenuElement page) throws Exception
Exception
public ContentContext getContextForAbsoluteURL()
public String getContextRequestLanguage()
public void setContextRequestLanguage(String lg)
public ContentContext getContextForDefaultLanguage()
public String getCookieLanguage()
public MenuElement getCurrentPage() throws Exception
Exception
public MenuElement getCurrentPageCached()
public MenuElement getVirtualCurrentPage() throws Exception
Exception
public Device getDevice()
public List<String> getDeviceNames() throws Exception
Exception
public URL getDMZServerInter()
public void resetDMZServerInter()
public String getHostName()
public int getHostPort()
public String getLanguage()
public Locale getLocale()
public String getPath()
public int getRenderMode()
public javax.servlet.http.HttpServletRequest getRequest()
public RequestService getRequestService()
public String getRequestContentLanguage()
public String getRequestContentLanguageRAW()
public javax.servlet.http.HttpServletResponse getResponse()
public void sendRedirect(String url) throws IOException
url
- IOException
public String getSpecialContentRenderer()
public IURLFactory getURLFactory()
public void setURLFactory(IURLFactory urlFactory)
public String getURLProtocolPrefix()
public boolean isAbsoluteURL()
public boolean isAjax()
public boolean isArray()
public boolean isAsModifyMode()
public boolean isAsPreviewMode()
public boolean isAsPageMode()
public boolean isAsEditMode()
public boolean isAsViewMode()
public boolean isVisualMode()
public boolean isTrackingContext()
public boolean isEdit()
public boolean isInteractiveMode()
public boolean isNeedRefresh()
public boolean isPreview()
public boolean isPreviewOnly()
public boolean isViewPrefix()
public void setViewPrefix(boolean viewPrefix)
public boolean isVisible()
protected void resetCache()
public void setAbsoluteURL(boolean isAbsoluteURL)
public void setAjax(boolean ajax)
public boolean isPageRequest()
public void setPageRequest(boolean pageRequest)
public void setAllLanguage(String lg)
lg
- public void setArea(String area)
public void setDefaultArea()
public void setArray(boolean array)
public void setContentLanguage(String lg)
public void setCookieLanguage(String lang)
public void setCurrentPageCached(MenuElement currentPageCached) throws Exception
Exception
public void resetCurrentPageCached()
public void setDevice(Device device)
@Deprecated public void setEdit(boolean b)
b
- public void setHostName(String inHost)
public void setHostPort(int port)
public void setLanguage(String lg)
lg
- public void setNeedRefresh(boolean needRefresh)
public void setPath(String newPath)
string
- a logical path@Deprecated public void setPreview(boolean b)
b
- public void setRenderMode(int renderMode)
public void setRequest(javax.servlet.http.HttpServletRequest request)
request
- public void setRequestContentLanguage(String lg)
public void setResponse(javax.servlet.http.HttpServletResponse response)
response
- public void setSpecialContentRenderer(String specialContent)
public void setURLProtocolPrefix(String protocol)
public void setVisible(boolean b)
b
- public void storeInRequest(javax.servlet.http.HttpServletRequest request)
public void toStream(OutputStream outStream)
out
- public User getCurrentUser()
public User getCurrentEditUser()
public String getCurrentUserId()
public String getCurrentUserIdNeverNull()
public Map<String,String> getAjaxInsideZone()
public Map<String,Object> getAjaxData()
public Map<String,AjaxHelper.ScheduledRender> getScheduledAjaxInsideZone()
public void addAjaxData(String key, String value)
id
- a xhtml idxhtml
- the new content of the zonepublic void addAjaxInsideZone(String id, String xhtml)
id
- a xhtml idxhtml
- the new content of the zonepublic void scheduleAjaxInsideZone(String id, String uri, Map<String,Object> attributes)
id
- a xhtml idxhtml
- the new content of the zonepublic Map<String,String> getAjaxZone()
public void addAjaxZone(String id, String xhtml)
id
- a xhtml idxhtml
- the new content of the zonepublic boolean isLikeViewRenderMode()
public boolean isLikeEditRenderMode()
public String getFormat()
public void setFormat(String format)
format
- sample : pdf, html, png...public boolean setCurrentTemplateId(String templateId)
templateId
- public void setCurrentTemplate(Template template)
public boolean isResourceGZip() throws Exception
Exception
public boolean isFree()
public void setFree(boolean free)
tree
- public String getHomePageURL()
public static void main(String[] args)
public String getPathPrefix()
public String getPathPrefix(javax.servlet.http.HttpServletRequest request)
public static String getPathPrefix(GlobalContext globalContext, javax.servlet.http.HttpServletRequest request)
public boolean isHostDefineSite()
public static boolean isHostDefineSite(javax.servlet.http.HttpServletRequest request)
public static void setHostDefineSite(javax.servlet.http.HttpServletRequest request, boolean hostDefineSite)
public void release()
public boolean isRefreshParent()
public void setRefreshParent(boolean refreshParent)
public String getParentURL()
public void setParentURL(String parentURL)
public boolean isClosePopup()
public void setClosePopup(boolean closePopup)
public boolean isEdition()
public boolean isEditPreview()
public void setEditPreview(boolean editPreview)
public static boolean isEditPreview(javax.servlet.http.HttpServletRequest request)
public static void setForcePathPrefix(javax.servlet.ServletRequest request, String forcePathPrefix)
public void setForcePathPrefix(String forcePathPrefix)
public boolean isExport()
public void setExport(boolean export)
public GlobalContext getGlobalContext()
public void setForceGlobalContext(GlobalContext forceGlobalContext)
public boolean isForceGlobalContext()
public boolean isContentFound()
public void setContentFound(boolean contentFound)
public boolean setContentContextIfNeeded(Object object)
object
- a object, if object don't implement INeedContentContext
interface this method do nothing.public void setVirtualCurrentPage(MenuElement virtualCurrentPage)
public String getVirtualArea()
public void setVirtualArea(String virtualArea)
public boolean isPageAssociation()
public void setPageAssociation(boolean pageAssociation)
public String getSpecificJson()
public void setSpecificJson(String specifixAjax)
public int getEditMode()
public boolean isComponentCache()
public void setComponentCache(boolean componentCache)
public boolean isInternalURL()
public void setInternalURL(boolean internalURL)
public boolean isCheckContentArea()
public void setCheckContentArea(boolean checkContentArea)
public boolean isPostRequest()
public void setPostRequest(boolean postRequest)
public int getTitleDepth()
public void setTitleDepth(int titleDepth)
public boolean isClearSession()
public void setClearSession(boolean clearSession)
public String getRemoteIp()
public String getRealRemoteIp()
public static String getRealRemoteIp(javax.servlet.http.HttpServletRequest request)
public String getRealRemoteIp(boolean anonymised)
public static String getRealRemoteIp(javax.servlet.http.HttpServletRequest request, boolean anonymised)
public boolean isForceCorrectPath()
public void setForceCorrectPath(boolean forceCorrectPath)
public ContentContext getNewContentContext()
public void setContentContent(ContentContext ctx)
public ContentContextBean getBean()
public ContentContext getMasterContentContext() throws IOException
IOException
public boolean isUserWebSiteManager()
public boolean isContentStatic()
public boolean isStopRendering()
public void setStopRendering(boolean stopRendering)
public boolean isOnlyArea()
public boolean isTakeScreenShort()
Copyright © 2012-2018. All Rights Reserved.