Configuring the Adapter for JSON

Topics:

How to:

x

You can configure the Adapter for JSON from the Web Console or the Data Management Console.

Procedure: How to Configure the Adapter

You can configure the adapter from either the Web Console or the Data Management Console.

  1. From the Web Console sidebar, click Connect to Data.

    or

    From the Data Management Console, expand the Adapters folder.

    In the DMC, the Adapters folder opens. In the Web Console, the Adapters page opens showing your configured adapters.

  2. In the Web Console, click the New Datasource button on the menu bar and find the adapter on the page or, in the DMC, expand the Available folder if it is not already expanded.
    On the Web Console, you can select a category of adapter from the drop-down list or use the search option (magnifying glass) to search for specific characters.
  3. In the DMC, expand the appropriate group folder and the specific adapter folder. The group folder is described in the connection attributes reference.
  4. Right-click the adapter name and/or version and select Configure.

    The Add Adapter to Configuration pane opens.

  5. Enter values for the parameters required by the adapter, as described in the chapter for the specific adapter you want to configure.
  6. Click Configure. The configured adapter is added to the Adapters list in the DMC resources tree or the Configured list in the Web Console.
    In the Web Console, the adapter remains on the Available Adapters list with an asterisk to indicate that at least one connection has been configured. You can configure additional connections from either the Configured or Available list by right-clicking the adapter and clicking Add Connection.

Note: The JSON adapter is in XML-based drop-down.. No input parameters are required.

Associating a Master File With a JSON Document

How to:

You must explicitly issue a FILEDEF command to associate a Master File with a JSON document. In order to properly code the FILEDEF command, you need to determine how the JSON documents are organized. If the documents are all in one file, the organization is called a COLUMN. If there are various documents in one directory, then the organization is called a COLLECTION.

Source

Collection Organization

Column Organization

disk

supported

supported

http

not supported

supported

https

not supported

supported

Syntax: How to Associate a Master File With a JSON Document

FILEDEF ddname source filename

where:

ddname

Is the logical reference name matching the desired Master File.

source

Is the location of the JSON document. Possible values are http, https, and disk.

filename

For a JSON Column, is the full path to the source file.

For a JSON Collection, is the full path to the source directory. The directory name must be followed by the wildcard characters '*.*'.

The file name must start with 'http://' or 'https://' if the JSON documents are to be read using an HTTP or HTTPS session.

Example: Issuing a FILEDEF Command for a JSON Column

Note: If you are working on the Web Console or Data Management Console Create Synonym panes, see Synonym Creation Parameters for JSON for details about how FILEDEFs are created.

For Windows, when you have the ordercol.JSON document under C:\, use the following FILEDEF in your profile:

FILEDEF ordercol disk C:\ordercol.JSON

For UNIX, when you have the ordercol.JSON document under /usera/JSON/, use the following FILEDEF in your profile:

FILEDEF ordercol DISK /usera/JSON/ordercol.JSON

For z/OS, when you have the ordercol.JSON document in TEST.JSON, use the following FILEDEF in your profile:

FILEDEF ordercol DISK //'TEST.JSON'

For HTTP and HTTPS, when you have the ordercol.JSON document under http://www.test.com/JSONtest/ (or https://www.test.com/JSONtest/), use the following FILEDEF in your profile:

FILEDEF order http http://www.test.com/JSONtest/ordercol.JSON

or

FILEDEF order http https://www.test.com/JSONtest/ordercol.JSON

Example: Issuing a FILEDEF Command for a JSON Collection

Note: If you are working on the Web Console or Data Management Console Create Synonym panes, see Synonym Creation Parameters for JSON for details about how FILEDEFs are created.

For Windows, when you have the order1.JSON and order2.JSON documents under C:\ORDERS, use the following FILEDEF in your profile:

FILEDEF order disk C:\orders\*.*

For UNIX, when you have the ordercol.JSON document under /usera/orders, use the following FILEDEF in your profile:

FILEDEF ordercol DISK //'TEST.JSON'

For z/OS, when you have the order document in TEST.JSON, use the following FILEDEF in your profile:

FILEDEF order DISK /usera/orders/*.*

WebFOCUS

Feedback