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
A post models a given content to be presented to the user.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class pt.ist.fenixframework.core.AbstractDomainObject
pt.ist.fenixframework.core.AbstractDomainObject.SerializedForm -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCategories(Category categories) voidvoidarchive()booleanbooleancanEdit()clone(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()voidvoidensureCanEditPost(Site site) voidorg.fenixedu.commons.i18n.LocalizedStringgetBody()org.fenixedu.bennu.core.groups.Groupreturns the group of people who can view this site.org.fenixedu.commons.i18n.LocalizedStringorg.fenixedu.commons.i18n.LocalizedStringgetSite()booleanbooleanbooleanbooleanbooleanbooleanisValidSlug(String slug) A slug is valid if there are no other page on that site that have the same slug.booleanmakeWrap()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) voidMethods 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, setViewGroupMethods inherited from class pt.ist.fenixframework.core.AbstractDomainObject
checkForDeletionBlockers, deleteDomainObject, ensureOid, equals, getDeletionBlockers, getDomainModel, getExternalId, getOid, hashCode, init$Instance, makeSerializedForm, toString, writeReplace
-
Field Details
-
SIGNAL_CREATED
- See Also:
-
SIGNAL_DELETED
- See Also:
-
SIGNAL_EDITED
- See Also:
-
SIGNAL_ARCHIVED
- See Also:
-
SIGNAL_RECOVERED
- See Also:
-
CREATION_DATE_COMPARATOR
-
-
Constructor Details
-
Post
The loggedUsercreates a new Post.- Parameters:
site- site
-
-
Method Details
-
getSite
-
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
-
isValidSlug
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
- 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
-
getEditUrl
-
fixOrder
-
clone
-
getAttachmentFilesSorted
-
getEmbeddedFilesSorted
-
getFilesSorted
-
addFiles
-
removeFiles
- Overrides:
removeFilesin classPost_Base
-
addCategories
- Overrides:
addCategoriesin classPost_Base
-
setActive
public void setActive(boolean active) -
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
-
getCategoriesString
-
getStaticPage
-
isStaticPost
public boolean isStaticPost() -
makeWrap
-
isAccessible
public boolean isAccessible() -
isModified
public boolean isModified() -
sanitize
public static org.fenixedu.commons.i18n.LocalizedString sanitize(org.fenixedu.commons.i18n.LocalizedString original) -
getRevisionsIterator
-
getRevisions
-
canDelete
public boolean canDelete() -
canEdit
public boolean canEdit() -
ensureCanEditPost
public void ensureCanEditPost() -
ensureCanEditPost
-