org.xcmis.restatom.collections
Class AbstractCmisCollection<T>

java.lang.Object
  extended by org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
      extended by org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>
          extended by org.xcmis.restatom.collections.AbstractCmisCollection<T>
All Implemented Interfaces:
org.apache.abdera.protocol.server.CollectionAdapter, org.apache.abdera.protocol.server.CollectionInfo, org.apache.abdera.protocol.server.MediaCollectionAdapter, org.apache.abdera.protocol.server.Transactional
Direct Known Subclasses:
ChangesLogCollection, CmisObjectCollection, CmisTypeCollection

public abstract class AbstractCmisCollection<T>
extends org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>

Version:
$Id: AbstractCmisCollection.java 2634 2009-08-12 06:26:41Z andrew00x $
Author:
Andrey Parfonov

Field Summary
protected static java.lang.String ANONYMOUS
          The Constant ANONYMOUS.
protected static java.lang.String SYSTEM
          The Constant SYSTEM.
 
Constructor Summary
AbstractCmisCollection(org.xcmis.spi.Connection connection)
           
 
Method Summary
protected  void addPageLinks(java.lang.String id, org.apache.abdera.model.Feed feed, java.lang.String atomdocType, int maxItems, int skipCount, int total, boolean hasMore, org.apache.abdera.protocol.server.RequestContext request)
           
protected  org.apache.abdera.protocol.server.ResponseContext buildCreateEntryResponse(java.lang.String link, org.apache.abdera.model.Entry entry)
          
protected  org.apache.abdera.protocol.server.ResponseContext buildGetEntryResponse(org.apache.abdera.protocol.server.RequestContext request, org.apache.abdera.model.Entry entry)
          
protected  org.apache.abdera.protocol.server.ResponseContext buildGetFeedResponse(org.apache.abdera.model.Feed feed)
          
protected  org.apache.abdera.protocol.server.ResponseContext createErrorResponse(java.lang.String msg, int status)
          Creates the error response.
protected  org.apache.abdera.protocol.server.ResponseContext createErrorResponse(java.lang.Throwable t, int status)
          Creates the error response.
 void deleteEntry(java.lang.String resourceName, org.apache.abdera.protocol.server.RequestContext request)
          
protected  boolean getBooleanParameter(org.apache.abdera.protocol.server.RequestContext request, java.lang.String name, boolean defaultValue)
           
protected  org.xcmis.spi.Connection getConnection(org.apache.abdera.protocol.server.RequestContext request)
          To get Connection for provided repository Id within request.
 java.lang.Object getContent(T entry, org.apache.abdera.protocol.server.RequestContext request)
          
protected  java.lang.Integer getIntegerParameter(org.apache.abdera.protocol.server.RequestContext request, java.lang.String name, java.lang.Integer defaultValue)
           
protected  java.lang.String getObjectTypeLink(java.lang.String id, org.apache.abdera.protocol.server.RequestContext request)
          Create link to object type description.
protected  java.lang.String getRepositoryId(org.apache.abdera.protocol.server.RequestContext request)
          Get id of CMIS repository.
protected  java.lang.String getServiceLink(org.apache.abdera.protocol.server.RequestContext request)
          Create link to AtomPub Service Document contains the set of repositories that are available.
 org.apache.abdera.protocol.server.ResponseContext postEntry(org.apache.abdera.protocol.server.RequestContext request)
          
 T postEntry(java.lang.String title, org.apache.abdera.i18n.iri.IRI id, java.lang.String summary, java.util.Date updated, java.util.List<org.apache.abdera.model.Person> authors, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request)
          
 void putEntry(T entry, java.lang.String title, java.util.Date updated, java.util.List<org.apache.abdera.model.Person> authors, java.lang.String summary, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request)
          
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
addContent, addEntryDetails, addFeedDetails, addMediaContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, deleteMedia, deleteMedia, getAuthors, getContentType, getEntries, getEntry, getEntry, getEntryFromCollectionProvider, getFeed, getFeedIriForEntry, getId, getLink, getLink, getMedia, getMediaName, getMediaStream, getName, getQueryParameters, getSummary, getTitle, getUpdated, headEntry, headMedia, isMediaEntry, postMedia, postMedia, putEntry, putMedia, putMedia
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
asCollectionElement, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, end, extensionRequest, getAccepts, getAuthor, getCategories, getCategoriesInfo, getEntryFromRequest, getHref, getHref, getId, getResourceName, optionsEntry, optionsMedia, setHref, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.protocol.server.CollectionInfo
getTitle
 

Field Detail

ANONYMOUS

protected static final java.lang.String ANONYMOUS
The Constant ANONYMOUS.

See Also:
Constant Field Values

SYSTEM

protected static final java.lang.String SYSTEM
The Constant SYSTEM.

See Also:
Constant Field Values
Constructor Detail

