Interface PortalSiteHelper


  • public interface PortalSiteHelper
    Author:
    ieb
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean allowTool​(org.sakaiproject.site.api.Site site, org.sakaiproject.tool.api.Placement placement)  
      Map<String,​Object> convertSiteToMap​(javax.servlet.http.HttpServletRequest req, org.sakaiproject.site.api.Site s, String prefix, String currentSiteId, String myWorkspaceSiteId, boolean includeSummary, boolean expandSite, boolean resetTools, boolean doPages, String toolContextPath, boolean loggedIn, List<String> siteProviders)  
      boolean doGatewaySiteList()  
      String getGatewaySiteId()  
      org.sakaiproject.site.api.Site getMyWorkspace​(org.sakaiproject.tool.api.Session session)  
      org.sakaiproject.site.api.Site getSite​(String siteId)
      This looks up a site but also checks for any aliases.
      SiteView getSitesView​(SiteView.View view, javax.servlet.http.HttpServletRequest req, org.sakaiproject.tool.api.Session session, String siteId)
      Generates a SiteView object from the current request and location
      org.sakaiproject.site.api.Site getSiteVisit​(String siteId)  
      String getUserSpecificSiteTitle​(org.sakaiproject.site.api.Site site, boolean escaped)
      SAK-29138 - Get the site or section title for the current user for the current site.
      String getUserSpecificSiteTitle​(org.sakaiproject.site.api.Site site, boolean truncated, boolean escaped)
      Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but also takes truncated parameter
      String getUserSpecificSiteTitle​(org.sakaiproject.site.api.Site site, boolean truncated, boolean escaped, List<String> siteProviders)
      Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but consumes the specified siteProviders (for performance savings)
      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.
      String lookupPageToAlias​(String siteId, org.sakaiproject.site.api.SitePage page)
      Find an alias for a page.
      org.sakaiproject.site.api.SitePage lookupSitePage​(String pageId, org.sakaiproject.site.api.Site site)  
      Map<String,​Object> pageListToMap​(javax.servlet.http.HttpServletRequest req, boolean loggedIn, org.sakaiproject.site.api.Site site, org.sakaiproject.site.api.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.
    • Method Detail

      • getSiteVisit

        org.sakaiproject.site.api.Site getSiteVisit​(String siteId)
                                             throws org.sakaiproject.exception.IdUnusedException,
                                                    org.sakaiproject.exception.PermissionException
        Parameters:
        siteId -
        Returns:
        Throws:
        org.sakaiproject.exception.IdUnusedException
        org.sakaiproject.exception.PermissionException
      • getMyWorkspace

        org.sakaiproject.site.api.Site getMyWorkspace​(org.sakaiproject.tool.api.Session session)
        Parameters:
        session -
        Returns:
      • allowTool

        boolean allowTool​(org.sakaiproject.site.api.Site site,
                          org.sakaiproject.tool.api.Placement placement)
        Parameters:
        site -
        placement -
        Returns:
      • doGatewaySiteList

        boolean doGatewaySiteList()
        Returns:
      • getGatewaySiteId

        String getGatewaySiteId()
        Returns:
      • lookupSitePage

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

        Map<String,​Object> pageListToMap​(javax.servlet.http.HttpServletRequest req,
                                               boolean loggedIn,
                                               org.sakaiproject.site.api.Site site,
                                               org.sakaiproject.site.api.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 -
      • convertSiteToMap

        Map<String,​Object> convertSiteToMap​(javax.servlet.http.HttpServletRequest req,
                                                  org.sakaiproject.site.api.Site s,
                                                  String prefix,
                                                  String currentSiteId,
                                                  String myWorkspaceSiteId,
                                                  boolean includeSummary,
                                                  boolean expandSite,
                                                  boolean resetTools,
                                                  boolean doPages,
                                                  String toolContextPath,
                                                  boolean loggedIn,
                                                  List<String> siteProviders)
      • getUserSpecificSiteTitle

        String getUserSpecificSiteTitle​(org.sakaiproject.site.api.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​(org.sakaiproject.site.api.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​(org.sakaiproject.site.api.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)
      • getSitesView

        SiteView getSitesView​(SiteView.View view,
                              javax.servlet.http.HttpServletRequest req,
                              org.sakaiproject.tool.api.Session session,
                              String siteId)
        Generates a SiteView object from the current request and location
        Parameters:
        view -
        req -
        session -
        siteId -
        Returns:
      • lookupPageToAlias

        String lookupPageToAlias​(String siteId,
                                 org.sakaiproject.site.api.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

        org.sakaiproject.site.api.Site getSite​(String siteId)
                                        throws org.sakaiproject.exception.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:
        org.sakaiproject.exception.IdUnusedException - If the siteId doesn't exist and there isn't an alias for this.