ccc.api.jaxrs
Class PagesImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.PagesImpl
All Implemented Interfaces:
Pages

public class PagesImpl
extends JaxrsCollection
implements Pages

Implementation of the Pages interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Pages
NAME
 
Constructor Summary
PagesImpl(Pages pages)
          Constructor.
 
Method Summary
 ResourceSummary create(Page page)
          Creates a new page.
 PagedCollection<ResourceSummary> list(PageCriteria criteria, int pageNo, int pageSize)
          List existing pages.
 Page retrieve(java.util.UUID pageId)
          Retrieve the page.
 Page retrieveWorkingCopy(java.util.UUID pageId)
          Retrieve the working copy for a page.
 void update(java.util.UUID pageId, Page json)
          Update the specified page on the server.
 void updateWorkingCopy(java.util.UUID pageId, Page delta)
          Update the working copy of the specified page.
 java.lang.String validate(Page page)
          Validate a set of paragraphs against a given definition.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagesImpl

public PagesImpl(Pages pages)
Constructor.

Parameters:
pages - The pages implementation delegated to.
Method Detail

retrieve

public Page retrieve(java.util.UUID pageId)
Retrieve the page.

Specified by:
retrieve in interface Pages
Parameters:
pageId - The page's id.
Returns:
The corresponding page.

create

public ResourceSummary create(Page page)
Creates a new page.

Specified by:
create in interface Pages
Parameters:
page - Details of the new page to create.
Returns:
A resource summary describing the new page.

validate

public java.lang.String validate(Page page)
Validate a set of paragraphs against a given definition.

Specified by:
validate in interface Pages
Parameters:
page - The page to test.
Returns:
A list of errors, as strings.

updateWorkingCopy

public void updateWorkingCopy(java.util.UUID pageId,
                              Page delta)
Update the working copy of the specified page.

Specified by:
updateWorkingCopy in interface Pages
Parameters:
pageId - The id of the page to update.
delta - The changes to apply.

update

public void update(java.util.UUID pageId,
                   Page json)
Update the specified page on the server.

Specified by:
update in interface Pages
Parameters:
pageId - The id of the page to update.
json - The changes to apply.

retrieveWorkingCopy

public Page retrieveWorkingCopy(java.util.UUID pageId)
Retrieve the working copy for a page.

Specified by:
retrieveWorkingCopy in interface Pages
Parameters:
pageId - The page's id.
Returns:
The corresponding working copy.

list

public PagedCollection<ResourceSummary> list(PageCriteria criteria,
                                             int pageNo,
                                             int pageSize)
List existing pages.

Specified by:
list in interface Pages
Parameters:
criteria - The criteria by which to filter pages.
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A list of pages.


Copyright © 2010. All Rights Reserved.