com.ptc.netmarkets.util.beans
Class NmCommandBean

java.lang.Object
  extended by com.ptc.netmarkets.util.beans.NmCommandBean
All Implemented Interfaces:
com.ptc.core.components.beans.FormDataHolder, Externalizable, Serializable

public class NmCommandBean
extends Object
implements com.ptc.core.components.beans.FormDataHolder, Externalizable



Supported API: true

Extendable: true

See Also:
Serialized Form

Nested Class Summary
static class com.ptc.netmarkets.util.beans.NmCommandBean.DialogButton
           
static class com.ptc.netmarkets.util.beans.NmCommandBean.ElementName
           
 
Method Summary
 NmOid getActionOid()
          Gets the object that is the target of the action.
 ArrayList<NmOid> getActionOidsWithoutWizard()
          Gets the actions oids of a action that does not have a wizard.
 ArrayList<NmOid> getActionOidsWithWizard()
          Gets the actions oids of a action that had a wizard.
 List getAddedItemsByName(String param_name)
          Will return the list of NmOids which were selected for addition from the component defined by the component name param_name.
 HashMap getChangedComboBox()
          Gets the comboboxes that have changed.
 HashMap getChangedRadio()
          Returns a hashMap of any radio buttons that have changed.
 HashMap getChangedText()
          Gets the textboxes that have changed.
 HashMap getChangedTextArea()
          Gets the textareas that have changed.
 NmOid getElementOid()
          Gets the row context object.
 HashMap getNewChecked()
          Returns a hashMap of Name of Checkbox -> Optional Column Name so that if one was to make a table of principals to Access control, the name would be the user, and the optional column name would be the access control.
 ArrayList<NmOid> getNmOidSelected()
          Get the selected objects as oids.
 ArrayList<NmOid> getNmOidSelectedInOpener()
          Get the selected-in-opener objects as oids.
 JspWriter getOut()
          Gets the value of the attribute: out; available in the jsp engine only This is the jsp out variable

Supported API: true
 NmOid getPageOid()
          Gets the over-ridden context object.
 NmOid getPrimaryOid()
          Gets the main context object.
 List getRemovedItemsByName(String param_name)
          Will return the list of NmOids which were selected for removal from the component defined by the component name param_name.
 HttpServletResponse getResponse()
          Gets the value of the attribute: response; available in the jsp engine only

Supported API: true
 ArrayList getSelectedContextsForPopup()
          Same as getSelectedOidForPopup but it does not auto-convert the NmContext -> NmOid if developer needs that extra info.
 ArrayList getSelectedOidForPopup()
          gets the selected objects from the table in the popup window jsp or table code if the UI needs to display something about the selected objects that were selected when the action was click to launch the window.
 String getTextParameter(String key)
          Gets a HTTP request parameter value in UTF8 format.
 String[] getTextParameterValues(String key)
          Gets all the HTTP request parameter values for the given key in UTF8 format.
 HashMap getUnChecked()
          Returns a hashMap of all the un-checked checkboxes on the page.
 void initializeServerRequestData()
          Initialize the commandbean so that request data is available in the Method Server The request object must have been set prior to this call Will not reset if called multiple times

Supported API: true
 void setOut(Object a_Out)
          Sets the value of the attribute: out; available in the jsp engine only

Supported API: true
 void setParameter(String name, String value, String[] values)
          Initialize the commandBean with a specific parameter.
 void setRequest(Object a_Request)
          Initializes the commandbean with all the request params.
 void setResponse(Object a_Response)
          Sets the value of the attribute: response; available in the jsp engine only

Supported API: true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPrimaryOid

public NmOid getPrimaryOid()
                    throws WTException
Gets the main context object. Usually the oid on the url from which the page was launched. last resort for knowing what the page should display info for. Use getActionOid(), getActionOidsWithWizard(), getActionOidsWithOutWizard() for determing the target of actions. Use getPageOid() for determing the object to use incase it jsp over-rode the context object on an include.

Supported API: true

Returns:
NmOid
Throws:
WTException

getPageOid

public NmOid getPageOid()
                 throws WTException
Gets the over-ridden context object. Same as primaryOid when no jsp include has occured. Use getActionOid(), getActionOidsWithWizard(), getActionOidsWithOutWizard() for determing the target of actions. Use getPageOid() for determing the object to use incase it jsp over-rode the context object on an include.

Supported API: true

Returns:
NmOid
Throws:
WTException

getElementOid

public NmOid getElementOid()
                    throws WTException
Gets the row context object. Use getActionOid(), getActionOidsWithWizard(), getActionOidsWithOutWizard() for determing the target of actions.

Supported API: true

Returns:
NmOid
Throws:
WTException

getNewChecked

public HashMap getNewChecked()
                      throws WTException
Returns a hashMap of Name of Checkbox -> Optional Column Name so that if one was to make a table of principals to Access control, the name would be the user, and the optional column name would be the access control.

Supported API: true

Returns:
HashMap
Throws:
WTException

getUnChecked

public HashMap getUnChecked()
                     throws WTException
Returns a hashMap of all the un-checked checkboxes on the page. Only returns values that were originally rendered with checkbox gui-components. Name of Checkbox -> Optional Column Name so that if one was to make a table of principals to Access control, the name would be the user, and the optional column name would be the access control.

Supported API: true

Returns:
HashMap
Throws:
WTException

getChangedRadio

public HashMap getChangedRadio()
                        throws WTException
