Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Initially your service does not include any queries. Click on "Add New Query" to add a new query, input/output mappings, events etc. to your Data Service. Enter query details according to the structure of the response you want.

Image RemovedImage Added

Click the "Add New Output Mapping" button to define how the output looks like. In this example, we create "Customer Number" as element and "Customer Name and City" as attributes as follows:

Image RemovedImage Added

 

Click on "Main Configuration" once you enter the output mappings and "Save" the query details. For information on adding validations to input mappings in the query, if any, refer to section Input Validators.

...

8. You will be navigated to the "Deployed Services" page.

Image RemovedImage Added

From here, you can manage your data service. For instructions, refer to section Service Management. For a demonstration on the usage of Google Spreadsheets as a data source, refer to Google Spreadsheet Sample.  

Google Data Sources in Query Mode
Anchor
Q
Q

In the query mode, users can query a Google Spreadsheet in a much familiar SQL-like manner. To implement the query mode, internally the "org.wso2.carbon.dataservices.sql.driver.TDriver" class is used as the SQL Driver. It is a JDBC driver implementation to be used with tabular data models such as Google SpreadSheets, Excel sheets etc.

Follow the instructions below to add a data source in the query mode.

 

1. Log on to the product's management console and select "Data Service -> Create" under the "Main" menu.

 

Image Added

 

2. The "Create Data Service" page appears. Fill in the fields and click "Next". The Data Service name is mandatory.

 

Image Added

 

Info

For more information on 'Advanced Configurations' in creating data services, refer to section Transaction Handling.

 

3. The "Data Sources" page appears. Click on the "Add New Data Source" link and add your Data Source details. Select the data source type as "Google Spread Sheet". Make sure you select the "Use Query Mode" check box.

 

You can use either private or public Google spread sheets as the data source. Note that public visibility is supported when a Google spread sheet is published on the web. To publish a spreadsheet to the web, select "File > Publish to the web" from the Spreadsheet's user interface, and then click the "Start Publishing" button. Use the URL generated there as the URL of the sheet. 

 

If the spread sheet is Private, you will be prompted to enter the user name and the password. For example,

Image Added