Class Site

    • Constructor Detail

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

      • 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.
      • getOrCreateCategoryForSlug

        public Category getOrCreateCategoryForSlug​(String slug,
                                                   org.fenixedu.commons.i18n.LocalizedString name)
      • 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
      • menuForOid

        public Menu menuForOid​(String oid)
        searches for a Menu by oid on this Site.
        Parameters:
        oid - the slug of the Menu wanted.
        Returns:
        the Menu with the given oid if it exists on this site, or null otherwise.
      • menuForSlug

        public Menu menuForSlug​(String slug)
        searches for a Menu by its slug on this Site.
        Parameters:
        slug - the slug of the Menu wanted.
        Returns:
        the Menu with the given oid if it exists on this site, or null otherwise.
      • 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()
      • 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.
      • getBaseUrl

        public String getBaseUrl()
      • getLatestPosts

        public List<Post> getLatestPosts()
      • getFullUrl

        public String getFullUrl()
      • getRssUrl

        public String getRssUrl()
      • getEditUrl

        public String getEditUrl()
      • checkHasEitherFunctionalityOrFolder

        public boolean checkHasEitherFunctionalityOrFolder()
      • getDefaultRoleTemplateRole

        public Role getDefaultRoleTemplateRole()
      • getSortedPages

        public List<Page> getSortedPages()
      • pushActivity

        public void pushActivity​(SiteActivity siteActivity)
      • getStaticPostsStream

        public Stream<Post> getStaticPostsStream()
      • getNonStaticPostsStream

        public Stream<Post> getNonStaticPostsStream()
      • getNonStaticArchivedPostsStream

        public Stream<Post> getNonStaticArchivedPostsStream()