The Presentation Web Service

The presentation web service provides a standard REST HTTP API in which all operations are performed by sending GET requests to various URLs. Since the presentation web service is read-only, no other request types are allowed. The default name of the web service is live-center-presentation-webservice.

Like the editorial web service, the Live Center presentation web service has no global entry point or "start" URL. You will usually access it by obtaining a URL from the Content Engine's (JSP) presentation layer as follows:

${article.fields.livecenter.value}

Assuming ${article} is an Event content item, then this will return a URL like this:

http://host-ip-address/live-center-presentation-webservice/event/event-id/entries

where:

  • host-ip-address is the IP address and port number of the Content Engine

  • event-id is the content item ID of the event

Submitting a GET request to such a URL returns a JSON structure containing the event's top 10 entries, something like this:

{ 
  "entries": [
    { 
      "author": 
        { 
          "value": "livedemo Administrator", 
          "origin": "http://host-ip-address/webservice/escenic/person/1"
        },
      "creator": 
        { 
           "value": "livedemo Administrator", 
           "origin": "http://host-ip-address/webservice/escenic/person/1"
        },
      "creationDate": "2015-05-14T12:23:18.000+0000", 
      "eTag": "ccd54879-ac58-4e86-bdf2-3f00901e5e17", 
      "lastModifiedDate": "2015-05-14T12:23:18.000+0000", 
      "publishDate": "2015-05-14T12:23:18.000+0000", 
      "payload": [ 
        { 
          "name": "basic",
          "value": "This is the title" 
        } 
      ],
      "state": "published", 
      "tags": [ ],
      "sticky": false 
    } 
  ],
  ...(up to 9 more entries)... 
  "self": "http://host-ip-address/live-center-presentation-webservice/event/3/entries?count=10",
  "after": "http://host-ip-address/live-center-presentation-webservice/event/3/entries/after/2015-05-14T12:23:18.000+0000?count=10",
  "before": "http://host-ip-address/live-center-presentation-webservice/event/3/entries/before/2015-05-14T12:23:18.000+0000?count=10",
  "changelog": "http://host-ip-address/live-center-presentation-webservice/changelog/event/3"
}

The returned structure contains the following fields:

entries

An array of entry structures. For a event with 10 or fewer entries, all entries are returned. If there are more than 10 entries, then only the top 10 entries are returned. The entries are sorted in the order they should appear on the event page - with sticky entries at the top and then ordinary entries sorted by publishDate (or creationDate for unpublished entries), most recent first. For a description of the fields in the entries, see Entry Fields.

Entries are returned 10 at a time by default. You can, however, change this page length — see Presentation Layer Pagination for details.

self

This structure's presentation web service URL.

after

The presentation web service URL for the 10 entries above the current set of entries: that is, entries that should appear above the current set on the event page. If you want to specify a different maximum number of entries to retrieve, just change the URL's count parameter.

You can use this URL for implementing paging functionality (displaying more entries when the user reaches the bottom of the page, for example). To poll for new entries or changes use the changelog URL (see Using The Event Change Log).

before

The presentation web service URL for the 10 entries below the current set of entries: that is, entries that should appear below the current set on the event page. If you want to specify a different maximum number of entries to retrieve, just change the URL's count parameter.

changelog

The presentation web service URL of this event's change log (see Using The Event Change Log for details).