|
Apache Abdera API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
org.apache.abdera.protocol.server.adapters.jcr.JcrCollectionAdapter
public class JcrCollectionAdapter
Adapter implementation that uses a JCR Repository to store Atompub collection entries. The adapter is intended to be used with the DefaultProvider implementation.
Constructor Summary | |
---|---|
JcrCollectionAdapter()
|
Method Summary | |
---|---|
void |
deleteEntry(String resourceName,
RequestContext request)
|
static void |
dump(javax.jcr.Node node)
Recursively outputs the contents of the given node. |
void |
end(RequestContext request,
ResponseContext response)
Called by the provider after dispatching the request to the adapter |
String |
getAuthor(RequestContext request)
|
List<Person> |
getAuthors(javax.jcr.Node entry,
RequestContext request)
|
ResponseContext |
getCategories(RequestContext request)
Get an Atompub Categories document |
Object |
getContent(javax.jcr.Node entry,
RequestContext request)
|
String |
getContentType(javax.jcr.Node entry)
|
static Calendar |
getDateOrNull(javax.jcr.Node node,
String propName)
|
Iterable<javax.jcr.Node> |
getEntries(RequestContext request)
|
javax.jcr.Node |
getEntry(String resourceName,
RequestContext request)
|
String |
getId(javax.jcr.Node entry)
|
String |
getId(RequestContext request)
|
String |
getMediaName(javax.jcr.Node entry)
|
InputStream |
getMediaStream(javax.jcr.Node entry)
|
String |
getName(javax.jcr.Node entry)
|
static String |
getStringOrNull(javax.jcr.Node node,
String propName)
|
Text |
getSummary(javax.jcr.Node entry,
RequestContext request)
|
String |
getTitle(javax.jcr.Node entry)
|
String |
getTitle(RequestContext request)
Get the value of the app:collection element's atom:title element. |
Date |
getUpdated(javax.jcr.Node entry)
|
static javax.jcr.Value |
getValueOrNull(javax.jcr.Node node,
String propName)
|
void |
initialize()
Logs into the repository and posts a node for the collection if one does not exist. |
boolean |
isMediaEntry(javax.jcr.Node entry)
|
javax.jcr.Node |
postEntry(String title,
IRI id,
String summary,
Date updated,
List<Person> authors,
Content content,
RequestContext request)
|
protected javax.jcr.Node |
postEntry(String title,
String summary,
Date updated,
List<Person> authors,
Content content,
javax.jcr.Session session,
javax.jcr.Node collectionNode,
String resourceName,
int num)
|
javax.jcr.Node |
postMedia(javax.activation.MimeType mimeType,
String slug,
InputStream inputStream,
RequestContext request)
|
protected String |
postSummaryForEntry(javax.jcr.Node n)
post a summary for an entry. |
void |
putEntry(javax.jcr.Node entry,
String title,
Date updated,
List<Person> authors,
String summary,
Content content,
RequestContext request)
|
void |
setAuthor(String author)
|
void |
setCollectionNodePath(String collectionNodePath)
|
void |
setCredentials(javax.jcr.Credentials credentials)
|
void |
setMaxActiveSessions(int maxActiveSessions)
|
void |
setRepository(javax.jcr.Repository repository)
|
void |
setTitle(String title)
|
void |
start(RequestContext request)
Called by the provider before dispatching the request to the adapter |
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter |
---|
addContent, addEntryDetails, addFeedDetails, addMediaContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, deleteMedia, deleteMedia, getEntry, getEntryFromCollectionProvider, getFeed, getFeedIriForEntry, getLink, getLink, getMedia, getQueryParameters, headEntry, headMedia, postEntry, postMedia, putEntry, putMedia, putMedia |
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter |
---|
asCollectionElement, buildCreateEntryResponse, buildGetEntryResponse, buildGetFeedResponse, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, extensionRequest, getAccepts, getCategoriesInfo, getEntryFromRequest, getHref, getHref, getResourceName, optionsEntry, optionsMedia, setHref |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JcrCollectionAdapter()
Method Detail |
---|
public void setCollectionNodePath(String collectionNodePath)
public void setTitle(String title)
public void setAuthor(String author)
public void initialize() throws Exception
javax.jcr.RepositoryException
Exception
public void start(RequestContext request) throws ResponseContextException
Transactional
start
in interface Transactional
start
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
ResponseContextException
public void end(RequestContext request, ResponseContext response)
Transactional
end
in interface Transactional
end
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
public String getContentType(javax.jcr.Node entry)
getContentType
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
public boolean isMediaEntry(javax.jcr.Node entry) throws ResponseContextException
isMediaEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public javax.jcr.Node postMedia(javax.activation.MimeType mimeType, String slug, InputStream inputStream, RequestContext request) throws ResponseContextException
postMedia
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
protected String postSummaryForEntry(javax.jcr.Node n)
n
-
public javax.jcr.Node postEntry(String title, IRI id, String summary, Date updated, List<Person> authors, Content content, RequestContext request) throws ResponseContextException
postEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
protected javax.jcr.Node postEntry(String title, String summary, Date updated, List<Person> authors, Content content, javax.jcr.Session session, javax.jcr.Node collectionNode, String resourceName, int num) throws ResponseContextException, javax.jcr.RepositoryException
ResponseContextException
javax.jcr.RepositoryException
public void deleteEntry(String resourceName, RequestContext request) throws ResponseContextException
deleteEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public static void dump(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public String getAuthor(RequestContext request) throws ResponseContextException
getAuthor
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
ResponseContextException
public List<Person> getAuthors(javax.jcr.Node entry, RequestContext request) throws ResponseContextException
getAuthors
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public Object getContent(javax.jcr.Node entry, RequestContext request) throws ResponseContextException
getContent
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public Iterable<javax.jcr.Node> getEntries(RequestContext request) throws ResponseContextException
getEntries
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public javax.jcr.Node getEntry(String resourceName, RequestContext request) throws ResponseContextException
getEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public String getId(RequestContext request)
getId
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
public String getId(javax.jcr.Node entry) throws ResponseContextException
getId
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public String getMediaName(javax.jcr.Node entry) throws ResponseContextException
getMediaName
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public InputStream getMediaStream(javax.jcr.Node entry) throws ResponseContextException
getMediaStream
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public String getName(javax.jcr.Node entry) throws ResponseContextException
getName
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public Text getSummary(javax.jcr.Node entry, RequestContext request) throws ResponseContextException
getSummary
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public String getTitle(RequestContext request)
CollectionInfo
public String getTitle(javax.jcr.Node entry) throws ResponseContextException
getTitle
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public Date getUpdated(javax.jcr.Node entry) throws ResponseContextException
getUpdated
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public void putEntry(javax.jcr.Node entry, String title, Date updated, List<Person> authors, String summary, Content content, RequestContext request) throws ResponseContextException
putEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<javax.jcr.Node>
ResponseContextException
public static String getStringOrNull(javax.jcr.Node node, String propName) throws ResponseContextException
ResponseContextException
public ResponseContext getCategories(RequestContext request)
CollectionAdapter
getCategories
in interface CollectionAdapter
getCategories
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
public static Calendar getDateOrNull(javax.jcr.Node node, String propName) throws ResponseContextException
ResponseContextException
public static javax.jcr.Value getValueOrNull(javax.jcr.Node node, String propName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void setRepository(javax.jcr.Repository repository)
public void setCredentials(javax.jcr.Credentials credentials)
public void setMaxActiveSessions(int maxActiveSessions)
|
Apache Abdera API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |