Class VelocityPortletPaneledAction

    • Constructor Detail

      • VelocityPortletPaneledAction

        public VelocityPortletPaneledAction()
    • Method Detail

      • mainPanelUpdateId

        public static String mainPanelUpdateId​(String toolId)
        Compute the courier update html element id for the main panel - add "." and other names for inner panels.
        Parameters:
        toolId - The tool (portlet) id.
        Returns:
        The courier update html element id for the main panel.
      • titlePanelUpdateId

        public static String titlePanelUpdateId​(String toolId)
        Compute the courier update html element id for the title panel.
        Parameters:
        toolId - The tool (portlet) id.
        Returns:
        The courier update html element id for the title panel.
      • addAlert

        public static void addAlert​(org.sakaiproject.event.api.SessionState state,
                                    String message)
        Add another string to the alert message. Defaults to removing duplicates from the alert message
        Parameters:
        state - The session state.
        message - The string to add.
      • addAlert

        public static void addAlert​(org.sakaiproject.event.api.SessionState state,
                                    String message,
                                    boolean removeDuplicates)
        Add another string to the alert message.
        Parameters:
        state - The session state.
        message - The string to add.
        removeDuplicates - Remove duplicates from the alert
      • addFlashNotif

        public static void addFlashNotif​(org.sakaiproject.event.api.SessionState state,
                                         String message)
        Add another string to the flash notification message.
        Parameters:
        state - The session state.
        message - The string to add.
      • switchPanel

        public static void switchPanel​(org.sakaiproject.event.api.SessionState state,
                                       String newPanel)
        Switch to a new panel
        Parameters:
        state - The session state.
        newPanel - The new panel name
      • initState

        protected void initState​(org.sakaiproject.event.api.SessionState state,
                                 javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse res)
        Initialize for the first time the session state for this session. If overridden in a sub-class, make sure to call super.
        Overrides:
        initState in class ToolServlet
        Parameters:
        state - The session state.
        req - The current portlet request.
        res - The current portlet response.
      • updateState

        protected void updateState​(org.sakaiproject.event.api.SessionState state,
                                   javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse res)
        Update for this request processing the session state. If overridden in a sub-class, make sure to call super.
        Overrides:
        updateState in class ToolServlet
        Parameters:
        state - The session state.
        req - The current portlet request.
        res - The current portlet response.
      • toolModeDispatch

        protected void toolModeDispatch​(String methodBase,
                                        String methodExt,
                                        javax.servlet.http.HttpServletRequest req,
                                        javax.servlet.http.HttpServletResponse res)
                                 throws org.sakaiproject.tool.api.ToolException
        Dispatch to a "do" method based on reflection. Override ToolServlet to support the old "build" ways.
        Overrides:
        toolModeDispatch in class ToolServlet
        Parameters:
        methodBase - The base name of the method to call.
        methodExt - The end name of the method to call.
        req - The HttpServletRequest.
        res - The HttpServletResponse
        Throws:
        org.sakaiproject.tool.api.ToolException
      • panelMethodName

        protected String panelMethodName​(String panel)
        Allow extension classes to control which build method gets called for this pannel
        Parameters:
        panel -
        Returns:
      • processAction

        public void processAction​(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse res)
        Process a Portlet action.
        Overrides:
        processAction in class ToolServlet
      • checkCSRFToken

        public boolean checkCSRFToken​(javax.servlet.http.HttpServletRequest request,
                                      RunData rundata,
                                      String action)
      • actionDispatch

        protected void actionDispatch​(String methodBase,
                                      String methodExt,
                                      javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse res)
        Dispatch to a "processAction" method based on reflection.
        Overrides:
        actionDispatch in class ToolServlet
        Parameters:
        methodBase - The base name of the method to call.
        methodExt - The end name of the method to call.
        req - The HttpServletRequest.
        res - The HttpServletResponse
      • helperActionDispatch

        protected void helperActionDispatch​(String methodBase,
                                            String methodExt,
                                            javax.servlet.http.HttpServletRequest req,
                                            javax.servlet.http.HttpServletResponse res,
                                            String className)
        Dispatch to a "processAction" method based on reflection in a helper class.
        Parameters:
        methodBase - The base name of the method to call.
        methodExt - The end name of the method to call.
        req - The HttpServletRequest.
        res - The HttpServletResponse
      • getContext

        protected Map<String,​String> getContext​(RunData data)
        This is used to get "template" from the map, the default template registered for the tool in chef_tools.xreg.
      • doOptions

        public void doOptions​(RunData runData,
                              Context context)
        Handle a request to set options.
      • build_permissions_context

        protected String build_permissions_context​(VelocityPortlet portlet,
                                                   Context context,
                                                   RunData data,
                                                   org.sakaiproject.event.api.SessionState state)
      • saveOptions

        protected void saveOptions()
        Complete the options process with a save.
      • cancelOptions

        protected void cancelOptions()
        Cancel the options process.
      • addOptionsMenu

        protected void addOptionsMenu​(org.sakaiproject.cheftool.api.Menu bar,
                                      JetspeedRunData data)
        Add the options to the menu bar, if allowed.
        Parameters:
        bar - The menu bar to add to,
        ref - The resource reference to base the security decision upon.
      • allowedToOptions

        protected boolean allowedToOptions()
        Check if the current user is allowed to do options for the current context (site based)
        Returns:
        true if the user is allowed to modify the current context's options, false if not.
      • doReset

        public void doReset​(RunData runData,
                            Context context)
        Handle the "reset tool" option from the Title bar.
      • resetTool

        protected void resetTool​(org.sakaiproject.event.api.SessionState state)
        Reset the tool (state) to "home" conditions. Default here is to clear everything from state.
        Parameters:
        state - The tool's session state.
      • setVmStdRef

        protected void setVmStdRef​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
        Add some standard references to the vm context.
        Overrides:
        setVmStdRef in class ToolServlet
        Parameters:
        request - The render request.
        response - The render response.
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse res)
                      throws javax.servlet.ServletException
        Respond to a request by dispatching to a portlet like "do" method based on the portlet mode and tool mode
        Overrides:
        doGet in class ToolServlet
        Throws:
        javax.servlet.ServletException
      • checkRunData

        protected void checkRunData​(javax.servlet.http.HttpServletRequest req)
      • scheduleTopRefresh

        protected void scheduleTopRefresh()
        Schedule a refresh for whole page
      • schedulePeerFrameRefresh

        protected void schedulePeerFrameRefresh​(String id)
        Schedule a refresh for a peer frame.
        Parameters:
        id - The peer frame's id.
      • scheduleFocusRefresh

        protected void scheduleFocusRefresh​(String[] path)
        Schedule a focus change.
        Parameters:
        path - The desired focus path elements
      • getDateFormatString

        public String[] getDateFormatString()
      • getTimeFormatString

        public String[] getTimeFormatString()
        Return a String array containing the "h", "m", "a", or "H" characters (corresponding to hour, minute, am/pm, or 24-hour) in the locale specific order