com.sapportals.portal.prt.component

Interface IPortalComponentRequest


public interface IPortalComponentRequest

The IPortalComponentRequest is the portal component specific view on all request related matters.

It provides access to the Portal Object Model, events, other components, the component context, and more.


Method Summary
 IEvent createAboutRequestEvent()
          Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead
 String createComponentURL(INode targetNode, IPortalRequestEvent event)
          Deprecated. use createPortalComponentURI instead
 String createComponentURL(IPortalRequestEvent event)
          Deprecated. use createPortalComponentURI instead
 IEvent createEditRequestEvent()
          Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead
 IEvent createHelpRequestEvent()
          Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead
 String createPageURL(String urn)
          Deprecated. use createPortalComponentURI instead
 String createPageURL(String urn, IPortalRequestEvent event)
          Deprecated. use createPortalComponentURI instead
 String createPageURL(String urn, NodeMode mode)
          Deprecated. use createPortalComponentURI instead
 IPortalComponentURI createPortalComponentURI()
          Creates a new PortalComponentURI
 IEvent createPreviewRequestEvent()
          Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead
 IEvent createRefreshRequestEvent()
          Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead
 IPortalRequestEvent createRequestEvent(String eventName)
          Creates a request event.
 IPortalRequestEvent createRequestEvent(String eventName, IPortalRequestEventData eventData)
          Creates a request event.
 IPortalRequestEventData createRequestEventData()
          Creates an empty request event data object.
 void dispatchRequest(INode aNode, IPortalComponentResponse aResponse)
          Dispatches the request to another node
 void dispatchRequest(IResource aResource, IPortalComponentResponse aResponse)
          Dispatches the request to a Resource
 ILogger getClassLogger(Class aClass)
          Returns the logger associated to aClass's package.
 ClientType getClientType()
          Deprecated. Please use XXXX for User Agent information.
 IPortalComponentContext getComponentContext()
          Gets the current context of the component.
 IPortalComponentContext getComponentContext(NodeMode nodeMode)
          Gets the current context of the component for a particular mode
 IPortalComponentContext getComponentContext(String urn)
          This object allows to act as a factory for context objects.
 IPortalComponentSession getComponentSession()
          gets a reference on the PortalComponentSession, that defines the component's view on a (servlet) session that is subject to time outs.
 Cookie[] getCookies()
          Deprecated. Please use the corresponding method on the servlet request object obtained by calling getServletRequest().
 Locale getLocale()
          Retrieves the Locale associated with this request.
 ILogger getLogger()
          Returns the default Logger.
 ILogger getLogger(String loggerName)
          Returns a logger associated to the logger name.
 INode getNode()
          Gets the current node in the portal OM.
 String getParameter(String name)
          gets a parameter of this request
 String getPrivateResourcePath()
          Returns the full file system path to access private resources that belong to the current component.
 String getPrivateResourcePath(String componentName)
          Returns the full file system path to access private component resources.
 String getPublicResourcePath()
          Returns the full file system path to access public resources that belong to the current component.
 String getPublicResourcePath(String componentName)
          Returns the full file system path to access public component resources.
 String getRedirectURL()
          Gets a currently set redirect URL or null if none was specified.
 IPortalRequestEvent getRequestEvent()
          If applicable, gets the request event defined by the incoming request.
 Guid getRequestGuid()
          Deprecated. Please handle GUIDs locally.
 InputStream getRequestInputStream()
          Gets an InputStream that provides access to the request's body data.
 String getRequestTheme()
          Gets the theme associated with this request.
 PortalComponentRequestType getRequestType()
          Deprecated. Instead of referring to request types, please use the mode information provided by the current node.
 IResource getResource(String resourceType, String resourceName)
          Returns an IResource object that belongs to the current component.
 IResource getResource(String componentName, String resourceType, String resourceName)
          Returns an IResource object that belongs to the component.
 ResourceBundle getResourceBundle()
          Retrieves the Portal Components default Resource Bundle, as specified in the Components profile or by using the default name defined by IPortalComponentProfile.DEFAULT_RESOURCE_BUNDLE.
 IService getService(String serviceName)
          Deprecated. Use access to services via PortalRuntime instead.
 IService getService(String serviceName, IServiceConfiguration aServiceConfiguration)
          Deprecated. Use access to services via PortalRuntime instead.
 IService getService(String serviceName, IServiceId aServiceID)
          Deprecated. Use access to services via PortalRuntime instead.
 ServletConfig getServletConfig()
          Gets the actual servlet config.
 HttpServletRequest getServletRequest()
          Gets the actual servlet request.
 HttpServletResponse getServletResponse(boolean answering)
          Gets the original servlet response.
 IUserContext getUser()
          gets the profile of the current user.
 Object getValue(String name)
          Retrieve a piece of data from the request.
 String getWebResourcePath()
          Returns a path to access to web resources that belong to the current component The generated path depends on some servlet settings (context name) provided by the request.
 String getWebResourcePath(String componentName)
          Returns a URL to access to web resources that belong to the component.
 String getWebServicePath(String serviceName)
          Deprecated. Please use getWebResourcePath(java.lang.String) instead.
 boolean isResponseClean()
          Returns whether the servlet's response is still available for content procession by the runtime.
 void putValue(String name, Object value)
          Put a piece of data into the request.
 void redirect(String location)
          Forces a redirect of the request to some other location.
 void setNode(INode node)
          Sets the current node of this request.
 void setRequestType(PortalComponentRequestType requestType)
          Deprecated. Instead of referring to request types, please use the mode information provided by the current node.
 

