org.xcmis.restatom.collections
Class CmisObjectCollection

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<org.xcmis.spi.model.CmisObject>
              extended by org.xcmis.restatom.collections.CmisObjectCollection
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:
AllVersionsCollection, CheckedOutCollection, FolderChildrenCollection, FolderDescentantsCollection, ParentsCollection, PoliciesCollection, QueryCollection, RelationshipsCollection, UnfiledCollection

public abstract class CmisObjectCollection
extends AbstractCmisCollection<org.xcmis.spi.model.CmisObject>

Version:
$Id: CmisObjectCollection.java 218 2010-02-15 07:38:06Z andrew00x $
Author:
Andrey Parfonov

Field Summary
protected static String ANONYMOUS
          The Constant ANONYMOUS.
protected static String SPACES_AIR_SPECIFIC_REFERER
          The Constant SPACES_AIR_SPECIFIC_REFERER.
protected static String SYSTEM
          The Constant SYSTEM.
 
Constructor Summary
CmisObjectCollection()
          Instantiates a new cmis object collection.
 
Method Summary
protected  String addEntryDetails(org.apache.abdera.protocol.server.RequestContext request, org.apache.abdera.model.Entry entry, org.apache.abdera.i18n.iri.IRI feedIri, org.xcmis.spi.model.CmisObject object)
          
protected  org.xcmis.spi.utils.MimeType convertMimeType(MimeType abderaMimeType)
           
protected  org.apache.abdera.model.Feed createFeedBase(org.apache.abdera.protocol.server.RequestContext request)
          
 void deleteEntry(String objectId, org.apache.abdera.protocol.server.RequestContext request)
          
 org.apache.abdera.protocol.server.ResponseContext deleteMedia(org.apache.abdera.protocol.server.RequestContext request)
          
 void deleteMedia(String documentId, org.apache.abdera.protocol.server.RequestContext request)
          
protected  String getACLLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's ACL.
protected  String getAllowableActionsLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's allowable actions.
protected  String getAllVersionsLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's versions.
 String getAuthor(org.apache.abdera.protocol.server.RequestContext request)
          
 List<org.apache.abdera.model.Person> getAuthors(org.xcmis.spi.model.CmisObject object, org.apache.abdera.protocol.server.RequestContext request)
          
protected  org.xcmis.spi.model.BaseType getBaseObjectType(org.xcmis.spi.model.CmisObject object)
          Get object's base type.
