Class EntryableView<T extends Linkable>

Type Parameters:
T - resource model class extended from Linkable, e.g. PersistentObject
Direct Known Subclasses:
PersistentLinkableView

public abstract class EntryableView<T extends Linkable> extends LinkableView<T>
Abstract class for resource representation views that could be represented as atom entry. This class extends LinkableView. The implementation class must define an annotation DataViewBinding.
  • Constructor Details

    • EntryableView

      public EntryableView(T serializableData, UriInfo uriInfo, String repositoryName, Boolean returnLinks, Map<String,Object> others)
      Constructor of the entryable view.
      Parameters:
      serializableData - the resource data model extended from by Linkable
      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

    • entryId

      public String entryId()
      The returning value of this method is to resolve the value of the atom entry ID. The default atom ID will be the canonical resource URI defined by LinkableView.canonicalResourceUri(boolean)
      Returns:
      the atom entry ID
    • entryTitle

      public abstract String entryTitle()
      The returning value of this method is to resolve the value of the atom entry title.
      Returns:
      the atom entry title
    • entrySummary

      public abstract String entrySummary()
      The returning value of this method is to resolve the value of the atom entry summary.
      Returns:
      the atom entry summary
    • entryUpdated

      public abstract Date entryUpdated()
      The returning value of this method is to resolve the value of the atom entry updated time.
      Returns:
      the atom entry updated time
    • entryPublished

      public abstract Date entryPublished()
      The returning value of this method is to resolve the value of the atom entry published time.
      Returns:
      the atom entry published time
    • entryAuthors

      public abstract List<AtomAuthor> entryAuthors()
      The returning value of this method is to resolve the value of the atom entry authors.
      Returns:
      the atom entry authors
    • entryLinks

      public abstract List<Link> entryLinks()
      The returning value of this method is to resolve the value of the atom entry links.
      Returns:
      the atom entry links
    • entryContent

      public T entryContent()
      The returning value of this method is to resolve the value of the inline atom entry content when it is inline. The default is to return the parent class method LinkableView.data().
      Returns:
      the inline atom entry content
    • entrySrc

      public String entrySrc()
      The returning value of this method is to resolve the value of the atom entry src link on behalf of the entry content when it is not inline.
      Returns:
      the atom entry src link on behalf of the entry content
    • entry

      public AtomEntry entry(boolean inline)
      Build the atom entry from this view instance.
      Parameters:
      inline - indicate whether the model instance is inline with the atom content.
      Returns:
      the atom entry
    • getAtomId

      protected String getAtomId()
      Build the atom feed ID by removing URL extension name from the canonical URI, defined by LinkableView.canonical().
      Returns:
      the atom feed ID
    • getAtomAuthor

      protected AtomAuthor getAtomAuthor(String author)
      Build the atom author by the author name.
      Parameters:
      author - the author name
      Returns:
      the atom author model
    • getDefaultEntryLinks

      protected List<Link> getDefaultEntryLinks()
      Build default atom entry links. The default entry links contains the 'edit' link relation.
      Returns:
      the list of links for the atom entry
    • customizeEntry

      protected void customizeEntry(AtomEntry atomEntry)
      Override this method to additionally customize the atom entry, especially for custom atom entry attributes. By default this method does nothing with the entry.
      Parameters:
      atomEntry - the entry