com.sapportals.wcm.rendering.uicommand

Interface ISelector


public interface ISelector

This interface is used to extend the functionality of IUICommands and IUIMassCommands. When a command uses the AbstractProxyControl to render its follow-up screen, it may want to make sure, that a certain layout is used. Also, it wants to be called, when IResources have been selected on that screen. The third functionality with this interface is the offering of texts to set for input fields and explanations on that follow-up screen. The typical setup to use commands that implement this interface is as follows: The command is clicked by the user, and it its execute method it starts a screenflow, that uses an AbstractProxyControl to render the output. The proxy can then retrieve the layoutset-id of the ISelector, if it is encoded in the received WdfEvent. If the proxy uses the ILayoutControllerFactory to retrieve an ILayoutController and through this the Controls to render, it can use the retrieved layoutset-id to retrieve the ILayoutController defined in this layoutset. With this layoutset, typically certain UICommands should be defined, that do not carry out an action themselves, but use the getCommand method of the AbstractProxyControl to retrieve the command (usually an instance of ISelector) to actually do the work.


Method Summary
 boolean allowUserInput()
          states if the implementing class requires input fields displayed on the screen.
 IRenderingEvent execute(IResourceList list, IProxy currentproxy)
          Carries out the action on the IResourceList found in the imported list, using the information from the current screen found inside the proxy.
 String getLabel(String key)
          returns one of the text-elements needed, if a secondary screen is displayed for this command
 String getLayoutSetID()
          returns the layoutset defined for this class in the configuration
 com.sapportals.wcm.control.base.IMandatoryField[] getUserInputSpecifiers()
          returns a list of mandatory fields that have to be rendered by the screenflow that holds the implementing class as embedded command.
 boolean isValidTargetResource(IResource resource)
          checks if the command that implements this interface can operate with its resource on the resource that is given as a parameter.
 void setLayoutSetID(String layoutSetID)
          set the Layout Set ID.
 

Method Detail

getLayoutSetID

public String getLayoutSetID()
returns the layoutset defined for this class in the configuration

Returns:
the Layout Set ID or null.

setLayoutSetID

public void setLayoutSetID(String layoutSetID)
set the Layout Set ID. This ID is usually defined through the configuration.


execute

public IRenderingEvent execute(IResourceList list,
                               IProxy currentproxy)
                        throws WcmException
Carries out the action on the IResourceList found in the imported list, using the information from the current screen found inside the proxy.

Parameters:
list - the list of IResource that act as 'targets' for the action to perform.
currentproxy - - the proxy from the current screen. Needed, as the implementing class only holds the IProxy from the request when it was instantiated itself.
Returns:
events stating the result of the operation and triggering the screenflow, if necessary. Can be null. If the implementing class had additional fields rendered via its getUserInputSpecifiers method
Throws:
WcmException

getLabel

public String getLabel(String key)
returns one of the text-elements needed, if a secondary screen is displayed for this command

Returns:
the translated text or null, if there is no text available for this key. Note: There is no possibility to add variables to these texts (e.g. add the resource name)

allowUserInput

public boolean allowUserInput()
states if the implementing class requires input fields displayed on the screen. If this method returns true, its getUserInputSpecifiers is called to provide data what kind of fields have to be rendered.

Returns:
true, if the implementing class requires input fields displayed on the screen

getUserInputSpecifiers

public com.sapportals.wcm.control.base.IMandatoryField[] getUserInputSpecifiers()
returns a list of mandatory fields that have to be rendered by the screenflow that holds the implementing class as embedded command. This method is only called, if the interface method allowUserInput returns true. The FieldIdentifier within the returned fields must be unique. Several of the implementing classes might be used to render the content of an htmlb-Screen, which requires each field to have a unique ID. Therefore, the implementing class should add a prefix to the IDs it uses for its different fields. The IProxys method createUniqueComponentId can be used for this.

Returns:

isValidTargetResource

public boolean isValidTargetResource(IResource resource)
checks if the command that implements this interface can operate with its resource on the resource that is given as a parameter. A copy-command, for example will return true in this method, if the parameter given is a not-locked ICollection and the current user has write-access. It will return false, if it is a simple IResource, locked, etc...

Parameters:
resource - the resource which is to be used as target for the command that implements this interface
Returns:
flag, if the given resource is a valid target. Will throw a NullPointerException, if the resource parameter is null


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.