Hitachi

JP1 Version 12 JP1/Navigation Platform Development Guide


5.2.1 inputFromNode method

When transition occurs from a node that contains an I/O Plugin to another node, this method performs processing to acquire and input information about the transition source node.

You can use this method to effectively implement data update processing, such as acquiring information about the transition source node and linking with the external system, during node transition.

Notes on the inputFromNode method

Organization of this subsection

(1) Format

public Map<String, Object> inputFromNode(HttpSession session, Map<String, Object> param);

(2) Arguments

(a) session

This argument stores the current session. To execute the setAttribute() method for the HttpSession object acquired in a plugin, do not specify any of the following names for the name argument of the setAttribute() method:

  • Name beginning with "ucnp"

  • Name beginning with "java."

  • Name beginning with "javax."

  • Name beginning with "javax.portlet."

  • Name beginning with "hptl"

  • Name beginning with "com.cosminexus"

  • Name beginning with "jp.co.hitachi.soft.portal"

You can also use the URL request parameter. To use this parameter, you must acquire the ucnpOptions parameter by using the ucnp.request.options key.

You can acquire the ucnpOptions parameter for each session or for each window ID. We recommend that you acquire the value of the ucnpOptions parameter for each window ID. For details about how to acquire the values for each window ID, see (b) param.

Reason why data acquisition for each session is not recommended

If multiple windows of Navigation Platform are displayed in the same session, the HTTP session is overwritten with the value of the ucnpOptions parameter of the window that you worked with last. As a result, information of the ucnpOptions parameters for previously used windows is deleted.

ucnp.request.options key

This key is used to acquire the value of the ucnpOptions parameter (specified for the URL) from the session. By specifying this key in the HttpSession.getAttribute() method, you can acquire the URL decoded value of the ucnpOptions parameter. If the ucnpOptions parameter is not specified for the URL, null is returned.

  • Specification example of the ucnp.request.options key (for each session) (not recommended)

public class IoPluginController implements IIoPluginController {
 
    /**
     * Execute the server processing for I/O Plugins.
     * 
     * @param session
     *            The current session
     * @param param
     *            The parameter sent from the client
     */
    public Map<String, Object> inputFromNode(HttpSession session, Map<String, Object> param){
 
        /* Obtain the value of the ucnpOptions parameter from the current session. */
        String ucnpOptions = (String) session.getAttribute("ucnp.request.options");
        if (ucnpOptions != null) {
            /* If the ucnpOptions parameter is specified, describe the processing for that value. */
            ...
        }
    }
}

(b) param

This argument stores the information sent from the client during execution of the I/O Plugin. The table below provides details. Do not update the param parameter.

Table 5‒2: Keys stored in param (inputFromNode method)

No.

Key name

Value

Description

1

ucnp.current.params.map

Map<String,String>

  • Key: String of one or more characters

  • Value: String of zero or more characters

When an I/O Plugin is executed, a Map containing the following key and value pair is passed:

  • Key

    Input parameter name of the I/O Plugin

  • Value

    Cache value of the Guide associated with the input parameter

Parameters not associated with the Guide are not contained in the key.

For details about cache values of Guide Parts, see (5) Cache values of Guide Parts.

2

ucnp.current.params.type.map

Map<String,String>

  • Key: String of one or more characters

  • Value: String of zero or more characters

When an I/O Plugin is executed, a Map containing the following key and value pair is passed:

  • Key

    Input parameter name of the I/O Plugin

  • Value

    Type name of the Guide associated with the input parameter

Parameters not associated with the Guide are not contained in the key.

For details about type name of Guide Parts, see (6) Type names of Guide Parts.

3

ucnp.button.type

String

One of the following:

  • "start"

  • "show_next_page"

  • "show_previous_page"

  • "show_complete_page"

Indicates the type of the clicked button or the type of transition.

  • "start"

    Switch from the Terminal Node (start) to a Process Node.

    Alternatively, display the first Process Node not connected to the Terminal Node (start).

  • "show_next_page"

    Switch to the next node by clicking the button or directly selecting the node.

    Alternatively, switch to a Process Node for which the transition destination node exists or a Process Node with the Back button displayed.

  • "show_previous_page"

    Switch to the previous node by clicking the button or directly selecting the node.

  • "show_complete_page"

    Switch to a node with the Done button displayed.

    Alternatively, switch to a Process Node for which the transition destination node does not exist and for which the Back button is hidden.

4

ucnp.isdirectjump

String

Either of the following:

  • "true"

  • "false"

Indicates whether the transition type is direct transition.

  • "true"

    Direct transition

  • "false"

    Not direct transition

5

ucnp.current.node.name

String

String of zero or more characters

The node name corresponding to the transfer-source Guide is passed.

If the node name has not been set, an empty character string is passed.

6

ucnp.next.node.name

String

String of zero or more characters

The node name corresponding to the transfer-destination Guide is passed.

If the node name has not been set, an empty character string is passed.

7

ucnp.current.node.id

String

String of zero or more characters

The node ID corresponding to the transfer-source Guide is passed.

If the node ID has not been set, an empty character string is passed.

8

ucnp.next.node.id

