com.sapportals.portal.appintegrator.layer
Class AbstractIntegrationLayer

java.lang.Object
  |
  +--com.sapportals.portal.appintegrator.layer.AbstractIntegrationLayer
All Implemented Interfaces:
IIntegrationLayer
Direct Known Subclasses:
BSPLayer, BWReportLayer, CacheLayer, DragAndRelateLayer, DSMLayer, HTTPRenderLayer, ITSDetectionLayer, PSIDLayer, SingleSignOnLayer, TopLayer, TransactionLayer, URLTemplateProcessLayer

public abstract class AbstractIntegrationLayer
extends java.lang.Object
implements IIntegrationLayer

Copyright: Copyright (c) 2002 by SAP AG Description

Version:
$Revision: #2 $.

Fields inherited from interface com.sapportals.portal.appintegrator.layer.IIntegrationLayer
PROPNAME_MANDATORY_PARAMETERS, PROPNAME_NEXT_LAYER, PROPNAME_OPTIONAL_PARAMETERS
 
Constructor Summary
AbstractIntegrationLayer()
           
 
Method Summary
 java.util.Map assembleParameters()
          assembles all properties of the current layer into a HashMap
 void epilog()
          This method is used to provide the result of this layer for the subsequent layers and it has to be called after prolog and processLayer() and before render().
 boolean getBooleanParameter(java.lang.String id)
          Returns the boolean value of the parameter defined by its id for this layer.
 IParameterConveyor getConveyor()
          Returns the conveyor.
 java.lang.Exception getException()
          Returns the exception the occured during the processing of this layer or null if the processing was succesful.
 java.lang.String getLayerId()
          Returns the (hopefully unique) id of this layer.
 int getLayerNo()
          Returns the number of this layer that is the position of this layer in the layer stack.
 long getLongParameter(java.lang.String id)
          Returns the long value of the parameter defined by its id for this layer.
 java.util.Enumeration getMandatoryParameters()
          Returns an enumeration over the mandatory parameters of this layer
 java.lang.String getNextLayer()
          Returns the id of the next layer in the layer stack.
 com.sapportals.portal.prt.pom.INode getNode()
          Returns the node.
 java.util.Enumeration getOptionalParameters()
          Returns an enumeration over the optional parameters of this layer
 java.lang.Object getParameter(java.lang.String id)
          Returns the value of the parameter defined by its id for this layer.
 com.sapportals.portal.prt.component.IPortalComponentRequest getRequest()
          Returns the request.
