SAP NetWeaver '04

Package com.sapportals.wcm.rendering.uicommand

Contains interfaces to render and execute commands for one or more resources.

See:
          Description

Interface Summary
ICommand  
IExecCommand  
IMassCommand  
IMassExecCommand  
IResourceDeletionEvent  
ISelector This interface is used to extend the functionality of IUICommands and IUIMassCommands.
ISimpleExecution  
ISimpleMassExecution  
ISneakProvider  
IUICommand IUICommands encapsulate everything that is needed to work with a specified resource on the user interface: - it provides the label and tooltip texts needed to display itself on the screen - it encapsulates the screenflow (if needed) that guides the user through the functionality of the command - it calls framework functionality to actually do the requested work - it provides success and error messages to inform the user about the state of the execution The commands use functionality of the htmlb and the WD-Framework, to implement the screenflow functionality the IScreenflow can be used.
IUIGroupCommand Description of the Interface
IUIMassCommand Deprecated. As of EP 5.0 SP6 and EP 6.0 SP1, replaced by IMassCommand
IUIMenu Base class for rendering menus
IUIMenuCommand Description of the Interface
 

Class Summary
AbstractCommand This class can be used by IUICommands to reduce coding overhead and to take advantage of some convinience methods for resource bundle handling.
AbstractMassCommand
AbstractUICommand This class can be used by IUICommands to reduce coding overhead and to take advantage of some convinience methods for resource bundle handling.
AbstractUIGroupCommand Description of the Interface
AbstractUIMassCommand Deprecated. As of EP 5.0 SP6 and EP 6.0 SP1, replaced by AbstractMassCommand
AbstractUIMenu This class can be used by IUIMenus to reduce coding overhead.
LinkAttributes Contains the attributes needed for creating a link It is used by IUICommand when the Command raise no event, rather ein link.
PreviewMimeType The PreviewMimeType is a singleton factory, and contains a list with all mime types and mime types pattern for Preview function.
PropertyInformation  
ScreenflowInformation  
UIBaseCommandList
UIBaseCommandListIterator
UIButtonMenu Renders the button menu for the given IUICommandGroup
UICConsts This class holds keys for the resource bundle UICConsts.properties.
UICommandFactory  
UICommandRenderer This class can be used to take care of the complete rendering of a resource.
UIConfiguration  
UIGroupCommand
UIHoverMenu Renders the hovermenu for the given IUICommandGroup
UIIconMenu Renders the link menu for the given IUICommandGroup
UILinkMenu Renders the link menu for the given IUICommandGroup
UIMenuBar Renders the menu bar for the given IUICommandGroup
UIMenuCommand  
UIMenuFactory The UIMenuFactory is a singleton factory, that allows other classes to retrieve instances of IUIMenus.
UISmallButtonMenu Renders the small button menu for the given IUICommandGroup
UITabMenu Renders the link menu for the given IUICommandGroup do not use - this class is not released !!!!
UIToolbarButtonMenu Renders the small button menu for the given IUICommandGroup
UIVerticalLinkMenu Renders the link menu for the given IUICommandGroup
 

Exception Summary
 

Package com.sapportals.wcm.rendering.uicommand Description

Contains interfaces to render and execute commands for one or more resources.

Package Specification

Purpose
Detailed Concept
Interfaces and Classes
Configuration
Implementation Notes

Purpose

The uicommand package is one of several packages in the KM framework that enable flexible rendering and screenflows for explorer controls. The task of ICommands objects is to render commands for resources, collections or lists of these items. They can start a screenflow to carry out an action, execute an action, open a browser window or simply provide status information for the user. Instances of ICommand and IMassCommand are provided by the UICommandFactory . An IUIGroupCommand allows the grouping of instances of IUIGroupCommand, ICommand and IMassCommand. This enables the creation of hierarchical command structures on the user interface.

Detailed Concept

ICommands can be used by controls, ICollectionRenderer orIResourceRenderer instances to render a link or button that is used to perform operations on a resource or a list of resources. Before rendering takes place, the calling class can ask the command, if it is executable and applicable for the current resource. However, this naturally does not guarantee the successful execution of the command at a later time. As the selection of an IUIGroupCommand is dynamic and not defined at compilation time, it enables the rendering of a more flexible user interface. For example, an interface that is suitable for administrative purposes can be rendered to include more commands than a interface that is suitable for browsing purposes. Commands are customizable, for example, their label or screenflow can be configured.

Interfaces and Classes

The ICommand includes everything that is required for an action to be carried out on a resource. It stores texts for labels, tooltips and messages. It also checks whether the execution is possible (at rendering time) and carries out the execution (at "click" time). If a screenflow is needed for the action, the command creates the screenflow and triggers it. As it operates on an htmlb-wdf-driven user interface, it must be able to encode all needed information for its execution in an htmlb-Event.

