SAP NetWeaver '04

com.sapportals.wcm.rendering.base
Class AbstractProxyControl

[contained in: com.sap.km.cm.ui.flex.par - km.shared.ui.flex.base_api.jar]
com.sapportals.wcm.rendering.base.AbstractProxyControl
All Implemented Interfaces:
IAmalgamationProvider, IProxy

public abstract class AbstractProxyControl
implements IProxy

implements the IProxy and extends the WcmBaseControl. It acts as the base class for all classes that work as interface between the WD-framework and the rendering classes underneath.

Since:
EP5 SP6 and EP6 SP1

Field Summary
static java.lang.String DISPATCH_EVENT
           
static java.lang.String HTMLB_PREFIX
          constant that can be used to filter out parameters in the URL that are only needed for htmlb.
protected  boolean isFirstCall
           
static java.lang.String ON_DELEGATED_CLICK
           
static java.lang.String ON_EXECUTE
          constant to use as a target for the creation of Events through the WdfEventDispatcher for IUICommand
static java.lang.String ON_MASS_EXECUTE
          constant to use as a target for the creation of Events through the WdfEventDispatcher for IUIMassCommand
static java.lang.String ON_NAVIGATE
          constant to use as a target for the creation of Events through the WdfEventDispatcher when a navigation via resource-URLs is wanted
protected  java.util.HashMap renderKeys
           
protected  ISearchSession searchsession
           
 
Fields inherited from interface com.sapportals.wcm.rendering.base.IProxy
ROOT_RID
 
Constructor Summary
AbstractProxyControl()
           
 
Method Summary
 void addControlStatus(java.lang.String id, IControlStatus status)
          acts as a wrapper around the ControlStatusService.
protected  boolean checkEvent(com.sapportals.wdf.event.WdfEvent event)
          returns true, if the event to clean status has been fired
 java.lang.String createDispatchableID(java.lang.String handler, java.util.ArrayList values)
          creates an id that contains dispatch information.
 java.lang.String createDispatchableID(java.lang.String handler, java.lang.String value)
          creates an id that contains dispatch information.
abstract  java.lang.String createNavigationTarget(ICollection collection)
          creates the needed information for a Link or Button to offer navigation to the given ICollection.
 java.util.List decodeValues(com.sapportals.htmlb.event.Event event)
          Returns the values created via the createDispatchableID methods and returns the list of parameters in the same order they were when submitting them.
protected  void deleteAllControlStatus(boolean partial)
           
 void deleteControlStatus(java.lang.String id)
          deletes the instance of the IControlStatus that was created with the given key.
 ResourcePropertyAmalgamation getAmalgamation()
           
abstract  IUIBaseCommand getCommand()
           
 IControlStatus getControlStatus(java.lang.String id)
          returns the IControlStatus that has been added to the proxy using its addControlStatus method.
 java.lang.String getCssCacheID()
           
 com.sapportals.htmlb.page.DynPage getDynamicPage()
          returns the DynPage the proxy is created in
abstract  java.lang.String getDynamicPane()
          returns the name of the PaneElement that holds the PaneElement that can be replaced with a dynamic screenflow.
 java.util.ArrayList getEventValues(com.sapportals.htmlb.event.Event event)
           
 java.lang.String[] getInputFromEntryControls()
          iterates through all controls that implement the IInputFieldControlinterface and asks for their input.
abstract  java.util.Hashtable getParameters()
           
abstract  com.sapportals.wdf.element.PaneElement getPresentDynamicPane()
          returns the PaneElement that holds the current control.
 IResource getResource()
          returns the present resource of the control or null.
protected  RID getRID()
           
 ISearchSession getSearchSession()
          returns the search session attribute of the proxy.
abstract  java.lang.String getStartUri()
          returns the starturi of the control or null.
abstract  IProxy getTargetControl()
          returns the event handler control.
abstract  java.lang.String getUri()
          returns the uri of the control.
 java.lang.String getUserInput(java.lang.String key)
          returns the input from the http-request that was specified in a field with the given field
protected  void initialize()
           
 boolean isPreviewEnabled()
          returns a flag, if the present screen offers functionality to view resources in this screen.
 com.sapportals.wdf.event.WdfEvent onDelegatedClick(com.sapportals.htmlb.event.Event event)
           
abstract  com.sapportals.wdf.event.WdfEvent onExecute(com.sapportals.htmlb.event.Event event)
          This method is called by the WDF when a Link or a Button with this target has been clicked and the ON_EXECUTE constant has been used as target for link or button creation.