protected  javax.servlet.http.Cookie getSAPWPActiveCookie(com.sapportals.portal.prt.util.AbstractURI uri)
          returns the SAPWP_active cookie for the given uri which indicates the remote system that it runs in a Portal environment
 java.lang.String getStringParameter(java.lang.String id)
          Returns the String value of the parameter defined by its id for this layer.
 java.util.Enumeration getValidValues(java.lang.String parameter)
          Returns an enumeration over the valid values of the given parameter.
 boolean hasException()
          Returns true if an exception occured during the processing of this layer
 void init(com.sapportals.portal.prt.component.IPortalComponentRequest request, IParameterConveyor conveyor, int layerNo, java.lang.String layerName)
          Initializes this layer.
 boolean isDebugMode()
          Returns true if debug mode is active (DebugMode == true) but only for the first request (no $action).
 boolean isEmbedded()
          Returns true if the current component is embedded or not
 boolean missingParameters()
          Returns true, if there are one or more mandatory parameters missing to process this layer.
 void processLayer()
          This method is used to do the real job of this layer (ie.
protected  java.lang.String processTemplate(java.lang.String template)
          processes the given template by using the template processor service
 void prolog()
          This method is used to retrieve the input parameters for this layer and it is called before processLayer(), epilog and render().
 void render(com.sapportals.portal.prt.component.IPortalComponentResponse response)
          This method is used to produce the output of this layer.
 void setException(java.lang.Exception e)
          set the exception for this layer
protected  void setParameter(java.lang.String id, java.lang.Object value)
          Sets the value of the parameter given by its id for the THIS layer
protected  void setParameterForNextLayer(java.lang.String id, java.lang.Object value)
          Sets the value of the parameter given by its id for the NEXT layer
 boolean stopProcessing()
          Returns whether the layer processing should stop at this layer or not
 java.lang.String swapOutCurrentLayer()
          Performs a Redirection of the current component to itself - i.e. do another Round Trip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIntegrationLayer

public AbstractIntegrationLayer()
Method Detail

init

public void init(com.sapportals.portal.prt.component.IPortalComponentRequest request,
                 IParameterConveyor conveyor,
                 int layerNo,
                 java.lang.String layerName)
Description copied from interface: IIntegrationLayer
Initializes this layer.
Specified by:
init in interface IIntegrationLayer
See Also:
IIntegrationLayer.init(IPortalComponentRequest, IParameterConveyor, int, String)

getLayerNo

public final int getLayerNo()
Description copied from interface: IIntegrationLayer
Returns the number of this layer that is the position of this layer in the layer stack. This will be 0 for the top layer, 1 for the second layer etc. The number is defined by the initialization of this layer.
Specified by:
getLayerNo in interface IIntegrationLayer
Returns:
the layer number
See Also:
IIntegrationLayer.getLayerNo()

getMandatoryParameters

public final java.util.Enumeration getMandatoryParameters()
Description copied from interface: IIntegrationLayer
Returns an enumeration over the mandatory parameters of this layer
Specified by:
getMandatoryParameters in interface IIntegrationLayer
See Also:
IIntegrationLayer.getMandatoryParameters()

getOptionalParameters

public final java.util.Enumeration getOptionalParameters()
Description copied from interface: IIntegrationLayer
Returns an enumeration over the optional parameters of this layer
Specified by:
getOptionalParameters in interface IIntegrationLayer
See Also:
IIntegrationLayer.getOptionalParameters()

missingParameters

public final boolean missingParameters()
Description copied from interface: IIntegrationLayer
Returns true, if there are one or more mandatory parameters missing to process this layer.
Specified by:
missingParameters in interface IIntegrationLayer
See Also:
IIntegrationLayer.missingParameters()

getException

public final java.lang.Exception getException()
Description copied from interface: IIntegrationLayer
Returns the exception the occured during the processing of this layer or null if the processing was succesful.
Specified by:
getException in interface IIntegrationLayer
See Also:
IIntegrationLayer.getException()

setException

public final void setException(java.lang.Exception e)
set the exception for this layer
Specified by:
setException in interface IIntegrationLayer

hasException

public final boolean hasException()
Description copied from interface: IIntegrationLayer
Returns true if an exception occured during the processing of this layer
Specified by:
hasException in interface IIntegrationLayer
See Also:
IIntegrationLayer.hasException()

getNextLayer

public java.lang.String getNextLayer()
Description copied from interface: IIntegrationLayer
Returns the id of the next layer in the layer stack. Each layer defines the layer that is processed at next - that means each layer knows as best which layer to proceed. The caller is responsible to retrieve a corresponding implementation of the returned layer name and has to instantiate it.
Specified by:
getNextLayer in interface IIntegrationLayer
See Also:
IIntegrationLayer.getNextLayer()

getNode

public final com.sapportals.portal.prt.pom.INode getNode()
Returns the node.
Returns:
INode

getRequest

public final com.sapportals.portal.prt.component.IPortalComponentRequest getRequest()
Returns the request.
Returns:
IPortalComponentRequest

getConveyor

public final IParameterConveyor getConveyor()
Returns the conveyor.
Returns:
ParameterConveyor

getLayerId

public final java.lang.String getLayerId()
Description copied from interface: IIntegrationLayer
Returns the (hopefully unique) id of this layer. The number is defined by the initialization of this layer.
Specified by:
getLayerId in interface IIntegrationLayer
See Also:
IIntegrationLayer.getLayerId()

getParameter

public final java.lang.Object getParameter(java.lang.String id)
Returns the value of the parameter defined by its id for this layer.
Parameters:
id - the name of the parameter
Returns:
the value of the given parameter

getStringParameter

public final java.lang.String getStringParameter(java.lang.String id)
Returns the String value of the parameter defined by its id for this layer. If the parameter is not a String, the toString() result of the value is returned.
Parameters:
id - the name of the parameter
Returns:
the String value of the given parameter, or null if the value is not a String.
See Also:
getParameter(String)

getBooleanParameter

public final boolean getBooleanParameter(java.lang.String id)
Returns the boolean value of the parameter defined by its id for this layer. If the parameter value is of type Boolean, the boolean value is returned. For type String the method returns true if then parameter value is "true", "yes" or "1" - (ignoring the case); otherwise it returns false.
Parameters:
id - the name of the parameter
Returns:
the boolean value of the given parameter
See Also:
getParameter(String), Boolean.valueOf(java.lang.String)

getLongParameter

public final long getLongParameter(java.lang.String id)
Returns the long value of the parameter defined by its id for this layer. If the parameter is not a long, -1 is returned.
Parameters:
id - the name of the parameter
Returns:
the String value of the given parameter, or null if the value is not a String.
See Also:
getParameter(String)

getValidValues

public final java.util.Enumeration getValidValues(java.lang.String parameter)
Description copied from interface: IIntegrationLayer
Returns an enumeration over the valid values of the given parameter. If the set of valid values cannot be calculated (because there are none or they are not countable), the method returns an empty enumeration.
Specified by:
getValidValues in interface IIntegrationLayer
See Also:
IIntegrationLayer.getValidValues(String)

isEmbedded

public final boolean isEmbedded()
Returns true if the current component is embedded or not
Returns:
true if the component is embedded and false, if the component is isolated

isDebugMode

public final boolean isDebugMode()
Returns true if debug mode is active (DebugMode == true) but only for the first request (no $action).
Specified by:
isDebugMode in interface IIntegrationLayer
Returns:
true, if debug is active and debug screen wasn't shown before

stopProcessing

public boolean stopProcessing()
Description copied from interface: IIntegrationLayer
Returns whether the layer processing should stop at this layer or not
Specified by:
stopProcessing in interface IIntegrationLayer
Following copied from interface: com.sapportals.portal.appintegrator.layer.IIntegrationLayer
Returns:
true, if the layer processing should stop at this layer

assembleParameters

public final java.util.Map assembleParameters()
assembles all properties of the current layer into a HashMap

swapOutCurrentLayer

public final java.lang.String swapOutCurrentLayer()
Performs a Redirection of the current component to itself - i.e. do another Round Trip. The result is that the component will be isolated and writes its response into its own iframe.

processLayer

public void processLayer()
Description copied from interface: IIntegrationLayer
This method is used to do the real job of this layer (ie. URL computation etc). It is called after epilog and before render() and processLayer().
Specified by:
processLayer in interface IIntegrationLayer
See Also:
IIntegrationLayer.processLayer()

epilog

public void epilog()
Description copied from interface: IIntegrationLayer
This method is used to provide the result of this layer for the subsequent layers and it has to be called after prolog and processLayer() and before render().
Specified by:
epilog in interface IIntegrationLayer
See Also:
IIntegrationLayer.epilog()

prolog

public void prolog()
Description copied from interface: IIntegrationLayer
This method is used to retrieve the input parameters for this layer and it is called before processLayer(), epilog and render().
Specified by:
prolog in interface IIntegrationLayer
See Also:
IIntegrationLayer.prolog()

render

public void render(com.sapportals.portal.prt.component.IPortalComponentResponse response)
Description copied from interface: IIntegrationLayer
This method is used to produce the output of this layer. Most intermediate layers can skip this (or render only a comment). This method is called after prolog, processLayer() and epilog.
Specified by:
render in interface IIntegrationLayer
See Also:
IIntegrationLayer.render(IPortalComponentResponse)

setParameter

protected final void setParameter(java.lang.String id,
                                  java.lang.Object value)
Sets the value of the parameter given by its id for the THIS layer
Parameters:
id - the id of the parameter
value - the value for the next layer

setParameterForNextLayer

protected final void setParameterForNextLayer(java.lang.String id,
                                              java.lang.Object value)
Sets the value of the parameter given by its id for the NEXT layer
Parameters:
id - the id of the parameter
value - the value for the next layer

processTemplate

protected final java.lang.String processTemplate(java.lang.String template)
processes the given template by using the template processor service

getSAPWPActiveCookie

protected javax.servlet.http.Cookie getSAPWPActiveCookie(com.sapportals.portal.prt.util.AbstractURI uri)
returns the SAPWP_active cookie for the given uri which indicates the remote system that it runs in a Portal environment
Parameters:
uri - the URI for which domain the Cookie will be set
Returns:
SAPWP_active=1 cookie