SAP NetWeaver '04

com.sapportals.wcm.rendering.uicommand
Class UICommandFactory

[contained in: com.sap.km.cm.ui.flex.par - km.shared.ui.flex.uicommand_api.jar]
com.sapportals.wcm.rendering.uicommand.UICommandFactory
All Implemented Interfaces:
IFactoryInfoProvider

public final class UICommandFactory
implements IFactoryInfoProvider


Inner classes inherited from class com.sapportals.wcm.rendering.base.IFactoryInfoProvider
IFactoryInfoProvider.MappingInformation
 
Field Summary
static java.lang.String KEY_ALIAS
           
static java.lang.String KEY_CLASS
           
static java.lang.String KEY_DESCRIPTION
           
static java.lang.String KEY_EMB_LABEL
           
static java.lang.String KEY_EMB_MASS_LABEL
           
static java.lang.String KEY_EMB_MASS_TOOLTIP
           
static java.lang.String KEY_EMB_TOOLTIP
           
static java.lang.String KEY_GROUP_BUNDLE_FILE
           
static java.lang.String KEY_GROUP_BUNDLE_LABEL
           
static java.lang.String KEY_GROUP_BUNDLE_TOOPTIP
           
static java.lang.String KEY_GROUP_COMMANDS_LIST
           
static java.lang.String KEY_GROUP_LABEL
           
static java.lang.String KEY_GROUP_TOOPTIP
           
static java.lang.String KEY_ICON_PATH
           
static java.lang.String KEY_INPUT_CONTROL_TEXT_1
           
static java.lang.String KEY_INPUT_CONTROL_TEXT_2
           
static java.lang.String KEY_LAYOUT_SET
           
static java.lang.String KEY_MASSCOMMAND
           
static java.lang.String KEY_PARAMETERS
           
static java.lang.String KEY_PROPERTIES
           
static java.lang.String KEY_ROLE_MAPPING
           
static java.lang.String LINE_BREAK
          constant used to separate debugging information
static ResourceBundles resBundleDefault
           
 
Method Summary
 java.lang.Boolean checkSecurity(IExecCommand command, IResourceContext context)
           
 void configEvent(com.sapportals.config.event.ConfigEvent parm1)
          is called by the configuration, if configuration for the factory was changed.
 java.util.ArrayList createTargetValues(IExecCommand command)
          returns the arraylist with all the information needed by the given IUICommand to do its work.
 java.util.ArrayList createTargetValues(IMassExecCommand command)
          returns the arraylist with all the information needed by the given IUIMassCommand to do its work.
 IMassExecCommand decodeMassTarget(java.util.ArrayList values, IResourceContext context, IProxy proxy)
          returns a properly created instance of an IUIMassCommand as it was encoded in the given array list by the factories createTarget .
 IExecCommand decodeTarget(java.util.ArrayList values, IResourceContext context, IProxy proxy)
          returns a properly created instance of an IUICommand as it was encoded in the given array list by the factories createTarget.
 IUIBaseCommand decodeTargetCommand(java.util.ArrayList values, IResourceContext context, IProxy proxy)
          returns a properly created instance of an IUICommand as it was encoded in the given array list by the factories createTarget.
 IUIBaseCommand getCommandByAlias(java.lang.String alias, IResourceContext context)
          returns a command that is mapped to the given alias.
 java.lang.String getConfigListenerId()
          Gets the configListenerId attribute of the UICommandFactory object This stays the same regardless of the instance of the factory!
 java.lang.String getFactoryName()
           
 IUIGroupCommand getGroupCommand(IResource resource, com.sapportals.wcm.repository.service.layout.customizing.IParameterName group, com.sapportals.wcm.repository.service.layout.customizing.flavor.IFlavor flavor, java.util.Hashtable table)
          returns the configured group command for the given resource.
 IUIBaseCommand getGroupCommandByID(java.lang.String groupID, IResourceContext context)
          returns a new instance - ready to use - for the groupcommand that is mapped to the given parameter.