abstract  com.sapportals.wdf.event.WdfEvent onMassExecute(com.sapportals.htmlb.event.Event event)
          This method is called by the WDF when a Link or a Button with this target has been clicked and the ON_MASS_EXECUTE constant has been used as target for link or button creation.
protected  void refreshAllControlStatus()
           
 java.lang.String register(IDelegatedReceiver receiver)
          registers the given receiver with the implementing class of this interface.
 void setCssCacheID(java.lang.String id)
           
protected  void setRID(RID rid)
           
abstract  void setUri(java.lang.String string)
          sets the uri of the control.
 
Methods inherited from interface com.sapportals.wcm.rendering.base.IProxy
createUniqueComponentId, getHabitat, getResourceContext
 

Field Detail

renderKeys

protected java.util.HashMap renderKeys

searchsession

protected ISearchSession searchsession

isFirstCall

protected boolean isFirstCall

ON_EXECUTE

public static final java.lang.String ON_EXECUTE
constant to use as a target for the creation of Events through the WdfEventDispatcher for IUICommand

ON_MASS_EXECUTE

public static final java.lang.String ON_MASS_EXECUTE
constant to use as a target for the creation of Events through the WdfEventDispatcher for IUIMassCommand

ON_NAVIGATE

public static final java.lang.String ON_NAVIGATE
constant to use as a target for the creation of Events through the WdfEventDispatcher when a navigation via resource-URLs is wanted

ON_DELEGATED_CLICK

public static final java.lang.String ON_DELEGATED_CLICK

HTMLB_PREFIX

public static final java.lang.String HTMLB_PREFIX
constant that can be used to filter out parameters in the URL that are only needed for htmlb. This can lead to performance gains, as the HashMap with the URL-Parameters that can be used by all classes holds less entries

DISPATCH_EVENT

public static final java.lang.String DISPATCH_EVENT
Constructor Detail

AbstractProxyControl

public AbstractProxyControl()
Method Detail

onExecute

public abstract com.sapportals.wdf.event.WdfEvent onExecute(com.sapportals.htmlb.event.Event event)
                                                     throws com.sapportals.wdf.WdfException
This method is called by the WDF when a Link or a Button with this target has been clicked and the ON_EXECUTE constant has been used as target for link or button creation. All IExecCommand created by the UICommandFactory are also pointing to this method when clicked. The inner structure of the values encoded in the Event can only be decoded by the UICommandFactory The IExecCommand can change the static screenflow, defined in the xml-files of the WDF. If they do, this change is carried out within this method. The returned event triggers the screenflow.
Parameters:
event - encapsulates all information needed to carry out the functionality of the link or button that raised it.
Returns:
a WdfEvent that is propagated to all WdfEventReceivers and that might trigger a screenflow. Can return null.
Throws:
a - WdfException that can encapsulate other exceptions.

onMassExecute

public abstract com.sapportals.wdf.event.WdfEvent onMassExecute(com.sapportals.htmlb.event.Event event)
                                                         throws com.sapportals.wdf.WdfException
This method is called by the WDF when a Link or a Button with this target has been clicked and the ON_MASS_EXECUTE constant has been used as target for link or button creation. All IMassExecCommand created by the UICommandFactory are also pointing to this method when clicked. The inner structure of the values encoded in the Event can only be decoded by the UICommandFactory The IMassExecCommand can change the static screenflow, defined in the xml-files of the WDF. If they do, this change is carried out within this method. The returned event triggers the screenflow.
Parameters:
event - encapsulates all information needed to carry out the functionality of the link or button that raised it.
Returns:
a WdfEvent that is propagated to all WdfEventReceivers and that might trigger a screenflow. Can return null.
Throws:
a - WdfException that can encapsulate other exceptions.

getDynamicPane

public abstract java.lang.String getDynamicPane()
returns the name of the PaneElement that holds the PaneElement that can be replaced with a dynamic screenflow.
Specified by:
getDynamicPane in interface IProxy
Returns:
the name of the outer pane of the dynamic screenflow setup

getPresentDynamicPane

public abstract com.sapportals.wdf.element.PaneElement getPresentDynamicPane()
                                                                      throws com.sapportals.wdf.WdfException
returns the PaneElement that holds the current control.
Returns:
the current pane
Throws:
WdfException. - This can happen, if the static WDF-file is badly configured, e.g. if the Pane, whose name is returned in the controls getDynamicPane holds no or more than one pane.

createNavigationTarget

