Interface PortalHandler


  • public interface PortalHandler
    Tools that want to add handlers into the portal URL space may impliment this interface. The once injected into the portal the portal will invoke the register and deregister methods as part of the life cycle.
    Since:
    Sakai 2.4
    Version:
    $Rev$
    Author:
    ieb
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ABORT
      Return codes, stop processing immediately
      static int END
      Stop processing
      static int NEXT
      try next handler
      static int RESET_DONE
      stop processing and mark reset as done
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deregister​(Portal portal)
      deregister the the portal, invoked by the portal
      int doGet​(String[] parts, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session)
      Perform a get, the method should inspect parts[] and other parameters to determin if it should perform the operation, returning one of the above codes
      int doPost​(String[] parts, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session)
      perform a post but only accept it the handler accepts a post.
      String getUrlFragment()
      get the fragment of the URL that represents part[1] and is used to register the handler in the portal.
      void register​(Portal portal, PortalService portalService, javax.servlet.ServletContext servletContext)
      register this handler with the portal, invoked by the portal
    • Method Detail

      • doGet

        int doGet​(String[] parts,
                  javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res,
                  org.sakaiproject.tool.api.Session session)
           throws PortalHandlerException
        Perform a get, the method should inspect parts[] and other parameters to determin if it should perform the operation, returning one of the above codes
        Parameters:
        parts -
        req -
        res -
        session -
        Returns:
        Throws:
        IOException
        javax.servlet.ServletException
        ToolHandlerException
        PortalHandlerException
      • getUrlFragment

        String getUrlFragment()
        get the fragment of the URL that represents part[1] and is used to register the handler in the portal.
        Returns:
      • deregister

        void deregister​(Portal portal)
        deregister the the portal, invoked by the portal
        Parameters:
        portal -
      • register

        void register​(Portal portal,
                      PortalService portalService,
                      javax.servlet.ServletContext servletContext)
        register this handler with the portal, invoked by the portal
        Parameters:
        portal -
        portalService -
        servletContext -
      • doPost

        int doPost​(String[] parts,
                   javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res,
                   org.sakaiproject.tool.api.Session session)
            throws PortalHandlerException
        perform a post but only accept it the handler accepts a post.
        Parameters:
        parts -
        req -
        res -
        session -
        Returns:
        Throws:
        PortalHandlerException