Hitachi

JP1 Version 12 JP1/Navigation Platform Content Editing Guide


5.12.1 JavaScriptPluginManager (JavaScript Plugin Manager class)

This class provides objects that allow JavaScript to perform processing provided by Navigation Platform. By using the reserved variable ucnpJavaScriptPluginManager, you can acquire these objects from JavaScript.

The following table describes the methods of JavaScriptPluginManager. Some methods of JavaScriptPluginManager can also be used in JavaScript running on a web browser (on the client-side).

Table 5‒5: Methods of JavaScriptPluginManager

Method name

Description

Can the method be used in JavaScript running on a web browser (on the client-side)?

getCurrentParamsTypeMap

This method acquires the Map object that stores the input parameter names and type names of the Guide Parts connected to the input parameters.

Y

getParam

This method acquires the Map object to be passed to the second argument of the JavaScript Plugin.

Y

getParamValue

This method acquires the cached value of the specified parameter.

If the connected Guide Parts are radio buttons, check boxes, or hyperlinks, you can specify whether to acquire the entire cached value including the label portion of it or the cached value without the label portion.

Y

getReturnMap

This method acquires the Map object used as the return value of the JavaScript Plugin.

Y

getRestClient

This method acquires the RestClient object.

N

getSession

This method acquires the HttpSession object to be passed to the first argument of the JavaScript Plugin.

N

isInput

This method determines whether the call is made by the input method of the input parameter (a method similar to the inputFromNode method).

Y

Legend:

Y: Can be used.

N: Cannot be used.

Organization of this subsection

(1) getCurrentParamsTypeMap method

This method acquires the Map object that stores the input parameter names and type names of the Guide Parts connected to the input parameters.

(a) Format

public Map<String, String> getCurrentParamsTypeMap();

(b) Arguments

None

(c) Return values

The Map object is returned, with the input parameter names stored in keys and the type names stored in values.

Note that the Map object does not store information regarding the keys of the input parameters to which no Guide Parts are connected.

The following table describes the type names of Guide Parts.

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

(2) getParam method

This method acquires the Map object to be passed to the second argument of the JavaScript Plugin.

(a) Format

public Map<String, Object> getParam();

(b) Arguments

None

(c) Return values

The Map object to be passed to the first argument of the JavaScript Plugin is returned.

When a value is input to the input parameter, this object stores information similar to the one held by the second argument (param) of the inputFromNode method. When a value is output to the output parameter, this object stores information similar to the one held by the outputToNode method. For details about the inputFromNode method and the outputToNode method, see the manual JP1/Navigation Platform Development Guide.

Note that you cannot get the value of the ucnp.current.params.map key from this object.

(d) Exception

None

(3) getParamValue method

This method acquires the cached value of the specified parameter.

If the connected Guide Parts are radio buttons, check boxes, or hyperlinks, you can specify whether to acquire the entire cached value including the label portion of it or the cached value without the label portion.

(a) Format

Format 1

public String getParamValue(String paramName);

Format 2

public String getParamValue(String paramName, boolean withLabel);

(b) Arguments

  • paramName

    This argument specifies the name of the parameter for which to acquire a cached value.

  • withLabel

    This argument specifies whether to acquire the entire cached value, including the label, for the parameter. Note that, if you use this method with Format 1, it is assumed that this argument is set to false.

    • true

      The entire value including the label is returned as is.

    • false

      Depending on the type of the connected Guide Part, one of the values shown in the following table is returned.

      Table 5‒7: Types of Guide Parts and the corresponding values to be acquired

      No.

      Guide Part type

      Value to be acquired

      1

      Static text

      Cached value

      2

      Image

      Cached value

      3

      Text box

      Cached value

      4

      Text area

      Cached value

      5

      Radio button

      Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed

      6

      Check box

      Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed

      7

      Drop down

      Cached value

      8

      Hyperlink

      Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed

      9

      Inline frame

      Cached value

(c) Return values

The cached value for the specified parameter is returned.

(d) Exception

None

(4) getReturnMap method

This method acquires the Map object used as the return value of the JavaScript Plugin.

(a) Format

Map<String, Object> getReturnMap();

(b) Arguments

None

(c) Return values

The Map object to be passed to the first argument of the JavaScript Plugin is returned.

When a value is input to the input parameter, this object stores information similar to the one held by the second argument (param) of the inputFromNode method. When a value is output to the output parameter, this object stores information similar to the one held by the outputToNode method. For details about the inputFromNode method and the outputToNode method, see the manual JP1/Navigation Platform Development Guide.

(d) Exception

None

(5) getRestClient method

This method acquires the RestClient object.

(a) Format

public RestClient getRestClient();

(b) Arguments

None

(c) Return values

The RestClient object is returned.

(d) Exception

None

(6) getSession method

This method acquires the HttpSession object to be passed to the first argument of the JavaScript Plugin.

(a) Format

public HttpSession getSession();

(b) Arguments

None

(c) Return values

The HttpSession object to be passed to the first argument of the JavaScript Plugin is returned.

This object stores information similar to the one held by the first argument (session) of the inputFromNode method and the outputToNode method. For details about the inputFromNode method and the outputToNode method, see the manual JP1/Navigation Platform Development Guide.

(d) Exception

None

(7) isInput method

This method determines whether the call is made by the input method of the input parameter (a method similar to the inputFromNode method).

(a) Format

boolean isInput();

(b) Arguments

None

(c) Return values

  • true

    When the call is made by the input method of the input parameter (a method similar to the inputFromNode method) (The JavaScript Plugin is executed when a transition is made from the node on which it is placed to the next node)

  • false

    When the call is not made by the input method of the input parameter (a method similar to the inputFromNode method) (The JavaScript Plugin is executed when a transition is made to the node on which it is placed)

(d) Exception

None