public abstract java.lang.String createNavigationTarget(ICollection collection)
                                                 throws WcmException
creates the needed information for a Link or Button to offer navigation to the given ICollection. It uses the WdfEventDispatcher. The parameters in this string have to be in the following order:
URL of the resource to navigate to (mandatory) Start-Path to use (not mandatory)
As several Components in an iView may specify the same navigation target, it is necessary to ensure unique IDs for each of these components. One way to do this is to add some unique string at a later position in the parameter list, such as new UUID().toString().
Specified by:
createNavigationTarget in interface IProxy
Parameters:
collection - the folder to navigate to
Returns:
the information needed to create a navigation link to the given folder
Throws:
WdfException - if an exception occurs in the repository framework or the WDF

getTargetControl

public abstract IProxy getTargetControl()
returns the event handler control. If the proxy does not want to handle events itself, it can specify another control with this method that handles the events. If it wants to handle the events itself, it must return a handle to itself here:
return this
Specified by:
getTargetControl in interface IProxy
Returns:
a control that is used by the WdfEventDispatcher when creating a Link or Button. Must not return null

getParameters

public abstract java.util.Hashtable getParameters()
                                           throws WcmException
Specified by:
getParameters in interface IProxy
Returns:
Hashtable contains all parameters from the http-request, without the entries that are htmlb-related. The iView-parameters, for example, are included in the table. As some classes may modify these parameters, the implementing class has to ensure, that it does not return its own instance of these parameters, but rather returns a deep-clone of its own hashtable. When the hashtable only holds keys and values of type String, the hashtable's own clone method will suffice.

getCommand

public abstract IUIBaseCommand getCommand()
                                   throws WcmException
Specified by:
getCommand in interface IProxy
Returns:
a stored command whose execution extends over more than one screen. Another IUIBaseCommand can ask the AbstractProxyControl for this command and use it.

getUri

public abstract java.lang.String getUri()
returns the uri of the control. Can be null
Specified by:
getUri in interface IProxy

setUri

public abstract void setUri(java.lang.String string)
sets the uri of the control. Can be null

getStartUri

public abstract java.lang.String getStartUri()
returns the starturi of the control or null. The start-uri states the furthermost ancestor of the uri that is available for browsing.
Specified by:
getStartUri in interface IProxy

isPreviewEnabled

public boolean isPreviewEnabled()
returns a flag, if the present screen offers functionality to view resources in this screen.
Specified by:
isPreviewEnabled in interface IProxy
Returns:
true, if the screen offers functionality to view resources in place. Depending on the resource's mimetype, the preview might not be possible, even if the preview is available. The implementation available in this abstract class always returns false.

getResource

public IResource getResource()
returns the present resource of the control or null. The implementation available in this abstract class always returns null.
Specified by:
getResource in interface IProxy

initialize

protected void initialize()
                   throws com.sapportals.wdf.WdfException

getInputFromEntryControls

public java.lang.String[] getInputFromEntryControls()
                                             throws WcmException
iterates through all controls that implement the IInputFieldControlinterface and asks for their input. The controls must be registered at the WD-Framework by the implementing class.
Returns:
The inputFromEntryControls value or null The implementation available in this abstract class always returns null.
Throws:
WdfException - Exception raised in failure situation

addControlStatus

public void addControlStatus(java.lang.String id,
                             IControlStatus status)
Description copied from interface: IProxy
acts as a wrapper around the ControlStatusService. The class that calls this method must be able to reproduce the key at a later time to retrieve the status provided here. The implementation must map the keys returned by the ControlStatusService to the key provided here. The method will raise a NullPointerException if any of the parameters is null
Specified by:
addControlStatus in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
key - - the key the calling class will use to retrieve the given status through the proxy's getControlStatus method. Must not be null
status - - the status the calling class wants to store. Must not be null

getControlStatus

public IControlStatus getControlStatus(java.lang.String id)
Description copied from interface: IProxy
returns the IControlStatus that has been added to the proxy using its addControlStatus method. The calling class must be aware of the fact, that this method might return null, even if the status has been created with this key before. This can have several reasons. First of all, the ControlStatusService might have removed the status due to a too long idle time or a too high server load. Also, certain events within the interaction (e.g. the navigation to another resource) can trigger the deletion of all status' registered with that proxy.
Specified by:
getControlStatus in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
key - the key of the status to retrieve, must not be null
Returns:
 

deleteControlStatus