Method Detail

getServletConfig

public ServletConfig getServletConfig()
Gets the actual servlet config. Note: It is recommended not to access the servlet config if possible. This is only available, if the request was initiated from a servlet based connection.

Returns:
The actual servlet config, or null if not applicable

getServletRequest

public HttpServletRequest getServletRequest()
Gets the actual servlet request. Note: It is recommended not to access the servlet request if possible. This is only available, if the request was initiated from a servlet based connection.

Returns:
The actual servlet request or null if not applicable

getServletResponse

public HttpServletResponse getServletResponse(boolean answering)
Gets the original servlet response. Note: This should be accessed in extraordinary cases only. If the parameter is set to true all further content procession of the runtime will be skipped. This is only available, if the request was initiated from a servlet based connection.

Parameters:
answering - specificying whether it is intended by the caller to write into the response and thereby skip all further content procession by the runtime.
Returns:
The original servlet response of null if not applicable.

isResponseClean

public boolean isResponseClean()
Returns whether the servlet's response is still available for content procession by the runtime.

Returns:
whether the servlet's response is still available for content procession by the runtime.

getRequestInputStream

public InputStream getRequestInputStream()
                                  throws IOException
Gets an InputStream that provides access to the request's body data. Its content is buffered by the Runtime to provide access to any number of Portal Components

Returns:
the request input stream
Throws:
IOException

getCookies

public Cookie[] getCookies()
Deprecated. Please use the corresponding method on the servlet request object obtained by calling getServletRequest().

Gets the array of cookies provided by the client with the request

Returns:
An array of cookies from the request.

getRequestEvent

public IPortalRequestEvent getRequestEvent()
If applicable, gets the request event defined by the incoming request.

Returns:
The event provided by the request, null if none there.

getRequestType

public PortalComponentRequestType getRequestType()
Deprecated. Instead of referring to request types, please use the mode information provided by the current node.

Gets the type of this request

Returns:
The type of this request

getRequestTheme

public String getRequestTheme()
Gets the theme associated with this request. This information can be used to do special rendering

Returns:
a theme identifier or null if not applicable.

setRequestType

public void setRequestType(PortalComponentRequestType requestType)
Deprecated. Instead of referring to request types, please use the mode information provided by the current node.

Sets the type of this request

Parameters:
requestType - The type of this request

getClientType

public ClientType getClientType()
Deprecated. Please use XXXX for User Agent information.

Gets the type of the client associated to thie request

Returns:
Information on the type of client that send the request

getComponentContext

public IPortalComponentContext getComponentContext()
Gets the current context of the component. This can be null, if no component context is assigned.

Returns:
The current context of the component

getComponentContext

public IPortalComponentContext getComponentContext(NodeMode nodeMode)
Gets the current context of the component for a particular mode

Parameters:
nodeMode - the node mode to retrieve the context for.
Returns:
The context corresponding to the specified mode. Note this can be a context resulting from a mode delegation.

getNode

public INode getNode()
Gets the current node in the portal OM.

Returns:
the current node.

setNode

public void setNode(INode node)
Sets the current node of this request. Note: usually you should not worry about setting the node of the request, but leave the responsibility to the runtime.

Parameters:
node - that needs to be attached to this request.

getComponentContext

public IPortalComponentContext getComponentContext(String urn)
This object allows to act as a factory for context objects.
This method allows to obtain a context corresponding to the given urn.

Parameters:
urn - a URN specifying a Component Context.
Returns:
The component context specified by the URN

putValue

public void putValue(String name,
                     Object value)
Put a piece of data into the request. This can be retrieved later during the request.

Parameters:
name - An identifier of the value
value - The object to be kept in the request

getValue

public Object getValue(String name)
Retrieve a piece of data from the request.

Parameters:
name - An identifier of the value
Returns:
The object that was kept in the request

getUser

public IUserContext getUser()
gets the profile of the current user.

Returns:
The current user.

getComponentSession

public IPortalComponentSession getComponentSession()
gets a reference on the PortalComponentSession, that defines the component's view on a (servlet) session that is subject to time outs.

Returns:
The portal component session

createPortalComponentURI

public IPortalComponentURI createPortalComponentURI()
Creates a new PortalComponentURI

Returns:
a new IPortalComponentURI

createComponentURL

public String createComponentURL(INode targetNode,
                                 IPortalRequestEvent event)
Deprecated. use createPortalComponentURI instead

creates a url that refers to a node in the POM that a client event shall be sent to using it.

Parameters:
targetNode - The node that the URL is to point to.
event - The event to be passed by this URL.
Returns:
The generated URL.

createComponentURL

public String createComponentURL(IPortalRequestEvent event)
Deprecated. use createPortalComponentURI instead

creates a url that refers to the current node in the POM that a client event shall be sent to using it.

Parameters:
event - The event to be passed by this URL.
Returns:
The generated URL.

createPageURL

public String createPageURL(String urn)
Deprecated. use createPortalComponentURI instead

In contrast to createComponentURL(com.sapportals.portal.prt.pom.INode, com.sapportals.portal.prt.event.IPortalRequestEvent) this method generates a URL that replaces the root component of a subsequent request as specified by the context URN. context name.

Parameters:
urn - The URN of the context representing the new root component.
Returns:
The generated URL as a String

createPageURL

public String createPageURL(String urn,
                            IPortalRequestEvent event)
Deprecated. use createPortalComponentURI instead

In contrast to createComponentURL(com.sapportals.portal.prt.pom.INode, com.sapportals.portal.prt.event.IPortalRequestEvent) this method generates a URL that replaces the root component of a subsequent request as specified by the context URN. context name. The passed on event will be fired on the new root component.

Parameters:
urn - The URN of the context representing the new root component.
event - The event to be fired on the top most Portal Component.
Returns:
The generated URL as a String

createPageURL

public String createPageURL(String urn,
                            NodeMode mode)
Deprecated. use createPortalComponentURI instead

In contrast to createComponentURL(com.sapportals.portal.prt.pom.INode, com.sapportals.portal.prt.event.IPortalRequestEvent) this method generates a URL that replaces the root component of a subsequent request as specified by the context URN. context name. The passed on event will be fired on the new root component. The passed on node mode will be set on the Portal Object Model node carrying the specified context.