String

String of zero or more characters

The node ID corresponding to the transfer-destination Guide is passed.

If the node ID has not been set, an empty character string is passed.

9

ucnp.flow.contents.id

String

String of one or more characters

The Operational Content ID of the selected Operational Content is passed.

10

ucnp.flow.contents.name

String

String of one or more characters

The Operational Content name of the selected Operational Content is passed.

11

ucnp.flow.contents.execute.id

String

Indicates the Operational Content execution ID, which is assigned during execution of Operational Content

12

ucnp.flow.contents.version.id

String

Indicates the version ID of the Operational Content being used for execution.

13

ucnp.screen.id

String

String of one or more characters

The window ID is passed, which uniquely identifies the window being used for execution of Operational Content.

14

ucnp.screen.ispreview

String

Either of the following:

  • "true"

  • "false"

Indicates whether the window being used for execution of Operational Content is the preview window.

  • "true"

    Preview window

  • "false"

    Operational Content Execution Window

15

ucnp.options.param#

String

Indicates the URL decoded value of the ucnpOptions parameter acquired for each window ID.

This key is not set if the ucnpOptions parameter is not specified.

#

This key is used to acquire the value of the ucnpOptions parameter (specified for the URL) for each window ID. By specifying this key in the param argument, you can acquire the URL decoded value of the ucnpOptions parameter. If the ucnpOptions parameter is not specified for the URL, null is returned.

  • Specification example of the ucnp.options.param key (for each window ID) (recommended)

public class IoPluginController implements IIoPluginController {
    /**
     * Execute the server processing for I/O Plugins.
     *
     * @param session
     *            The current session
     * @param param
     *            The parameter sent from the client
     */
   public Map<String, Object> inputFromNode(HttpSession session,Map<String, Object> param) {
        /*  Acquire the value of the ucnpOptions parameter from the argument. */
        String ucnpOptions = (String) param.get("ucnp.options.param");
        if (ucnpOptions != null) {
            /* If the ucnpOptions parameter is specified, describe the processing for that value. */
        }
    }
}

(3) Return values

The execution result of the I/O Plugin is returned as a Map. The table below provides details. Values not covered in the table are ignored.

Table 5‒3: Return values of the inputFromNode method

No.

Key name

Value

Description

1

ucnp.error.message

String

String of zero or more characters

Set this key if you want to display a message for users after execution of the inputFromNode method.

The string specified for this key is displayed in the message dialog box after the inputFromNode methods of all I/O Plugins associated with the transfer-source node are executed.

Note the following when setting this key:

  • Use \n to specify a linefeed.

  • If this key is set for multiple I/O Plugins, the specified strings are connected and displayed in the message dialog box, using a linefeed as a delimiter. If a message is too long, it might not be displayed fully in the window. Check the message size and make sure that the whole message can be displayed in the window.

2

ucnp.error.type

String

Either of the following:

  • "NG"

  • "WARNING"

Specify whether to suppress node transition after the message dialog box specified for ucnp.error.message is displayed.

  • "NG"

    Transition is suppressed.

  • "WARNING"

    Transition is not suppressed.

The value specified for this key is ignored in the following cases:

  • A value is not specified for ucnp.error.message.

  • Null is specified for ucnp.error.message.

"NG" is assumed in the following cases:

  • A string other than "NG" and "WARNING" is specified.

  • Null is specified.

  • A value is not specified.

When you execute multiple I/O Plugins, operation is different depending on the setting as shown below:

  • "WARNING" is specified for all I/O Plugins.

    Transition is not suppressed.

  • "WARNING" is not specified for any I/O Plugin.

    Transition is suppressed.

3

ucnp.error.params.list

List<String>

String of one or more characters

Set this key if you want to highlight a Guide Part for which node transition is suppressed. For the value of the key, specify the list of input parameters associated with that part. The Guide Part will be displayed with a colored frame.

The default frame color is red. You can change the frame color by using the ucnp.base.client.erroritem.emphasis.border.color property in the user property file (ucnp_user.properties).

For details about the user property file, see the manual JP1/Navigation Platform Setup and Operations Guide.

Specify this key together with the ucnp.error.message key in the Map of the return value. If you set this key without setting the ucnp.error.message key, the highlight display is disabled.

If node transition is not suppressed, the value specified for this key is ignored.

4

ucnp.next.nodes.active.list

List<String>

Specify the transition destination node.

This activates the Next button corresponding to the process node ID contained in the list, and deactivates buttons not included in the list.

To activate all buttons, specify null.

To deactivate all buttons, specify an empty list.

If this key is specified by multiple plugins simultaneously, buttons will be activated if even one of these is activated.

If a transition destination node is specified from a JavaScript Plugin, by default all buttons will be activated without running the plugin when the Back button is clicked.

To specify the transition destination node even when the Back button is clicked, select the Execute when return. check box before specifying this.

This setting may make direct transition impossible for certain nodes. The check mark will be removed for nodes that can no longer transition due to this setting.

A KDCZ00362-E error will occur if direct transition destination nodes can no longer transition due to the plugin specified on the transition path. When an error occurs, Navigation Platform will behave in the same way as when "NG" is specified for ucnp.error.type.

