Package org.gatein.mop.api.workspace

Examples of org.gatein.mop.api.workspace.Page


      assertEquals("en", attrs.getString("locale"));
      assertEquals("test_skin", attrs.getString("skin"));
      assertEquals("test_prop_value", attrs.getString("prop_key"));

      //
      Page layout = portal.getRootNavigation().getTemplatized().getTemplate();
      assertNotNull(layout);
      assertSame(portal.getRootPage().getChild("templates").getChild("default"), layout);
   }
View Full Code Here


   }

   public void testPageWithoutPageId() throws Exception
   {
      Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
      Page testRootPage = testPortal.getRootPage();
      Page pages = testRootPage.getChild("pages");
      Page testPage = pages.getChild("test2");
      assertNotNull(testPage);
   }
View Full Code Here

   }

   public void testPage() throws Exception
   {
      Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
      Page testRootPage = testPortal.getRootPage();
      Page pages = testRootPage.getChild("pages");
      Page testPage = pages.getChild("test1");
      assertNotNull(testPage);

      //
      assertTrue(testPage.isAdapted(ProtectedResource.class));
      ProtectedResource pr = testPage.adapt(ProtectedResource.class);
      assertEquals(Arrays.asList("test_access_permissions"), pr.getAccessPermissions());
      assertEquals("test_edit_permission", pr.getEditPermission());

      //
      Described testPageDescribed = testPage.adapt(Described.class);
      assertEquals("test_title", testPageDescribed.getName());
      assertEquals(null, testPageDescribed.getDescription());

      //
      Attributes testPageAttrs = testPage.getAttributes();
      assertEquals("test_factory_id", testPageAttrs.getString("factory-id"));
      assertEquals(true, (boolean)testPageAttrs.getBoolean("show-max-window"));

      //
      UIContainer c = testPage.getRootComponent();
      assertNotNull(c);
      assertEquals(2, c.getComponents().size());
      Iterator<? extends UIComponent> it = c.getComponents().iterator();

      //
View Full Code Here

                    throw new IllegalArgumentException("Cannot update portal " + config.getName() + " that does not exist");
                }

                //
                site = workspace.addSite(type, config.getName());
                Page root = site.getRootPage();
                root.addChild("pages");
                root.addChild("templates");
            }
            new Mapper(session).save(config, site);

            //
            return null;
View Full Code Here

               int pos = instanceName.indexOf("#");
               if (pos != -1)
               {
                  String a = instanceName.substring(0, pos);
                  String b = instanceName.substring(pos + 1);
                  Page page = site.getRootPage().getChild("pages").getChild(b);
                  Customization c = page.getCustomizationContext().getCustomization(a);
                  if (c != null)
                  {
                     c.destroy();
                  }
                  customization =
                     page.getCustomizationContext().customize(a, Portlet.CONTENT_TYPE, applicationName + "/" + portletName,
                        new PortletBuilder().build());
               }
               else
               {
                  Customization c = site.getCustomizationContext().getCustomization(instanceName);
View Full Code Here

               }
               else
               {
                  String a = instanceName.substring(0, pos);
                  String b = instanceName.substring(pos + 1);
                  Page page = site.getRootPage().getChild("pages").getChild(b);
                  customization = (Customization<Portlet>)page.getCustomizationContext().getCustomization(a);
               }
            }

            //
            if (customization != null)
View Full Code Here

               throw new IllegalArgumentException("Cannot update portal " + config.getName() + " that does not exist");
            }

            //
            site = workspace.addSite(type, config.getName());
            Page root = site.getRootPage();
            root.addChild("pages");
            root.addChild("templates");

            // Add pending preferences
            for (PortletPreferences prefs : session.getPortletPreferences(site))
            {
               new PortletPreferencesTask.Save(prefs).run(session);
View Full Code Here

                siteName, pageTitle, from, to);
        int size = a.size();
        PageContext[] array = new PageContext[size];
        int ptr = 0;
        while (a.hasNext()) {
            Page page = a.next();
            PageData data = new PageData(page);
            dataCache.putPage(data);
            array[ptr++] = new PageContext(data);
        }
        return new QueryResult<PageContext>(from, size, Arrays.asList(array));
View Full Code Here

    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site)
            throws ResourceNotFoundException, OperationException {
        boolean pageOrNav = false;
        Set<String> children = new LinkedHashSet<String>(3);

        Page pages = site.getRootPage().getChild("pages");
        if (pages != null && !pages.getChildren().isEmpty()) {
            children.add("pages");
            pageOrNav = true;
        }

        Navigation defaultNav = site.getRootNavigation().getChild("default");
View Full Code Here

            ObjectType<Site> siteType) throws ResourceNotFoundException, OperationException {
        Collection<Site> sites = workspace.getSites(siteType);
        Set<String> children = new LinkedHashSet<String>(sites.size());
        for (Site site : sites) {
            boolean pageOrNav = false;
            Page pages = site.getRootPage().getChild("pages");
            if (pages != null && !pages.getChildren().isEmpty()) {
                pageOrNav = true;
            }
            Navigation defaultNav = site.getRootNavigation().getChild("default");
            if (defaultNav != null && !defaultNav.getChildren().isEmpty()) {
                pageOrNav = true;
View Full Code Here

TOP

Related Classes of org.gatein.mop.api.workspace.Page

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.