Returns a hashMap of any radio buttons that have changed. Radio buttons needed to have been rendered by gui-comopnents. key,values of the hashmap are Name of radio -> Optional Column Name so that if one was to make a table of principals to Access control, the name would be the user, and the optional column name would be the access control.

Supported API: true

Returns:
HashMap
Throws:
WTException

getChangedText

public HashMap getChangedText()
                       throws WTException
Gets the textboxes that have changed. Name -> new value

Supported API: true

Returns:
HashMap
Throws:
WTException

getChangedTextArea

public HashMap getChangedTextArea()
                           throws WTException
Gets the textareas that have changed. Name -> new value

Supported API: true

Returns:
HashMap
Throws:
WTException

getChangedComboBox

public HashMap getChangedComboBox()
                           throws WTException
Gets the comboboxes that have changed. Name -> new value

Supported API: true

Returns:
HashMap
Throws:
WTException

getSelectedOidForPopup

public ArrayList getSelectedOidForPopup()
                                 throws WTException
gets the selected objects from the table in the popup window jsp or table code if the UI needs to display something about the selected objects that were selected when the action was click to launch the window.

Supported API: true

Returns:
ArrayList
Throws:
WTException

getAddedItemsByName

public List getAddedItemsByName(String param_name)
Will return the list of NmOids which were selected for addition from the component defined by the component name param_name.

Parameters:
param_name - The name of the component which the items were added to. (for example: table ID)
param_name -
Returns:
a list of oids that are added from the component.

Supported API: true

getRemovedItemsByName

public List getRemovedItemsByName(String param_name)
Will return the list of NmOids which were selected for removal from the component defined by the component name param_name.

Parameters:
param_name - The name of the component which the items were removed from. (for example: table ID)
param_name -
Returns:
a list of oids that are removed from the component.

Supported API: true

getTextParameter

public String getTextParameter(String key)
Gets a HTTP request parameter value in UTF8 format. Works in both Servlet engine and Method Server code. Use this instead of getRequest().getParameter()

Available in the servlet container and in the Method Server

Supported API: true

Parameters:
key -
Returns:
String

getTextParameterValues

public String[] getTextParameterValues(String key)
Gets all the HTTP request parameter values for the given key in UTF8 format.

Available in the servlet container and in the Method Server

Supported API: true

Parameters:
key -
Returns:
String[]

setRequest

public void setRequest(Object a_Request)
                throws WTException
Initializes the commandbean with all the request params. Each request param is iterated over to set JCA state. Sets the value of the attribute: request;

Supported API: true

Parameters:
a_Request -
Throws:
WTException

getResponse

public HttpServletResponse getResponse()
Gets the value of the attribute: response; available in the jsp engine only

Supported API: true

Returns:
HttpServletResponse

setResponse

public void setResponse(Object a_Response)
                 throws WTException
Sets the value of the attribute: response; available in the jsp engine only

Supported API: true

Parameters:
a_Response -
Throws:
WTException

getOut

public JspWriter getOut()
Gets the value of the attribute: out; available in the jsp engine only This is the jsp out variable

Supported API: true

Returns:
JspWriter

setOut

public void setOut(Object a_Out)
            throws WTException
Sets the value of the attribute: out; available in the jsp engine only

Supported API: true

Parameters:
a_Out -
Throws:
WTException

getSelectedContextsForPopup

public ArrayList getSelectedContextsForPopup()
                                      throws WTException
Same as getSelectedOidForPopup but it does not auto-convert the NmContext -> NmOid if developer needs that extra info.

Supported API: true

Throws:
WTException

getActionOid

public NmOid getActionOid()
                   throws WTException
Gets the object that is the target of the action. This could be the elementOid for a row based action or the primarOid for actions invoked on the details page It will not look at selected objects for toolbar actions. Please use for toolbar actions: getActionOidsWithWizard, getActionOidsWithOutWizard

Supported API: true

Throws:
WTException

setParameter

public void setParameter(String name,
                         String value,
                         String[] values)
                  throws WTException
Initialize the commandBean with a specific parameter.

Parameters:
name - - the name of the request parameter
value - - the value to set
values - - array of values, if null, will be defaulted to be new String {value}

Supported API: true
Throws:
WTException

initializeServerRequestData

public void initializeServerRequestData()
Initialize the commandbean so that request data is available in the Method Server The request object must have been set prior to this call Will not reset if called multiple times

Supported API: true


getActionOidsWithWizard

public ArrayList<NmOid> getActionOidsWithWizard()
                                         throws WTException
Gets the actions oids of a action that had a wizard. Use this method to find which objects the action should act upon. When its in a toolbar, this will return all the selected objects when the action was launched. When launched from other locations it will return the actionOid

Supported API: true

Throws:
WTException

getActionOidsWithoutWizard

public ArrayList<NmOid> getActionOidsWithoutWizard()
                                            throws WTException
Gets the actions oids of a action that does not have a wizard. Use this method to find which objects the action should act upon. When its in a toolbar, this will return all the selected objects when the action was launched. When launched from other locations it will return the actionOid

Supported API: true

Throws:
WTException

getNmOidSelected

public ArrayList<NmOid> getNmOidSelected()
                                  throws WTException
Get the selected objects as oids. getSelected() method will return NmContexts which provides more info but requires calling code to cast and and call getTargetOid()

Supported API: true

Throws:
WTException

getNmOidSelectedInOpener

public ArrayList<NmOid> getNmOidSelectedInOpener()
                                          throws WTException
Get the selected-in-opener objects as oids. getSelectedInOpener() method will return NmContexts which provides more info but requires calling code to cast and and call getTargetOid()

Supported API: true

Throws:
WTException