static UICommandFactory getInstance()
          Gets the instance attribute of the UICommandFactory class.
 long getLastReloadTime()
           
 java.util.List getMappings(java.util.Locale locale)
           
 java.util.List getPresentConfiguration(IResourceContext context)
          returns a list of setting information of the groupcommands.
 java.lang.String getPresentConfiguration(IResourceContext context, java.lang.String style, boolean showJavaClassNames)
          returns a string representation of the structure of all defined groupcommands with their children.
 IPropertyNameList getRequiredProperties(java.lang.String groupID)
           
 java.lang.String getScreenflowAlias(java.lang.String commandalias)
          is a convinience method to allow the easier use of the InitialScreenflowProvider technology.
 IExecCommand getSingleCommandByAlias(java.lang.String commandalias, IResource res)
           
 Status getStatus()
           
 

Field Detail

LINE_BREAK

public static final java.lang.String LINE_BREAK
constant used to separate debugging information

KEY_ALIAS

public static final java.lang.String KEY_ALIAS

KEY_CLASS

public static final java.lang.String KEY_CLASS

KEY_DESCRIPTION

public static final java.lang.String KEY_DESCRIPTION

KEY_ICON_PATH

public static final java.lang.String KEY_ICON_PATH

KEY_MASSCOMMAND

public static final java.lang.String KEY_MASSCOMMAND

KEY_ROLE_MAPPING

public static final java.lang.String KEY_ROLE_MAPPING

KEY_GROUP_COMMANDS_LIST

public static final java.lang.String KEY_GROUP_COMMANDS_LIST

KEY_LAYOUT_SET

public static final java.lang.String KEY_LAYOUT_SET

KEY_PROPERTIES

public static final java.lang.String KEY_PROPERTIES

KEY_PARAMETERS

public static final java.lang.String KEY_PARAMETERS

KEY_GROUP_LABEL

public static final java.lang.String KEY_GROUP_LABEL

KEY_GROUP_TOOPTIP

public static final java.lang.String KEY_GROUP_TOOPTIP

KEY_GROUP_BUNDLE_LABEL

public static final java.lang.String KEY_GROUP_BUNDLE_LABEL

KEY_GROUP_BUNDLE_TOOPTIP

public static final java.lang.String KEY_GROUP_BUNDLE_TOOPTIP

KEY_GROUP_BUNDLE_FILE

public static final java.lang.String KEY_GROUP_BUNDLE_FILE

KEY_EMB_TOOLTIP

public static final java.lang.String KEY_EMB_TOOLTIP

KEY_EMB_MASS_LABEL

public static final java.lang.String KEY_EMB_MASS_LABEL

KEY_EMB_MASS_TOOLTIP

public static final java.lang.String KEY_EMB_MASS_TOOLTIP

KEY_EMB_LABEL

public static final java.lang.String KEY_EMB_LABEL

KEY_INPUT_CONTROL_TEXT_1

public static final java.lang.String KEY_INPUT_CONTROL_TEXT_1

KEY_INPUT_CONTROL_TEXT_2

public static final java.lang.String KEY_INPUT_CONTROL_TEXT_2

resBundleDefault

public static ResourceBundles resBundleDefault
Method Detail

getInstance

public static UICommandFactory getInstance()
Gets the instance attribute of the UICommandFactory class.
Returns:
the only available instance of this factory in the VM.

getScreenflowAlias

public java.lang.String getScreenflowAlias(java.lang.String commandalias)
is a convinience method to allow the easier use of the InitialScreenflowProvider technology. If an IExecCommand implements the ISneakProvider interface, this factory will retrieve the ScreenflowInformation provided by that class.
Parameters:
commandalias - the command to retrieve screenflow information for, must not be null.
Returns:
the alias of the screenflow class provided by the command in question. This alias can be used as a URL-queryparameter value to invoke an initial screenflow. Might return null

getSingleCommandByAlias

public IExecCommand getSingleCommandByAlias(java.lang.String commandalias,
                                            IResource res)
Parameters:
commandalias - the alias of the command to retrieve, must not be null
res - the resource the command should use, must not be null
Returns:
a ready-to-use new instance of the command mapped to the given alias. If no mapping could be found, null will be returned.

getCommandByAlias

public IUIBaseCommand getCommandByAlias(java.lang.String alias,
                                        IResourceContext context)
returns a command that is mapped to the given alias. It first checks, if an IUIGroupCommand with this alias exists, then if an IExecCommand exists and finally, an IMassExecCommand. If nothing can be found, null is returned and an error is added to the log file, stating the alias searched for.
Parameters:
alias - the alias of the command requested
context - the context of the current request
Returns:
the command needed or null

createTargetValues

public java.util.ArrayList createTargetValues(IExecCommand command)
                                       throws WcmException
returns the arraylist with all the information needed by the given IUICommand to do its work. The ArrayList is used by the WdfEventDispatcher to create the Component that will trigger the execution of the given command.
Parameters:
command - The command that has to rendered.
Returns:
ArrayList a new ArrayList, with following order position 0..n-1: The n-elements that are retrieved from the command through its getTargetParameters method position n: a UUID to make sure that the created html-link will have a unique ID position n+1: the alias of the IUICommand, so the factory can recreate an instance of this command when the decodeTarget method is called.
Throws:
WcmException - Exception raised in failure situation

createTargetValues

public java.util.ArrayList createTargetValues(IMassExecCommand command)
                                       throws WcmException
returns the arraylist with all the information needed by the given IUIMassCommand to do its work. The ArrayList is used by the WdfEventDispatcher to create the Component that will trigger the execution of the given command.
Parameters:
command - The command that has to rendered.
Returns:
ArrayList a new ArrayList, with following order position 0..n-1: The n-elements that are retrieved from the command through its getTargetParameters method position n: a UUID to make sure that the created html-link will have a unique ID position n+1: the alias of the IUIMassCommand, so the factory can recreate an instance of this command when the decodeTarget method is called.
Throws:
WcmException - Exception raised in failure situation

decodeTargetCommand

public IUIBaseCommand decodeTargetCommand(java.util.ArrayList values,
                                          IResourceContext context,
                                          IProxy proxy)
                                   throws WcmException
returns a properly created instance of an IUICommand as it was encoded in the given array list by the factories createTarget. This command is ready to use, e.g. call its execute method. It can be used instead of the decodeTarget or decodeMassTarget methods, if it is unknown, which kind of class created the values list.
Parameters:
values - Description of the param
context - Description of the param
proxy - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Exception raised in failure situation

decodeTarget

public IExecCommand decodeTarget(java.util.ArrayList values,
                                 IResourceContext context,
                                 IProxy proxy)
                          throws WcmException
returns a properly created instance of an IUICommand as it was encoded in the given array list by the factories createTarget. This command is ready to use, e.g. call its execute method.
Parameters:
values - a list of String values, as it was created by the createTargetValues method of this class. Must not be null and must not contain classes that are not of type String .
context - the present context of the session. Must not be null .
proxy - the proxy that the returned command shall use. Must not be null
Returns:
a new instance of the IUICommand which was encoded in the values parameter
Throws:
WcmException - Exception raised in failure situation

decodeMassTarget

public IMassExecCommand decodeMassTarget(java.util.ArrayList values,
                                         IResourceContext context,
                                         IProxy proxy)
                                  throws WcmException
returns a properly created instance of an IUIMassCommand as it was encoded in the given array list by the factories createTarget . This command is ready to use, e.g. call its execute method.
Parameters:
values - a list of String values, as it was created by the createTargetValues method of this class. Must not be null and must not contain classes that are not of type String .
context - the present context of the session. Must not be null .
proxy - the proxy that the returned command shall use. Must not be null
Returns:
a new instance of the IUIMassCommand which was encoded in the values parameter
Throws:
WcmException - Exception raised in failure situation

getGroupCommand

public IUIGroupCommand getGroupCommand(IResource resource,
                                       com.sapportals.wcm.repository.service.layout.customizing.IParameterName group,
                                       com.sapportals.wcm.repository.service.layout.customizing.flavor.IFlavor flavor,
                                       java.util.Hashtable table)
                                throws WcmException
