Interface PortalSiteHelper


  • public interface PortalSiteHelper
    Author:
    ieb
    • Method Detail

      • getMyWorkspace

        Site getMyWorkspace​(Session session)
        Parameters:
        session -
        Returns:
      • allowTool

        boolean allowTool​(Site site,
                          Placement placement)
        Parameters:
        site -
        placement -
        Returns:
      • doGatewaySiteList

        boolean doGatewaySiteList()
        Returns:
      • getGatewaySiteId

        String getGatewaySiteId()
        Returns:
      • lookupSitePage

        SitePage lookupSitePage​(String pageId,
                                Site site)
        Parameters:
        portal -
        pageId -
        site -
        Returns:
      • pageListToMap

        Map<String,​Object> pageListToMap​(HttpServletRequest req,
                                               boolean loggedIn,
                                               Site site,
                                               SitePage page,
                                               String toolContextPath,
                                               String portalPrefix,
                                               boolean doPages,
                                               boolean resetTools,
                                               boolean includeSummary)
        Iterate through the pages in a site and return information in a Map.
        Parameters:
        req -
        loggedIn -
        site -
        page -
        toolContextPath -
        portalPrefix -
        doPages -
        resetTools -
        includeSummary -
      • getUserSpecificSiteTitle

        String getUserSpecificSiteTitle​(Site site,
                                        boolean escaped)
        SAK-29138 - Get the site or section title for the current user for the current site. Takes into account 'portal.use.sectionTitle' sakai.property; if set to true, this method will return the title of the section the current user is enrolled in for the site (if it can be found). Otherwise, it will return the site title (default behaviour)
        Parameters:
        site - the site in question
        escaped - true if you want the site title HTML escaped, false otherwise
        Returns:
        the site or section title
      • getUserSpecificSiteTitle

        String getUserSpecificSiteTitle​(Site site,
                                        boolean truncated,
                                        boolean escaped)
        Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but also takes truncated parameter
        Parameters:
        truncated - true if you want long titles to be truncated with an ellipses
        See Also:
        getUserSpecificSiteTitle(Site site, String userId)
      • getUserSpecificSiteTitle

        String getUserSpecificSiteTitle​(Site site,
                                        boolean truncated,
                                        boolean escaped,
                                        List<String> siteProviders)
        Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but consumes the specified siteProviders (for performance savings)
        Parameters:
        truncated - true if you want long titles to be truncated with an ellipses
        siteProviders - the site providers corresponding to the specified site; if null, they will be looked up
        See Also:
        getUserSpecificSiteTitle(Site site, String userId)
      • lookupPageToAlias

        String lookupPageToAlias​(String siteId,
                                 SitePage page)
        Find an alias for a page.
        Parameters:
        siteId -
        page -
        Returns:
        null if no alias was found, otherwise the short alias for the page.
      • isJoinable

        boolean isJoinable​(String siteId,
                           String userId)
        Check if the site is joinable by the supplied user and the user isn't currently a member of the site.
        Parameters:
        siteId - The ID of the site.
        userId - The ID of the user.
        Returns:
        true if the user can join the site.
      • getSite

        Site getSite​(String siteId)
              throws IdUnusedException
        This looks up a site but also checks for any aliases. This doesn't do any permission checks.
        Parameters:
        siteId - The siteId/alias to lookup
        Returns:
        The site.
        Throws:
        IdUnusedException - If the siteId doesn't exist and there isn't an alias for this.