Parameters:
urn - The URN of the context representing the new root component.
mode - The mode to be set on the top most Portal Component.
Returns:
The generated URL as a String

redirect

public void redirect(String location)
Forces a redirect of the request to some other location. To be effective this method must be called before the content phase. The Portal Builder Runtime will stop page procession as soon as possible but not before the content assembly phase.

Parameters:
location - A URL to redirect the request to.

getRedirectURL

public String getRedirectURL()
Gets a currently set redirect URL or null if none was specified.

Returns:
a redirect URL.

getParameter

public String getParameter(String name)
gets a parameter of this request

Parameters:
name - The name of the parameter.

getResource

public IResource getResource(String componentName,
                             String resourceType,
                             String resourceName)
Returns an IResource object that belongs to the component.

Example:

String componentName = request.getComponentContext().getComponentName();
IResource script = getResource(componentName, IResource.SCRIPT, "scripts/menu.js");


The component name specified must be the complete name including the profile name (i.e.: <par-file name>.<profile name>).

Parameters:
componentName - the component name
resourceType - the type of the resource
resourceName - the file name for the resource
Returns:
an IResource object
See Also:
getResource(String, String)

getResource

public IResource getResource(String resourceType,
                             String resourceName)
Returns an IResource object that belongs to the current component.

Example:

IResource script = getResource(IResource.SCRIPT, "scripts/menu.js");

The resourceName specified must be relative to the component resource path.
The IResource interface defines string constants for standard resource types.

Parameters:
resourceType - the type of the resource
resourceName - the file name for the resource
Returns:
an IResource object
See Also:
IResource, getPrivateResourcePath(), getPublicResourcePath(), getWebResourcePath(), IPortalComponentResponse.addResource(IResource)

getLogger

public ILogger getLogger(String loggerName)
Returns a logger associated to the logger name.

Parameters:
loggerName - The logger name.
Returns:
A logger associated to the logger name.

getLogger

public ILogger getLogger()
Returns the default Logger.

Returns:
The default logger.

getClassLogger

public ILogger getClassLogger(Class aClass)
Returns the logger associated to aClass's package.

Parameters:
aClass - The class which is calling the logger.
Returns:
The logger associated to aClass's package.

getService

public IService getService(String serviceName)
Deprecated. Use access to services via PortalRuntime instead.

Returns a service of a specific name.

Parameters:
serviceName - name of the service to get
Returns:
the Service requested, null otherwise.
See Also:
IService

getService

public IService getService(String serviceName,
                           IServiceId aServiceID)
Deprecated. Use access to services via PortalRuntime instead.

Gets a Service of a specific name and a given ID.

Parameters:
serviceName - name of the Service to access
aServiceID - the ID of the service to get
Returns:
the Service requested, null otherwise.
See Also:
IService, IServiceId

getService

public IService getService(String serviceName,
                           IServiceConfiguration aServiceConfiguration)
Deprecated. Use access to services via PortalRuntime instead.

gets a service with a name and a service configuration.

Parameters:
serviceName - the name of the Service.
aServiceConfiguration -
Returns:
the Service requested, null otherwise.
See Also:
IService, IServiceConfiguration

createRequestEvent

public IPortalRequestEvent createRequestEvent(String eventName)
Creates a request event.

Parameters:
eventName - the name of the event
Returns:
the Portal Request Event created with the event.
See Also:
IPortalRequestEvent

createRequestEvent

public IPortalRequestEvent createRequestEvent(String eventName,
                                              IPortalRequestEventData eventData)
Creates a request event.

Parameters:
eventName - the name of the event
eventData - data to be passed on the event
Returns:
the Portal Request Event created with the event.
See Also:
IPortalRequestEvent

createRequestEventData

public IPortalRequestEventData createRequestEventData()
Creates an empty request event data object.

Returns:
An implementation of IPortalRequestEventData
See Also:
IPortalRequestEventData

createEditRequestEvent

public IEvent createEditRequestEvent()
Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead

Creates a Edit Request Event, that is an event that will trigger the personalization of a Portal Component when fired on a corresponding component node

