AdoNet

This extension contains functions for retrieving data via ADO.NET Data Services  Related Links: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.deki.services
SID: http://services.mindtouch.com/deki/draft/2008/02/ado.net

This service requires Deki Wiki 1.9.0a or later.

To enable this extension, follow these steps:

  1. Go to Service management in the Control Panel of your wiki.
  2. Under Add Service, click on Local, and select type Extension.
  3. Enter a description and the extension SID: http://services.mindtouch.com/deki/draft/2008/02/ado.net
  4. Add any additional configuration settings that are required by the extension (see below).
  5. Click on add service.

Notes:

Additional information can be found at the ADO.NET Data Services web site. At the present moment it appears that this extension only works with data hosted via the experimental ADO.NET Data Service (also known as Astoria) based on the Project "Astoria" prototype, hosted by Microsoft. You can create your own free data service with a maximum capacity of 100MB. You will need a passport account. Since it is an experimental service under active development, there may be periods where your service is unavailable. There are some additional sample data-sets that you can use to experiment with the service, incuding a subset of the Encarta Encyclopedia article base.

Configuration:

AdoNet extension has optional configuration settings that you can define globally. Alternatively, this information can be included in every use of the extension.

Config Key Description
service-uri URI to an ADO.NET web service endpoint. Example: http://astoria.sandbox.live.com/nort.../northwind.rse
username Optional username for ADO.NET data service
password Optional password for ADO.NET data service

Functions:

  1. adonet.table
  2. adonet.list
  3. adonet.value

adonet.table(resource: str, expand: str, filter: str, orderby: str, skip: num, top: num, columns: map, dataservice: uri) : xml

Embed a table of data from an ADO.NET Data Service. The standard URI parameters used when connecting to an ADO.NET Data Service via a browser generally apply here.

Parameters:

Name Type Description
resource
string resource name with optional query logic. Example: Products[ProductName eq 'Chai']
expand
string
nested resources to expand (default: none)
filter
string
filter records by (default: return all records)
orderby
string
order records by (default: none)
skip
int
number of records to skip (default: 0)
top
int number of records to return (default: 100)
columns
map
record columns to table columns mapping ({ Customer: { LastName: 'Last', FirstName: 'First' }, Order: { OrderID: 'ID'} }; default: all columns)
dataservice
uri
URI to ADO.NET data service. Optional if provided in the service configuration.

Samples:


Output
A table displaying specific Employee columns from the Northwind data service.
{{adonet.table{resource: "Employees", columns: {Employee:
{LastName:"Last", FirstName:"First", BirthDate:"BirthDate",
HireDate:"HireDate", Address:"Address", City:"City", PostalCode:"Zip",
HomePhone:"Phone", PhotoPath: "Photo" } }, dataservice:
"http://astoria.sandbox.live.com/northwind/northwind.rse" } }}
adonet table.PNG


adonet.list(resource: str, filter: str, orderby: str, skip: num, top: num, column: string, dataservice: uri) : xml

Embed a set of data from an ADO.NET Data Service. The standard URI parameters used when connecting to an ADO.NET Data Service via a browser generally apply here. This returns a comma separated list representing one column of data.

Parameters:

Name Type Description
resource
string resource name with optional query logic. Example: Products[ProductName eq 'Chai']
filter
string
filter records by (default: return all records)
orderby
string
order records by (default: none)
skip
int
number of records to skip (default: 0)
top
int number of records to return (default: 100)
columns
string
record column
dataservice
uri
URI to ADO.NET data service. Optional if provided in the service configuration.

Samples:


Output
A list of discontinued product names
{{ adonet.list{ resource: "Products[Discontinued eq 'true']", 
column: "ProductName", 
dataservice: "http://astoria.sandbox.live.com/northwind/northwind.rse" } }}
["Chef Anton\'s Gumbo Mix", "Mishi Kobe Niku", "Alice Mutton", "Guaran\u00e1 Fant\u00e1stica", "R\u00f6ssle Sauerkraut", "Th\u00fcringer Rostbratwurst", "Singaporean Hokkien Fried Mee", "Perth Pasties"]


adonet.value(resource: str, filter: str, column: string, dataservice: uri) : xml

Return a single value from the first resource returned from an ADO.NET Data Service. The standard URI parameters used when connecting to an ADO.NET Data Service via a browser generally apply here.

Parameters:

Name Type Description
resource
string resource name with optional query logic. Example: Products[ProductName eq 'Chai']
filter
string
filter records by (default: return all records)
columns
string
record column
dataservice
uri
URI to ADO.NET data service. Optional if provided in the service configuration.

Samples:


Output
The price of the product with id 50.
{{ adonet.value{ resource: "Products[50]", column:
"UnitPrice", dataservice:
"http://astoria.sandbox.live.com/northwind/northwind.rse" } }} 
16.2500
Tag page
You must login to post a comment.