|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sapportals.wcm.rendering.uicommand.AbstractCommand
This class can be used by IUICommands to reduce coding overhead and
to take advantage of some convinience methods for resource bundle handling. It
also holds some implementations for the ISelector interface. Copyright:
Copyright 2004 SAP AG
| Inner Class Summary | |
protected class |
AbstractCommand.ResourceNotFoundException
|
| Field Summary | |
protected int |
applicable
|
protected IResourceContext |
context
|
java.lang.String |
layoutSetID
Layout Set ID |
AbstractProxyControl |
proxy
Description of the Field |
protected IResource |
resource
Description of the Field |
| Fields inherited from interface com.sapportals.wcm.rendering.uicommand.IExecCommand |
APPLICABLE_FALSE, APPLICABLE_TRUE, APPLICABLE_UNKNOWN |
| Constructor Summary | |
AbstractCommand()
public constructor used by the UICommandFactory, when command is
created for the first time |
|
AbstractCommand(java.lang.String keyLabel,
java.lang.String keyTooltip)
allows to set keys for the label and the tooltip of the command. |
|
| Method Summary | |
protected void |
createResource(IResourceContext context,
RID rid)
creates an IResource from the given parameters and sets it as the
member variable. |
protected IResource |
createResource(java.lang.String uri)
creates an IResource from the given parameters and returns it. |
RenderingEvent |
execute(ScreenflowData data)
|
java.lang.String |
getAlias()
Gets the alias attribute of the AbstractUICommand object |
protected java.lang.String |
getBundleString(java.lang.String key)
returns the translated text for the given key. |
protected java.lang.String |
getBundleString(java.lang.String key,
java.lang.Object obj)
returns the translated text with the given variables included in the object. |
protected java.lang.String |
getBundleString(java.lang.String key,
java.lang.Object[] obj)
returns the translated text with the given variables included in the object array. |
protected java.lang.String |
getBundleString(java.lang.String key,
java.lang.Object obj1,
java.lang.Object obj2)
returns the translated text with the given variables included in the two objects. |
java.lang.String |
getButtonLabel()
|
com.sapportals.htmlb.Component |
getComponent()
Returns a component for this command. |
java.util.Properties |
getConfigurationProperties()
returns the configproperties for this command. |
protected java.lang.String |
getLabel()
returns the label text for the command. |
java.lang.String |
getLayoutSetID()
Gets the layoutSetID attribute of the AbstractUICommand object |
LinkAttributes |
getLinkAttributes()
Gets the linkAttributes attribute of the AbstractUICommand object |
java.lang.String |
getLinkLabel()
Gets the linkLabel attribute of the AbstractUICommand object |
protected java.lang.String |
getOTHDefinedURL(IResource res,
IActionType actiontype)
|
java.util.Hashtable |
getParameters()
Gets the command parameters |
AbstractProxyControl |
getProxy()
Gets the proxy attribute of the AbstractUICommand object |
java.util.List |
getReplaceCommands()
gets the list of commands which will be ignored when the command is executable |
IResource |
getResource()
returns the resource the command operates on |
protected RID |
getStartUri()
returns the Start Uri value from proxy parameters |
java.lang.String |
getText(TextKey key)
Gets the text attribute of the AbstractUICommand object |
java.lang.String |
getTextForSecondaryScreen(java.lang.String key)
Gets the textForSecondaryScreen attribute of the AbstractUICommand object |
protected java.util.Properties |
getTextProperties()
returns the defined textproperties |
protected java.lang.String |
getTooltip()
returns the tooltip text for the command. |
protected void |
handleWrongConfiguration()
throws an InvalidConfigurationException that will be displayed
on the screen and give further information what was invalid for the given configuration |
protected ICommand |
initNewInstance(ICommand command)
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()
Gets the applicable attribute of the AbstractUICommand object |
protected boolean |
isMatchedPath(java.lang.String[] paths,
java.lang.String resourcePath)
|
protected boolean |
othAvailable(IResource res,
IActionType actiontype)
|
boolean |
raisesEvent()
Description of the Method |
protected IResource |
resolveLink()
returns either the current resource, or the target of the current resource, if the current resource is an internal link |
void |
setAlias(java.lang.String alias)
Sets the alias attribute of the AbstractUICommand object |
void |
setConfigurationProperties(java.util.Properties properties)
allows to set a free list of key-value pairs to be used by this command. |
void |
setLabelBundleKey(java.lang.String groupLabel)
currently not implemented. |
void |
setLayoutSetID(java.lang.String layoutSetID)
Sets the layoutSetID attribute of the AbstractUICommand object |
void |
setParameters(java.util.Hashtable parameters)
Sets parameters for the command. |
void |
setProxy(AbstractProxyControl proxy)
Sets the proxy attribute of the AbstractUICommand object |
void |
setReplaceCommands(java.util.List replaceCommandsList)
set the list of commands which will be ignored when the command is executable |
void |
setResource(IResource resource)
sets the resource the command shall operate on |
void |
setResourceBundle(ResourceBundles bundleFile)
sets the resourcebundle for this command |
void |
setResourceContext(IResourceContext context)
Sets the resourceContext attribute of the AbstractUICommand object |
void |
setTextProperties(java.util.Properties properties)
copies the values of known keys from the given properties-object into its own list. |
void |
setTooltipBundleKey(java.lang.String groupTooltip)
currently not implemented. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sapportals.wcm.rendering.uicommand.ICommand |
execute, getNewInstance |
| Methods inherited from interface com.sapportals.wcm.rendering.uicommand.IExecCommand |
getTargetParameters, isExecutable, setTargetParameters |
| Field Detail |
protected IResource resource
protected int applicable
protected IResourceContext context
public java.lang.String layoutSetID
public AbstractProxyControl proxy
| Constructor Detail |
public AbstractCommand()
UICommandFactory, when command is
created for the first time
public AbstractCommand(java.lang.String keyLabel,
java.lang.String keyTooltip)
keyLabel - the labelkey for the resourcebundle of the command, it is
only set if it is not nullkeyTooltip - the tooltipkey for the resourcebundle of the command, it
is only set if it is not null| Method Detail |
public void setResource(IResource resource)
setResource in interface IUIBaseCommandresource - resource the command shall operate on. Must not be nullpublic IResource getResource()
getResource in interface ICommandnull.protected java.lang.String getTooltip()
protected java.lang.String getLabel()
public java.lang.String getText(TextKey key)
getText in interface IUIBaseCommandkey - Description of the parampublic void setTextProperties(java.util.Properties properties)
setTextProperties in interface ICommandproperties - should hold key-value pairs with keys defined in IUIBaseCommand.TEXT_KEYS
. Other key-value pairs will not be used.protected java.util.Properties getTextProperties()
null, but may return
an empty Properties-object.public void setResourceBundle(ResourceBundles bundleFile)
setResourceBundle in interface IUIBaseCommandbundleFile - the bundle the command uses to retrieve its texts.public void setLabelBundleKey(java.lang.String groupLabel)
setLabelBundleKey in interface IUIBaseCommandgroupLabel - The new labelBundleKey valuepublic void setTooltipBundleKey(java.lang.String groupTooltip)
setTooltipBundleKey in interface IUIBaseCommandgroupTooltip - The new tooltipBundleKey valuepublic void setConfigurationProperties(java.util.Properties properties)
setConfigurationProperties in interface IUIBaseCommandproperties - free properties bag to be used by a command.public java.util.Properties getConfigurationProperties()
getConfigurationProperties in interface IUIBaseCommandnull, but may return an empty properties-object.public com.sapportals.htmlb.Component getComponent()
getComponent in interface IUIBaseCommandnull;
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.
protected IResource createResource(java.lang.String uri)
throws ResourceException,
WcmException
IResource from the given parameters and returns it. Does not
set it as a 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 IExecCommandprotected final ICommand initNewInstance(ICommand command)
getNewInstancemethod 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()
getLinkAttributes in interface IExecCommandpublic void setProxy(AbstractProxyControl proxy)
setProxy in interface IUIBaseCommandproxy - The new proxy valuepublic AbstractProxyControl getProxy()
public java.lang.String getTextForSecondaryScreen(java.lang.String key)
key - Description of the parampublic java.lang.String getLayoutSetID()
public void setLayoutSetID(java.lang.String layoutSetID)
layoutSetID - The new layoutSetID valuepublic java.lang.String getAlias()
getAlias in interface IExecCommandpublic void setAlias(java.lang.String alias)
setAlias in interface IExecCommandalias - The new alias value
public RenderingEvent execute(ScreenflowData data)
throws WcmException
public void setResourceContext(IResourceContext context)
setResourceContext in interface IUIBaseCommandcontext - The new resourceContext value
protected java.lang.String getBundleString(java.lang.String key,
java.lang.Object[] obj)
key - the key of the text to return - must not be
nullobj - the variables to fill the place holders in
the resource bundle, can be nulljava.util.MissingResourceException - if the IResourceContext is not
set for the commandprotected java.lang.String getBundleString(java.lang.String key)
key - the key of the text to return - must not be
nulljava.util.MissingResourceException - if the IResourceContext is not
set for the command
protected java.lang.String getBundleString(java.lang.String key,
java.lang.Object obj)
key - the key of the text to return - must not be
nullobj - the variable to fill the place holder in the
resource bundle, can be nulljava.util.MissingResourceException - if the IResourceContext is not
set for the command
protected java.lang.String getBundleString(java.lang.String key,
java.lang.Object obj1,
java.lang.Object obj2)
key - the key of the text to return - must not be
nullobj1 - the variable to fill the first place holder
in the resource bundle, can be nullobj2 - the variable to fill the second place holder
in the resource bundle, can be null *java.util.MissingResourceException - if the IResourceContext is not
set for the command
protected void handleWrongConfiguration()
throws com.sapportals.wcm.control.base.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 java.util.List getReplaceCommands()
getReplaceCommands in interface IUIBaseCommandpublic void setReplaceCommands(java.util.List replaceCommandsList)
setReplaceCommands in interface IUIBaseCommandreplaceCommandsList - The new replaceCommands valuepublic boolean isApplicable()
isApplicable in interface IExecCommandprotected RID getStartUri()
public java.lang.String getLinkLabel()
public java.lang.String getButtonLabel()
protected boolean isMatchedPath(java.lang.String[] paths,
java.lang.String resourcePath)
protected boolean othAvailable(IResource res,
IActionType actiontype)
protected java.lang.String getOTHDefinedURL(IResource res,
IActionType actiontype)
public void setParameters(java.util.Hashtable parameters)
setParameters in interface IUIBaseCommandparameters - The new parameters valuepublic java.util.Hashtable getParameters()
getParameters in interface IUIBaseCommand
protected 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 method
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||