Package com.emc.documentum.rest.view
Class FeedableView<T extends Linkable>
java.lang.Object
com.emc.documentum.rest.view.FeedableView<T>
- Type Parameters:
T
- resource model class extended fromLinkable
, e.g.PersistentObject
- Direct Known Subclasses:
DefaultFeedView
Abstract class for resource representation views that could be represented as atom feed
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizeFeed
(AtomFeed feed) Override this method to additionally customize the atom feed, especially for custom atom feed attributes.feed
(boolean inline) Build the atom feed from this view instance.The returning value of this method is to resolve the value of the atom feed authors.feedId()
The returning value of this method is to resolve the value of the atom feed ID.The returning value of this method is to resolve the value of the atom feed items number for each page.The returning value of this method is to resolve the value of the atom feed links.The returning value of this method is to resolve the value of the atom feed page number.abstract String
The returning value of this method is to resolve the value of the atom feed title.The returning value of this method is to resolve the value of the atom feed total number of items in the back-end system.abstract Date
The returning value of this method is to resolve the value of the atom feed updated time.protected String
Build the atom feed ID by removing the URL extension name from the request URI.Return other parameters from the constructor parameter.Return the repository name from the constructor parameter.protected UriFactory
Deprecated.Return the URI info from the constructor parameterUriInfo
.Class<? extends AbstractController>
Return the working resource controller class of this view instanceThe returning value of this method is to resolve the value of the atom feed page items.boolean
Indicate whether to return links for the inline resource object.protected ResourceUriBuilder
uriBuilder
(String resource) Get resource URI builder
-
Field Details
-
uriInfo
-
repositoryName
-
returnLinks
protected boolean returnLinks -
otherParams
-
-
Constructor Details
-
FeedableView
public FeedableView(Page<T> page, UriInfo uriInfo, String repositoryName, Boolean returnLinks, Map<String, Object> others) Constructor of the feedable view- Parameters:
page
- the page of resource model instances to be serializeduriInfo
- the URI info of the request. This is typically obtained from the resource controller where the controller method has an annotated parameter forRequestUri
repositoryName
- the repository namereturnLinks
- indicates whether to return links for this model instanceothers
- other parameters
-
-
Method Details
-
getUriInfo
Return the URI info from the constructor parameterUriInfo
.- Returns:
- te URI info
-
getRepositoryName
Return the repository name from the constructor parameter.- Returns:
- the repository name
-
returnLinks
public boolean returnLinks()Indicate whether to return links for the inline resource object. The value comes from the constructor parameter.- Returns:
- TRUE if returning links; FALSE otherwise
-
getOtherParams
Return other parameters from the constructor parameter.- Returns:
- other parameters as a map
-
getWorkingController
Return the working resource controller class of this view instance- Returns:
- the controller class
-
feedId
The returning value of this method is to resolve the value of the atom feed ID. The default is to return the URI of the feed.- Returns:
- the atom feed ID
-
feedTitle
The returning value of this method is to resolve the value of the atom feed title.- Returns:
- the atom feed title
-
feedUpdated
The returning value of this method is to resolve the value of the atom feed updated time.- Returns:
- the atom feed updated time
-
feedAuthors
The returning value of this method is to resolve the value of the atom feed authors. The default implementation is to return a single user named as "Open Text Documentum".- Returns:
- the atom feed authors
-
feedPageNumber
The returning value of this method is to resolve the value of the atom feed page number.- Returns:
- the atom feed page number
-
feedItemsPerPage
The returning value of this method is to resolve the value of the atom feed items number for each page.- Returns:
- the atom feed items number for each page
-
feedTotalNumber
The returning value of this method is to resolve the value of the atom feed total number of items in the back-end system.- Returns:
- the atom feed total number of items on server side
-
feedLinks
The returning value of this method is to resolve the value of the atom feed links. Pagination links will be automatically added to the link collection. Implementation class should extend this method for additional link rendering.- Returns:
- the atom feed links
-
pageItems
The returning value of this method is to resolve the value of the atom feed page items.- Returns:
- the atom feed page items
-
pageTotalForEach
-
feed
Build the atom feed from this view instance.- Type Parameters:
E
- extended atom entry type- Parameters:
inline
- whether inline the entry- Returns:
- the rendered atom feed
-
customizeFeed
Override this method to additionally customize the atom feed, especially for custom atom feed attributes. By default this method does nothing with the feed.- Parameters:
feed
- the feed
-
getAtomId
Build the atom feed ID by removing the URL extension name from the request URI.- Returns:
- the atom feed ID
-
getUriFactory
Deprecated.Please useuriBuilder(String)
to build links.Get the URI factory.- Returns:
- the URI factory
-
uriBuilder
Get resource URI builder- Parameters:
resource
- resource name- Returns:
- the resource URI builder
-
uriBuilder(String)
to build links.