Class PresentationData
- All Implemented Interfaces:
IPresentationData
,Serializable
,Cloneable
,Map<Object,
Object>
public abstract class PresentationData
extends HashMap<Object,Object>
implements IPresentationData, Serializable, Cloneable
An instance of this class is available on every request handled by the Portal servlet.
To access this instance, use the static method getPresentationData(javax.servlet.http.HttpServletRequest)
.
This instance is initialized with data useful in presenting a response to the request,
including
- the primary object representing the requested resource (see
IPresentationData.getDataObject()
) - the portal id of that object (see
IPresentationData.getResourceID()
) - web-app context path (see
IPresentationData.getContextPath()
) and servlet path (seeIPresentationData.getCanonicalServletPath()
) - other miscellaneous useful information
The web-app context path is useful when drawing a link to a static web resource hosted by the portal, such as an image. To draw a link to an image in the portal war '/ui/images/' directory, you could use the following JSP snippet:
<img src="<%=presentationbean.getContextPath().length > 1
? presentationbean.getContextPath() + "/"
: presentationbean.getContextPath()%>ui/images/myimage.gif" />
The full servlet path is useful when drawing a link to an aliased portal resource,
such as a folder or portlet. To draw a link to the Public Folders using its alias,
you could use the following JSP snippet:
<a href="<%=presentationbean.getFullServletPath()%>folder.public">
Public Folders
</a>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields inherited from interface com.webmethods.portal.framework.presentation.IPresentationData
DATA_DIRECTORY, DATA_DS_PRINCIPAL, DATA_EMPTY, DATA_FORWARD, DATA_READER, DATA_REDIRECT, DATA_STREAM, DATA_STRING, DATA_THING, DATA_UNKNOWN, DATA_VERSION, DATA_W3C_NODE, ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a shallow copy of this.static PresentationData
getPresentationData
(HttpServletRequest request) Retrieves thePresentationData
from the specified request.static void
setPresentationData
(HttpServletRequest request, PresentationData presentationData) Associates the specifiedPresentationData
with the specifiedHttpServletRequest
.Methods inherited from class java.util.HashMap
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.webmethods.portal.framework.presentation.IPresentationData
getApplication, getBaseResource, getBuildVersion, getCanonicalServletPath, getContext, getContextPath, getCss, getCurrentRequestURL, getDataObject, getDataType, getDefaultLayout, getEditor, getErrorLayout, getExtension, getFullServletPath, getHelp, getImages, getIncludes, getLayout, getLoginName, getMimeType, getPool, getPortlet, getPreviousRequestURL, getRelativeTheme, getRequestedServerURL, getResource, getResourceID, getResourceURI, getScripts, getServerURL, getServletPath, getShell, getStyle, getSystemTitle, getWidgets, getWorkspaces, getXslt, init, putAll, release, setApplication, setBaseResource, setContext, setContextPath, setCss, setCurrentRequestURL, setDataObject, setDataType, setDefaultLayout, setEditor, setErrorLayout, setExtension, setHelp, setImages, setIncludes, setLayout, setLoginName, setMimeType, setPool, setPortlet, setPreviousRequestURL, setRelativeTheme, setRequestedServerURL, setResource, setResourceURI, setScripts, setServerURL, setServletPath, setStyle, setWidgets, setWorkspaces, setXslt
-
Constructor Details
-
PresentationData
public PresentationData()
-
-
Method Details
-
getPresentationData
Retrieves thePresentationData
from the specified request.- Parameters:
request
- Request from which to retrieve thePresentationData
.- Returns:
PresentationData
associated with the specified request.
-
setPresentationData
public static void setPresentationData(HttpServletRequest request, PresentationData presentationData) Associates the specifiedPresentationData
with the specifiedHttpServletRequest
.- Parameters:
request
- Request with which to associate the specifiedPresentationData
.presentationData
-PresentationData
with which to associate the specified request.
-
clone
Creates a shallow copy of this.
-