Class Post

java.lang.Object
pt.ist.fenixframework.core.AbstractDomainObject
org.fenixedu.cms.domain.Post_Base
org.fenixedu.cms.domain.Post
All Implemented Interfaces:
Serializable, Cloneable, Sluggable, Wrappable, pt.ist.fenixframework.DomainObject

public class Post extends Post_Base implements Wrappable, Sluggable, Cloneable
A post models a given content to be presented to the user.
See Also:
  • Field Details

  • Constructor Details

    • Post

      public Post(Site site)
      The logged User creates a new Post.
      Parameters:
      site - site
  • Method Details

    • getSite

      public Site getSite()
      Overrides:
      getSite in class Post_Base
    • setName

      public void setName(org.fenixedu.commons.i18n.LocalizedString name)
      saves the name of the post and creates a new slug for the post.
      Overrides:
      setName in class Post_Base
    • setSlug

      public void setSlug(String slug)
      Specified by:
      setSlug in interface Sluggable
      Overrides:
      setSlug in class Post_Base
    • isValidSlug

      public boolean isValidSlug(String slug)
      A slug is valid if there are no other page on that site that have the same slug.
      Specified by:
      isValidSlug in interface Sluggable
      Parameters:
      slug - slug
      Returns:
      true if it is a valid slug.
    • getAddress

      public String getAddress()
      Returns:
      the URL link to the slug's page.
    • delete

      public void delete()
    • archive

      public void archive()
    • recover

      public void recover()
    • hasPublicationPeriod

      public boolean hasPublicationPeriod()
    • isInPublicationPeriod

      public boolean isInPublicationPeriod()
    • isVisible

      public boolean isVisible()
    • getCanViewGroup

      public org.fenixedu.bennu.core.groups.Group getCanViewGroup()
      returns the group of people who can view this site.
      Returns:
      group the access group for this site
    • setCanViewGroup

      public void setCanViewGroup(org.fenixedu.bennu.core.groups.Group group)
      sets the access group for this site
      Parameters:
      group - the group of people who can view this site
    • create

      public static Post create(Site site, Page page, org.fenixedu.commons.i18n.LocalizedString name, org.fenixedu.commons.i18n.LocalizedString body, org.fenixedu.commons.i18n.LocalizedString excerpt, Category category, boolean active, org.fenixedu.bennu.core.domain.User creator)
    • getEditUrl

      public String getEditUrl()
    • fixOrder

      public void fixOrder(List<PostFile> sortedItems)
    • clone

      public Post clone(CloneCache cloneCache)
      Specified by:
      clone in interface Cloneable
    • getAttachmentFilesSorted

      public Stream<PostFile> getAttachmentFilesSorted()
    • getEmbeddedFilesSorted

      public Stream<PostFile> getEmbeddedFilesSorted()
    • getFilesSorted

      public List<PostFile> getFilesSorted()
    • addFiles

      public void addFiles(PostFile postFile)
      Overrides:
      addFiles in class Post_Base
    • removeFiles

      public void removeFiles(PostFile files)
      Overrides:
      removeFiles in class Post_Base
    • addCategories

      public void addCategories(Category categories)
      Overrides:
      addCategories in class Post_Base
    • setActive

      public void setActive(boolean active)
      Overrides:
      setActive in class Post_Base
    • setBody

      public void setBody(org.fenixedu.commons.i18n.LocalizedString body)
    • setBodyAndExcerpt

      public void setBodyAndExcerpt(org.fenixedu.commons.i18n.LocalizedString body, org.fenixedu.commons.i18n.LocalizedString excerpt)
    • getExcerpt

      public org.fenixedu.commons.i18n.LocalizedString getExcerpt()
    • getBody

      public org.fenixedu.commons.i18n.LocalizedString getBody()
    • getPresentationBody

      public org.fenixedu.commons.i18n.LocalizedString getPresentationBody()
    • setLocation

      public void setLocation(org.fenixedu.commons.i18n.LocalizedString location)
      Overrides:
      setLocation in class Post_Base
    • setPublicationEnd

      public void setPublicationEnd(org.joda.time.DateTime publicationEnd)
      Overrides:
      setPublicationEnd in class Post_Base
    • setPublicationBegin

      public void setPublicationBegin(org.joda.time.DateTime publicationBegin)
      Overrides:
      setPublicationBegin in class Post_Base
    • getCategories

      public String getCategories()
    • getCategoriesString

      public String getCategoriesString()
    • getStaticPage

      public Optional<Page> getStaticPage()
    • isStaticPost

      public boolean isStaticPost()
    • makeWrap

      public Wrap makeWrap()
      Specified by:
      makeWrap in interface Wrappable
    • isAccessible

      public boolean isAccessible()
    • isModified

      public boolean isModified()
    • sanitize

      public static org.fenixedu.commons.i18n.LocalizedString sanitize(org.fenixedu.commons.i18n.LocalizedString original)
    • getRevisionsIterator

      public Iterator<PostContentRevision> getRevisionsIterator()
    • getRevisions

      public Iterable<PostContentRevision> getRevisions()
    • canDelete

      public boolean canDelete()
    • canEdit

      public boolean canEdit()
    • ensureCanEditPost

      public void ensureCanEditPost()
    • ensureCanEditPost

      public void ensureCanEditPost(Site site)