REST protocol for SAIL Data Services (SDS)
The initial implementation of the SAIL Data Service has been created using the Ruby on Rails web framework and is located here: http://rails.dev.concord.org/sds. The source code is in a Subversion repository located here: http://svn.rails.dev.concord.org/svn/sds/trunk/.
REST web service protocols are based on the HTTP verbs POST (create), PUT (update), GET (show), and DELETE (delete) applied to resources specified with urls. When a REST protocol is used the data exchanged is formatted as XML. The SDS implements REST-based services for communication with external portals to support the delivery of SAIL-based curriculum units. Many of the administrative services are also available as html rendered in a browser.
Child Pages
Table of Contents
- Resources managed in the SDS
- Interpreting Response Headers
- Accessing SDS resources with Atom feeds
- Create a new SDS portal relationship
- Info on a specific SDS portal
- Create a new SDS curnit for a portal
- Create a new SDS jnlp for a portal
- Info on all SDS config_versions for the sds
- Create a new SDS user for a portal
- Create a new SDS offering for a portal
- Create a new SDS workgroup for an offering
- Producing a Java Webstart JNLP
- Producing a config file for the Java client
- Saving new session bundle files for the Java client
- Producing a collection of session bundle files for the Java client
Rest Architecture and Tutorial links
Java
- Great tutorial at Sun on RESTful Web Services with Java (Turadg)
- See Crossing borders: REST on Rails for an example of Java code for interfacing to a REST interface.
Resources managed in the SDS:
portal: this is an SDS realm managed for an external portal.
The following resources related to the portal are created and managed through administrative services:
- user: a SAIL user that is linked to a portal user
- curnit: a reference to a SAIL curriculum unit.
- jnlp: a reference to a java web start jnlp whose resources are needed to run a curnit
- offering: a composition of a curnit, and a jnlp
- workgroup: a SAIL workgroup is related to an offering and consists of 1 or more SAIL users (actually saved in a workgroup_membership)
- workgroup/membership: the collection of users in a workgroup is specified in a workgroup/membership. When new membership collections are created the workgroup version is incremented.
Learner data is in general associated with a workgroup. When learner data is requested by the Java client all data available are returned. However at a lower level in the SDS all the session bundles are actually related to workgroup versions. It is possible using the datamodel to distinguish learner data contributed by different cohorts of learners in a single workgroup. This functionality is not exposed yet.
The following resources are created dynamically and are used in communication with the SAIL java learner runtime. There is no interface to change these resources directly. All of these resources are specified by their relationship to to a portal, offering, and workgroup.
offering/jnlp: the dynamically generated jnlp file that relates a portal, offering, and workgroup.
offering/config: the dynamically generated config file that the PLR uses to setup operation
offering/sessionBundle: a collection of all learner generated data that occurred during one session
offering/sessionBundleCollection: a collection of all sessionBundles for a specific offering and either a workgroup or a user
These resources are created when learner data are sent back sent back to the SDS.
socks: user data related to pod_uuid, rim name, offering, and workgroup
rims: rim name, related to offering, and workgroup (should be related to step also)
step: this is actually very hard to get - it is only in the curnit in a very opaque XML structure
All interaction is through a url of the form: http://rails.dev.concord.org/sds (or in the future https://rails.dev.concord.org/sds) where sds is the uri for the Sail Data Service. Obviously the service can be deployed on a different server which will change the url.
When the HTTP operation is a PUT or POST and the HTTP Content-Type header is set to 'application/xml' the SDS will assume that a REST connection is being made and will expect resources to be sent in the appropriate XML format. When the HTTP operation is a GET and the HTTP Accept header is set to 'application/xml' the SDS will assume that a REST connection is being made and will return resources in the appropriate XML format. A specific header is not needed when an HTTP DELETE operation is performed because no data is sent or returned except for the specification of the resource with a url, the headers that are sent and the headers that are returned.
In the case of HTTP GET or POST commands if the appropriate header is not set to 'application/xml' the SDS will assume that an html page is requested and will render the appropriate UI in html. In the examples below I use 'wise' as an example of an SDS portal relationship.
At this time all of the following resources are also editable through a browser using http/html interactions.
Interpreting Response Headers
In general if the url you are using to access the REST API is misspelled the following error is returned in an HTTP header:
- HTTP/1.1 404 Not Found
The SDS is now returning an MD5 digest hash in the return headers to bundle creation POSTS. The return of a MD5 message digest hah header will be extended to all REST POSTS or PUT operations.
Later Both the client and server can calculate these and include them as headers in both connections and responses.
See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.15
and: http://www.ietf.org/rfc/rfc1864.txt
An example from a POST of a sessionBundles:
HTTP/1.1 201 Created
Date: Sat, 28 Oct 2006 22:10:25 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://localhost:3000/1/offering/2/bundle/3/1
Content-Md5: C0LhalzTHn3vcOe41KY1xA==
Creation
When a new resource creation request is made with an HTTP POST to a url referencing a collection of resources the following status codes are returned in the HTTP headers indicating success or failure:
- Success
- HTTP/1.1 201 Created
- Location: http://localhost:3000/1/jnlp/8
- Failure
- HTTP/1.1 400 Bad Request
- Failure can occur if a required static or relational element of the resource is missing.
Read: a single resource
When a request is made to read a single existing resource with an HTTP GET to a url referencing that specific resource the following status codes are returned in the HTTP headers indicating success or failure:
- Success
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 1577
- Failure
- HTTP/1.1 400 Bad Request
Read: a collection of resources
When a request is made to read a collection of resources with an HTTP GET to a url referencing a collection of resources the following status codes are returned in the HTTP headers indicating success:
- Success
- HTTP/1.1 200 OK
It is not a failure if there are no members of the resource collection. In this case an empty xml element which is the pluralized form of he sigular element name is returned. For example if there were no jnlp resources defined this empty element would be returned as content: "<jnlps />".
- HTTP/1.1 200 OK
Update
When an existing resource update request is made with an HTTP PUT to a url referencing that specific resource the following status codes are returned in the HTTP headers indicating success or failure:
- Success
- HTTP/1.1 201 Created
- Location: http://localhost:3000/1/jnlp/8
- Failure
- HTTP/1.1 400 Bad Request
Delete
Accessing SDS resources with Atom feeds
Collections of workgroup data are accessible as Atom news feeds by adding "/atom" to the url. These feeds are viewable in News Aggregators as well as the web browsers Safari and Firefox 2.0. Earlier versions of Firefox do not have this capability. I don't know he state of viewing news feeds on IE or Opera.
The plan is that any resource on the SDS which can be interpreted as referring to a collection of user data will also be accessible as a news feed. So for example accessing this url in a browser:
- http://rails.dev.concord.org/sds/1/workgroups
will display a list of Workgroups defined for SDS portal realm 1. While accessing this url: - http://rails.dev.concord.org/sds/1/workgroups/atom
Will instead display a newsfeed of all the workgroups and all the data sent back by workgroup sessions.
This url is used to display information about a specific Offering (the Wise term would be Run):
- http://rails.dev.concord.org/sds/1/offering/2
While adding "/atom" on the end will produce instead a news feed of just the workgroups and their data for the offering with id 2. - http://rails.dev.concord.org/sds/1/offering/2/atom
Create a new SDS portal relationship.
In order to create a portal relationship the SDS portal the username and password must be sent in the HTTP header as Basic Authentication must be sent. The username and password can be obtained from the SDS administrator. In addition the portal host url is sent. Any further requests for creation or changing resources associated with this portal must come from the portal host url.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/portal
POST data:
<portal>
<name>Wise2</name>
<use-authenticatio>false</use-authentication>
<auth-username>user</auth-username>
<auth-password>password</auth-password>
</portal>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/portal/1
return data:
Example (note: don't pass an <id /> element in when creating a portal, this is generated by the SDS):
curl -i -H 'Content-Type: application/xml' -X POST -d '<portal><name>Wise2</name><use-authentication>false</use-authentication><auth-username>user</auth-username><auth-password>password</auth-password></portal>' http://rails.dev.concord.org/sds/portal/
HTTP/1.1 201 Created
Date: Fri, 11 Aug 2006 08:35:08 GMT
Content-Type: application/xml
Location: http://rails.dev.concord.org/sds/portal/1
Content-Length: 0
If you pass in malformed xml or are missing required elements a HTTP/1.1 400 Bad Request error will be reported in the returned HTTP headers.
Info on all SDS portals.
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/portal
HTTP/1.1 200 OK
Cache-Control: no-cache
Connection: Keep-Alive
Date: Tue, 08 Aug 2006 13:28:56 GMT
Content-Type: application/xml
Server: WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24)
Content-Length: 363
Set-Cookie: _session_id=3d6d0815169f908f61cd89967d0b65f4; path=/
<?xml version="1.0" encoding="UTF-8"?>
<portals>
<portal>
<name>Test</name>
<auth-username>user</auth-username>
<use-authentication>true</use-authentication>
<id>1</id>
<auth-password>password</auth-password>
</portal>
<portal>
<name>Wise2</name>
<auth-username>user</auth-username>
<use-authentication>false</use-authentication>
<id>2</id>
<auth-password>password</auth-password>
</portal>
</portals>
Info on a specific SDS portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/portal/<sds_portal_id>
return headers:
HTTP/1.1 200 OK
return data:
xml representation of resource
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/portal/4
HTTP/1.1 200 OK
Date: Tue, 08 Aug 2006 15:03:49 GMT
Content-Type: application/xml
Content-Length: 187
Location: http://rails.dev.concord.org/sds/portal/4
<?xml version="1.0" encoding="UTF-8"?>
<portal>
<name>Wise2</name>
<auth-username>user</auth-username>
<use-authentication>true</use-authentication>
<id type="integer">4</id>
<auth-password>password</auth-password>
</portal>
Change a specific SDS portal
This is done with a PUT
PUT
Content-Type: application/xml
http://rails.dev.concord.org/sds/portal/<sds_portal_id>
POST data:
<portal>
<name>TestX</name>
<auth-username>user</auth-username>
<use-authentication>true</use-authentication>
<auth-password>password</auth-password>
</portal>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/portal/1
return data:
Example:
curl -i -H 'Content-Type: application/xml' -X PUT -d '<portal><name>TestX</name><auth-username>user</auth-username><use-authentication>true</use-authentication><auth-password>password</auth-password></portal>' http://rails.dev.concord.org/sds/portal/1
HTTP/1.1 201 Created
Date: Tue, 15 Aug 2006 20:59:09 GMT
Content-Type: application/xml
Location: http://rails.dev.concord.org/sds/portal/1
Create a new SDS curnit for a portal.
The url returned in the Location header is a direct link to the SDS curnit resource for this specific sds curnit.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/curnit
POST data:
<curnit>
<name>Airbag3</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url>
</curnit>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/curnit/<SDS curnit id>
return data:
none
Example: create a new curnit for portal #1
curl -i -H 'Content-Type: application/xml' -X POST -d '<curnit><name>Airbag3</name><url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url></curnit>' http://rails.dev.concord.org/sds/1/curnit
HTTP/1.1 201 Created
Date: Tue, 15 Aug 2006 22:39:36 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/curnit/3
Info on all SDS curnits for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/curnit
return headers:
return data:
<curnits>
<curnit>
<name>airbag test</name>
<portal-id type="integer">1</portal-id>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/curnit-airbag.jar</url>
<id type="integer">3</id>
</curnit>
</curnits>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/curnit
HTTP/1.1 200 OK
Date: Fri, 11 Aug 2006 09:06:25 GMT
Server: lighttpd/1.4.11
Content-Type: application/xml
Cache-Control: no-cache
Set-Cookie: _session_id=1e3ca6f073691ceada1a3d1a16776de7; path=/
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<curnits>
<curnit>
<name>Airbag</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url>
<id>1</id>
</curnit>
<curnit>
<name>airbag2</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url>
<id>2</id>
</curnit>
<curnit>
</curnits>
Info on one SDS curnit for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/curnit/<sds_curnit_id>
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<curnit>
<name>Airbag3</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url>
<id>4</id>
</curnit>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/curnit/4
HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 22:48:16 GMT
Content-Type: application/xml
Content-Length: 179
Location: http://rails.dev.concord.org/sds/1/curnit/4
<?xml version="1.0" encoding="UTF-8"?>
<curnit>
<name>Airbag3</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</url>
<id>4</id>
</curnit>
Create a new SDS jnlp for a portal.
The url returned in the Location header is a direct link to the actual SAIL jnlp resource for this specific sds jnlp.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/jnlp
POST data:
<jnlp>
<name>pedagogica-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<config_version_id>1</config_version_id>
</jnlp>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/jnlp/<sds_jnlp_id>
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<jnlp><name>testing</name><url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url><config_version_id>1</config_version_id></jnlp>' http://rails.dev.concord.org/sds/1/jnlp
HTTP/1.1 201 Created
Date: Tue, 15 Aug 2006 22:39:36 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/jnlp/3
Info on all SDS jnlps for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/jnlp
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<jnlps>
<jnlp>
<name>pedagogica-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<id>6</id>
<config-version-id>1</config-version-id>
</jnlp>
<jnlp>
<name>basic-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<id>7</id>
<config-version-id>1</config-version-id>
</jnlp>
</jnlps>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/jnlp
HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 23:10:55 GMT
Content-Type: application/xml
Content-Length: 349
<?xml version="1.0" encoding="UTF-8"?>
<jnlps>
<jnlp>
<name>pedagogica-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<id>6</id>
<config_version_id>1</config_version_id>
</jnlp>
<jnlp>
<name>basic-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<id>7</id>
<config-version-id>1</config-version-id>
</jnlp>
</jnlps>
Info on one SDS jnlp for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id/jnlp/<sds_jnlp_id>
return headers:
return data:
<jnlp id="<sds_jnlp_id>", name="all_emf", url="http:/tels.org/all_emf.jnlp"/>
Examples:
Requesting a resource that exists:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/jnlp/6
HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 23:12:49 GMT
Content-Type: application/xml
Content-Length: 178
Location: http://rails.dev.concord.org/sds/1/jnlp/6
<?xml version="1.0" encoding="UTF-8"?>
<jnlp>
<name>pedagogica-emf</name>
<url>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/basic-emf.jnlp</url>
<id>6</id>
<config-version-id>1</config-version-id>
</jnlp>
Requesting a resource that doesn't exist:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/jnlp/16
HTTP/1.1 404 Not Found
Date: Tue, 15 Aug 2006 23:12:57 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Info on all SDS config_versions for the sds
GET
Accept: application/xml
http://rails.dev.concord.org/sds/config_versions
return headers:
return data:
<config-versions>
<config-verison>
<name>#name#</name>
<id>#id#</id>
<version>#version#</version>
<template>#template#</template>
<created-at>#timestamp#</created-at>
<updated-at>#timestamp#</created-at>
</config-version>
#possibly more <config-version>#
</config-versions>
Examples:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/config_versions
HTTP/1.1 200 OK
Date: Fri, 01 Feb 2008 15:43:05 GMT
Content-Type: application/xml
Content-Length: 7027
<?xml version="1.0" encoding="UTF-8"?>
<config-versions type="array">
<config-version>
<created-at type="datetime">2008-01-30T14:58:40Z</created-at>
<id type="integer">1</id>
<name>Original version</name>
<template>... cut for size ...</template>
<updated-at type="datetime">2008-01-31T18:52:40Z</updated-at>
<version type="float">1.0</version>
</config-version>
<config-version>
... cut for size ...
</config-version>
</config-versions>
Info on one SDS config_version for the sds
GET
Accept: application/xml
http://rails.dev.concord.org/sds/config_versions/<config_version_id>
return headers:
return data:
<config-verison>
<name>#name#</name>
<id>#id#</id>
<version>#version#</version>
<template>#template#</template>
<created-at>timestamp#</created-at>
<updated-at>#timestamp#</created-at>
</config-version>
Examples:
Requesting a resource that exists:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/config_versions/1
HTTP/1.1 200 OK
Date: Fri, 01 Feb 2008 15:52:02 GMT
Content-Type: application/xml
Content-Length: 3129
<?xml version="1.0" encoding="UTF-8"?>
<config-version>
<created-at type="datetime">2008-01-30T14:58:40Z</created-at>
<id type="integer">1</id>
<name>Original version</name>
<template>... cut for size ...</template>
<updated-at type="datetime">2008-01-31T18:52:40Z</updated-at>
<version type="float">1.0</version>
</config-version>
Requesting a resource that doesn't exist:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/config_versions/123
HTTP/1.1 404 Not Found
Date: Fri, 01 Feb 2008 15:52:02 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 9
Not Found
Create a new SDS user for a portal.
The url returned in the Location header is a direct link to the actual SAIL user resource for this specific sds user.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user
POST data:
<sail-user>
<first-name>Stephen</first-name>
<last-name>Smith</last-name>
</sail-user>
return headers:
success:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user/<sds_user_id>
failure:
HTTP/1.1 400 Bad Request
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<sail-user><first-name>Stephen</first-name><last-name>Smith</last-name></sail-user>' http://rails.dev.concord.org/sds/1/sail_user
HTTP/1.1 201 Created
Date: Wed, 16 Aug 2006 01:04:44 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/sail_user/4
Info on all SDS users for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user
return headers:
return data:
<?xml version="1.0" encoding="UTF-8"?>
<sail-users>
<sail-user>
<uuid>1846687e-2cc0-11db-8906-0016cb92217d</uuid>
<id>2</id>
<first-name>Stephen</first-name>
<last-name>Bannasch</last-name>
</sail-user>
<sail-user>
<uuid>c096c6c6-2cc1-11db-92b2-0016cb92217d</uuid>
<id>3</id>
<first-name>Stephen</first-name>
<last-name>Bannasch</last-name>
</sail-user>
</sail-users>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/sail_user
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 00:57:22 GMT
Content-Type: application/xml
Content-Length: 470
<?xml version="1.0" encoding="UTF-8"?>
<sail-users>
<sail-user>
<uuid>1846687e-2cc0-11db-8906-0016cb92217d</uuid>
<id>2</id>
<first-name>Stephen</first-name>
<last-name>Bannasch</last-name>
</sail-user>
<sail-user>
<uuid>c096c6c6-2cc1-11db-92b2-0016cb92217d</uuid>
<id>3</id>
<first-name>Stephen</first-name>
<last-name>Bannasch</last-name>
</sail-user>
</sail-users>
Info on one SDS user for a portal.
You can specify a user resource with either the sds_user_id or the sds_user_uuid.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user/<sds_user_id>
OR
http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user/<sds_user_uuid>
return headers:
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 00:58:54 GMT
Content-Type: application/xml
Content-Length: 225
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/sail_user/<sds_user_id>
return data:
<?xml version="1.0" encoding="UTF-8"?>
<sail-user>
<uuid>c096c6c6-2cc1-11db-92b2-0016cb92217d</uuid>
<id>3</id>
<first-name>Stephen</first-name>
<last-name>Bannasch</last-name>
</sail-user>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/sail_user/122
HTTP/1.1 200 OK
Date: Thu, 21 Dec 2006 16:16:43 GMT
Server: lighttpd/1.4.11
Content-Type: application/xml
Location: http://rails.dev.concord.org/sds/1/user/122
Cache-Control: no-cache
Content-Length: 213
<?xml version="1.0" encoding="UTF-8"?>
<sail-user>
<portal-id>1</portal-id>
<uuid>2ee80540-8479-11db-b8e9-0014c2c34555</uuid>
<id>122</id>
<first-name>Trudi</first-name>
<last-name>Tester</last-name>
</sail-user>
OR
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/sail_user/2ee80540-8479-11db-b8e9-0014c2c34555
HTTP/1.1 200 OK
Date: Thu, 21 Dec 2006 16:17:00 GMT
Server: lighttpd/1.4.11
Content-Type: application/xml
Location: http://rails.dev.concord.org/sds/1/user/2ee80540-8479-11db-b8e9-0014c2c34555
Cache-Control: no-cache
Content-Length: 213
<?xml version="1.0" encoding="UTF-8"?>
<sail-user>
<portal-id>1</portal-id>
<uuid>2ee80540-8479-11db-b8e9-0014c2c34555</uuid>
<id>122</id>
<first-name>Trudi</first-name>
<last-name>Tester</last-name>
</sail-user>
Create a new SDS offering for a portal.
The url returned in the Location header is a direct link to the actual SDS offering resource for this specific sds offering.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering
POST data:
<offering>
<name>Airbag Incomplete</name>
<curnit-id>1</curnit-id>
<jnlp-id>6</jnlp-id>
</offering>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<offering><name>Airbag Incomplete</name><curnit-id>1</curnit-id><jnlp-id>6</jnlp-id></offering>' http://rails.dev.concord.org/sds/1/offering
HTTP/1.1 201 Created
Date: Wed, 16 Aug 2006 02:33:28 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/offering/3
Info on all SDS offerings for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering
return headers:
HTTP/1.1 200 OK
return data:
<offerings>
<offering>
<name>Airbag Complete</name>
<curnit-id>1</curnit-id>
<id>1</id>
<jnlp-id>6</jnlp-id>
</offering>
<offering>
<name>Air Bag Test</name>
<curnit-id>2</curnit-id>
<id>2</id>
<jnlp-id>6</jnlp-id>
</offering>
</offerings>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 02:28:10 GMT
Content-Type: application/xml
Content-Length: 397
<?xml version="1.0" encoding="UTF-8"?>
<offerings>
<offering>
<name>Airbag Complete</name>
<curnit-id>1</curnit-id>
<id>1</id>
<jnlp-id>6</jnlp-id>
</offering>
<offering>
<name>Air Bag Test</name>
<curnit-id>2</curnit-id>
<id>2</id>
<jnlp-id>6</jnlp-id>
</offering>
</offerings>
Info on one SDS offering for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>
return headers:
return data:
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering/3
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 02:35:02 GMT
Content-Type: application/xml
Content-Length: 195
Location: http://rails.dev.concord.org/sds/1/offering/3
<?xml version="1.0" encoding="UTF-8"?>
<offering>
<name>Airbag Incomplete</name>
<curnit-id>1</curnit-id>
<id>3</id>
<jnlp-id>6</jnlp-id>
</offering>
Curnitmap of one SDS offering for a portal
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/curnitmap
return headers:
success:
HTTP/1.1 200 OK
failure:
HTTP/1.1 404 Not Found - General failure, don't expect this same request to ever work. Details will be included in the response body.
HTTP/1.1 408 Timeout - Failure because the curnitmap generation process timed out. Re-requesting this URL may work, but is not guaranteed to work.
HTTP/1.1 5xx - Failure because something went wrong with the server. Notify the appropriate people.
return data:
see example
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering/4/curnitmap
HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 22:48:16 GMT
Content-Type: application/xml
Content-Length: 179
Location: http://rails.dev.concord.org/sds/1/offering/4/curnitmap
<?xml version="1.0" encoding="UTF-8"?>
<pas_curnit_map>
<project podUUID="cccccccc-0002-3878-0000-000000000000"
title="Global Warming: Virtual Earth">
<activity podUUID="dddddddd-6004-0000-0000-000000000000"
title="Identifying the Problem" number="0">
<step podUUID="dddddddd-6004-0001-0000-000000000000"
title="1. Global Warming is happening" number="0" type="Display"
classname="org.telscenter.pas.steps.DisplayPage" />
<step podUUID="dddddddd-6004-0002-0000-000000000000"
title="2. The Science behind Global Warming" number="1"
type="Display" classname="org.telscenter.pas.steps.DisplayPage" />
<step podUUID="dddddddd-6004-0003-0000-000000000000"
title="3. Your contribution to Global Warming" number="2"
type="Display" classname="org.telscenter.pas.steps.DisplayPage" />
<step podUUID="dddddddd-6004-0004-0000-000000000000"
title="4. Your Ecological Footprint" number="3" type="Evidence"
classname="org.telscenter.pas.steps.Evidence" />
<step podUUID="dddddddd-6004-0005-0000-000000000000"
title="5. Your Ecological Footprint Data" number="4" type="Note"
classname="org.telscenter.pas.steps.Note">
<rim rimname="undefined6"
prompt="<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" /> <title></title> </head> <body> Partner #2: How many football fields of land are required to support your lifestyle? </body> </html> " />
<rim rimname="undefined4"
prompt="<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" /> <title></title> </head> <body> Partner #1: How many football fields of land are required to support your lifestyle? </body> </html> " />
...
</step>
...
</activity>
...
</project>
</pas_curnit_map>
Create a new SDS workgroup for an offering.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup
POST data:
<workgroup>
<name>Pineapples</name>
<offering-id>1</offering-id>
</workgroup>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<workgroup_id>
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<workgroup><name>Pineapples</name><offering-id>1</offering-id></workgroup>' http://rails.dev.concord.org/sds/1/workgroup
HTTP/1.1 201 Created
Date: Wed, 16 Aug 2006 07:43:39 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/workgroup/10
Create the membership for a workgroup
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<sds_workgroup_id>/membership
POST data:
<workgroup-memberships>
<workgroup-membership>
<sail-user-id>7</sail-user-id>
</workgroup-membership>
<workgroup-membership>
<sail-user-id>4</sail-user-id>
</workgroup-membership>
</workgroup-memberships>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<sds_workgroup_id>
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<workgroup-memberships><workgroup-membership><sail-user-id>7</sail-user-id></workgroup-membership><workgroup-membership><sail-user-id>4</sail-user-id></workgroup-membership></workgroup-memberships>' http://rails.dev.concord.org/sds/1/workgroup/8/membership
HTTP/1.1 201 Created
Date: Wed, 16 Aug 2006 07:30:54 GMT
Content-Type: application/xml
Content-Length: 0
Location: http://rails.dev.concord.org/sds/1/workgroup/8/membership
List the members in a workgroup
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<sds_workgroup_id>/membership
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<workgroup-memberships>
<workgroup-membership>
<sail-user-id>7</sail-user-id>
</workgroup-membership>
<workgroup-membership>
<sail-user-id>4</sail-user-id>
</workgroup-membership>
</workgroup-memberships>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/workgroup/8/membership
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 07:31:14 GMT
Content-Type: application/xml
Content-Length: 240
<?xml version="1.0" encoding="UTF-8"?>
<workgroup-memberships>
<workgroup-membership>
<sail-user-id>7</sail-user-id>
</workgroup-membership>
<workgroup-membership>
<sail-user-id>4</sail-user-id>
</workgroup-membership>
</workgroup-memberships>
Info on all SDS workgroups for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<workgroups>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
<workgroup>
<name>Bannanas</name>
<uuid>5ea6e6f4-2ced-11db-92b2-0016cb92217d</uuid>
<id>9</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
</workgroups>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/workgroup
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 06:06:55 GMT
Content-Type: application/xml
Content-Length: 507
<?xml version="1.0" encoding="UTF-8"?>
<workgroups>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
<workgroup>
<name>Bannanas</name>
<uuid>5ea6e6f4-2ced-11db-92b2-0016cb92217d</uuid>
<id>9</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
</workgroups>
Info on one SDS workgroup for a portal.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<sds_workgroup_id>
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/workgroup/8
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 06:07:52 GMT
Content-Type: application/xml
Content-Length: 243
Location: http://rails.dev.concord.org/sds/1/workgroup/8
<?xml version="1.0" encoding="UTF-8"?>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
Info on all SDS workgroups for an offering.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/workgroups
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<workgroups>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
<workgroup>
<name>Bannanas</name>
<uuid>5ea6e6f4-2ced-11db-92b2-0016cb92217d</uuid>
<id>9</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
</workgroups>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/3/offering/171/workgroups
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 06:06:55 GMT
Content-Type: application/xml
Content-Length: 507
<?xml version="1.0" encoding="UTF-8"?>
<workgroups>
<workgroup>
<name>Oranges</name>
<uuid>4bf7c82a-2ced-11db-92b2-0016cb92217d</uuid>
<id>8</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
<workgroup>
<name>Bannanas</name>
<uuid>5ea6e6f4-2ced-11db-92b2-0016cb92217d</uuid>
<id>9</id>
<version>1</version>
<offering-id>1</offering-id>
</workgroup>
</workgroups>
Producing a Java Webstart JNLP file
Before the SDS will generate a valid jnlp for running a SAIl curnit an sds Offering must be made which consists of references to a curnit and a template jnlp used to run the curnit. In addition at least one sds workgroup associated with the Offering must be created. Once these resources are created you can construct a url to start the curnit by either specifying the workgroup or a user in an existing workgroup.
- implicit workgroup
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/<sds_workgroup_id> - explicit workgroup
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/workgroup/<sds_workgroup_id> - explicit user
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/user/<sds_user_id>
A workgroup id or user id are needed to produce a jnlp however the argument in the application-desc which points to a config file adds a workgroup version number. This is needed in the case where the members of a workgroup change while a client session is in progress. In this case when the session information is saved it will be related to the workgroup version in existence when the session was started.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/<sds_workgroup_id>
OR
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/workgroup/<sds_workgroup_id>
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/jnlp/user/<sds_user_id>
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="http://rails.dev.concord.org/sds/1/offering/1/jnlp/8/3" spec="1.0+" codebase="http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/">
<information>
<title>Preview Pas Pedagogica</title>
<vendor>Concord Consortium</vendor>
<homepage href="http://rails.dev.concord.org/sds/1/offering/1" />
<description>Preview Pas Pedagogica</description>
<icon href="sail_orangecirc_64.gif" height="64" width="64"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se max-heap-size="128m" version="1.4.2+" initial-heap-size="32m"/>
<jar href="concurrent/concurrent.jar" version="1.3.4"/>
<jar href="com.webrenderer/webrenderer-win.jar" version="3.0"/>
<jar href="org.telscenter/pas-learner-runtime.jar" version="0.4.3-20060727.051158-20"/>
<jar href="com.webrenderer/webrenderer.jar" version="3.0"/>
<jar href="log4j/log4j.jar" version="1.2.8"/>
<jar href="ekit/ekit.jar" version="1.1"/>
<jar href="org.eclipse.emf/ecore.jar" version="2.2.0-SNAPSHOT"/>
<jar href="jgoodies/looks.jar" version="1.3.1"/>
<jar href="jgroups/jgroups-all.jar" version="2.2.8"/>
<jar href="org.eclipse.emf/common.jar" version="2.2.0-SNAPSHOT"/>
<jar href="commons-beanutils/commons-beanutils.jar" version="1.7.0"/>
<jar href="com.l2fprod.common/l2fprod-common-tasks.jar" version="6.2"/>
<jar href="com.webrenderer/webrenderer-osx.jar" version="3.0"/>
<jar href="net.sf.sail/sail-data-emf.jar" version="0.1.0-20060724.065806-5" main="true"/>
<jar href="jug/jug.jar" version="1.1.2"/>
<jar href="swing/swing.jar" version="1.7"/>
<jar href="jsr223/script.jar" version="1.0ea"/>
<jar href="jdom/jdom.jar" version="1.0"/>
<jar href="com.lowagie/itext.jar" version="1.3.1"/>
<jar href="jgoodies/binding.jar" version="1.0"/>
<jar href="aelfred/aelfred.jar" version="1.1.1"/>
<jar href="mysql/mysql-connector-java.jar" version="3.1.12"/>
<jar href="commons-io/commons-io.jar" version="1.1"/>
<jar href="com.l2fprod.common/l2fprod-common-sheet.jar" version="6.2"/>
<jar href="javax.activation/activation.jar" version="1.1"/>
<jar href="org.telscenter/pedraw.jar" version="1.3.0-20060717.010643-2"/>
<jar href="commons-logging/commons-logging.jar" version="1.0.3"/>
<jar href="vldocking/vldocking.jar" version="2.0.5"/>
<jar href="xito/dialog.jar" version="0.9"/>
<jar href="xstream/xstream.jar" version="1.1.2"/>
<jar href="tablelayout/TableLayout.jar" version="20020517"/>
<jar href="com.toedter/jcalendar.jar" version="1.2.2"/>
<jar href="net.sf.nachocalendar/nachocalendar.jar" version="0.21"/>
<jar href="commons-lang/commons-lang.jar" version="2.0"/>
<jar href="org.eclipse.emf/ecore-xmi.jar" version="2.2.0-SNAPSHOT"/>
<jar href="rhino/js.jar" version="1.6R2"/>
<jar href="javax.mail/mail.jar" version="1.4"/>
<jar href="com.l2fprod.common/l2fprod-common-shared.jar" version="6.2"/>
<jar href="net.sf.sail/sail-core.jar" version="0.4.5-20060723.044604-14"/>
<jar href="org.telscenter/sensemaker.jar" version="1.3.3"/>
<jar href="jmdns/jmdns.jar" version="1.0rc2"/>
<jar href="xpp3/xpp3.jar" version="1.1.3.4-RC8"/>
</resources>
<application-desc main-class="net.sf.sail.emf.launch.EMFLauncher3">
<argument>http://rails.dev.concord.org/sds/1/offering/1/config/8/3</argument>
</application-desc>
</jnlp>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering/1/jnlp/8
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 09:28:54 GMT
Content-Type: application/x-java-jnlp-file
Content-Disposition: attachment; filename=testjnlp.jnlp
Content-Length: 3221
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="http://rails.dev.concord.org/sds/1/offering/1/jnlp/8?version=3" spec="1.0+" codebase="http://tels-develop.soe.berkeley.edu:8080/maven-jnlp/">
<information>
<title>Preview Pas Pedagogica</title>
<vendor>Concord Consortium</vendor>
<homepage href="http://rails.dev.concord.org/sds/1/offering/1" />
<description>Preview Pas Pedagogica</description>
<icon href="sail_orangecirc_64.gif" height="64" width="64"/>
<offline-allowed/>
</information>
<security> <all-permissions/> </security><resources> <j2se max-heap-size='128m' version='1.4.2+' initial-heap-size='32m'/> <jar href='concurrent/concurrent.jar' version='1.3.4'/><jar href='com.webrenderer/webrenderer-win.jar' version='3.0'/><jar href='org.telscenter/pas-learner-runtime.jar' version='0.4.3-20060727.051158-20'/><jar href='com.webrenderer/webrenderer.jar' version='3.0'/><jar href='log4j/log4j.jar' version='1.2.8'/><jar href='ekit/ekit.jar' version='1.1'/><jar href='org.eclipse.emf/ecore.jar' version='2.2.0-SNAPSHOT'/><jar href='jgoodies/looks.jar' version='1.3.1'/><jar href='jgroups/jgroups-all.jar' version='2.2.8'/><jar href='org.eclipse.emf/common.jar' version='2.2.0-SNAPSHOT'/><jar href='commons-beanutils/commons-beanutils.jar' version='1.7.0'/><jar href='com.l2fprod.common/l2fprod-common-tasks.jar' version='6.2'/><jar href='com.webrenderer/webrenderer-osx.jar' version='3.0'/><jar href='net.sf.sail/sail-data-emf.jar' version='0.1.0-20060724.065806-5' main='true'/><jar href='jug/jug.jar' version='1.1.2'/><jar href='swing/swing.jar' version='1.7'/><jar href='jsr223/script.jar' version='1.0ea'/><jar href='jdom/jdom.jar' version='1.0'/><jar href='com.lowagie/itext.jar' version='1.3.1'/><jar href='jgoodies/binding.jar' version='1.0'/><jar href='aelfred/aelfred.jar' version='1.1.1'/><jar href='mysql/mysql-connector-java.jar' version='3.1.12'/><jar href='commons-io/commons-io.jar' version='1.1'/><jar href='com.l2fprod.common/l2fprod-common-sheet.jar' version='6.2'/><jar href='javax.activation/activation.jar' version='1.1'/><jar href='org.telscenter/pedraw.jar' version='1.3.0-20060717.010643-2'/><jar href='commons-logging/commons-logging.jar' version='1.0.3'/><jar href='vldocking/vldocking.jar' version='2.0.5'/><jar href='xito/dialog.jar' version='0.9'/><jar href='xstream/xstream.jar' version='1.1.2'/><jar href='tablelayout/TableLayout.jar' version='20020517'/><jar href='com.toedter/jcalendar.jar' version='1.2.2'/><jar href='net.sf.nachocalendar/nachocalendar.jar' version='0.21'/><jar href='commons-lang/commons-lang.jar' version='2.0'/><jar href='org.eclipse.emf/ecore-xmi.jar' version='2.2.0-SNAPSHOT'/><jar href='rhino/js.jar' version='1.6R2'/><jar href='javax.mail/mail.jar' version='1.4'/><jar href='com.l2fprod.common/l2fprod-common-shared.jar' version='6.2'/><jar href='net.sf.sail/sail-core.jar' version='0.4.5-20060723.044604-14'/><jar href='org.telscenter/sensemaker.jar' version='1.3.3'/><jar href='jmdns/jmdns.jar' version='1.0rc2'/><jar href='xpp3/xpp3.jar' version='1.1.3.4-RC8'/> </resources><application-desc main-class='net.sf.sail.emf.launch.EMFLauncher3'> <argument>http://rails.dev.concord.org/sds/1/offering/1/config/8/3</argument> </application-desc></jnlp>
Adding additional portal-specific config parameters
Additional portal-specific data can be added to the sail learner session by appending it to the end of the jnlp url in standard HTTP GET key/value format. For example in this url:
http://rails.dev.concord.org/sds/1/offering/23/jnlp/17?projectName=My%20Test%20Project&projectID=23
Two additional session parameters will be added when sail starts up:
projectName: "My Test Project"
projectID: 23
These properties are then available to the Bean of a Pod though the SessionService interface.
See:
http://www.telscenter.org/confluence/display/SAIL/Session+Launch+Properties
for more info on the Java implementation.
Right now this functionality is being used to pass to sail information used by the PAS-WISE legacy step that supports display of web content and learner interactivity rendered in WISE such as the discussion step.
Producing a config file for the Java client.
Right now the workgroup is not being passed in the config file (it is specified in the various urls) and instead the members of the workgroup are passed in as a collection of participants.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/config/<sds_workgroup_id>
return headers:
HTTP/1.1 200 OK
return data:
config file in xml format (see example below)
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering/1/config/8/3
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 09:35:20 GMT
Content-Type: application/xml
Content-Length: 2032
<?xml version="1.0" encoding="UTF-8"?>
<java class="java.beans.XMLDecoder" version="1.4.0">
<object class="net.sf.sail.core.service.impl.CurnitUrlProviderImpl">
<void property="url">
<string>http://tels-develop.soe.berkeley.edu:8080/maven-jnlp//curnit-airbag.jar</string>
</void>
</object>
<object class="net.sf.sail.emf.launch.PortfolioManagerService">
<void property="portfolioUrlProvider">
<object class="net.sf.sail.emf.launch.XmlUrlStringProviderImpl">
<void property="urlString">
<string>http://rails.dev.concord.org/sds/1/offering/1/session/8/3</string>
</void>
</object>
</void>
<void property="sessionPoster">
<object class="net.sf.sail.emf.launch.SessionPoster">
<void property="postUrl">
<string>http://rails.dev.concord.org/sds/1/offering/1/session/8/3</string>
</void>
</object>
</void>
</object>
<object class="net.sf.sail.core.service.impl.LauncherServiceImpl"/>
<object class="net.sf.sail.emf.launch.EMFSailDataStoreService2"/>
<object class="net.sf.sail.core.service.impl.UserServiceImpl">
<void property="participants">
<void method="add">
<object class="net.sf.sail.core.entity.User">
<object class="net.sf.sail.core.uuid.UserUuid">
<string>341c16a4-2cc3-11db-92b2-0016cb92217d</string>
</object>
<string>Stephen Smith</string>
</object>
</void>
<void method="add">
<object class="net.sf.sail.core.entity.User">
<object class="net.sf.sail.core.uuid.UserUuid">
<string>01a373c6-2cc7-11db-92b2-0016cb92217d</string>
</object>
<string>Stephen Smith</string>
</object>
</void>
</void>
<void property="userLookupService">
<object class="net.sf.sail.core.service.impl.UserLookupServiceImpl"/>
</void>
</object>
<object class="net.sf.sail.core.service.impl.SessionLoadMonitor"/>
<object class="net.sf.sail.core.service.impl.SessionManagerImpl"/>
</java>
Saving new session bundle files for the Java client.
POST
Content-Type: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/bundle/<sds_workgroup_id>/<sds_workgroup_version>
POST data:
<sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"/>
return headers:
HTTP/1.1 201 Created
Location: http://rails.dev.concord.org/sds/<sds_portal_id>/workgroup/<sds_workgroup_id>
return data:
none
Example:
curl -i -H 'Content-Type: application/xml' -X POST -d '<sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"></sessionBundles>' http://localhost:3000/1/offering/2/bundle/3/1
HTTP/1.1 201 Created
Cache-Control: no-cache
Connection: Keep-Alive
Date: Sat, 28 Oct 2006 22:10:25 GMT
Content-Type: application/xml
Server: WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24)
Content-Length: 0
Location: http://localhost:3000/1/offering/2/bundle/3/1
Content-Md5: C0LhalzTHn3vcOe41KY1xA==
Producing a collection of session bundle files for the Java client.
GET
Accept: application/xml
http://rails.dev.concord.org/sds/<sds_portal_id>/offering/<sds_offering_id>/bundle/<sds_workgroup_id>/<sds_workgroup_version>
return headers:
HTTP/1.1 200 OK
return data:
<?xml version="1.0" encoding="UTF-8"?>
<sailuserdata:EPortfolio xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata" xmi:version="2.0">
<sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"/>
<sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"/>
</sailuserdata:EPortfolio>
Example:
curl -i -X GET -H 'Accept: application/xml' http://rails.dev.concord.org/sds/1/offering/1/bundle/8/7
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 11:15:41 GMT
Content-Type: text/xml; charset=UTF-8
Content-Length: 383
<?xml version="1.0" encoding="UTF-8"?>
<sailuserdata:EPortfolio xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata">
<sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"></sessionBundles><sessionBundles xmlns:xmi="http://www.omg.org/XMI" xmlns:sailuserdata="sailuserdata"></sessionBundles></sailuserdata:EPortfolio>