AbstractCmisCollection

public AbstractCmisCollection(org.xcmis.spi.Connection connection)
Method Detail

deleteEntry

public void deleteEntry(java.lang.String resourceName,
                        org.apache.abdera.protocol.server.RequestContext request)
                 throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
deleteEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getContent

public java.lang.Object getContent(T entry,
                                   org.apache.abdera.protocol.server.RequestContext request)
                            throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getContent in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

postEntry

public org.apache.abdera.protocol.server.ResponseContext postEntry(org.apache.abdera.protocol.server.RequestContext request)

Specified by:
postEntry in interface org.apache.abdera.protocol.server.CollectionAdapter
Overrides:
postEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>

postEntry

public T postEntry(java.lang.String title,
                   org.apache.abdera.i18n.iri.IRI id,
                   java.lang.String summary,
                   java.util.Date updated,
                   java.util.List<org.apache.abdera.model.Person> authors,
                   org.apache.abdera.model.Content content,
                   org.apache.abdera.protocol.server.RequestContext request)
            throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
postEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

putEntry

public void putEntry(T entry,
                     java.lang.String title,
                     java.util.Date updated,
                     java.util.List<org.apache.abdera.model.Person> authors,
                     java.lang.String summary,
                     org.apache.abdera.model.Content content,
                     org.apache.abdera.protocol.server.RequestContext request)
              throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
putEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<T>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

addPageLinks

protected void addPageLinks(java.lang.String id,
                            org.apache.abdera.model.Feed feed,
                            java.lang.String atomdocType,
                            int maxItems,
                            int skipCount,
                            int total,
                            boolean hasMore,
                            org.apache.abdera.protocol.server.RequestContext request)
Parameters:
id - id
feed - feed to which are added links
atomdocType - type of collections. See ProviderImpl.
maxItems - max items in each response
skipCount - number of skipped results from the begin of set
total - total number items in result set. If total number is unknown then this parameter must be set as -1.
hasMore - true if has more items in result set false otherwise
request - request context

buildCreateEntryResponse

protected org.apache.abdera.protocol.server.ResponseContext buildCreateEntryResponse(java.lang.String link,
                                                                                     org.apache.abdera.model.Entry entry)

Overrides:
buildCreateEntryResponse in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

buildGetEntryResponse

protected org.apache.abdera.protocol.server.ResponseContext buildGetEntryResponse(org.apache.abdera.protocol.server.RequestContext request,
                                                                                  org.apache.abdera.model.Entry entry)
                                                                           throws org.apache.abdera.protocol.server.context.ResponseContextException

Overrides:
buildGetEntryResponse in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

buildGetFeedResponse

protected org.apache.abdera.protocol.server.ResponseContext buildGetFeedResponse(org.apache.abdera.model.Feed feed)

Overrides:
buildGetFeedResponse in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

createErrorResponse

protected org.apache.abdera.protocol.server.ResponseContext createErrorResponse(java.lang.String msg,
                                                                                int status)
Creates the error response.

Parameters:
msg - the msg
status - the status
Returns:
the response context

createErrorResponse

protected org.apache.abdera.protocol.server.ResponseContext createErrorResponse(java.lang.Throwable t,
                                                                                int status)
Creates the error response.

Parameters:
t - the t
status - the status
Returns:
the response context

getObjectTypeLink

protected java.lang.String getObjectTypeLink(java.lang.String id,
                                             org.apache.abdera.protocol.server.RequestContext request)
Create link to object type description.

Parameters:
id - object type id
request - request context
Returns:
link to AtomPub Document that describes object type

getRepositoryId

protected java.lang.String getRepositoryId(org.apache.abdera.protocol.server.RequestContext request)
Get id of CMIS repository.

Parameters:
request - RequestContext
Returns:
repositoryId string

getServiceLink

protected java.lang.String getServiceLink(org.apache.abdera.protocol.server.RequestContext request)
Create link to AtomPub Service Document contains the set of repositories that are available.

Parameters:
request - the request context
Returns:
link to AtomPub Service Document

getConnection

protected org.xcmis.spi.Connection getConnection(org.apache.abdera.protocol.server.RequestContext request)
To get Connection for provided repository Id within request.

Parameters:
request - the request context
Returns:
the Connection to CMIS storage

getBooleanParameter

protected boolean getBooleanParameter(org.apache.abdera.protocol.server.RequestContext request,
                                      java.lang.String name,
                                      boolean defaultValue)

getIntegerParameter

protected java.lang.Integer getIntegerParameter(org.apache.abdera.protocol.server.RequestContext request,
                                                java.lang.String name,
                                                java.lang.Integer defaultValue)
                                         throws org.apache.abdera.protocol.server.context.ResponseContextException
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException


Copyright © 2011 eXo Platform SAS. All Rights Reserved.