Class ContentContext

    • Constructor Detail

    • 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()
      • getFreeContentContext

        public ContentContext getFreeContentContext()
      • getContextWithoutArea

        public ContentContext getContextWithoutArea()
      • getContextWithOtherRenderMode

        public ContentContext getContextWithOtherRenderMode​(int mode)
      • 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
      • 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()
      • 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()
      • getRequestContentLanguage

        public String getRequestContentLanguage()
      • getRequestContentLanguageRAW

        public String getRequestContentLanguageRAW()
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
        Returns:
      • getSpecialContentRenderer

        public String getSpecialContentRenderer()
      • 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)
      • 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)
      • 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.
      • addAjaxData

        public void addAjaxData​(String key,
                                String value)
        add a ajax zone for update.
        Parameters:
        id - a xhtml id
        xhtml - the new content of the zone
      • addAjaxInsideZone

        public void addAjaxInsideZone​(String id,
                                      String xhtml)
        add a ajax zone for update.
        Parameters:
        id - a xhtml id
        xhtml - 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 id
        xhtml - 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 id
        xhtml - the new content of the zone
      • setAjaxMap

        public void setAjaxMap​(Map<? extends Object,​? extends Object> ajaxMap)
      • getAjaxMap

        public Map<? extends Object,​? extends Object> getAjaxMap()
      • 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)
      • 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)
      • setContentContent

        public void setContentContent​(ContentContext ctx)
      • 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)
      • setAttribute

        public void setAttribute​(String key,
                                 Object obj)
      • 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)