Package org.exoplatform.portal.pom.spi.portlet

Examples of org.exoplatform.portal.pom.spi.portlet.Portlet


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

      // Check state
      Portlet pagePrefs = storage_.load(instanceId, ApplicationType.PORTLET);
      assertEquals(new PortletBuilder().add("template", "par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl")
         .build(), pagePrefs);

      // Now save the cloned page
      storage_.save(clone);

      // Get cloned page
      clone = storage_.getPage("portal::test::_test4");
      assertEquals(2, clone.getChildren().size());
      banner1 = (Application<Portlet>)clone.getChildren().get(0);
      instanceId = banner1.getState();

      // 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);
View Full Code Here


         (Application<Portlet>)uctx.unmarshalDocument(new FileInputStream(
            "src/test/resources/jibx/portlet-application.xml"), null);
      TransientApplicationState portletState = (TransientApplicationState)app.getState();
      assertNotNull(portletState);
      assertEquals("web/BannerPortlet", portletState.getContentId());
      Portlet preferences = (Portlet)portletState.getContentState();
      assertEquals(new PortletBuilder().add("template", "template_value").build(), preferences);
   }
View Full Code Here

      Page page = storage_.getPage("portal::test::test4");
      Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
      PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();

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

      //
      prefs.setValue("template", "someanothervalue");
      storage_.save(state, prefs);

      //
      prefs = storage_.load(state, ApplicationType.PORTLET);
      assertNotNull(prefs);
View Full Code Here

      Page page = storage_.getPage("portal::test::test4");
      Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
      PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();

      //
      Portlet prefs = storage_.load(state, ApplicationType.PORTLET);

      //
      prefs.setValue("template", null);
      storage_.save(state, prefs);

      //
      prefs = storage_.load(state, ApplicationType.PORTLET);
      assertNotNull(prefs);
View Full Code Here

            assertEquals("test", clone.getOwnerId());
            assertEquals("test5", clone.getName());

            //
            Application<Portlet> app = (Application<Portlet>)clone.getChildren().get(0);
            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();
View Full Code Here

            assertEquals("Dashboard", app.getTitle());
            assertNotNull(app.getState());
            assertEquals("dashboard/DashboardPortlet", storage_.getId(app.getState()));
            // assertEquals("portal", app.getInstanceState().getOwnerType());
            // assertEquals("test", app.getInstanceState().getOwnerId());
            Portlet prefs2 = storage_.load(app.getState(), ApplicationType.PORTLET);
            assertNull(prefs2);
         }
      }.execute(null);
   }
View Full Code Here

                            : "";
                    portletPreferenceMaps.put(key, ppValue);
                }
            }

            Portlet pp = uiPortlet.getPreferences();
            if (pp != null) {
                for (Preference pref : pp) {
                    if (!pref.isReadOnly()) {
                        portletPreferenceMaps.put(pref.getName(), (pref.getValues().size() > 0) ? pref.getValues().get(0) : "");
                    }
View Full Code Here

        // Marshal ApplicationState
        ApplicationState<Portlet> state = portletApplication.getState();

        // Marshal application state
        String contentId;
        Portlet portlet;
        // If transient we have all the information we need
        if (state instanceof TransientApplicationState) {
            TransientApplicationState<Portlet> transientApplicationState = (TransientApplicationState<Portlet>) state;
            contentId = transientApplicationState.getContentId();
            portlet = transientApplicationState.getContentState();
View Full Code Here

            }

            //
            if (customization != null)
            {
               Portlet state = customization.getVirtualState();
               if (state != null)
               {
                  ArrayList<Preference> list = new ArrayList<Preference>();
                  for (org.exoplatform.portal.pom.spi.portlet.Preference preference : state)
                  {
View Full Code Here

        // Marshal ApplicationState
        ApplicationState<Portlet> state = portletApplication.getState();

        // Marshal application state
        String contentId;
        Portlet portlet;
        // If transient we have all the information we need
        if (state instanceof TransientApplicationState) {
            TransientApplicationState<Portlet> transientApplicationState = (TransientApplicationState<Portlet>) state;
            contentId = transientApplicationState.getContentId();
            portlet = transientApplicationState.getContentState();
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.pom.spi.portlet.Portlet

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.