Package org.exoplatform.portal.application

Examples of org.exoplatform.portal.application.PortletPreferences$PortletPreferencesSet


         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


      // 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

            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

      assertEquals("group::/platform/test/legacy::register", page.getPageId());
      assertEquals("/platform/test/legacy", page.getOwnerId());
      Application app = (Application)page.getChildren().get(0);
      //    assertEquals("group#/platform/test/legacy:/web/IFramePortlet/blog", app.getInstanceState().getWeakReference());

      PortletPreferences prefs = storage.getPortletPreferences("group#/platform/test/legacy:/web/IFramePortlet/blog");
      assertNotNull(prefs);
      assertEquals("group#/platform/test/legacy:/web/IFramePortlet/blog", prefs.getWindowId());
   }
View Full Code Here

      assertEquals("group::/platform/test/normalized::register", page.getPageId());
      assertEquals("/platform/test/normalized", page.getOwnerId());
      Application app = (Application)page.getChildren().get(0);
      //    assertEquals("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account", app.getInstanceState().getWeakReference());

      PortletPreferences prefs =
         storage.getPortletPreferences("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account");
      assertNotNull(prefs);
      assertEquals("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account", prefs.getWindowId());
   }
View Full Code Here

                     pref.setName(preference.getName());
                     pref.setValues(new ArrayList<String>(preference.getValues()));
                     pref.setReadOnly(preference.isReadOnly());
                     list.add(pref);
                  }
                  PortletPreferences prefs = new PortletPreferences();
                  prefs.setWindowId(windowId);
                  prefs.setPreferences(list);
                  return prefs;
               }
            }
         }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.application.PortletPreferences$PortletPreferencesSet

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.