Examples of PortletPreferences


Examples of javax.portlet.PortletPreferences

    throws PortletException, IOException
    {
        String actionPage = this.defaultActionPage;
        if (this.allowPreferences == true)
        {
            PortletPreferences prefs = request.getPreferences();
            if (prefs != null)
            {
                actionPage = prefs.getValue(PARAM_ACTION_PAGE, this.defaultActionPage);
            }
        }


        if (actionPage != null)
View Full Code Here

Examples of javax.portlet.PortletPreferences

    throws PortletException, IOException
    {
        String customPage = this.defaultCustomPage;
        if (this.allowPreferences == true)
        {
            PortletPreferences prefs = request.getPreferences();
            // allow ViewPage override by the request
            customPage = (String) request.getAttribute(PARAM_CUSTOM_PAGE);           
           
            if (prefs != null && customPage == null)
            {
                customPage = prefs.getValue(PARAM_CUSTOM_PAGE, this.defaultCustomPage);
            }
        }

        if (customPage != null)
        {
View Full Code Here

Examples of javax.portlet.PortletPreferences

            editPage = reqEditPage;
        }
       
        if (this.allowPreferences == true)
        {                      
            PortletPreferences prefs = request.getPreferences();

            if (prefs != null && reqEditPage == null)
            {
                editPage = prefs.getValue(PARAM_EDIT_PAGE, this.defaultEditPage);
            }
        }

        if (editPage != null)
        {
View Full Code Here

Examples of javax.portlet.PortletPreferences

        }
       
        if (this.allowPreferences == true)
        {

            PortletPreferences prefs = request.getPreferences();

            if (prefs != null && reqHelpPage == null)
            {
                helpPage = prefs.getValue(PARAM_HELP_PAGE, this.defaultHelpPage);
            }
        }

        if (helpPage != null)
        {
View Full Code Here

Examples of javax.portlet.PortletPreferences

      viewPage = reqViewPage;
    }
   
        if (this.allowPreferences == true)
        {
            PortletPreferences prefs = request.getPreferences();

           
            if (prefs != null && reqViewPage == null)
            {
                viewPage = prefs.getValue(PARAM_VIEW_PAGE, this.defaultViewPage);
            }         
        }

        if (viewPage != null)
        {
View Full Code Here

Examples of javax.portlet.PortletPreferences

     * Save the prefs
     */
    public void processPreferencesAction(ActionRequest request, ActionResponse actionResponse)
    throws PortletException, IOException
    {
        PortletPreferences prefs = request.getPreferences();
        PreferencesHelper.requestParamsToPreferences(request);
        prefs.store();
        actionResponse.setPortletMode(PortletMode.VIEW);
    }
View Full Code Here

Examples of javax.portlet.PortletPreferences

  }

  public DOMTree getDOMTree( String name, PortletRequest request )
    {
    if ( name == null ) name = "";
    PortletPreferences prefs = request.getPreferences();
    String path = prefs.getValue( name, "" );
        return new DOMTree( name, path );
    }
View Full Code Here

Examples of org.exoplatform.portal.application.PortletPreferences

         pref.addValue("value" + i);
         prefs.add(pref);
      }

      //
      PortletPreferences portletPreferences = new PortletPreferences();
      portletPreferences.setWindowId(testPortletPreferences);
      portletPreferences.setPreferences(prefs);

      //
      storage_.save(portletPreferences);

      //
      PortletPreferences portletPref = storage_.getPortletPreferences(testPortletPreferences);
      assertEquals(portletPref.getWindowId(), testPortletPreferences);
   }
View Full Code Here

Examples of org.exoplatform.portal.application.PortletPreferences

      // Check instance id format
      assertEquals("web/BannerPortlet", storage_.getId(banner1.getState()));

      // Update site prefs
      PortletPreferences sitePrefs = new PortletPreferences();
      sitePrefs.setWindowId("portal#test:/web/BannerPortlet/banner");
      sitePrefs.setPreferences(new ArrayList<Preference>(Collections.singleton(new Preference())));
      sitePrefs.getPreferences().get(0).setName("template");
      sitePrefs.getPreferences().get(0).getValues().add("bar");
      storage_.save(sitePrefs);

      // Check that page prefs have not changed
      pagePrefs = storage_.load(instanceId, ApplicationType.PORTLET);
      assertEquals(new PortletBuilder().add("template", "par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl")
         .build(), pagePrefs);

      // Update page prefs
      pagePrefs.setValue("template", "foo");
      storage_.save(instanceId, pagePrefs);

      // Check that page prefs have changed
      pagePrefs = storage_.load(instanceId, ApplicationType.PORTLET);
      assertEquals(new PortletBuilder().add("template", "foo").build(), pagePrefs);

      // Check that site prefs have not changed
      sitePrefs = storage_.getPortletPreferences("portal#test:/web/BannerPortlet/banner");
      assertEquals("bar", sitePrefs.getPreferences().get(0).getValues().get(0));

      // Now check the container
      Container container = (Container)clone.getChildren().get(1);
      assertEquals(2, container.getChildren().size());
View Full Code Here

Examples of org.exoplatform.portal.application.PortletPreferences

            Portlet prefs2 = storage_.load(app.getState(), ApplicationType.PORTLET);
            assertEquals(new PortletBuilder().add("template",
               "par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl").build(), prefs2);

            // Update prefs of original page
            PortletPreferences prefs = new PortletPreferences();
            prefs.setWindowId("portal#test:/web/BannerPortlet/banner");
            storage_.save(prefs);

            //
            prefs2 = storage_.load(app.getState(), ApplicationType.PORTLET);
            assertEquals(new PortletBuilder().add("template",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.