The IMassCommand is very similar to the ICommand . The only difference is, that it does not know which resources it will operate on at the time of rendering. Therefore, it cannot check whether execution is possible. At "click" time, the surrounding framework provides the list of selected resources for the mass command. The command then iterates through this list, executing the required action for each of the resources. If execution fails for one resource, other resources are not influenced . No transaction-like behavior is implemented.

The UICommandFactory is a singleton factory that holds instances of all commands. It is the single entry point for all classes within the flexible UI that need to obtain instances of commands or group commands. The factory also maps an htmlb event to a command and instantiates a command for a given htmlb event. When a command is rendered, it adds all information it needs for execution to a list. The factory adds further information like the command's alias and unique identifier to the list. The list is then attached to the event. At "click" time, the factory is called. It creates an instance of the uicommand from the information added to the event and returns the list with information to the command. It is important to note, that the instance of the command that creates the list of values and the instance of the command that receives the list of values (and executes the action) are not the same.

The IUIGroupCommand allows the grouping of commands and other IUIGroupCommands. This enables the creation of hiearchical structures of commands. Normally such structures are set in the configuration. However, other implementations of IUIGroupCommand can dynamically generate a command structure at runtime. For example, the statemanagement service uses such an implementation. It checks the resource and current users permissions before generating the appropriate list of commands, for example approve, reject and skip approval.

The classes UIMenuFactory, UICommandRenderer as well as UIButtonMenu, UILinkMenu, UIHoverMenu and UISmallButtonMenu offer more convenient use of the command classes.

Configuration

Configuration is possible for IUIGroupCommands, ICommands and IMassCommands. The configuration can be accessed in the Configuration Framework under Content Management->UserInterface->Commands-> in three different sections : UICommands, UICommands With Selection and UI GroupCommands.

For UICommand, the following attributes are available:

Property Required Description
javaclass Yes Class that implements the ICommand or IMassCommand interface
description No Short description of the commands functions
alias Yes Unique name to identify the command to use. Within the configuration, only the alias is used, never the original java name of the class.
masscommand Yes If this box is checked, the factory tries to load the class as a IMassCommand. 
Bundle File Name No The resource bundle to use to retrieve label and tooltip for the command
Bundle Key For Label No The key to retrieve the label text from the resource bundle
Bundle Key For Tooltip No The key to retrieve the tooltip text from the resource bundle

For UICommand With Selection, the following attributes are available:

Property Required Description
javaclass Yes Class that implements the ICommand or IMassCommand interface
description No Short description of the commands functionality
alias Yes Unique name to identify the command to use. Within the configuration, only the alias is used, never the original Java name of the class.
masscommand Yes If the box is checked, the factory tries to load the class as a IMassCommand. 
Bundle File Name No The resource bundle to use to retrieve label and tooltip for this command
Bundle Key For Label No The key to retrieve the label text from the resource bundle
Bundle Key For Tooltip No The key to retrieve the tooltip text from the resource bundle
LayoutSet Yes The layout set that must be used on the first screen of the command's screenflow
Label for Command on Selection Screen No The label for the command that will lead to the completion of the commands screenflow and implementation
Label for Mass Command on Selection Screen No The label for the masscommand that will lead to the completion of the commands screenflow and implementation
Tooltip for Command on Selection Screen No The tooltip for the command that will lead to the completion of the commands screenflow and implementation
Tooltip for Mass Command on Selection Screen No The tooltip for the masscommand that will lead to the completion of the commands screenflow and implementation
Label for First Input Field No The label for the first input field on the selection screen, if there is one
Label for Second Input Field No The Label for the second input field on the selection screen if there is one

For UI Command Groups, the following attributes are available:

Property Required Description
UI Command Class Yes Class that implements the IUIGroupCommandinterface
description No Short description of the commands functionality
alias Yes Unique name to identify the command to use. Within the configuration, only the alias is used, never the classes original JAVA-name.
commandlist Yes A comma-separated list of aliases of other groups and commands. 
Bundle File Name No The resource bundle to use to retrieve label and tooltip for this command
Bundle Key For Label No The key to retrieve the label text from the resource bundle
Bundle Key For Tooltip No The key to retrieve the tooltip text from the resource bundle

Implementation Notes

The ICommand object and UICommandFactory work in close coordination with other elements of the KM framework related to rendering. When, for example, a particular folder or resource are rendered with commands, the process is as follows:

An AbstractProxyControl instance is informed, via an event, that a folder must be rendered. In response, the proxy requests an ILayoutController object from the LayoutControllerFactory. It then calls the layout controllers's render method. This can use several controls to render the folder. These controls use the ICollectionRendererFactory to retrieve ICollectionRenderer instances.  The ICollectionRendererinstances use IResourceRenderers that are provided by the ResourceRendererFactory to further delegate rendering. They also use ICommands, provided by the UICommandFactory, to delegate the creation of commands for the displayed resources. The UICommandFactory uses the parameter settings of the renderer classes to retrieve the correct group command to render. The included ICommands check whether the commands are executable and whether they should be rendered or deactivated.


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.