com.sapportals.portal.appintegrator.layer

Class AbstractIntegrationLayer

java.lang.Object
  extended bycom.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 Object
implements IIntegrationLayer

Copyright: Copyright (c) 2002 by SAP AG Description


Field Summary
 
Fields inherited from interface com.sapportals.portal.appintegrator.layer.IIntegrationLayer
PROPNAME_MANDATORY_PARAMETERS, PROPNAME_NEXT_LAYER, PROPNAME_OPTIONAL_PARAMETERS
 
Constructor Summary
AbstractIntegrationLayer()
           
 
Method Summary
 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(String id)
          Returns the boolean value of the parameter defined by its id for this layer.
 IParameterConveyor getConveyor()
          Returns the conveyor.
 Exception getException()
          Returns the exception the occured during the processing of this layer or null if the processing was succesful.
 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(String id)
          Returns the long value of the parameter defined by its id for this layer.
 Enumeration getMandatoryParameters()
          Returns an enumeration over the mandatory parameters of this layer
 String getNextLayer()
          Returns the id of the next layer in the layer stack.
 INode getNode()
          Returns the node.
 Enumeration getOptionalParameters()
          Returns an enumeration over the optional parameters of this layer
 Object getParameter(String id)
          Returns the value of the parameter defined by its id for this layer.
 IPortalComponentRequest getRequest()
          Returns the request.
protected  Cookie getSAPWPActiveCookie(AbstractURI uri)
          returns the SAPWP_active cookie for the given uri which indicates the remote system that it runs in a Portal environment
 String getStringParameter(String id)
          Returns the String value of the parameter defined by its id for this layer.
 Enumeration getValidValues(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(IPortalComponentRequest request, IParameterConveyor conveyor, int layerNo, 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  String processTemplate(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(IPortalComponentResponse response)
          This method is used to produce the output of this layer.
 void setException(Exception e)
          set the exception for this layer
protected  void setParameter(String id, Object value)
          Sets the value of the parameter given by its id for the THIS layer
protected  void setParameterForNextLayer(String id, 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
 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(IPortalComponentRequest request,
                 IParameterConveyor conveyor,
                 int layerNo,
                 String layerName)
Description copied from interface: IIntegrationLayer
Initializes this layer.

Specified by:
init in interface IIntegrationLayer
Parameters:
request - the Portal Component Request
conveyor - the Parameter Conveyor that will provide this layer with its parameter
layerNo - the number of this layer - i.e. the position in the layer stack
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 Enumeration getMandatoryParameters()
Description copied from interface: IIntegrationLayer
Returns an enumeration over the mandatory parameters of this layer

Specified by:
getMandatoryParameters in interface IIntegrationLayer
Returns:
an enumeration over the mandatory parameters of this layer
See Also:
IIntegrationLayer.getMandatoryParameters()

getOptionalParameters

public final Enumeration getOptionalParameters()
Description copied from interface: IIntegrationLayer
Returns an enumeration over the optional parameters of this layer

Specified by:
getOptionalParameters in interface IIntegrationLayer
Returns:
an enumeration over the optional parameters of this layer
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
Returns:
true, if one or more mandatory parameters for this layer are not defined.
See Also:
IIntegrationLayer.missingParameters()

getException

public final 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
Returns:
the exception (if any) of this layer
See Also:
IIntegrationLayer.getException()

setException

public final void setException(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
Returns:
true, if an exception occured during the processing of this layer
See Also:
IIntegrationLayer.hasException()

getNextLayer

public 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
Returns:
the id of the next layer.
See Also:
IIntegrationLayer.getNextLayer()

getNode

public final INode getNode()
Returns the node.

Returns:
INode

getRequest

public final IPortalComponentRequest getRequest()
Returns the request.

Returns:
IPortalComponentRequest

getConveyor

public final IParameterConveyor getConveyor()
Returns the conveyor.

Returns:
ParameterConveyor

getLayerId

public final 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
Returns:
the id of this layer
See Also:
IIntegrationLayer.getLayerId()

getParameter

public final Object getParameter(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 String getStringParameter(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(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(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 Enumeration getValidValues(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
Returns:
an enumeration over the set of valid values for the given parameter
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
Returns:
true, if the layer processing should stop at this layer

assembleParameters

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


swapOutCurrentLayer

public final 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(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(String id,
                                  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(String id,
                                              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 String processTemplate(String template)
processes the given template by using the template processor service


getSAPWPActiveCookie

protected Cookie getSAPWPActiveCookie(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


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.