Item name |
Content |
Remarks |
Trigger name |
Enter the name of the trigger. |
|
Execution path |
Enter execution path of trigger. |
- The default value is "path".
- Example: If in the execution path "run" is specified, the URL of trigger execution will be as follows.
http://<Hostname or IP address of DataSpiderServer>:<Port number of DataSpiderServer>/dataspider/trigger/run
- If [Enable HTTPS] at [Control Panel] - [DataSpiderServer Settings] - [Security] tab is checked, URL of trigger execution is as follows.
https://<Hostname or IP address of DataSpiderServer>:<SSL port number of DataSpiderServer>/dataspider/trigger/run
|
Action when executed successfully |
Select the action script which is running in HTTP trigger successfully end.
- [Return page generated by script]: (default)
Returns the data in trigger variable "trigger.outputHtml".
- [Forwarded to another page]:
Forward to another web page such as JSP.
|
-
Request can only be forwarded to either a JSP or an HTML.
-
Set JSP file under $DATASPIDER_HOME/server/system/kernel/modules/webcontainer/META-INF/catalina/webapps/dataspider.
|
Action when exit abnormally |
Select the operation in case that script performed by HTTP trigger script exits abnormally.
- [Return error page of web server]: (default)
Returns an error page that is set in the web server.
- [Forwarded to another page]:
You can forward to another JSP Web page.
|
-
Request can only be forwarded to either a JSP or an HTML.
-
Set JSP file under $DATASPIDER_HOME/server/system/kernel/modules/webcontainer/META-INF/catalina/webapps/dataspider.
|
Request settings |
Settings pertaining to HTTP request received |
|
Request settings/Encoding |
Select the encoding.
|
- Defaults to 'UTF-8'
If you receive XML data or JSON data, the encoding specified is ignored.
- If the any specification of encoding in the XML document is present, it will be used. Otherwise the encoding used defaults to UTF-8.
- Treat JSON data as UTF-8.
|
Response settings |
Settings pertaining to HTTP response returned. |
If the script executed on the HTTP trigger event fails,[Response settings] is disregarded and error will be returned accordingly to the settings in the [Action when exit abnormally]
|
Response settings/Encoding |
Specify the encoding used for the http response returned. |
- Defaults to 'UTF-8'
Encoding setting is disregarded when request is forwarded.
Encoding needs to be specified in the JSP the request is forwarded.
|
Response settings/Content-Type |
Select the media type of the Content-Type
-
[Not specified]:
The media type is determined by the content returned.
text/html is used if the data is not XML.
text/xml is used for XML data.
-
[text/html]:(default)
text/html is used.
-
[text/xml]:
text/xml is used.
-
[text/plain]:
text/plain is used.
-
[text/csv]:
text/csv is used.
-
[application/json]:
application/json is used.
|
-
For more about the [text/csv] used, see CSV Output.
-
For more about the [application/json] used, see JSON Output.
|
Response settings/Output as file |
Select whether the response should be output as a file. |
|
Response settings/Specify file name by trigger variables |
Select whether to specify file name to be output by trigger variables "trigger.file_name". |
-
Enabled if [Response settings/Output as file]is checked.
|
Response settings/File name |
Enter the name of the file to be output. |
-
Enabled if [Response settings/Output as file]is checked and [Response settings/Specify file name by trigger variables] is unchecked.
-
Multi-byte character is not supported.
|
Item name |
Content |
Remarks |
Trigger owner |
Select the owner of the trigger to be created. |
Can only be selected by users with administrator privileges.
(Ordinary users can select themselves only.)
|
Execution user name |
Select the user to run script specified by [Script]. |
|
Password |
Type the password associated with the user specified by [Execution user name]. |
|
Service |
Select the script to run by trigger. |
- Project that was registered as a service displays.
|
Script |
Select the script to run by trigger. |
- Script in the service specified by [Service] displays.
|
Script arguments |
script input variables that is set in script specified by [Script] displays |
- The script output variable does not display.
For details on how to set script input variables into script and to use, refer to "Input/output Variables".
|
Script arguments / Variable name |
Script variable name is displayed. |
|
Script arguments / Type |
Script variable number type is displayed. |
|
Script arguments / Value |
Enter a script variable value. |
|
Script outputs |
Script output variables that is set in script specified in [Script] appears. |
- The script input variables does not display.
For details on how to set script output variables into script and to use, refer to "Input/output Variables".
|
Script outputs / Variable name |
Script variable name is displayed. |
|
Script outputs / Type |
Script variable number type is displayed. |
|
Script outputs / Value |
Enter a script variable value. |
|
Trigger variable name |
Value |
Content |
Remarks |
Input data |
trigger.inputData |
Formats to treat the request itself differ depending on the value of Content-Type header of request.
- [text/xml] or [application/xml]:
Treats request as XML format and stores in script input variable.
- [application/json]:
Treats request as JSON format and stores in script input variable.
|
- Example: ${trigger.inputData}
The value can be stored only to an XML type input variable.
- For how to treat JSON format data, refer to "Converting JSON Format Data".
|
Exit code |
trigger.exitStatus |
Exit status of Running script. |
- Example: ${trigger.exitStatus}
|
Message when exit abnormally |
trigger.failureMessage |
The error message string if the script fails to run. |
- Example: ${trigger.failureMessage}
|
Service name |
trigger.serviceName |
The service name of the script execution. |
- Example: ${trigger.serviceName}
For compatibility, trigger.projectName will also work.
|
Script name |
trigger.scriptName |
The script name of the script execution. |
- Example: ${trigger.scriptName}
|
Output data |
trigger.outputData |
If [Return page generated by script] is selected in [Action when executed successfully] the value dereferenced by this variable will be returned to the HTTP client. |
- Example:${trigger.outputData}
For compatibility, trigger.outputHtml will also work.
|
Client address |
trigger.client_address |
The IP address of the client which sent the request or the proxy server which connected. |
- Example:${trigger.client_address}
|
HTTP header |
trigger.header:<HTTP request header name> |
Stores the request header value specified in <HTTP request header name> to script input variable. |
- Example:${trigger.header:Content-Type}
- Does not distinguish between upper and lower case of header name specifying to <HTTP request header name>.
- If specified header does not exist in <HTTP request header name>, default value of script variable will be used.
- If header specified in <HTTP request header name> exists multiply, the header value detected first will be stored.
|
trigger.header:<HTTP response header name> |
Adds the value of name specified in <HTTP response header name> and the value in variables to response header. |
- Example:${trigger.header:X-PRODUCT-NAME}
- The following headers will be ignored despite specifying.
- Content-Type
- Content-Disposition
- Content-Length
- Transfer-Encoding
- Date
- Server
|
Status code |
trigger.status_code |
Set the value within this variable into response status code. |
- Example:${trigger.status_code}
For details on specifiable status codes, refer to "Response status code".
|
Output file name |
trigger.file_name |
Set the value within this variable into response file name. |
- Example:${trigger.file_name}
Multi-byte character is not supported.
|
Element Name |
Attribute Name |
Description |
Remarks |
root |
- |
Root element that wraps JSON object. |
|
type |
Sets attribute value that shows JSON type.
Attribute Value |
Description |
object |
Shows JSON object type.
Example:JSON object that consists of object type
{"name":"Suzuki"}
Outputs the above JSON object example by converting into the following XML data.
<root type="object">
<name type="string">Suzuki</name>
</root>
|
array |
Shows JSON array type.
Example:JSON object that consist of array type
["apple","grape","orange"]
Outputs the above JSON object example by converting into the following XML data.
<root type="array">
<element type="string">apple</element>
<element type="string">grape</element>
<element type="string">orange</element>
</root>
|
|
|
JSON member name |
- |
Element showing JSON member. |
|
type |
Sets attribute value showing JSON type.
Attribute Value |
Description |
string |
Shows JSON character string type.
Example:JSON member that has character string type value.
{"name":"Suzuki"}
Outputs the above JSON member example by converting into the following XML data.
<name type="string">Suzuki</name>
|
number |
Shows tha JSON numeric value type.
Example:JSON member that has numeric value type value.
{"age":37}
Outputs the above JSON member example by converting into the following XML data.
<age type="number">37</age>
|
boolean |
Shows boolean type of JSON.
Example:JSON member that has boolean type value.
{"success":true}
Outputs the above JSON member example by converting into the following XML data.
<success type="boolean">true</success>
|
object |
Shows object type of JSON.
Example:JSON member that has object type value.
{"name":{"first":"Ichiro","last":Suzuki"}}
Outputs the above JSON member example by converting into the following XML data.
<name type="object">
<first type="string">Ichiro</first>
<last type="string">Suzuki</last>
</name>
|
array |
Shows array type of JSON.
JSON array type element is showed as "element" element.
If JSON array type element is object type, XML data that has schema showing JSON object is output to child element of "element" element, and if other types, the value is output to element contents of "element" element.
Schema is as follows.
<JSON member name type="array">
<element type="Attribute value showing JSON type">value</element>
:
</JSON member name>
Example:JSON member that has array type value.
{"fruits":["apple","grape","orange"]}
Outputs the above JSON member example by converting into the following XML data.
<fruits type="array">
<element type="string">apple</element>
<element type="string">grape</element>
<element type="string">orange</element>
</fruits>
|
null |
Shows null type of JSON.
Example:JSON member that has null type value.
{"name":null}
Outputs the above JSON member example by converting into the following XML data.
<name type="null"/>
|
|
|
element |
- |
Elment name that shows array type element. |
|
type |
Outputs the character string that shows JSON type.
Same attribute value as JSON member name type attribute will be set.
|
|
member |
- |
Element name that is used when the JSON member name is inappropreate as XML element name. |
|
type |
Character string that shows JSON type will be output.
Same attribute value as JSON member name type attribute will be set.
|
|
name |
Outputs JSON member name.
Example:JSON member that has inappropreate name as XML element name
{"1name":"Suzuki"}
Outputs the above JSON member example by converting into the following XML data.
<member type="string" name="1name">Suzuki</member>
|
|