Skip to content

Commit

Permalink
Merge branch 'master' of github.com:teiid/teiid-documents
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Apr 19, 2016
2 parents f71c0c9 + 8b3a9ba commit eaf9e6a
Showing 1 changed file with 39 additions and 73 deletions.
112 changes: 39 additions & 73 deletions client-dev/OData4_Support.adoc
Expand Up @@ -104,33 +104,16 @@ INSERT/CREATE is accomplished through an HTTP method "POST".
----
POST /service.svc/Customers HTTP/1.1
Host: host
Content-Type: application/atom+xml
Accept: application/atom+xml
Content-Length: nnn
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="http://host/service.svc/"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom">
<id>http://host/service.svc/Customers('ASDFG')</id>
<title type="text" />
<updated>2008-12-07T8:00:00Z</updated>
<author>
<name />
</author>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders" href="Orders(1)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders" href="Orders(2)" />
<content type="application/xml">
<m:properties>
<d:CustomerID>ASDFG</d:CustomerID>
<d:CompanyName>Contoso Widgets</d:CompanyName>
<d:Address>
<d:Street>58 Contoso St</d:Street>
<d:City>Seattle</d:City>
</d:Address>
</m:properties>
</content>
</entry>
Content-Type: application/json
Accept: application/json
{
"CustomerID": "AS123X",
"CompanyName": "Contoso Widgets",
"Address" : {
"Street": "58 Contoso St",
"City": "Seattle"
}
}
----

An UPDATE is performed with an HTTP "PUT".
Expand All @@ -140,24 +123,15 @@ An UPDATE is performed with an HTTP "PUT".
----
PUT /service.svc/Customers('ALFKI') HTTP/1.1
Host: host
Content-Type: application/atom+xml
Accept: application/atom+xml
Content-Length: nnn
DataServiceVersion: 1.0
MaxDataServiceVersion: 3.0
Prefer: return-content
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<m:properties>
<d:CustomerID>ALFKI</d:CustomerID>
<d:CompanyName>Updated Company Name</d:CompanyName>
<d:Address>
<d:Street>Updated Street</d:Street>
</d:Address>
</m:properties>
</content>
</entry>
Content-Type: application/josn
Accept: application/json
{
"CustomerID": "AS123X",
"CompanyName": "Updated Company Name",
"Address" : {
"Street": "Updated Street"
}
}
----

The DELETE operation uses the HTTP "DELETE" method.
Expand All @@ -167,21 +141,17 @@ The DELETE operation uses the HTTP "DELETE" method.
----
DELETE /service.svc/Customers('ALFKI') HTTP/1.1
Host: host
Content-Type: application/atom+xml
Accept: application/atom+xml
Content-Length: nnn
DataServiceVersion: 1.0
Content-Type: application/json
Accept: application/json
----

== Security

By default OData access is secured using HTTPBasic authentication. The user will be authenticated against Teiid’s default security domain "teiid-security". Users are expected to have the *odata* role.
By default OData access is secured using HTTPBasic authentication. The user will be authenticated against Teiid’s default security domain "teiid-security". Users are expected to have the *odata* role. Be sure to create user with this role when you are using add-user.sh script to create a new user.

However, if you wish to change the security domain use a deployment-overlay to override the _web.xml_ file in the odata4 file in the _<modules>/org/jboss/teiid/main/deployments_ directory.

In future versions more WS-Security based configurations will be provided.

NOTE: *SAML Based Security* - To provide Single-Sign-On (SSO) using SAML2 for OData access, please take a look in the link:../security/Security_Guide.adoc[Security Guide] for link:../security/SAML_Based_Security_For_OData.adoc[SAML Based Security For OData] section.
OData WAR can also support Kerberos, SAML and OAuth2 authentications, for configuring the these security schemes please see ../security/Security_Guide.adoc[Security Guide]

== Configuration

Expand All @@ -198,6 +168,10 @@ The OData WAR file can be configured with following properties in the web.xml fi
|Time interval between the results being recycled/expired between $skiptoken requests
|300000

|invalid-xml10-character-replacement
|XML 1.0 replacement character for non UTF-8 characters.
|

|local-transport-name
|Teiid Local transport name for connection
|odata
Expand Down Expand Up @@ -238,29 +212,23 @@ Teiid OData server, implements cursoring logic when the result rows exceed the c

The following feature limitations currently apply.

* Blob support for media types are not supported.
* "$value" construct to retrieve individual column value is not supported.
* create/update/delete $links is not supported.
* $expand is minimally supported.
* delta processing is not supported
* data-aggregation extension to specification is not supported.
* $expand is minimally supported, where only one navigation can be expanded.

== Client Tools for Access

OData access is really where the user comes in, depending upon your programming model and needs there are various ways you write your access layer into OData. The following are some suggestions:

* Your Browser: The OData Explorer is an online tool for browsing an OData data service.
* Microsoft .NET Framework 3.51: the WCF Data Services framework is available as a separate download for .NET 3.x.
* Microsoft .NET Framework 4.0: the WCF Data Services framework built into .NET 4.0 (in release candidate as of this writing).
* Silverlight 3: the Data Services client library for Silverlight is available for download.
* Java: the Restlet 2.0 library for Java (including Java on your Android phone) supports the OData protocol.
* Java: Use a library like OData4J for Java based access, or any Rest based framework
* JavaScript: the XMLHttpRequest object is standard in modern browsers or you can use jQuery, which comes out of the box with .NET 4.0 or is available for download.
* PHP: the Toolkit for PHPprovides OData support for PHP clients.
* AJAX: if you’re using AJAX for ASP.NET, Microsoft provides the ASP.NET Ajax Library for getting to OData.
* Excel 2010 PowerPivot: PowerPivot comes with OData support built right in.
* Windows Desktop: LINQPad is a wonderful tool for building OData queries interactively.
* Olingo: Is a Java framework that supports OData V4, has both consumer and producer framework.
* Microsoft has various .Net based libraries, see http://odata.github.io/
* Windows Desktop: LINQPad is a wonderful tool for building OData queries interactively. See https://www.linqpad.net/
* Shell Scripts: use CURL tool

== OData Metadata
For latest information other frameworks and tools available please see http://www.odata.org/ecosystem/

== OData Metadata (How Teiid interprets the relational schema into OData's $metadata)

OData defines its schema using Conceptual Schema Definition Language (CSDL). Every VDB, that is deployed in an ACTIVE state in Teiid server exposes its metadata in CSDL format. For example if you want retrieve metadata for your vdb _northwind_, you need to issue a query like

Expand All @@ -287,17 +255,15 @@ Since OData schema model is not a relational schema model, Teiid uses the follow
|EntityType’s Key Properties

|Foreign Key
|Navigation Property on EntityType, Association, AssosiationSet
|Navigation Property on EntityType

|Procedure
|FunctionImport
|FunctionImport, Action Import

|Procedure’s Table Return
|ComplexType
|===

Teiid by design does not define any "embedded" ComplexType in the EntityType.

Teiid does not define any one EntityContainer that resulted from different vdb models as a default container, so all entities must be accessed using full path to them.

Since OData access is more key oriented, it is * MANDATORY* that every table Teiid exposes through OData must have a PK or at least one UNIQUE key. Note that Teiid does support composite PRIMARY KEYs.
Since OData access is more key based, it is * MANDATORY* that every table Teiid exposes through OData must have a PK or at least one UNIQUE key. A table which does not either of these will be dropeed out of the $metadata

0 comments on commit eaf9e6a

Please sign in to comment.