Package lumis.portal.presentation
Class PresentationControllerHtml
- java.lang.Object
-
- lumis.portal.controller.ControllerHtml
-
- lumis.portal.presentation.PresentationControllerHtml
-
- Direct Known Subclasses:
XsltResultControllerHtml
public class PresentationControllerHtml extends ControllerHtml
Entry class for page rendering. Called by main.jsp.- Since:
- 4.0.0
- Version:
- $Revision: 25475 $ $Date: 2023-02-27 17:42:56 -0300 (Mon, 27 Feb 2023) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PresentationControllerHtml.DataPreviewMode
protected class
PresentationControllerHtml.PresentationPageRenderer
IPageRenderer
implementation used byPresentationControllerHtml
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE_ORIGINAL_URI
The name of the attribute where the original URI should be stored when performing a dispatch to this controller.protected java.lang.String
browserInfo
protected ChannelConfig
channelConfig
protected java.lang.String
channelPath
static java.lang.String
CONTENT_IS_NOT_PUBLISHED_ERROR_REASON
static java.lang.String
CONTENT_IS_NOT_PUBLISHED_FOR_USER_ERROR_REASON
protected PresentationControllerHtml.DataPreviewMode
dataPreviewMode
static java.lang.String
ERROR_REASON_HEADER_NAME
protected java.lang.String
executedProcessActionServiceInterfaceInstanceId
The identifier of the service interface instance that was the target of a process action executed in the current request.protected java.lang.String
highlightInterfaceInst
protected boolean
isPrinting
protected boolean
isSafeRenderMode
protected java.util.Map<java.lang.String,FileParameter>
multiPartFormFileParameters
protected java.util.Map<java.lang.String,java.lang.String[]>
multiPartFormParameters
protected java.lang.String
multiPartFormServiceInterfaceInstance
protected java.lang.String
navigationPaneHidden
protected PageConfig
pageConfig
protected IPageRenderer
pageRenderer
protected PageWebResourceData
pageWebResourceData
protected PortalRequestParameters
parameters
protected java.util.List<java.lang.String>
parentChannelIds
protected IPortalMode
portalMode
protected java.lang.String
previousParametersXmlString
protected java.lang.String
processActionRedirectDestination
protected java.io.File
rawRequestInputFile
The file where the raw request input content is stored.protected ReplaceInterfacesStorage
replaceInterfacesStorage
protected IResource
resource
protected ChannelConfig
rootChannel
protected ServiceContainer
serviceContainer
protected java.lang.String
splitterPosition
protected java.lang.String
uploadDir
protected PageWebResource
webResource
-
Fields inherited from class lumis.portal.controller.ControllerHtml
out, request, response, sessionConfig, userConfig
-
-
Constructor Summary
Constructors Constructor Description PresentationControllerHtml(HttpServletRequest request, HttpServletResponse response, PageContext pageContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addMultiPartFormParameter(java.lang.String parameterName, java.lang.String parameterValue)
Adds a multipart form parameter.protected void
checkForFileUpload(ITransaction transaction)
protected boolean
checkForProtocolRedirect(ITransaction portalTransaction)
static void
forward(java.lang.String path, HttpServletRequest request, HttpServletResponse response)
Forwards a request to the presentation controller.protected java.lang.String
getGeneratorPageCacheId()
Returns the identifier of the page cache the current request is generating.static PageWebResource
getPageWebResourceBeingRendered(HttpServletRequest request)
Returns the page web resource being rendered in the given request (if any).protected boolean
hasProcessAction()
protected void
prepareForPageRendering(ITransaction portalTransaction)
Performs any initialization required before page rendering.protected ITransaction
processActionIfRequired(ITransaction portalTransaction)
Checks to see if an action is to be processed.protected void
renderLayoutFile()
Renders the layout file for the currentpageRenderer
.void
renderPage()
Renders a portal page.protected void
renderPagePortalSettingsMode(ITransaction portalTransaction)
Renders the page in portal settings mode .protected void
renderPagePortalStudioMode(ITransaction portalTransaction)
Renders the page in portal studio mode .protected void
renderPagePublisherMode(ITransaction portalTransaction)
Renders the page in publisher perspective.protected void
renderPageUserMode(ITransaction portalTransaction)
Render the page in UserMode.protected void
setBrowserInfo()
Stores the request header HTTP_USER_AGENT value in a member variableprotected void
setDataPreviewMode(ITransaction portalTransaction)
Sets the Page Preview Mode.protected void
setLocale()
If necessary, updates the locale of the current session according to the web resource being accessed.protected void
setPageInfo(ITransaction portalTransaction)
This method calls thepresentationManager.getDefaultPage
to calculate the page that needs to be rendered.protected void
setPageMode(ITransaction portalTransaction)
Sets the Page Mode.protected void
setUACompatibleHeader()
Sets a new HTTP Header with the value stored in the property lumis.portal.presentation.X-UA-Compatible.protected void
setWebResource(ITransaction transaction)
SetswebResource
with the web resource instance for the current request.protected AccessError
validatePageAccess(ITransaction transaction)
-
Methods inherited from class lumis.portal.controller.ControllerHtml
checkRequestIsPost, deleteCookie, getCookie, getRequestMode, getSessionConfig, loadUserInfo, setCookie
-
-
-
-
Field Detail
-
CONTENT_IS_NOT_PUBLISHED_ERROR_REASON
public static final java.lang.String CONTENT_IS_NOT_PUBLISHED_ERROR_REASON
- See Also:
- Constant Field Values
-
CONTENT_IS_NOT_PUBLISHED_FOR_USER_ERROR_REASON
public static final java.lang.String CONTENT_IS_NOT_PUBLISHED_FOR_USER_ERROR_REASON
- See Also:
- Constant Field Values
-
ERROR_REASON_HEADER_NAME
public static final java.lang.String ERROR_REASON_HEADER_NAME
- See Also:
- Constant Field Values
-
ATTRIBUTE_ORIGINAL_URI
public static final java.lang.String ATTRIBUTE_ORIGINAL_URI
The name of the attribute where the original URI should be stored when performing a dispatch to this controller.- Since:
- 5.0.0
- See Also:
- Constant Field Values
-
browserInfo
protected java.lang.String browserInfo
-
pageConfig
protected PageConfig pageConfig
-
webResource
protected PageWebResource webResource
-
channelConfig
protected ChannelConfig channelConfig
-
channelPath
protected java.lang.String channelPath
-
resource
protected IResource resource
-
serviceContainer
protected ServiceContainer serviceContainer
-
portalMode
protected IPortalMode portalMode
-
isSafeRenderMode
protected boolean isSafeRenderMode
-
parameters
protected PortalRequestParameters parameters
-
previousParametersXmlString
protected java.lang.String previousParametersXmlString
-
splitterPosition
protected java.lang.String splitterPosition
-
navigationPaneHidden
protected java.lang.String navigationPaneHidden
-
processActionRedirectDestination
protected java.lang.String processActionRedirectDestination
-
isPrinting
protected boolean isPrinting
-
multiPartFormParameters
protected java.util.Map<java.lang.String,java.lang.String[]> multiPartFormParameters
-
multiPartFormFileParameters
protected java.util.Map<java.lang.String,FileParameter> multiPartFormFileParameters
-
multiPartFormServiceInterfaceInstance
protected java.lang.String multiPartFormServiceInterfaceInstance
-
uploadDir
protected java.lang.String uploadDir
-
parentChannelIds
protected java.util.List<java.lang.String> parentChannelIds
-
rootChannel
protected ChannelConfig rootChannel
-
dataPreviewMode
protected PresentationControllerHtml.DataPreviewMode dataPreviewMode
-
highlightInterfaceInst
protected java.lang.String highlightInterfaceInst
-
pageWebResourceData
protected PageWebResourceData pageWebResourceData
-
pageRenderer
protected IPageRenderer pageRenderer
-
replaceInterfacesStorage
protected ReplaceInterfacesStorage replaceInterfacesStorage
-
executedProcessActionServiceInterfaceInstanceId
protected java.lang.String executedProcessActionServiceInterfaceInstanceId
The identifier of the service interface instance that was the target of a process action executed in the current request.- Since:
- 5.5.0
-
rawRequestInputFile
protected java.io.File rawRequestInputFile
The file where the raw request input content is stored.- Since:
- 5.5.0
-
-
Constructor Detail
-
PresentationControllerHtml
public PresentationControllerHtml(HttpServletRequest request, HttpServletResponse response, PageContext pageContext) throws ControllerException, PortalException
- Throws:
ControllerException
PortalException
-
-
Method Detail
-
renderPage
public void renderPage() throws ControllerException, PortalException
Renders a portal page. Based on the logged on user, pageId passed and channelId passed in the request query string, this method calculates and renders the appropriate page. This method also checks if there is a ProcessAction to be handled before rendering the page. Based on the page mode, this method either calls#renderPageAdminMode
orrenderPage()
- Throws:
ControllerException
PortalException
-
prepareForPageRendering
protected void prepareForPageRendering(ITransaction portalTransaction) throws PortalException
Performs any initialization required before page rendering. Called before rendering Admin or User mode.- Parameters:
portalTransaction
-- Throws:
PortalException
- Since:
- 4.2.0
-
setPageMode
protected void setPageMode(ITransaction portalTransaction) throws ControllerException, PortalException
Sets the Page Mode. This could either bePortalContext.MODE_ADMIN
, orPortalContext.MODE_USER
.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
setDataPreviewMode
protected void setDataPreviewMode(ITransaction portalTransaction) throws ControllerException, PortalException
Sets the Page Preview Mode. This could either betrue
, orfalse
.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
renderPageUserMode
protected void renderPageUserMode(ITransaction portalTransaction) throws ControllerException, PortalException
Render the page in UserMode.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
forward
public static void forward(java.lang.String path, HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
Forwards a request to the presentation controller.- Parameters:
path
- the path for the forward.request
- the request.response
- the response.- Throws:
ServletException
java.io.IOException
- Since:
- 5.0.0
- See Also:
ServletRequest.getRequestDispatcher(String)
,RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
-
setBrowserInfo
protected void setBrowserInfo()
Stores the request header HTTP_USER_AGENT value in a member variable- Parameters:
portalTransaction
-
-
setWebResource
protected void setWebResource(ITransaction transaction) throws PortalException
SetswebResource
with the web resource instance for the current request.- Parameters:
transaction
- transaction for persistence access.- Throws:
PortalException
- Since:
- 5.0.0
-
setLocale
protected void setLocale()
If necessary, updates the locale of the current session according to the web resource being accessed.- Since:
- 6.0.1
-
setPageInfo
protected void setPageInfo(ITransaction portalTransaction) throws ControllerException, PortalException
This method calls thepresentationManager.getDefaultPage
to calculate the page that needs to be rendered. If the presentation manager could not calculate the page, the user is redirected to lumisadmin.jsp page. If the destination page is the framework blank page, the mode of the page is forced to PortalContext.MODE_USER since the blank page should never be modified in terms of layout etc. If runtime interface and service instance is specified, the appropriate values are added to the page config.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
validatePageAccess
protected AccessError validatePageAccess(ITransaction transaction) throws PortalException
- Throws:
PortalException
-
checkForProtocolRedirect
protected boolean checkForProtocolRedirect(ITransaction portalTransaction) throws ControllerException, PortalException
- Throws:
ControllerException
PortalException
-
processActionIfRequired
protected ITransaction processActionIfRequired(ITransaction portalTransaction) throws ControllerException, PortalException
Checks to see if an action is to be processed. This is detected based on the page parameterPageConfig.PAGE_PARAMETER_PROCESS_ACTION
has the value of 1. Once the ProcessAction is handled, the returned render parameters are remembered to pass on to the interface instance that initiated the process action. If no render parameters are returned, the interface instance that initiated the process action will not receive any parameters for its render method.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
hasProcessAction
protected boolean hasProcessAction()
-
renderPagePortalStudioMode
protected void renderPagePortalStudioMode(ITransaction portalTransaction) throws ControllerException, PortalException
Renders the page in portal studio mode . When the page is rendered in this mode, several additional javascript files need to be included in the page. Besides the javascript, the navigationPane, workPane, splitter and header need to be rendered as well.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
renderPagePortalSettingsMode
protected void renderPagePortalSettingsMode(ITransaction portalTransaction) throws ControllerException, PortalException
Renders the page in portal settings mode . When the page is rendered in this mode, several additional javascript files need to be included in the page. Besides the javascript, the navigationPane, workPane, splitter and header need to be rendered as well.- Parameters:
portalTransaction
-- Throws:
ControllerException
PortalException
-
renderPagePublisherMode
protected void renderPagePublisherMode(ITransaction portalTransaction) throws ControllerException, PortalException
Renders the page in publisher perspective. When the page is rendered in publisher perspective, several additional javascript files need to be included in the page. Besides the javascript, the navigationPane, workPane, splitter and header need to be rendered as well.- Parameters:
portalTransaction
- the current transaction- Throws:
ControllerException
PortalException
-
renderLayoutFile
protected void renderLayoutFile() throws ServletException, java.io.IOException
Renders the layout file for the currentpageRenderer
.- Throws:
ServletException
- if an exception is thrown during the layout file processing.java.io.IOException
- if an exception is thrown during the output to the response.- Since:
- 5.6.0
-
getGeneratorPageCacheId
protected java.lang.String getGeneratorPageCacheId()
Returns the identifier of the page cache the current request is generating.- Returns:
- the page cache identifier, or
null
if the current request is not for generating a page cache. - Since:
- 5.0.0
-
checkForFileUpload
protected void checkForFileUpload(ITransaction transaction) throws PortalException
- Throws:
PortalException
-
addMultiPartFormParameter
protected void addMultiPartFormParameter(java.lang.String parameterName, java.lang.String parameterValue)
Adds a multipart form parameter. This method checks if a parameter with the same name was previously included. If so, the new parameter value is appended to the end of the values array.- Parameters:
parameterName
- The name of the parameter.parameterValue
- The value of the parameter.- Since:
- 4.2.0
-
setUACompatibleHeader
protected void setUACompatibleHeader() throws PortalException
Sets a new HTTP Header with the value stored in the property lumis.portal.presentation.X-UA-Compatible. If the property is not defined the default value, IE=edge, will be used.- Throws:
PortalException
- Since:
- 7.0.0
-
getPageWebResourceBeingRendered
public static PageWebResource getPageWebResourceBeingRendered(HttpServletRequest request)
Returns the page web resource being rendered in the given request (if any).- Parameters:
request
- the request.- Returns:
- the page web resource being rendered in the given request (if any).
- Since:
- 10.2.0
-
-