Package org.apache.jetspeed.services.statemanager

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


                                          Context context,
                                          RunData rundata )
    {
        try {
       
            SessionState state = this.getSessionState(portlet, rundata);          
           
            String customizeEvent  = rundata.getParameters().getString(CUSTOMIZE_EVENT_PARAM);
           
            if (customizeEvent == null)
            {
              setTemplate(rundata, getParameterUsingFallback(portlet, rundata, CUSTOMIZE_TEMPLATE, null));
            }
            else
            {
                if (customizeEvent.equals(NEW_CATALOG_EVENT))
                {
                  this.doNewCatalog(portlet,context,rundata);
                }
           
                if (customizeEvent.equals(INSERT_CATALOG_EVENT))
                {
                  this.doInsertCatalog(portlet,context,rundata);
                }
            }
            // Store cataloPath and catalog into the context
            context.put(CATALOG_PATH_PARAM, state.getAttribute(CATALOG_PATH_PARAM));
            context.put(CATALOG_PARAM, state.getAttribute(CATALOG_PARAM));
        }
        catch (JetspeedCMSException e)
        {
            e.printStackTrace()
        }
View Full Code Here


    {
     
      try
      {
           
            SessionState state = this.getSessionState(portlet, rundata);
           
            String fromcatalogName = this.getParameterUsingFallback(portlet, rundata, FROM_URI, FROM_URI_DEFAULT_VALUE);
            String tocatalogName = rundata.getParameters().getString(TO_URI);
           
           
          
            if (tocatalogName == null)
            {
                // this case occur when the normal context is calling for the first time 
                if (state.getAttribute(CATALOG_PARAM) == null)
                { 
                  tocatalogName = fromcatalogName;
                }
                // this case occur when the end-used moves from the configure context to the normal context
              else
              {
                    context.put(CATALOG_PATH_PARAM, state.getAttribute(CATALOG_PATH_PARAM));
                    context.put(CATALOG_PARAM, state.getAttribute(CATALOG_PARAM));
                    return;         
              }
                             
            }
                     
            // get all catalogs objects used for the "catalog path"
            Vector catalogPath = this.getCmsManager().getCatalogs(fromcatalogName, tocatalogName);
           
            // get the catalog selected in the velocity template
            Catalog catalog = (Catalog) catalogPath.lastElement();
            // Retrieve catalog items
            this.getCmsManager().populateCatalog(catalog,true,true,1);
                                   
            // Store the cataloPath collection and the catalog into the portlet session for performance reason
            // (can be used by the customizer without a second retrieve in the cms repository          
            state.setAttribute(CATALOG_PATH_PARAM, catalogPath);
            state.setAttribute(CATALOG_PARAM, catalog);
           
           
            // Store cataloPath and catalog into the context
            context.put(CATALOG_PATH_PARAM, catalogPath);
            context.put(CATALOG_PARAM, catalog);
View Full Code Here

        return new JetspeedClearElement(url);
    }

    private void clearState(RunData rundata, PortletSet set)
    {
        SessionState state = ((JetspeedRunData)rundata).getPortletSessionState(set.getID());
        state.setAttribute(JetspeedResources.PATH_PANEID_KEY, null);
    }
View Full Code Here

                    return; // JSR 168 portlet, let it handle its own Help Mode
            }
        }
       
        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        // this will be the profile we are editing
        Profile profile = null;

        // the "reset" parameter's presence signals the start of customization
View Full Code Here

     * @return the portlet id being customized or null
     */
    public Portlet getCustomized()
    {
        // customization state info is in the page's session state
        SessionState customizationState = getPageSessionState();
        Stack stack = (Stack)customizationState.getAttribute("customize-stack");

        Portlet p = null;

        if ((stack!=null)&&(!stack.empty()))
        {
            p = (Portlet)stack.peek();
        }

        /**
         * Save the title of this currently selected portlet
         * --------------------------------------------------------------------------
         * last modified: 11/06/01
         * Andreas Kempf, Siemens ICM S CP PE, Munich
         */
        if ((p != null) && (stack.size() > 1))
          customizationState.setAttribute ("customize-paneName", (String)p.getTitle());
        else
          customizationState.setAttribute ("customize-paneName", "*");

        return (Portlet)p;
    }
View Full Code Here

     * @param id the portlet id to customize or null;
     */
    public void setCustomized(Portlet p)
    {
        // customization state info is in the page's session state
        SessionState customizationState = getPageSessionState();
        Stack stack = (Stack)customizationState.getAttribute("customize-stack");
        if (stack == null)
        {
            stack = new Stack();
            customizationState.setAttribute("customize-stack", stack);
        }

        if (p==null)
        {
            if (!stack.empty()) stack.pop();

            customizationState.setAttribute ("customize-paneName", "*");
        }
        else
        {
          if (stack.size () > 0)
          {
            Portlet last = (Portlet)stack.peek();


            if ((last!=null) && (p.getName().equals(last.getName())) && (p.getTitle().equals(last.getTitle())))
            {
                //System.out.println ("Portlet already used!!!");
            }
            else
              stack.push(p);
          }
          else
            stack.push(p);


          /**
           * Save the title of this currently selected portlet
           * --------------------------------------------------------------------------
           * last modified: 11/06/01
           * Andreas Kempf, Siemens ICM S CP PE, Munich
           */

           customizationState.setAttribute ("customize-paneName", (String)p.getTitle());
        }
    }
View Full Code Here

    * @return the Profile being customized.
    */
    public Profile getCustomizedProfile()
    {
        // customization state info is in the page's session state
        SessionState customizationState = getPageSessionState();

        return (Profile) customizationState.getAttribute("customize-profile");

    }   // getCustomizedProfile
View Full Code Here

    * @param profile The Profile being customized.
    */
    public void setCustomizedProfile(Profile profile)
    {
        // customization state info is in the page's session state
        SessionState customizationState = getPageSessionState();

        customizationState.setAttribute("customize-profile", profile);

    }   // setCustomizedProfile
View Full Code Here

    * Clean up from customization
    */
    public void cleanupFromCustomization()
    {
        // get the customization state for this page
        SessionState customizationState = getPageSessionState();

        customizationState.removeAttribute("customize-stack");
        customizationState.removeAttribute("customize-paneName");
        customizationState.removeAttribute("customize-profile");
        //customizationState.removeAttribute("customize-type");
        customizationState.removeAttribute("customize-columns");
        customizationState.removeAttribute("customize-mode");
        customizationState.removeAttribute("customize-parameters");

       setMode("default");

    }   // cleanupFromCustomization
View Full Code Here

            {
              // 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!!
              if(!p.getAttribute("_menustate", "open", rundata).equals("closed")) {
                  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!!
                    if(!p.getAttribute("_menustate", "open", rundata).equals("closed"))
                    {
                        SessionState state =
                            ((JetspeedRunData)rundata).getPortletSessionState(getPortlets().getID());
                        state.setAttribute(JetspeedResources.PATH_PANEID_KEY, subPane);
                    }
                    return true;
                }
            }
        }
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.