Interface Portal


  • public interface Portal
    This interface represents a portal and is used mainly by portal handlers that will not know the details of the portal implimentation.
    Since:
    Sakai 2.4
    Version:
    $Rev$
    Author:
    ieb
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String calcSiteType​(String siteId)
      work out the type of the site based on the site id.
      void doError​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, int mode)
      populate the model with error status
      void doLogin​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String returnPath, boolean skipContainer)
      perform login
      void doLogout​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String returnPath)
      Process a logout
      javax.servlet.http.Cookie findCookie​(javax.servlet.http.HttpServletRequest req, String name)
      Find a cookie by this name from the request
      void forwardPortal​(org.sakaiproject.tool.api.ActiveTool tool, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.site.api.ToolConfiguration siteTool, String skin, String toolContextPath, String toolPathInfo)
      forward to a portal url
      void forwardTool​(org.sakaiproject.tool.api.ActiveTool tool, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Placement placement, String skin, String toolContextPath, String toolPathInfo)
      forward the request to a tool
      PageFilter getPageFilter()
      Get a the page Filter Implementation
      String getPlacement​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String placementId, boolean doPage)
      get the placement for the request
      String getPortalContext()
      Get the context name of the portal.
      String getPortalPageUrl​(org.sakaiproject.site.api.ToolConfiguration siteTool)
      get the portal page URL base on the tool supplied
      javax.servlet.ServletContext getServletContext()
      Get the servlet context associated with the portal
      PortalSiteHelper getSiteHelper()  
      SiteNeighbourhoodService getSiteNeighbourhoodService()  
      String getUserEidBasedSiteId​(String userId)
      get the site id for the user
      void includeBottom​(PortalRenderContext rcontext, org.sakaiproject.site.api.Site site)
      include the model section that relates to the bottom of the page.
      void includeLogin​(PortalRenderContext rcontext, javax.servlet.http.HttpServletRequest req, org.sakaiproject.tool.api.Session session)
      include the part od the view tree needed to render login
      PortalRenderContext includePortal​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String siteId, String toolId, String toolContextPath, String prefix, boolean doPages, boolean resetTools, boolean includeSummary, boolean expandSite)
      populate the view tree for the model
      void includeSubSites​(PortalRenderContext rcontext, javax.servlet.http.HttpServletRequest req, org.sakaiproject.tool.api.Session session, String siteId, String toolContextPath, String prefix, boolean resetTools)
      Return the sub sites below a particular site Map.
      Map includeTool​(javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpServletRequest req, org.sakaiproject.site.api.ToolConfiguration placement)
      include the tool part of the view tree
      Map includeTool​(javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpServletRequest req, org.sakaiproject.site.api.ToolConfiguration placement, boolean inlineTool)
      include the tool part of the view tree
      boolean isPortletPlacement​(org.sakaiproject.tool.api.Placement placement)
      Indicate if a placement is a JSR-168 placement
      boolean redirectIfLoggedOut​(javax.servlet.http.HttpServletResponse res)
      perform a redirect if logged out
      void sendResponse​(PortalRenderContext rcontext, javax.servlet.http.HttpServletResponse res, String template, String contentType)
      prepare the response and send it to the render engine
      void setPageFilter​(PageFilter pageFilter)
      Set page Filter
      void setupForward​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Placement p, String skin)
      setup in preparation for a forward
      PortalRenderContext startPageContext​(String siteType, String title, String skin, javax.servlet.http.HttpServletRequest request, org.sakaiproject.site.api.Site site)
      get a new render context from the render engine
    • Field Detail

      • PARAM_FORCE_LOGIN

        static final String PARAM_FORCE_LOGIN
        Parameter value to allow anonymous users of gallery mode to be sent to the gateway site as anonymous user (like the /portal URL) instead of making them log in (like worksite, site, and tool URLs).
        See Also:
        Constant Field Values
      • ATTR_ERROR

        static final String ATTR_ERROR
        ThreadLocal attribute set while we are processing an error.
        See Also:
        Constant Field Values
      • ATTR_SITE_PAGE

        static final String ATTR_SITE_PAGE
        Session attribute root for storing a site's last page visited - just append the site id.
        See Also:
        Constant Field Values
      • DEFAULT_PORTAL_CONTEXT

        static final String DEFAULT_PORTAL_CONTEXT
        The default portal name is none is specified.
        See Also:
        Constant Field Values
      • CONFIG_AUTO_RESET

        static final String CONFIG_AUTO_RESET
        Configuration option to enable/disable state reset on navigation change
        See Also:
        Constant Field Values
      • TOOLCONFIG_SHOW_RESET_BUTTON

        static final String TOOLCONFIG_SHOW_RESET_BUTTON
        Names of tool config/registration attributes that control the rendering of the tool's titlebar
        See Also:
        Constant Field Values
      • JSR_168_PRE_RENDER

        static final String JSR_168_PRE_RENDER
        Tool property used to indicate if JSR_168 tools are to be pre-rendered as they are being placed in the context.
        See Also:
        Constant Field Values
      • TOOL_DIRECTURL_ENABLED_PROP

        static final String TOOL_DIRECTURL_ENABLED_PROP
        Tool property to allow the enabling/disabling of the direct url linking UI
        See Also:
        Constant Field Values
    • Method Detail

      • sendResponse

        void sendResponse​(PortalRenderContext rcontext,
                          javax.servlet.http.HttpServletResponse res,
                          String template,
                          String contentType)
                   throws IOException
        prepare the response and send it to the render engine
        Parameters:
        rcontext -
        res -
        template -
        contentType -
        Throws:
        IOException
      • getPlacement

        String getPlacement​(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse res,
                            org.sakaiproject.tool.api.Session session,
                            String placementId,
                            boolean doPage)
                     throws org.sakaiproject.tool.api.ToolException
        get the placement for the request
        Parameters:
        req -
        res -
        session -
        placementId -
        doPage -
        Returns:
        Throws:
        org.sakaiproject.tool.api.ToolException
      • doLogin

        void doLogin​(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res,
                     org.sakaiproject.tool.api.Session session,
                     String returnPath,
                     boolean skipContainer)
              throws org.sakaiproject.tool.api.ToolException
        perform login
        Parameters:
        req -
        res -
        session -
        returnPath -
        skipContainer -
        Throws:
        org.sakaiproject.tool.api.ToolException
      • doLogout

        void doLogout​(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse res,
                      org.sakaiproject.tool.api.Session session,
                      String returnPath)
               throws org.sakaiproject.tool.api.ToolException
        Process a logout
        Parameters:
        req - Request object
        res - Response object
        session - Current session
        returnPath - if not null, the path to use for the end-user browser redirect after the logout is complete. Leave null to use the configured logged out URL.
        Throws:
        org.sakaiproject.tool.api.ToolException
      • startPageContext

        PortalRenderContext startPageContext​(String siteType,
                                             String title,
                                             String skin,
                                             javax.servlet.http.HttpServletRequest request,
                                             org.sakaiproject.site.api.Site site)
        get a new render context from the render engine
        Parameters:
        siteType -
        title -
        skin -
        request -
        site -
        Returns:
      • redirectIfLoggedOut

        boolean redirectIfLoggedOut​(javax.servlet.http.HttpServletResponse res)
                             throws IOException
        perform a redirect if logged out
        Parameters:
        res -
        Returns:
        Throws:
        IOException
      • getPortalPageUrl

        String getPortalPageUrl​(org.sakaiproject.site.api.ToolConfiguration siteTool)
        get the portal page URL base on the tool supplied
        Parameters:
        siteTool -
        Returns:
      • doError

        void doError​(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res,
                     org.sakaiproject.tool.api.Session session,
                     int mode)
              throws org.sakaiproject.tool.api.ToolException,
                     IOException
        populate the model with error status
        Parameters:
        req -
        res -
        session -
        mode -
        Throws:
        org.sakaiproject.tool.api.ToolException
        IOException
      • forwardPortal

        void forwardPortal​(org.sakaiproject.tool.api.ActiveTool tool,
                           javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse res,
                           org.sakaiproject.site.api.ToolConfiguration siteTool,
                           String skin,
                           String toolContextPath,
                           String toolPathInfo)
                    throws org.sakaiproject.tool.api.ToolException,
                           IOException
        forward to a portal url
        Parameters:
        tool -
        req -
        res -
        siteTool -
        skin -
        toolContextPath -
        toolPathInfo -
        Throws:
        IOException
        org.sakaiproject.tool.api.ToolException
      • setupForward

        void setupForward​(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse res,
                          org.sakaiproject.tool.api.Placement p,
                          String skin)
                   throws org.sakaiproject.tool.api.ToolException
        setup in preparation for a forward
        Parameters:
        req -
        res -
        p -
        skin -
        Throws:
        org.sakaiproject.tool.api.ToolException
      • includeBottom

        void includeBottom​(PortalRenderContext rcontext,
                           org.sakaiproject.site.api.Site site)
        include the model section that relates to the bottom of the page.
        Parameters:
        rcontext -
        site -
      • calcSiteType

        String calcSiteType​(String siteId)
        work out the type of the site based on the site id.
        Parameters:
        siteId -
        Returns:
      • includeLogin

        void includeLogin​(PortalRenderContext rcontext,
                          javax.servlet.http.HttpServletRequest req,
                          org.sakaiproject.tool.api.Session session)
        include the part od the view tree needed to render login
        Parameters:
        rcontext -
        req -
        session -
      • forwardTool

        void forwardTool​(org.sakaiproject.tool.api.ActiveTool tool,
                         javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse res,
                         org.sakaiproject.tool.api.Placement placement,
                         String skin,
                         String toolContextPath,
                         String toolPathInfo)
                  throws org.sakaiproject.tool.api.ToolException
        forward the request to a tool
        Parameters:
        tool -
        req -
        res -
        siteTool -
        skin -
        toolContextPath -
        toolPathInfo -
        Throws:
        org.sakaiproject.tool.api.ToolException
      • getUserEidBasedSiteId

        String getUserEidBasedSiteId​(String userId)
        get the site id for the user
        Parameters:
        userId -
        Returns:
      • includePortal

        PortalRenderContext includePortal​(javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse res,
                                          org.sakaiproject.tool.api.Session session,
                                          String siteId,
                                          String toolId,
                                          String toolContextPath,
                                          String prefix,
                                          boolean doPages,
                                          boolean resetTools,
                                          boolean includeSummary,
                                          boolean expandSite)
                                   throws org.sakaiproject.tool.api.ToolException,
                                          IOException
        populate the view tree for the model
        Parameters:
        req -
        res -
        session -
        siteId -
        toolId -
        toolContextPath -
        prefix -
        doPages -
        resetTools -
        includeSummary -
        expandSite -
        Returns:
        Throws:
        org.sakaiproject.tool.api.ToolException
        IOException
      • includeTool

        Map includeTool​(javax.servlet.http.HttpServletResponse res,
                        javax.servlet.http.HttpServletRequest req,
                        org.sakaiproject.site.api.ToolConfiguration placement)
                 throws IOException
        include the tool part of the view tree
        Parameters:
        res -
        req -
        placement -
        Returns:
        Throws:
        IOException
      • includeTool

        Map includeTool​(javax.servlet.http.HttpServletResponse res,
                        javax.servlet.http.HttpServletRequest req,
                        org.sakaiproject.site.api.ToolConfiguration placement,
                        boolean inlineTool)
                 throws IOException
        include the tool part of the view tree
        Parameters:
        res -
        req -
        placement -
        inlineTool -
        Returns:
        Throws:
        IOException
      • getPortalContext

        String getPortalContext()
        Get the context name of the portal. This is the name used to identify the portal implimentation in the portal service and to other parts of the system. Typically portals will be registered with the portal service using a name and render engines and PortalHandlers will connect to named portals.
        Returns:
      • getServletContext

        javax.servlet.ServletContext getServletContext()
        Get the servlet context associated with the portal
        Returns:
      • includeSubSites

        void includeSubSites​(PortalRenderContext rcontext,
                             javax.servlet.http.HttpServletRequest req,
                             org.sakaiproject.tool.api.Session session,
                             String siteId,
                             String toolContextPath,
                             String prefix,
                             boolean resetTools)
        Return the sub sites below a particular site Map.
        Parameters:
        rcontext -
        req -
        siteId -
        toolContextPath -
        prefix -
        loggedIn -
      • getPageFilter

        PageFilter getPageFilter()
        Get a the page Filter Implementation
        Returns:
      • setPageFilter

        void setPageFilter​(PageFilter pageFilter)
        Set page Filter
      • isPortletPlacement

        boolean isPortletPlacement​(org.sakaiproject.tool.api.Placement placement)
        Indicate if a placement is a JSR-168 placement
        Returns:
      • findCookie

        javax.servlet.http.Cookie findCookie​(javax.servlet.http.HttpServletRequest req,
                                             String name)
        Find a cookie by this name from the request
        Parameters:
        req - The servlet request.
        name - The cookie name
        Returns:
        The cookie of this name in the request, or null if not found.