Class Site

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

public class Site extends Site_Base implements Wrappable, Sluggable, Cloneable
See Also:
  • Field Details

  • Constructor Details

    • Site

      protected Site()
    • Site

      public Site(org.fenixedu.commons.i18n.LocalizedString name, org.fenixedu.commons.i18n.LocalizedString description)
      the logged User creates a new Site.
      Parameters:
      name - name
      description - description
  • Method Details

    • 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
    • fromSlug

      public static Site fromSlug(String slug)
      searches for a Site by slug.
      Parameters:
      slug - the slug of the Site wanted.
      Returns:
      the Site with the given slug if it exists
      Throws:
      CmsDomainException - if the site doesn't exist
    • pageForSlug

      public Page pageForSlug(String slug)
      searches for a Page by slug on this Site.
      Parameters:
      slug - the slug of the Page wanted.
      Returns:
      the Page with the given slug if it exists on this site
    • archivedPageForSlug

      public Page archivedPageForSlug(String slug)
      searches for an archived Page by slug on this Site.
      Parameters:
      slug - the slug of the Page wanted.
      Returns:
      the archived Page with the given slug if it exists on this site, or null otherwise.
    • postForSlug

      public Post postForSlug(String slug)
      searches for a Post by slug on this Site.
      Parameters:
      slug - the slug of the Post wanted.
      Returns:
      the Post with the given slug if it exists on this site
    • archivedPostForSlug

      public Post archivedPostForSlug(String slug)
      searches for an archived Post by slug on this Site.
      Parameters:
      slug - the slug of the archived Post wanted.
      Returns:
      the archived Post with the given slug if it exists on this site, or null otherwise.
    • categoryForSlug

      public Category categoryForSlug(String slug)
      searches for a Category by slug on this Site.
      Parameters:
      slug - the slug of the Category wanted.
      Returns:
      the Category with the given slug if it exists on this site.
      Throws:
      CmsDomainException - if the category is not found
    • getOrCreateCategoryForSlug

      public Category getOrCreateCategoryForSlug(String slug, org.fenixedu.commons.i18n.LocalizedString name)
    • setSlug

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

      public void setNameToSuper(org.fenixedu.commons.i18n.LocalizedString name)
    • setName

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

      public void updateMenuFunctionality()
      Updates the site's slug and it's respective MenuFunctionality. It should be used after setting the site's description, name and slug.
    • getOrderedMenusSet

      public TreeSet<Menu> getOrderedMenusSet()
    • clone

      public Site clone(CloneCache cloneCache)
      Specified by:
      clone in interface Cloneable
    • delete

      public void delete()
    • getViewPostPage

      public Page getViewPostPage()
      Returns:
      the ViewPost of this Site if it is defined, or null otherwise.
    • isDefault

      public boolean isDefault()
      Returns:
      true if a site is the default site, meaning if this site should respond to '/' requests
    • getViewCategoryPage

      public Page getViewCategoryPage()
      Returns:
      the ListCategoryPosts of this Site if it is defined, or null otherwise.
    • getStaticDirectory

      public String getStaticDirectory()
      Returns:
      the static directory of this Site.
    • isValidSlug

      public boolean isValidSlug(String slug)
      Specified by:
      isValidSlug in interface Sluggable
    • getBaseUrl

      public String getBaseUrl()
    • getLatestPosts

      public List<Post> getLatestPosts()
    • getFullUrl

      public String getFullUrl()
    • getRssUrl

      public String getRssUrl()
    • getEditUrl

      public String getEditUrl()
    • setFolder

      public void setFolder(CMSFolder folder)
      Overrides:
      setFolder in class Site_Base
    • checkHasEitherFunctionalityOrFolder

      public boolean checkHasEitherFunctionalityOrFolder()
    • getDefaultRoleTemplateRole

      public Role getDefaultRoleTemplateRole()
    • makeWrap

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

      public List<Page> getSortedPages()
    • setTheme

      public void setTheme(CMSTheme theme)
      Overrides:
      setTheme in class Site_Base
    • getTheme

      public CMSTheme getTheme()
      Overrides:
      getTheme in class Site_Base
    • pushActivity

      public void pushActivity(SiteActivity siteActivity)
    • getLastFiveDaysOfActivity

      public List<Site.SiteActivities> getLastFiveDaysOfActivity()
    • getStaticPostsStream

      public Stream<Post> getStaticPostsStream()
    • getNonStaticPostsStream

      public Stream<Post> getNonStaticPostsStream()
    • getNonStaticArchivedPostsStream

      public Stream<Post> getNonStaticArchivedPostsStream()