Returns:
An Edit Request Event

createPreviewRequestEvent

public IEvent createPreviewRequestEvent()
Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead

Creates a Preview Request Event, that is an event that will trigger a preview request on a Portal Component when fired on a corresponding component node


createRefreshRequestEvent

public IEvent createRefreshRequestEvent()
Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead

Creates a Refresh Request Event, that is an event that will trigger a refresh request on a Portal Component when fired on a corresponding component node


createAboutRequestEvent

public IEvent createAboutRequestEvent()
Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead

Creates an "About" Request Event, that is an event that will trigger an "about" request on a Portal Component when fired on a corresponding component node


createHelpRequestEvent

public IEvent createHelpRequestEvent()
Deprecated. use INode.setNodeMode(com.sapportals.portal.prt.pom.NodeMode) instead

Creates a "Help" Request Event, that is an event that will trigger an "help" request on a Portal Component when fired on a corresponding component node


getWebResourcePath

public String getWebResourcePath(String componentName)
Returns a URL to access to web resources that belong to the component.

The generated path depends on some servlet settings (context name) provided by the request.
The component name specified must be the complete name including the profile name (i.e.: <par-file name>.<profile name>).

Parameters:
componentName - The name of the component.
Returns:
The path to access to component resources.

getWebServicePath

public String getWebServicePath(String serviceName)
Deprecated. Please use getWebResourcePath(java.lang.String) instead.

Returns a URL to access to the web resources that belong to the service.

The generated path depends on some servlet settings (context name) provided by the request.

Parameters:
serviceName - the name of the service.
Returns:
The path to access to service resources.

getWebResourcePath

public String getWebResourcePath()
Returns a path to access to web resources that belong to the current component

The generated path depends on some servlet settings (context name) provided by the request.

Returns:
the path to access the resource from the browser.

getPrivateResourcePath

public String getPrivateResourcePath(String componentName)
Returns the full file system path to access private component resources.

The component name specified must be the complete name including the profile name (i.e.: <par-file name>.<profile name>).

Parameters:
componentName - the name of the component
Returns:
the full path to access private component resources
See Also:
getPublicResourcePath()

getPrivateResourcePath

public String getPrivateResourcePath()
Returns the full file system path to access private resources that belong to the current component.

Returns:
The full path to access private resources of the current component.
See Also:
getPublicResourcePath()

getPublicResourcePath

public String getPublicResourcePath(String componentName)
Returns the full file system path to access public component resources.

The component name specified must be the complete name including the profile name (i.e.: <par-file name>.<profile name>).

Parameters:
componentName - the name of the component.
Returns:
The full path to access public component resources
See Also:
getWebResourcePath()

getPublicResourcePath

public String getPublicResourcePath()
Returns the full file system path to access public resources that belong to the current component.

Returns:
The full path to access public resources of the current component.
See Also:
getWebResourcePath()

getResourceBundle

public ResourceBundle getResourceBundle()
Retrieves the Portal Components default Resource Bundle, as specified in the Components profile or by using the default name defined by IPortalComponentProfile.DEFAULT_RESOURCE_BUNDLE.

Returns:
the resource bundle or null if none could be determined.

getLocale

public Locale getLocale()
Retrieves the Locale associated with this request.

Returns:
The Locale of this request or null if none was determined.

dispatchRequest

public void dispatchRequest(INode aNode,
                            IPortalComponentResponse aResponse)
Dispatches the request to another node

Parameters:
aNode - the node on which to dispatch the request
aResponse - the current response in use

dispatchRequest

public void dispatchRequest(IResource aResource,
                            IPortalComponentResponse aResponse)
Dispatches the request to a Resource

Parameters:
aResource - the resource to dispatch the request to
aResponse - the current response in use

getRequestGuid

public Guid getRequestGuid()
Deprecated. Please handle GUIDs locally.

Gets the GUID for this request. Each request can be identified by its own global unique id.

Returns:
The GUID of this request.


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.