Class FeedableView<T extends Linkable>

java.lang.Object
com.emc.documentum.rest.view.FeedableView<T>
Type Parameters:
T - resource model class extended from Linkable, e.g. PersistentObject
Direct Known Subclasses:
DefaultFeedView

public abstract class FeedableView<T extends Linkable> extends Object
Abstract class for resource representation views that could be represented as atom feed
  • Field Details

    • uriInfo

      protected UriInfo uriInfo
    • repositoryName

      protected String repositoryName
    • otherParams

      protected Map<String,Object> 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 serialized
      uriInfo - the URI info of the request. This is typically obtained from the resource controller where the controller method has an annotated parameter for RequestUri
      repositoryName - the repository name
      returnLinks - indicates whether to return links for this model instance
      others - other parameters
  • Method Details

    • getUriInfo

      public UriInfo getUriInfo()
      Return the URI info from the constructor parameter UriInfo.
      Returns:
      te URI info
    • getRepositoryName

      public String 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

      public Map<String,Object> getOtherParams()
      Return other parameters from the constructor parameter.
      Returns:
      other parameters as a map
    • getWorkingController

      public Class<? extends AbstractController> getWorkingController()
      Return the working resource controller class of this view instance
      Returns:
      the controller class
    • feedId

      public String 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

      public abstract String feedTitle()
      The returning value of this method is to resolve the value of the atom feed title.
      Returns:
      the atom feed title
    • feedUpdated

      public abstract Date 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

      public List<AtomAuthor> 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

      public Integer 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

      public Integer 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

      public Integer 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

      public List<Link> 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

      public List<T> 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

      public Map pageTotalForEach()
    • feed

      public <E extends AtomEntry> AtomFeed<E> feed(boolean inline)
      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

      protected void customizeFeed(AtomFeed feed)
      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

      protected String getAtomId()
      Build the atom feed ID by removing the URL extension name from the request URI.
      Returns:
      the atom feed ID
    • getUriFactory

      @Deprecated protected UriFactory getUriFactory()
      Deprecated.
      Please use uriBuilder(String) to build links.
      Get the URI factory.
      Returns:
      the URI factory
    • uriBuilder

      protected ResourceUriBuilder uriBuilder(String resource)
      Get resource URI builder
      Parameters:
      resource - resource name
      Returns:
      the resource URI builder