returns the configured group command for the given resource. The Factory uses the given parameters to determine the ID (alias) of the group command configured for the given resource. If no ID is configured or no instance of an IUIGroupCommand can be found in the factories instances-table, null is returned
Parameters:
resource - the resource the group command is needed for
flavor - the flavor to use when reading the configuration
group - the parameter to look for in the configuration
table - the parameters that hold configuration information
Returns:
a new group command for the given resource, ready to use, or null
Throws:
WcmException - Exception raised in failure situation

getGroupCommandByID

public IUIBaseCommand getGroupCommandByID(java.lang.String groupID,
                                          IResourceContext context)
returns a new instance - ready to use - for the groupcommand that is mapped to the given parameter.
Parameters:
groupID - the groupID that is defined for the group command requested.
context - the current context of the session
Returns:
a new instance of a IUIGroupCommand or null , if no groupID was given or no group is defined for the given groupID

getConfigListenerId

public java.lang.String getConfigListenerId()
Gets the configListenerId attribute of the UICommandFactory object This stays the same regardless of the instance of the factory!
Returns:
The configListenerId value

configEvent

public void configEvent(com.sapportals.config.event.ConfigEvent parm1)
is called by the configuration, if configuration for the factory was changed. If the event is of type ConfigEvent.CONFIGURABLE_LOADED or ConfigEvent.CONFIGMANAGER_TERMINATED , the factory deletes all its entries and reloads the configuration, creating all commands anew.
Parameters:
parm1 - the event raised by the configuration

getPresentConfiguration

public java.lang.String getPresentConfiguration(IResourceContext context,
                                                java.lang.String style,
                                                boolean showJavaClassNames)
returns a string representation of the structure of all defined groupcommands with their children.
Parameters:
context - the current context of the user, sets e.g. the language of the labels for the commands
style - currently not used
showJavaClassNames - flag to show (true) or hide (false) java class names in the returned string
Returns:
a String with line breaks and indentions to show the structure of all configured commands

getPresentConfiguration

public java.util.List getPresentConfiguration(IResourceContext context)
returns a list of setting information of the groupcommands. GroupCommands are free to add information to this list. When using this list a type check should be done before casting to String to avoid ClassCastException s.
Parameters:
context - Description of the param
Returns:
a list containing information provided by the factory's groupcommands.

getMappings

public java.util.List getMappings(java.util.Locale locale)
Specified by:
getMappings in interface IFactoryInfoProvider
Following copied from interface: com.sapportals.wcm.rendering.base.IFactoryInfoProvider
Parameters:
locale - defines the language to use, if the factory offers translated information, must not be null
Returns:
a list that must only contain IFactoryInfoProvider.MappingInformation, must not be null

getStatus

public Status getStatus()
Specified by:
getStatus in interface IFactoryInfoProvider
Following copied from interface: com.sapportals.wcm.rendering.base.IFactoryInfoProvider
Returns:
the aggregated status of the factory. If, e.g., there have been errors creating a class defined in the config, the factory should return Status.ERROR

getFactoryName

public java.lang.String getFactoryName()
Specified by:
getFactoryName in interface IFactoryInfoProvider
Following copied from interface: com.sapportals.wcm.rendering.base.IFactoryInfoProvider
Returns:
a human-readable name of the factory, must not be null

getRequiredProperties

public IPropertyNameList getRequiredProperties(java.lang.String groupID)

getLastReloadTime

public long getLastReloadTime()
Specified by:
getLastReloadTime in interface IFactoryInfoProvider
Following copied from interface: com.sapportals.wcm.rendering.base.IFactoryInfoProvider
Returns:
the time of the last reload of the config by this factory. Expects a format such as returned by System.currentTimeMillis(). An implementing class might also return -1 to indicate, that no information is available.

checkSecurity

public java.lang.Boolean checkSecurity(IExecCommand command,
                                       IResourceContext context)
Parameters:
command -  
context -  

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.