Package org.apache.jetspeed.services.statemanager

Examples of org.apache.jetspeed.services.statemanager.SessionState


                                         RunData rundata)
    {
        JetspeedRunData jdata = (JetspeedRunData) rundata;

        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        super.buildCustomizeContext(controller, context, rundata);

        List[] columns = null;

        // retrieve the number of columns
        String cols = controller.getConfig().getInitParameter("cols");
        int colNum = 0;
        try
        {
            colNum = Integer.parseInt(cols);
        }
        catch (Exception e)
        {
            // not an integer or null, default to standarrd value
            colNum = 3;
        }
        context.put("colNum", String.valueOf(colNum));

        //retrieve the size for each of the columns
        String sizes = controller.getConfig().getInitParameter("sizes");
        context.put("sizes", getCellSizes(sizes));

        //retrieve the class for each of the columns
        String columnClasses = controller.getConfig().getInitParameter("col_classes");
        context.put("col_classes", getCellClasses(columnClasses));

        columns = (List[]) customizationState.getAttribute("customize-columns");
        PortletSet customizedSet = (PortletSet) jdata.getCustomized();
        Portlets set = jdata.getCustomizedProfile()
                            .getDocument()
                            .getPortletsById(customizedSet.getID());

        Log.debug("MultiCol: columns " + columns + " set " + set);

        if ((columns != null) && (columns.length == colNum))
        {
            int eCount = 0;
            for (int i = 0; i < columns.length; i++)
            {
                eCount += columns[i].size();
            }

            Log.debug("MultiCol: eCount " + eCount + " setCount" + set.getEntryCount() + set.getPortletsCount());
            if (eCount != set.getEntryCount() + set.getPortletsCount())
            {
                Log.debug("MultiCol: rebuilding columns ");
                columns = buildColumns(set, colNum);
            }

        }
        else
        {
            Log.debug("MultiCol: rebuilding columns ");
            columns = buildColumns(set, colNum);
        }

        customizationState.setAttribute("customize-columns", columns);
        context.put("portlets", columns);

        Map titles = new HashMap();
        for (int col = 0; col < columns.length; col++)
        {
View Full Code Here


    }

    public void doSave(RunData data, Context context)
    {
        // get the customization state for this page
        SessionState customizationState = ((JetspeedRunData) data).getPageSessionState();

        // update the changes made here to the profile being edited
        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        for (int col = 0; col < columns.length; col++)
        {
            for (int row = 0; row < columns[col].size(); row++)
            {
                setPosition((IdentityElement) columns[col].get(row), col, row);
View Full Code Here

    public void doDelete(RunData data, Context context)
    {
        JetspeedRunData jdata = (JetspeedRunData) data;

        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        PortletSet customizedSet = (PortletSet) jdata.getCustomized();

        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        if (columns == null)
        {
            return;
        }
View Full Code Here

    }

    public void doLeft(RunData data, Context context)
    {
        // get the customization state for this page
        SessionState customizationState = ((JetspeedRunData) data).getPageSessionState();

        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        if (columns == null)
        {
            return;
View Full Code Here

    }

    public void doRight(RunData data, Context context)
    {
        // get the customization state for this page
        SessionState customizationState = ((JetspeedRunData) data).getPageSessionState();

        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        if (columns == null)
        {
            return;
View Full Code Here

    }

    public void doUp(RunData data, Context context)
    {
        // get the customization state for this page
        SessionState customizationState = ((JetspeedRunData) data).getPageSessionState();

        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        if (columns == null)
        {
            return;
View Full Code Here

    }

    public void doDown(RunData data, Context context)
    {
        // get the customization state for this page
        SessionState customizationState = ((JetspeedRunData) data).getPageSessionState();

        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        if (columns == null)
        {
            return;
View Full Code Here

            if (subPane!=null && p.getID().equals(subPane))
            {
              // change the currently selected pane in the user session
              // If this is not done, the tab selection works, but the
              // content is picked up from the pane in the session!!
              SessionState state = ((JetspeedRunData)rundata).getPortletSessionState(getPortlets().getID());
              state.setAttribute(JetspeedResources.PATH_PANEID_KEY, subPane);

              return true;
            }

            // is the peid for this tab set?
            if (getPortlets().getPortletByID(peid) != null)
            {
                // its for another tab in this set
                return false;
            }
            if (subPane == null)
            {
                if (last == null)
                {
                    return (getPortlets().getPortletAt( 0 ) == p);
                }
                else
                {
                    return (p.getID().equals(last));
                }
            }
            else
            {
                if (p.getID().equals( subPane ))
                {
                    // change the currently selected pane in the user session
                    // If this is not done, the tab selection works, but the
                    // content is picked up from the pane in the session!!
                    SessionState state =
                        ((JetspeedRunData)rundata).getPortletSessionState(getPortlets().getID());
                    state.setAttribute(JetspeedResources.PATH_PANEID_KEY, subPane);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

     *
     */
    protected String retrievePaneIDFromSession(RunData rundata)
    {
        // get the state for this portlet (portlet set) in this page in this session
        SessionState state = ((JetspeedRunData)rundata).getPortletSessionState(getPortlets().getID());

        // get the PANE_PARAMETER attribute
        String pane = (String) state.getAttribute(JetspeedResources.PATH_PANEID_KEY);
       
        // if not yet defined, select the first portlet set
        if (pane == null)
        {
            // use default
View Full Code Here

     @param id  The tab id to save for this controller
     */
    public void savePaneID( RunData data, String id )
    {
        // get the state for this portlet (portlet set) in this page in this session
        SessionState state = ((JetspeedRunData)data).getPortletSessionState(getPortlets().getID());
       
        // set the PANE_PARAMETER attribute
        state.setAttribute(JetspeedResources.PATH_PANEID_KEY, id);
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.services.statemanager.SessionState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.