|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an object that will implement the presentation logic for a data field. The presentation component is responsible for:
When the user submits a request by clicking one of the action button on a form, a HTTP POST request is sent to the Process Manager engine. The remaining method defined in this interface - the update method - is responsible for translating the data coming from the browser into the data structure that the custom field normally deals with. Think of this as the layer you would write to translate string values coming from a CGI request into numerical values or whatever data format you want.
The key idea behind this component is front-end; any logic needed to communicate with the client front-end is contained here.
IHTMLPage
,
IDataElement
,
IProcessInstance
,
IPMRequest
Field Summary | |
static int |
MODE_EDIT
Display mode value for editable presentation. |
static int |
MODE_HIDDEN
Display mode value for hidden presentation. |
static int |
MODE_VIEW
Display mode value for view-only presentation. |
Method Summary | |
void |
display(IHTMLPage html,
int displayMode,
java.lang.String displayFormat)
Ask the presentation element to display its portion of the business document. |
void |
display(IProcessInstance pi,
IHTMLPage html,
int displayMode,
java.lang.String displayFormat)
Ask the presentation element to display its portion of the business document. |
IDataElement |
getDataElement()
Get access to the data storage side of the field. |
void |
update(IProcessInstance pi,
IPMRequest rq)
Translates the HTTP POST/GET string parameters for this field into the usual data object associated with the field. |
Methods inherited from interface com.netscape.pm.model.IPMElement |
dumpState, getDescription, getName, getParent, getPrettyName, getProperty, isLocked, lockObject, postCreation, setParent, setProperties, toString |
Field Detail |
public static final int MODE_EDIT
displayMode
in either display
method,
the field should attempt to display itself in an editable format
in HTML. For instance, if the field represents itself as an HTML
textbox, editable mode would be a regular textbox that is able to
accept user input.display( IHTMLPage, int, String )
,
display( IProcessInstance, IHTMLPage, int, String )
public static final int MODE_VIEW
displayMode
in either display
method,
the field should attempt to display itself in a view-only format in
HTML. For instance, if the field represents itself as an HTML
textbox, viewable mode could be just outputting the text contained in
the field, instead of the regular textbox that would be displayed in
editable mode.display( IHTMLPage, int, String )
,
display( IProcessInstance, IHTMLPage, int, String )
public static final int MODE_HIDDEN
displayMode
in either display
method, the
field should not attempt to display itself and should only write out
hidden information, such as a hidden form tag, for client-side
JavaScript functions to access.display( IHTMLPage, int, String )
,
display( IProcessInstance, IHTMLPage, int, String )
Method Detail |
public void display(IHTMLPage html, int displayMode, java.lang.String displayFormat) throws java.lang.Exception
display
is only
called when a client is viewing the field from an entry point form,
as no process instance will have been instantiated at that point.
The display mode and display format parameters are defined at design-time by the process designer. The display mode behaves the same as it did in NPM 1.x, where the possible values where EDIT, VIEW and HIDDEN. It is up to you to alter the display of the field depending upon the display mode passed to the method. The display format was introduced in PAE 4.0; its value is completely designer-specific. One potential use could be to distinguish between a secure viewing mode and a non-secure viewing mode (for example, credit card information). In that example, the display format could contain either the value "secure" or "not secure".
In the event that your display call fails, you can throw a java.lang.Exception at any time to signal an error. An error message will be displayed to the user.
html
- the HTML page to be returned to the userdisplayMode
- the mode the field should be displaying
itself in; possible values are MODE_EDIT,
MODE_VIEW and MODE_HIDDENdisplayFormat
- additional formatting information available
to the field. This value is specified from
the inspector window of the field when it
is placed in the formjava.lang.Exception
- if there is a problem displaying the
contents of the field.MODE_EDIT
,
MODE_VIEW
,
MODE_HIDDEN
,
IHTMLPage
public void display(IProcessInstance pi, IHTMLPage html, int displayMode, java.lang.String displayFormat) throws java.lang.Exception
display
will be called
after the process instance has already been created, that is everywhere
but the entry point node. The process instance will contain the data
that is associated with your custom field; your implementation of
this method will need to fetch the data object via the
getData
method of the process instance class before
displaying it.
In the event that your display call fails, you can throw a java.lang.Exception at any time to signal an error. An error message will be displayed to the user.
pi
- the current process instancehtml
- the HTML page to be returned to the userdisplayMode
- the mode the field should be displaying
itself in; possible values are MODE_EDIT,
MODE_VIEW and MODE_HIDDENdisplayFormat
- additional formatting information available
to the field. This value is specified from
the inspector window of the field when it
is placed in the formjava.lang.Exception
- if there is a problem displaying the
contents of the field.MODE_EDIT
,
MODE_VIEW
,
MODE_HIDDEN
,
display( IHTMLPage, int, String )
,
IHTMLPage
,
IProcessInstance
public void update(IProcessInstance pi, IPMRequest rq) throws java.lang.Exception
This method is called after the user has submitted a request to the
Process Manager server. Since all requests in our system take the
form of an HTTP GET/POST, the purpose of the update method is to
translate the form parameters included as part of the request into
the usual data object associated with your custom field. To take our
shopping cart field as an example, suppose the form includes values
for an item ID and an item quantity. The update method will need to
convert the item quantity to a numerical value and create a
Item
object out of the item ID. The created item data
object can then be bound to the process instance via
setData
.
pi
- the current process instancerq
- the current HTTP requestjava.lang.Exception
- if there is a problem translating
the HTTP parameters to the field's
internal format.IProcessInstance
,
IPMRequest
public IDataElement getDataElement()
IDataElement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |