public abstract class AbstractUICommand extends Object implements IUICommand, IInitialScreenflowProvider
IUICommand
s to reduce coding overhead and
to take advantage of some convenience methods for resource bundle handling. It
also holds some implementations for the ISelector
interface. Copyright:
Copyright 2004 SAP AGModifier and Type | Class and Description |
---|---|
protected class |
AbstractUICommand.ResourceNotFoundException
Deprecated.
As of NetWeaver 7.1
|
Modifier and Type | Field and Description |
---|---|
protected int |
applicable
Deprecated.
The applicable flag set as default IExecCommand.APPLICABLE_UNKNOWN
|
protected IResourceContext |
context
Deprecated.
|
String |
layoutSetID
Deprecated.
Layout Set ID used for commands with selection
|
AbstractProxyControl |
proxy
Deprecated.
command proxy
|
protected IResource |
resource
Deprecated.
The resource for which the command operates its task
|
static RID |
ROOT_RID
Deprecated.
|
APPLICABLE_FALSE, APPLICABLE_TRUE, APPLICABLE_UNKNOWN
ERR_MESSAGE_MISSING_CONFIG_ENTRY, ERR_MESSAGE_WRONG_METHOD_CALL, KEY_INPUT_CONTROL_TEXT, KEY_INPUT_CONTROL_TEXT_2, KEY_INPUT_CONTROL_TEXT_2_DEFAULT_TEXT, KEY_INPUT_CONTROL_TEXT_3, KEY_INPUT_CONTROL_TEXT_DEFAULT_TEXT, KEY_LABEL, KEY_MASS_EMBEDDED_COMMAND_TEXT, KEY_MASS_EMBEDDED_COMMANT_TOOLTIP, KEY_SINGLE_EMBEDDED_COMMAND_TEXT, KEY_SINGLE_EMBEDDED_COMMAND_TOOLTIP, KEY_TOOLTIP, LINE_BREAK, TEXT_KEYS, VALUE_EMPTY_STRING
Constructor and Description |
---|
AbstractUICommand()
Deprecated.
public constructor used by the
UICommandFactory , when command is
created for the first time |
AbstractUICommand(String keyLabel,
String keyTooltip)
Deprecated.
Allows to set keys for the label and the tooltip of the command.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowUserInput()
Deprecated.
|
protected boolean |
checkArchivingStauts(IResource resource)
Deprecated.
Read archiving status for the given resource and check it.
|
protected void |
createResource(IResourceContext context,
RID rid)
Deprecated.
Creates an
IResource from the given parameters and sets it as the
member variable. |
protected IResource |
createResource(String uri)
Deprecated.
As of NetWeaver 7.1
|
com.sapportals.wdf.event.WdfEvent |
execute()
Deprecated.
This method will always throw a
InvalidConfigurationException . |
com.sapportals.wdf.event.WdfEvent |
execute(com.sapportals.wdf.ControllerDynPage dynpage,
boolean pushStack)
Deprecated.
Calls the
execute method without parameters. |
String |
getAlias()
Deprecated.
Gets the alias of the command
|
protected String |
getBundleString(String key)
Deprecated.
Returns the translated text for the given key.
|
protected String |
getBundleString(String key,
Object obj)
Deprecated.
Returns the translated text with the given variables included in the object.
|
protected String |
getBundleString(String key,
Object[] obj)
Deprecated.
Returns the translated text with the given variables included in the object
array.
|
protected String |
getBundleString(String key,
Object obj1,
Object obj2)
Deprecated.
Returns the translated text with the given variables included in the two objects.
|
String |
getButtonLabel()
Deprecated.
As of NetWeaver 7.1
|
com.sapportals.htmlb.Component |
getComponent()
Deprecated.
Returns a component for this command.
|
Properties |
getConfigurationProperties()
Deprecated.
Returns the configproperties for this command.
|
String |
getDefaultInput(String key)
Deprecated.
Used for commands with selection
|
Map |
getInitialControlProperties()
Deprecated.
As of NetWeaver 7.1
|
String[] |
getInitialControls()
Deprecated.
As of NetWeaver 7.1
|
protected String |
getLabel()
Deprecated.
Returns the label text for the command.
|
String |
getLabel(String key)
Deprecated.
As of NetWeaver 7.1
|
String |
getLayoutSetID()
Deprecated.
Returns the LayoutSet is which is configured in Configuration for Commands with Selection
|
LinkAttributes |
getLinkAttributes()
Deprecated.
When the command selection generates an external link then
this class should be implemented and a
LinkAttributes |
String |
getLinkLabel()
Deprecated.
As of NetWeaver 7.1
|
protected String |
getOTHDefinedURL(IResource res,
IActionType actiontype)
Deprecated.
As of NetWeaver 7.1
|
Hashtable |
getParameters()
Deprecated.
As of NetWeaver 7.1
|
AbstractProxyControl |
getProxy()
Deprecated.
Gets the command proxy
|
List |
getReplaceCommands()
Deprecated.
Gets the list of commands which will be ignored when the command is executable
|
IResource |
getResource()
Deprecated.
Returns the resource the command operates on
|
protected RID |
getStartUri()
Deprecated.
Returns the Start Uri value from proxy parameters
|
String |
getText(TextKey key)
Deprecated.
Generates the text for label and tooltip for the command according with the
inputed
IUIBaseCommand.TEXT_KEYS . |
String |
getTextForSecondaryScreen(String key)
Deprecated.
Gets the textForSecondaryScreen attribute of the AbstractUICommand object
|
protected Properties |
getTextProperties()
Deprecated.
Returns the defined textproperties
|
protected String |
getTooltip()
Deprecated.
Returns the tooltip text for the command.
|
IMandatoryField[] |
getUserInputSpecifiers()
Deprecated.
|
protected void |
handleWrongConfiguration()
Deprecated.
Throws an
InvalidConfigurationException that will be displayed
on the screen and give further information what was invalid for the given configuration |
protected IUICommand |
initNewInstance(IUICommand command)
Deprecated.
Whenever a new instance of a command is needed, the newly created instance has
to inherit all of the old instance's member variables, such as the alias, the
resource bundle...
|
boolean |
isApplicable()
Deprecated.
returns the information the command needs to carry out its task, when it is
called through its
execute method. |
protected boolean |
isMatchedPath(String[] paths,
String resourcePath)
Deprecated.
As of NetWeaver 7.1
|
protected boolean |
othAvailable(IResource res,
IActionType actiontype)
Deprecated.
As of NetWeaver 7.1
|
boolean |
raisesEvent()
Deprecated.
Mostly, the command selection is followed another dialog which
execute the command task.
|
protected IResource |
resolveLink()
Deprecated.
As of NetWeaver 7.1
|
void |
setAlias(String alias)
Deprecated.
Sets the alias of command
|
void |
setConfigurationProperties(Properties properties)
Deprecated.
Allows to set a free list of key-value pairs to be used by this command.
|
void |
setLabelBundleKey(String groupLabel)
Deprecated.
Currently not implemented.
|
void |
setLayoutSetID(String layoutSetID)
Deprecated.
As of NetWeaver 7.1
|
void |
setParameters(Hashtable parameters)
Deprecated.
As of NetWeaver 7.1
|
void |
setProxy(AbstractProxyControl proxy)
Deprecated.
Sets the proxy for the command
|
void |
setReplaceCommands(List replaceCommandsList)
Deprecated.
Set the list of commands which will be ignored when the command is executable
|
void |
setResource(IResource resource)
Deprecated.
Sets the resource the command shall operate on
|
void |
setResourceBundle(ResourceBundles bundleFile)
Deprecated.
Sets the resourcebundle for this command
|
void |
setResourceContext(IResourceContext context)
Deprecated.
Sets the
IResourceContext |
void |
setScreenflow(com.sapportals.wdf.element.PaneElement startPane,
com.sapportals.wdf.ControllerDynPage dynpage)
Deprecated.
As of NetWeaver 7.1
|
void |
setTextProperties(Properties properties)
Deprecated.
Copies the values of known keys from the given properties-object into its own
list.
|
void |
setTooltipBundleKey(String groupTooltip)
Deprecated.
Currently not implemented.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNewInstance
getTargetParameters, isExecutable, setTargetParameters
public static RID ROOT_RID
protected IResource resource
protected int applicable
protected IResourceContext context
public String layoutSetID
public AbstractProxyControl proxy
public AbstractUICommand()
UICommandFactory
, when command is
created for the first timepublic AbstractUICommand(String keyLabel, String keyTooltip)
keyLabel
- the labelkey for the resourcebundle of the command, it is
only set if it is not null
keyTooltip
- the tooltipkey for the resourcebundle of the command, it
is only set if it is not null
public void setResource(IResource resource)
setResource
in interface IUIBaseCommand
resource
- resource the command shall operate on. Must not be null
public IResource getResource()
getResource
in interface IUICommand
null
.protected String getTooltip()
protected String getLabel()
public String getText(TextKey key)
IUIBaseCommand.TEXT_KEYS
.
For TextKey.LABEL it returns the command label text. For TextKey.TOOLTIP it returns
the command tooltip text. For TextKey.LINK_LABEL it returns the command label when
the command is rendered as link. If no special label is whished then it should
return the same as for the TextKey.LABEL. For TextKey.BUTTON_LABEL it returns the command label when
the command is rendered as button. If no special label is whished then it should
return the same as for the TextKey.LABELgetText
in interface IUIBaseCommand
key
- keypublic void setTextProperties(Properties properties)
setTextProperties
in interface IExecCommand
setTextProperties
in interface IUICommand
properties
- should hold key-value pairs with keys defined in IUIBaseCommand.TEXT_KEYS
. Other key-value pairs will not be used.protected Properties getTextProperties()
null
, but may return
an empty Properties-object.public void setResourceBundle(ResourceBundles bundleFile)
setResourceBundle
in interface IUIBaseCommand
bundleFile
- the bundle the command uses to retrieve its texts.public void setLabelBundleKey(String groupLabel)
setLabelBundleKey
in interface IUIBaseCommand
groupLabel
- The new labelBundleKey valuepublic void setTooltipBundleKey(String groupTooltip)
setTooltipBundleKey
in interface IUIBaseCommand
groupTooltip
- The new tooltipBundleKey valuepublic void setConfigurationProperties(Properties properties)
setConfigurationProperties
in interface IUIBaseCommand
properties
- free properties bag to be used by a command.public Properties getConfigurationProperties()
getConfigurationProperties
in interface IUIBaseCommand
null
, but may return an empty properties-object.public com.sapportals.htmlb.Component getComponent()
getComponent
in interface IUIBaseCommand
null
;protected void createResource(IResourceContext context, RID rid) throws WcmException
IResource
from the given parameters and sets it as the
member variable.context
- the current context of the sessionrid
- the identifier of the resource to createWcmException
- if the resource could not be created.public boolean raisesEvent()
raisesEvent
in interface IExecCommand
protected final IUICommand initNewInstance(IUICommand command)
getNewInstance
method like this
public getNewInstance() {
return this.initNewInstance(new MyCommand());
}
this abstract class' method will copy all of the member-attributes.
Comparable to the deep-clone approach.command
- Description of the parampublic LinkAttributes getLinkAttributes()
LinkAttributes
getLinkAttributes
in interface IExecCommand
public void setProxy(AbstractProxyControl proxy)
setProxy
in interface IUIBaseCommand
proxy
- The new proxy value *public AbstractProxyControl getProxy()
public String getTextForSecondaryScreen(String key)
key
- Description of the parampublic String getLabel(String key)
key
- Description of the parampublic String getDefaultInput(String key)
key
- public boolean allowUserInput()
public IMandatoryField[] getUserInputSpecifiers()
IMandatoryField[]
instancepublic String getLayoutSetID()
public void setLayoutSetID(String layoutSetID)
layoutSetID
- The new layoutSetID valuepublic String getAlias()
getAlias
in interface IExecCommand
public void setAlias(String alias)
setAlias
in interface IExecCommand
alias
- The new alias valuepublic com.sapportals.wdf.event.WdfEvent execute() throws com.sapportals.wdf.WdfException
InvalidConfigurationException
.
Either, the implementing class has not overwrittenexecute
in interface IUICommand
com.sapportals.wdf.WdfException
- Exception raised in failure situationpublic com.sapportals.wdf.event.WdfEvent execute(com.sapportals.wdf.ControllerDynPage dynpage, boolean pushStack) throws com.sapportals.wdf.WdfException
execute
method without parameters.execute
in interface IUICommand
dynpage
- - not usedpushStack
- - not usedcom.sapportals.wdf.WdfException
- Exception raised in failure situationpublic void setResourceContext(IResourceContext context)
IResourceContext
setResourceContext
in interface IUIBaseCommand
context
- The new resourceContext valueprotected String getBundleString(String key, Object[] obj)
key
- the key of the text to return - must not be
null
obj
- the variables to fill the place holders in
the resource bundle, can be null
protected String getBundleString(String key)
key
- the key of the text to return - must not be
null
protected String getBundleString(String key, Object obj)
key
- the key of the text to return - must not be
null
obj
- the variable to fill the place holder in the
resource bundle, can be null
protected String getBundleString(String key, Object obj1, Object obj2)
key
- the key of the text to return - must not be
null
obj1
- the variable to fill the first place holder
in the resource bundle, can be null
obj2
- the variable to fill the second place holder
in the resource bundle, can be null
*protected void handleWrongConfiguration() throws InvalidConfigurationException
InvalidConfigurationException
that will be displayed
on the screen and give further information what was invalid for the given configurationInvalidConfigurationException
- Exception raised in failure situationpublic List getReplaceCommands()
getReplaceCommands
in interface IUIBaseCommand
public void setReplaceCommands(List replaceCommandsList)
setReplaceCommands
in interface IUIBaseCommand
replaceCommandsList
- The new replaceCommands valuepublic boolean isApplicable()
execute
method. See the setTargetParameters
method for details. The String[] must not contain any null
valuesisApplicable
in interface IExecCommand
protected RID getStartUri()
public String getLinkLabel()
getLinkLabel
in interface IUICommand
public String getButtonLabel()
getButtonLabel
in interface IUICommand
protected boolean isMatchedPath(String[] paths, String resourcePath)
paths
- pathsresourcePath
- resourcePathprotected boolean othAvailable(IResource res, IActionType actiontype)
IResource
and a given
IActionType
res
- resactiontype
- actiontypeprotected String getOTHDefinedURL(IResource res, IActionType actiontype)
IResource
and a given
IActionType
res
- resactiontype
- actiontypepublic void setParameters(Hashtable parameters)
null
, it will not be used
to overwrite the existing hashtable.setParameters
in interface IUIBaseCommand
parameters
- The new parameters valuepublic Hashtable getParameters()
Hashtable
,
but never null
.getParameters
in interface IUIBaseCommand
public String[] getInitialControls()
IInitialScreenflowProvider
null
, but can be of length 0
getInitialControls
in interface IInitialScreenflowProvider
public void setScreenflow(com.sapportals.wdf.element.PaneElement startPane, com.sapportals.wdf.ControllerDynPage dynpage) throws com.sapportals.wdf.WdfException
setScreenflow
in interface IInitialScreenflowProvider
startPane
- startPanedynpage
- dynpagecom.sapportals.wdf.WdfException
public Map getInitialControlProperties()
IInitialScreenflowProvider
null
.getInitialControlProperties
in interface IInitialScreenflowProvider
protected IResource createResource(String uri) throws ResourceException, WcmException
IResource
for a given uriuri
- uriWcmException
- is thrown when no resource is foundResourceException
- is thrown by the RepositoryFramework and not caught by this methodprotected final IResource resolveLink() throws ResourceException
getResource()
. If this resource is an
internal link: this.getResource().getLinkType().equals(LinkType.INTERNAL)
, the
target of this resource is returned.ResourceException
- is thrown by the RepositoryFramework and not caught by this methodprotected boolean checkArchivingStauts(IResource resource)
resource
- resourceAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com]
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice