personium Demo 1 - OData, WebDAV

This demo is to explain what OData, WebDAV are like. These two REST-based protocols are international standards widely used in various area other than personium also. More than 90% of personium API are based on these two standardized protocols. So application development using personium means application development against OData, WebDAV.

1.Sample Application

Before everything, just take a look at this simple demo application. app

2.Data API List

The simple app above is operating only two APIs below.

Data Name Type URL Demo Request
Country Info OData click
Country Name OData click
Flag Images WebDAV click

3. OData

OData provides RESTful interface for manipulating a relational data model. It enables various search like below.

Senario Description Demo Request
Single value retrieval retrieve a single record by specifying a key (__id value) click
$orderby: sorting sorting in the inverse order of Area_sqkm click
$top: limiting the returned records First 50 records in the search result are returned. Default value for $top is 25 in personium click
$skip: pagenation Skipping the first 50 records and return following 50 records from the search result. This is typically used for pagenation UI. click
$filter: search condition Like SQL "where" clause, various search condition with comparison, bool calculation etc. can be written in $filter. Example: records whose Goverment values match (eq) 'republic' click
$inlinecount: hit count You can let the response to linclude the hit count, the number of records that matches the condition, Hit count is returned with "__count" key. click
Fulltext search Example: "republic" (url encoding needed for non-ascii query) click
Schema View Schema information can be retrieved in EDMX format click

4. WebDAV

WebDAV is HTTP-based extended protocol. File operations are WebDAV Since WebDAV is entended HTTP, you can embed WebDAV endpoint URL in HTML files.

Senario Desciption Demo Request
Upload PUT Method for file upload. You can either create new resource or update existing one. Content-Type header value sent while uploading will be returned when downloading. click
Download GET Method for file download. Content-Type header value click
List in a directory PROPFIND method together with Depth header. The list of the click
Delete by sending DELETE method to the resource URL click
Collision Detection Optimal locking using ETag. Everytime you update a record, its ETag value changes. On updating or deleting a record, you may send ETag value of a file with If-Match request header and operation fails if the ETag value does not match. It happens when somebody else changes the record, so you can detect the collision of multile update or delete. click
Create a folder use special MKCOL method to create a collection (folder / directory in WebDAV terminology) click
Delete a folder DELETE method for deleting a collection (folder, directory).It fails if it has contents, ie. files or subdirectories. click