Package org.fenixedu.cms.domain
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPost.PostWrap
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Post>CREATION_DATE_COMPARATORstatic StringSIGNAL_ARCHIVEDstatic StringSIGNAL_CREATEDstatic StringSIGNAL_DELETEDstatic StringSIGNAL_EDITEDstatic StringSIGNAL_RECOVERED
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCategories(Category categories)voidaddFiles(PostFile postFile)voidarchive()booleancanDelete()booleancanEdit()Postclone(CloneCache cloneCache)static Postcreate(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)voiddelete()voidfixOrder(List<PostFile> sortedItems)StringgetAddress()Stream<PostFile>getAttachmentFilesSorted()org.fenixedu.commons.i18n.LocalizedStringgetBody()org.fenixedu.bennu.core.groups.GroupgetCanViewGroup()returns the group of people who can view this site.StringgetCategories()StringgetCategoriesString()StringgetEditUrl()Stream<PostFile>getEmbeddedFilesSorted()org.fenixedu.commons.i18n.LocalizedStringgetExcerpt()List<PostFile>getFilesSorted()org.fenixedu.commons.i18n.LocalizedStringgetPresentationBody()Iterable<PostContentRevision>getRevisions()Iterator<PostContentRevision>getRevisionsIterator()SitegetSite()Optional<Page>getStaticPage()booleanhasPublicationPeriod()booleanisAccessible()booleanisInPublicationPeriod()booleanisModified()booleanisStaticPost()booleanisValidSlug(String slug)A slug is valid if there are no other page on that site that have the same slug.booleanisVisible()WrapmakeWrap()voidrecover()voidremoveFiles(PostFile files)static org.fenixedu.commons.i18n.LocalizedStringsanitize(org.fenixedu.commons.i18n.LocalizedString original)voidsetActive(boolean active)voidsetBody(org.fenixedu.commons.i18n.LocalizedString body)voidsetBodyAndExcerpt(org.fenixedu.commons.i18n.LocalizedString body, org.fenixedu.commons.i18n.LocalizedString excerpt)voidsetCanViewGroup(org.fenixedu.bennu.core.groups.Group group)sets the access group for this sitevoidsetLocation(org.fenixedu.commons.i18n.LocalizedString location)voidsetName(org.fenixedu.commons.i18n.LocalizedString name)saves the name of the post and creates a new slug for the post.voidsetPublicationBegin(org.joda.time.DateTime publicationBegin)voidsetPublicationEnd(org.joda.time.DateTime publicationEnd)voidsetSlug(String slug)-
Methods inherited from class org.fenixedu.cms.domain.Post_Base
addComponent, addRevisions, getActive, getArchivedSite, getCategoriesSet, getComponentSet, getCreatedBy, getCreationDate, getFilesSet, getLatestRevision, getLocation, getMetadata, getModificationDate, getName, getPublicationBegin, getPublicationEnd, getRelationCategoryPost, getRelationNewestRevision, getRelationPostHasPostFiles, getRelationPostRevisionRevision, getRelationPostUser, getRelationPostViewGroup, getRelationSiteArchivedPosts, getRelationSitePost, getRelationStaticPostPost, getRevisionsSet, getSlug, getViewGroup, removeCategories, removeComponent, removeRevisions, setArchivedSite, setCreatedBy, setCreationDate, setLatestRevision, setMetadata, setModificationDate, setSite, setViewGroup
-
Methods inherited from class pt.ist.fenixframework.core.AbstractDomainObject
checkForDeletionBlockers, deleteDomainObject, ensureOid, equals, getDeletionBlockers, getDomainModel, getExternalId, getOid, hashCode, init$Instance, makeSerializedForm, toString, writeReplace
-
-
-
-
Field Detail
-
SIGNAL_CREATED
public static final String SIGNAL_CREATED
- See Also:
- Constant Field Values
-
SIGNAL_DELETED
public static final String SIGNAL_DELETED
- See Also:
- Constant Field Values
-
SIGNAL_EDITED
public static final String SIGNAL_EDITED
- See Also:
- Constant Field Values
-
SIGNAL_ARCHIVED
public static final String SIGNAL_ARCHIVED
- See Also:
- Constant Field Values
-
SIGNAL_RECOVERED
public static final String SIGNAL_RECOVERED
- See Also:
- Constant Field Values
-
CREATION_DATE_COMPARATOR
public static final Comparator<Post> CREATION_DATE_COMPARATOR
-
-
Constructor Detail
-
Post
public Post(Site site)
The loggedUsercreates a new Post.- Parameters:
site- site
-
-
Method Detail
-
setName
public void setName(org.fenixedu.commons.i18n.LocalizedString name)
saves the name of the post and creates a new slug for the post.
-
setSlug
public void setSlug(String slug)
-
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:
isValidSlugin interfaceSluggable- 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()
-
clone
public Post clone(CloneCache cloneCache)
-
removeFiles
public void removeFiles(PostFile files)
- Overrides:
removeFilesin classPost_Base
-
addCategories
public void addCategories(Category categories)
- Overrides:
addCategoriesin classPost_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:
setLocationin classPost_Base
-
setPublicationEnd
public void setPublicationEnd(org.joda.time.DateTime publicationEnd)
- Overrides:
setPublicationEndin classPost_Base
-
setPublicationBegin
public void setPublicationBegin(org.joda.time.DateTime publicationBegin)
- Overrides:
setPublicationBeginin classPost_Base
-
getCategories
public String getCategories()
-
getCategoriesString
public String getCategoriesString()
-
isStaticPost
public boolean isStaticPost()
-
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()
-
-