Entity URLs defined

Introduction

Defines what entity URLs are and how they relate to the Entity Broker

Entity Broker URLs

The Entity Broker scheme makes it possible to address an entity via a (globally routable) URL. Not all entities can be addressed via a URL - in order for this to happen, a suitable handler for the entity prefix must have been registered into the Entity Broker system. However, once registered, the URLs used to address entities all take the same form:

http://server/direct/<entity-reference>/<path-info>

where <entity-reference> represents the textual form of the entity reference, and <path-info> is any kind of following path-info information for the implementor of the access handler. Examples of entity URLs are below.

  1. Direct to an entity defined by prefix and id (ID reference)
  2. Direct to an entity space (e.g. when there is only one entity in this concept or only one way to see all entities in a space)

Any following material from the final / of the entity reference will be handed on to the access handler as the "pathInfo" of the HttpServletRequest.

Control over what happens when the user reaches that URL is completely up to the entity provider author and the related tool/webapp author. Rather than defining the URLs in the services and components (as it works in the legacy entity system in Sakai), we instead hand control over to the tool/webapp to define and control the "view" of an entity. In order for an entity access to be handled via URL, an object implementing the interface EntityViewAccessProvider must be registered into the service bean EntityViewAccessProviderManager.
Note that this replaces the old HttpServletAccessProvider which is still supported but deprecated.

Entity Views

The entity broker will interpret incoming URLs via a standard set of URL templates and determine which view of an entity or space is being requested. This will become an EntityView object which you can access in various EntityProvider methods. The standard set of views and templates are:

LIST

/prefix

a list view of a set of entities (possibly filtered and sorted by a search)

SHOW

/prefix/id

a view of a single entity

NEW

/prefix/new

a view for creating an entity

EDIT

/prefix/id/edit

a view for editing an entity

DELETE

/prefix/id/delete

view for deleting an entity (a confirmation page for example)

These templates can be customized per entity by implementing EntityViewUrlCustomizable in the entity provider

EntityBroker RESTful URL support

  • More info about RESTful URLs in the entity broker