com.sapportals.portal.appintegrator.layer

Class AbstractIntegrationLayer

java.lang.Object
  extended by com.sapportals.portal.appintegrator.layer.AbstractIntegrationLayer
All Implemented Interfaces:
IIntegrationLayer

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
 void addRenderingModeHeader()
           
 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.
 ApplicationIntegratorException getException()
          Returns the exception the occured during the processing of this layer or null if the processing was succesful.
 float getFloatParameter(String id)
           
 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.
protected  String getLocalOrRemote()
           
 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.
 Set getParameterNames()
          returns a set containing all parameter names of the context
protected  String getRemoteMode()
           
 IPortalComponentRequest getRequest()
          Returns the request.
protected  String getRequestMethod(String url)
          determines the request method to the target URL
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" or user-id) but only for the first request (no $action).
 boolean isEmbedded()
          Returns true if the current component is embedded or not
 boolean isRefreshMode()
           
 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.
 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(ApplicationIntegratorException e)
          set the exception for this layer
 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
 
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
layerName - the (unique) id of this layer
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 ApplicationIntegratorException 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(ApplicationIntegratorException 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)

getFloatParameter

public float getFloatParameter(String id)

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" or user-id) 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

getParameterNames

public final Set getParameterNames()
returns a set containing all parameter names of the context


assembleParameters

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


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

public 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

public 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

getLocalOrRemote

protected String getLocalOrRemote()

getRemoteMode

protected String getRemoteMode()

getRequestMethod

protected String getRequestMethod(String url)
determines the request method to the target URL


isRefreshMode

public boolean isRefreshMode()

addRenderingModeHeader

public void addRenderingModeHeader()
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/appintegration/api api EP-PIN


Copyright 2015 SAP AG Complete Copyright Notice