public void deleteControlStatus(java.lang.String id)
Description copied from interface: IProxy
deletes the instance of the IControlStatus that was created with the given key. If no instance for this key can be found, the implementing class should log this fact.
Specified by:
deleteControlStatus in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
key - the id of the status to delete as it was specified by the calling class in the addControlStatus method of this interface

deleteAllControlStatus

protected void deleteAllControlStatus(boolean partial)
Parameters:
partial - flag telling if all IControlStatus instances should be deleted (this is for value false), or if only instances should be deleted which do not implement the IRefreshSurvivor interface (this is for value true).

checkEvent

protected boolean checkEvent(com.sapportals.wdf.event.WdfEvent event)
returns true, if the event to clean status has been fired

refreshAllControlStatus

protected void refreshAllControlStatus()

setCssCacheID

public void setCssCacheID(java.lang.String id)

getCssCacheID

public java.lang.String getCssCacheID()

register

public java.lang.String register(IDelegatedReceiver receiver)
Description copied from interface: IProxy
registers the given receiver with the implementing class of this interface. If this method is called several times during the same http-request by the same class, it will always return the same String instance. After a server-roundtrip, the IProxy will recreate all receivers from the previous trip and therefore all of these receivers will register with the same IDs again. This ensures, that a receiver will be identified when an Event is received by the proxy
Specified by:
register in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
p0 -  
Returns:
 

getEventValues

public java.util.ArrayList getEventValues(com.sapportals.htmlb.event.Event event)
                                   throws WcmException

onDelegatedClick

public com.sapportals.wdf.event.WdfEvent onDelegatedClick(com.sapportals.htmlb.event.Event event)
                                                   throws com.sapportals.wdf.WdfException

getSearchSession

public ISearchSession getSearchSession()
Description copied from interface: IProxy
returns the search session attribute of the proxy. As the proxy-implementation itself might not offer any persistency mechanisms, classes that are interested in this search session might have to take care of persistency for this attribute themselves.
Specified by:
getSearchSession in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Returns:
the search session attribute or null

createDispatchableID

public java.lang.String createDispatchableID(java.lang.String handler,
                                             java.util.ArrayList values)
                                      throws WcmException
Description copied from interface: IProxy
creates an id that contains dispatch information. When an Event is raised with this id, the event will be send to the implementing class, using the information of the given parameters.
Specified by:
createDispatchableID in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
handler - The method that will be called when the event with this id is fired.
values - The objects of this list will be encoded using their toString() method and will be available in the handler method when the event is received
Returns:
String The dispatchableControlID, usable as ID for a Component.
Throws:
WcmException - Exception raised in failure situation
<{WcmException}> -  

createDispatchableID

public java.lang.String createDispatchableID(java.lang.String handler,
                                             java.lang.String value)
                                      throws WcmException
Description copied from interface: IProxy
creates an id that contains dispatch information. When an Event is raised with this id, the event will be send to the implementing class, using the information of the given parameters.
Specified by:
createDispatchableID in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
handler - The method that will be called when the event with this id is fired.
value - The value will be available in the handler method when the event is received. This value will not be encoded
Returns:
String The dispatchableControlID, usable as ID for a Component.
Throws:
WcmException - Exception raised in failure situation
<{WcmException}> -  

decodeValues

public java.util.List decodeValues(com.sapportals.htmlb.event.Event event)
Description copied from interface: IProxy
Returns the values created via the createDispatchableID methods and returns the list of parameters in the same order they were when submitting them. There will be no en- or decoding done to take care of special characters. If the createDispatchableID(String, String) method is used, a List with only one entry will be returned.
Specified by:
decodeValues in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
event - The event that contains the encoded values.
Returns:
String (cardinality = 1)

getDynamicPage

public com.sapportals.htmlb.page.DynPage getDynamicPage()
Description copied from interface: IProxy
returns the DynPage the proxy is created in
Specified by:
getDynamicPage in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Returns:
the DynPage the proxy is created in

getAmalgamation

public ResourcePropertyAmalgamation getAmalgamation()
Specified by:
getAmalgamation in interface IAmalgamationProvider

getUserInput

public java.lang.String getUserInput(java.lang.String key)
Description copied from interface: IProxy
returns the input from the http-request that was specified in a field with the given field
Specified by:
getUserInput in interface IProxy
Following copied from interface: com.sapportals.wcm.rendering.base.IProxy
Parameters:
key - - the key that was used as ID when creating the field in the http-response
Returns:
 

getRID

protected final RID getRID()

setRID

protected final void setRID(RID rid)

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
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.