protected  String getBaseRenditionHref(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to express renditions.
protected  String getChildrenLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub document that describes folder's children.
protected  String getContentLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to document content.
protected  org.xcmis.spi.ContentStream getContentStream(org.apache.abdera.model.Entry entry, org.apache.abdera.protocol.server.RequestContext request)
          Get content stream from entry.
 String getContentType(org.xcmis.spi.model.CmisObject object)
          
protected  Calendar getCreationDate(org.xcmis.spi.model.CmisObject object)
          Get object creation date.
protected  String getDescendantsLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub document that describes folder's descendants.
 org.xcmis.spi.model.CmisObject getEntry(String id, org.apache.abdera.protocol.server.RequestContext request)
          
protected  String getFolderTreeLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub document that describes folder's tree.
 String getId(org.xcmis.spi.model.CmisObject object)
          
 String getId(org.apache.abdera.protocol.server.RequestContext request)
          
protected  Calendar getLastModificationDate(org.xcmis.spi.model.CmisObject object)
          Get object creation date.
 org.apache.abdera.protocol.server.ResponseContext getMedia(org.apache.abdera.protocol.server.RequestContext request)
          
 String getName(org.xcmis.spi.model.CmisObject object)
          
protected  String getObjectLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object with id.
protected  String getParentsLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's parent(s).
protected  String getPoliciesLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's policies.
protected  org.xcmis.spi.model.Property<?> getProperty(org.xcmis.spi.model.CmisObject object, String propertyName)
          Get object's property.
protected  String getRelationshipsLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get link to AtomPub Document that describes object's relationships.
protected  String getResourceName(org.apache.abdera.protocol.server.RequestContext request)
          Get's the name of the specific resource requested.
protected  String getSelfLink(String id, org.apache.abdera.protocol.server.RequestContext request)
          Get self link which provides the URI to retrieve this resource again.
 String getStreamId(org.apache.abdera.protocol.server.RequestContext request)
          
 String getTitle(org.xcmis.spi.model.CmisObject object)
          
 Date getUpdated(org.xcmis.spi.model.CmisObject object)
          
 org.apache.abdera.protocol.server.ResponseContext putEntry(org.apache.abdera.protocol.server.RequestContext request)
          
 void putMedia(org.xcmis.spi.model.CmisObject entryObj, MimeType contentType, String slug, InputStream inputStream, org.apache.abdera.protocol.server.RequestContext request)
          Put media.
 org.apache.abdera.protocol.server.ResponseContext putMedia(org.apache.abdera.protocol.server.RequestContext request)
          
protected  void updatePropertiesFromEntry(org.xcmis.spi.model.CmisObject object, org.apache.abdera.model.Entry entry)
          From specification (1.0-cd06), section 3.5.2 Entries.
 
Methods inherited from class org.xcmis.restatom.collections.AbstractCmisCollection
addPageLinks, buildCreateEntryResponse, buildGetEntryResponse, buildGetFeedResponse, createErrorResponse, createErrorResponse, getBooleanParameter, getConnection, getContent, getIntegerParameter, getObjectTypeLink, getRepositoryId, getServiceLink, postEntry, postEntry, putEntry
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
addContent, addFeedDetails, addMediaContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, getEntries, getEntry, getEntryFromCollectionProvider, getFeed, getFeedIriForEntry, getLink, getLink, getMediaName, getMediaStream, getQueryParameters, getSummary, headEntry, headMedia, isMediaEntry, postMedia, postMedia
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
asCollectionElement, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, end, extensionRequest, getAccepts, getCategories, getCategoriesInfo, getEntryFromRequest, getHref, getHref, 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

SPACES_AIR_SPECIFIC_REFERER

protected static final String SPACES_AIR_SPECIFIC_REFERER
The Constant SPACES_AIR_SPECIFIC_REFERER.

See Also:
Constant Field Values

ANONYMOUS

protected static final String ANONYMOUS
The Constant ANONYMOUS.

See Also:
Constant Field Values

SYSTEM

protected static final String SYSTEM
The Constant SYSTEM.

See Also:
Constant Field Values
Constructor Detail

CmisObjectCollection

public CmisObjectCollection()
Instantiates a new cmis object collection.

Method Detail

deleteEntry

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

Overrides:
deleteEntry in class AbstractCmisCollection<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

deleteMedia

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

Specified by:
deleteMedia in interface org.apache.abdera.protocol.server.MediaCollectionAdapter
Overrides:
deleteMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>

deleteMedia

public void deleteMedia(String documentId,
                        org.apache.abdera.protocol.server.RequestContext request)
                 throws org.apache.abdera.protocol.server.context.ResponseContextException

Overrides:
deleteMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getAuthor

public String getAuthor(org.apache.abdera.protocol.server.RequestContext request)
                 throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getAuthor in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getAuthors

public List<org.apache.abdera.model.Person> getAuthors(org.xcmis.spi.model.CmisObject object,
                                                       org.apache.abdera.protocol.server.RequestContext request)
                                                throws org.apache.abdera.protocol.server.context.ResponseContextException

Overrides:
getAuthors in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getContentType

public String getContentType(org.xcmis.spi.model.CmisObject object)

Overrides:
getContentType in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>

getEntry

public org.xcmis.spi.model.CmisObject getEntry(String id,
                                               org.apache.abdera.protocol.server.RequestContext request)
                                        throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getId

public String getId(org.xcmis.spi.model.CmisObject object)
             throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getId

public String getId(org.apache.abdera.protocol.server.RequestContext request)

Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

getMedia

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

Specified by:
getMedia in interface org.apache.abdera.protocol.server.MediaCollectionAdapter
Overrides:
getMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>

getName

public String getName(org.xcmis.spi.model.CmisObject object)
               throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getName in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getStreamId

public String getStreamId(org.apache.abdera.protocol.server.RequestContext request)


getTitle

public String getTitle(org.xcmis.spi.model.CmisObject object)
                throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getTitle in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getUpdated

public Date getUpdated(org.xcmis.spi.model.CmisObject object)
                throws org.apache.abdera.protocol.server.context.ResponseContextException

Specified by:
getUpdated in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

putEntry

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

Specified by:
putEntry in interface org.apache.abdera.protocol.server.CollectionAdapter
Overrides:
putEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>

putMedia

public void putMedia(org.xcmis.spi.model.CmisObject entryObj,
                     MimeType contentType,
                     String slug,
                     InputStream inputStream,
                     org.apache.abdera.protocol.server.RequestContext request)
              throws org.apache.abdera.protocol.server.context.ResponseContextException
Put media.

Overrides:
putMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Parameters:
entryObj - the entry obj
contentType - the content type
slug - the slug
inputStream - the input stream
request - the request
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException - the response context exception

putMedia

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

Specified by:
putMedia in interface org.apache.abdera.protocol.server.MediaCollectionAdapter
Overrides:
putMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>

addEntryDetails

protected String addEntryDetails(org.apache.abdera.protocol.server.RequestContext request,
                                 org.apache.abdera.model.Entry entry,
                                 org.apache.abdera.i18n.iri.IRI feedIri,
                                 org.xcmis.spi.model.CmisObject object)
                          throws org.apache.abdera.protocol.server.context.ResponseContextException

Overrides:
addEntryDetails in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<org.xcmis.spi.model.CmisObject>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

convertMimeType

protected org.xcmis.spi.utils.MimeType convertMimeType(MimeType abderaMimeType)

createFeedBase

protected org.apache.abdera.model.Feed createFeedBase(org.apache.abdera.protocol.server.RequestContext request)
                                               throws org.apache.abdera.protocol.server.context.ResponseContextException

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

getACLLink

protected String getACLLink(String id,
                            org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's ACL.

Parameters:
id - object id
request - request context
Returns:
link to allowable actions document

getAllowableActionsLink

protected String getAllowableActionsLink(String id,
                                         org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's allowable actions.

Parameters:
id - object id
request - request context
Returns:
link to allowable actions document

getAllVersionsLink

protected String getAllVersionsLink(String id,
                                    org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's versions.

Parameters:
id - objects id
request - request context
Returns:
link to AtomPub Document that describes object's versions

getBaseObjectType

protected org.xcmis.spi.model.BaseType getBaseObjectType(org.xcmis.spi.model.CmisObject object)
Get object's base type.

Parameters:
object - object
Returns:
object's base type

getBaseRenditionHref

protected String getBaseRenditionHref(String id,
                                      org.apache.abdera.protocol.server.RequestContext request)
Get link to express renditions.

Parameters:
id - objects id
request - request context
Returns:
link to AtomPub Document that describes object's parent(s)

getChildrenLink

protected String getChildrenLink(String id,
                                 org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub document that describes folder's children.

Parameters:
id - folder id
request - the request context
Returns:
link to AtomPub document that describes folder's children

getSelfLink

protected String getSelfLink(String id,
                             org.apache.abdera.protocol.server.RequestContext request)
Get self link which provides the URI to retrieve this resource again. The atom:link with relation self MUST be generated to return the URI of the feed. If paging or any other mechanism is used to filter, sort, or change the representation of the feed, the URI MUST point back a resource with the same representation.

Parameters:
id - the object id
request - the request context
Returns:
link which provides the URI to retrieve this resource again.

getContentLink

protected String getContentLink(String id,
                                org.apache.abdera.protocol.server.RequestContext request)
Get link to document content.

Parameters:
id - document id
request - request context
Returns:
link to document content

getContentStream

protected org.xcmis.spi.ContentStream getContentStream(org.apache.abdera.model.Entry entry,
                                                       org.apache.abdera.protocol.server.RequestContext request)
                                                throws IOException,
                                                       org.apache.abdera.protocol.server.context.ResponseContextException
Get content stream from entry.

Parameters:
entry - source entry
request - request context
Returns:
content stream as ContentStream or null if there is no 'content' in entry
Throws:
IOException - if any i/o error occurs
org.apache.abdera.protocol.server.context.ResponseContextException - other errors

getCreationDate

protected Calendar getCreationDate(org.xcmis.spi.model.CmisObject object)
Get object creation date.

Parameters:
object - source object
Returns:
creation date

getDescendantsLink

protected String getDescendantsLink(String id,
                                    org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub document that describes folder's descendants. If repository does not support capability 'getDescendants' this method will return null.

Parameters:
id - folder id
request - request context
Returns:
link to AtomPub document that describes folder's descendants or null if capability 'getDescendants' is not supported.

getFolderTreeLink

protected String getFolderTreeLink(String id,
                                   org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub document that describes folder's tree. If repository does not support capability 'getFolderTree' this method will return null.

Parameters:
id - folder id
request - request context
Returns:
link to AtomPub document that describes folder's tree or null if capability 'getFolderTree' is not supported.

getLastModificationDate

protected Calendar getLastModificationDate(org.xcmis.spi.model.CmisObject object)
Get object creation date.

Parameters:
object - source object
Returns:
creation date

getObjectLink

protected String getObjectLink(String id,
                               org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object with id.

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

getParentsLink

protected String getParentsLink(String id,
                                org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's parent(s).

Parameters:
id - objects id
request - request context
Returns:
link to AtomPub Document that describes object's parent(s)

getPoliciesLink

protected String getPoliciesLink(String id,
                                 org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's policies.

Parameters:
id - objects id
request - request context
Returns:
link to AtomPub Document that describes policies applied to object

getProperty

protected org.xcmis.spi.model.Property<?> getProperty(org.xcmis.spi.model.CmisObject object,
                                                      String propertyName)
Get object's property.

Parameters:
object - object
propertyName - property name
Returns:
property or null if property does not exist

getRelationshipsLink

protected String getRelationshipsLink(String id,
                                      org.apache.abdera.protocol.server.RequestContext request)
Get link to AtomPub Document that describes object's relationships.

Parameters:
id - objects id
request - request context
Returns:
link to AtomPub Document that describes object's relationships

getResourceName

protected String getResourceName(org.apache.abdera.protocol.server.RequestContext request)
Get's the name of the specific resource requested.

Overrides:
getResourceName in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
Parameters:
request - RequestContext
Returns:
string resource name

updatePropertiesFromEntry

protected void updatePropertiesFromEntry(org.xcmis.spi.model.CmisObject object,
                                         org.apache.abdera.model.Entry entry)
From specification (1.0-cd06), section 3.5.2 Entries. When POSTing an Atom Document, the Atom elements MUST take precedence over the corresponding writable CMIS property. For example, atom:title will overwrite cmis:name.

Parameters:
object - CMIS object
entry - entry that delivered CMIS object.


Copyright © 2011 eXo Platform SAS. All Rights Reserved.