javaBin / ems-redux

Baksystemet som holder på alle foredrag som er sendt inn til JavaZone gjennom historien.
Apache License 2.0
10 stars 4 forks source link

ems-redux

Build Status

API for exposing Events and their sessions with speakers.

EMS uses Collection+JSON and further constrains the media-type.

Additional Constraints

All collections in EMS are homogenious. This means there will only be one type of object in any given collection.

Date properties are formatted according to RFC-3339. Will always be set to Midnight. MUST be in UTC timezone.

DateTime properties are formatted according to RFC-3339. MUST be in UTC timezone.

URI properties are normalized URIs according to RFC-3986.

Never assume that the properties listed are the only ones there. As the API evolves, new properties MAY appear. Clients MUST be written to allow for this. Old clients MUST ignore unknown properties.

Event

An event is a primary object type in EMS. An event consists of the following fields:

Session

A Session is always linked to a specific Event. A session consists of the following fields:

Contact

A Contact is a primary object type in EMS. A contact consists of the following fields:

There will also be hypertext controls for the photo of the contact.

Link relations

See the wiki for the link relations used. All link relations not found in the registries defined in collection+json should be considered to have the base URI of http://purl.org/javabin/rels/ems/

Exploring the API

You can use Trygve Laugstøl's excellent collection+json browser to explore the API.

Enabling authentication

The application is using JAAS for authentication.

The authentication is for now just Basic, meaning that the application should use HTTPS to make this more secure.

Set the system property 'java.security.auth.login.config' to the location of the config file.

If no system or security properties were set, try to read from the file, ${user.home}/.java.login.config, where ${user.home} is the value represented by the "user.home" System property.

Example file:

ems {
    com.sun.security.auth.module.LdapLoginModule REQUIRED
    userProvider="ldap://ldap.java.no"
    authIdentity="uid={USERNAME},ou=People,dc=java,dc=no"
    useSSL=false;
};

Creating new events

To create a new event you need to create a file called event.json with the follwoing content:

{
  "template": {
    "data": [
      {
        "name": "name",
        "value": "JavaZone 20XX"
      },
      {
        "name": "venue",
        "value": "Oslo Spektrum"
      }
    ]
  }
}

Add the basic auth token and run the following curl:

curl -XPOST -H 'Content-Type: application/vnd.collection+json' -d@event.json -n https://javazone.no/ems/server/events -H 'Authorization: Basic <auth>'  -v