The following table describes the return values of the inputFromNode method and operations after execution of the I/O Plugin associated with the transition source node.

Table 5‒4: Return values and operations after execution of the I/O Plugin associated with the transition source node

No.

Value specified for "ucnp.error.message"

Value specified for "ucnp.error.type"

Value specified for "ucnp.error.params.list"

Execution result of the method

Dialog box display

Node transition

Highlight display

1

Not specified, or null

NG

Specified (other than null)

Normal

Disabled

Disabled

Disabled

2

Not specified, or null

Normal

Disabled

Disabled

Disabled

3

WARNING

Specified (other than null)

Normal

Disabled

Disabled

Disabled

4

Not specified, or null

Normal

Disabled

Disabled

Disabled

5

Values other than NG and WARNING

Specified (other than null)

Normal

Disabled

Disabled

Disabled

6

Not specified, or null

Normal

Disabled

Disabled

Disabled

7

Specified (other than null)

NG

Specified (other than null)

Error

Enabled

Enabled

Enabled

8

Not specified, or null

Error

Enabled

Enabled

Disabled

9

WARNING

Specified (other than null)

Warning

Enabled

Disabled

Disabled

10

Not specified, or null

Warning

Enabled

Disabled

Disabled

11

Values other than NG and WARNING

Specified (other than null)

Error

Enabled

Enabled

Enabled

12

Not specified, or null

Error

Enabled

Enabled

Disabled

(4) Exception

None

(5) Cache values of Guide Parts

The following table describes the cache values of Guide Parts retained in plugins.

Table 5‒5: Cache values for each type of Guide Part

No.

Guide Part type

Cache value

Default value

1

Static text

Displayed character string

The value specified in the Displayed string text box in the Attribute Settings window

2

Image

A string consisting of the URL and the attribute value of the tool tip connected by a linefeed code (if the tool tip is an empty character string, the linefeed code is still included in the cache value).

A string consisting of the value specified in the URL text box, a linefeed code, and the value specified for the Tool tip text box in the Attribute Settings dialog box

3

Text box

The value entered in the text box

The value specified in the Default value text box in the Attribute Settings window

4

Text area

The value entered in the text area

The value specified in the Default value text area in the Attribute Settings window

5

Radio button

- If the Store label information too. check box is not selected:

The value specified in the Value text box for the selected radio button

- If the Store label information too. check box is selected:

A string consisting of the value specified in the Displayed string text box and the value specified in the Value text box in the Attribute Settings window for setting the selected radio button, which are connected to each other by a linefeed code (if a radio button is not selected: empty character string)

empty character string

6

Check box

- If the Store label information too. check box is not selected:

  • true: The check box is selected

  • false: The check box is cleared

(In any case, a single-byte character string is used.)

- If the Store label information too. check box is selected:

A string consisting of the value specified in the Displayed string text box in the Attribute Settings window and the following value, which are connected to each other by a linefeed code:

  • true: The check box is selected

  • false: The check box is cleared

(In any case, a single-byte character string is used.)

- If the Store label information too. check box is not selected:

  • true: The Change the default value to the check status check box is selected

  • false: The Change the default value to the check status check box is cleared

- If the Store label information too. check box is selected:

A string consisting of the value specified in the Displayed string text box in the Attribute Settings window and the following value, which are connected to each other by a linefeed code:

  • true: The Change the default value to the check status check box is selected

  • false: The Change the default value to the check status check box is cleared

7

Drop down

The value selected in the Selections list field

(Even if the value including commas or quotation marks ("), specify the value as is without using escape characters in CSV. For example, Cali"fornia" specified for the cache value is not interpreted as "Cali""fornia""".

  • The first value in the Selections list field (in the Attribute Settings window) that corresponds to a value in the Parent value field (if no corresponding value exists in the Parent value field, an empty character string is used)

  • If no parent drop down exists, the first value of the Selections list field (in the Attribute Settings window) for which the Parent value field is an empty character string

8

Hyperlink

A string consisting of the anchor string and the value specified for the URL, connected by a linefeed code

(A tool tip is not included in the string.)

  • A string consisting of the anchor string and the value specified for the URL, connected by a linefeed code

  • The values specified in the Anchor String text box and URL text box in the Attribute Settings window

9

Inline frame

The URL of the displayed page

(The setting of whether to display a frame is not included.)

The value specified in the URL text box in the Attribute Settings window

10

HTML Part

Displayed HTML Content

The value specified in the HTML String text box in the Attribute Settings window

Notes applicable to all types of parts

Note on text boxes

Note on radio buttons and check boxes

Notes on drop-down parts

Note on hyperlinks

(6) Type names of Guide Parts

The following table describes the type names of Guide parts retained in plugins.

Table 5‒6: Guide Part type names

No.

Guide Part type

Guide Part type name

1

Static text

Label

2

Image

Image

3

Text box

TextBox

4

Text area

TextArea

5

Radio button

RadioButton

6

Check box

CheckBox

7

Drop down

DropDown

8

Hyperlink

HyperLink

9

Inline frame

Iframe