Package org.gatein.mop.api.workspace.ui

Examples of org.gatein.mop.api.workspace.ui.UIWindow


      assertEquals("container_1_factory_id", container1Attrs.getString("factory-id"));
      assertEquals("container_1_width", container1Attrs.getString("width"));
      assertEquals("container_1_height", container1Attrs.getString("height"));

      //
      UIWindow application1 = (UIWindow)it.next();
      assertTrue(application1.isAdapted(ProtectedResource.class));
      ProtectedResource application1PR = application1.adapt(ProtectedResource.class);
      assertEquals(Collections.singletonList("application_1_access_permissions"), application1PR.getAccessPermissions());
      Described application1Described = application1.adapt(Described.class);
      assertEquals("application_1_title", application1Described.getName());
      assertEquals("application_1_description", application1Described.getDescription());
      Attributes application1Attrs = application1.getAttributes();
      assertEquals("application_1_theme", application1Attrs.getString("theme"));
      assertEquals(true, (boolean)application1Attrs.getBoolean("showinfobar"));
      assertEquals(true, (boolean)application1Attrs.getBoolean("showmode"));
      assertEquals(true, (boolean)application1Attrs.getBoolean("showwindowstate"));
      assertEquals("application_1_icon", application1Attrs.getString("icon"));
      assertEquals("application_1_width", application1Attrs.getString("width"));
      assertEquals("application_1_height", application1Attrs.getString("height"));
      assertEquals("application_1_prop_value", application1Attrs.getString("prop_key"));

      //
      Customization<?> customization = application1.getCustomization();
      assertNotNull(customization);
      assertEquals("application/portlet", customization.getType().getMimeType());
      assertEquals("web/BannerPortlet", customization.getContentId());
      //    assertEquals("banner", customization.getName());
   }
View Full Code Here


               mo = load(srcContainer, dstChildren);
            }
         }
         else if (component instanceof UIWindow)
         {
            UIWindow window = (UIWindow)component;
            ApplicationData application = load(window);
            mo = application;
         }
         else if (component instanceof UIBody)
         {
View Full Code Here

               String id = uniqueId.substring(1);

               // It's another window, we get its customization
               if (!dst.getObjectId().equals(id))
               {
                  UIWindow window = session.findObjectById(ObjectType.WINDOW, id);
                  Customization<?> windowCustomization = window.getCustomization();
                  if (windowCustomization.getType().equals(contentType))
                  {
                     customization = windowCustomization;
                  }
               }
View Full Code Here

                } else {
                    List<ComponentData> dstChildren = loadChildren(srcContainer);
                    mo = load(srcContainer, dstChildren);
                }
            } else if (component instanceof UIWindow) {
                UIWindow window = (UIWindow) component;
                ApplicationData application = load(window);
                mo = application;
            } else if (component instanceof UIBody) {
                mo = new BodyData(component.getObjectId(), BodyType.PAGE);
            } else {
View Full Code Here

        POMSession session = pomMgr.getSession();
        WorkspaceObject workspaceObject = session.findObjectById(applicationStorageId);

        if (workspaceObject instanceof UIWindow) {
            UIWindow application = (UIWindow) workspaceObject;
            Mapper mapper = new Mapper(session);

            ApplicationData data = mapper.load(application);
            return data;
        }
View Full Code Here

         if (site != null)
         {
            if (instanceName.startsWith("@"))
            {
               String id = instanceName.substring(1);
               UIWindow window = session.findObjectById(ObjectType.WINDOW, id);

               // Should check it's pointing to same instance though
               customization = window.getCustomization();
            }
            else
            {
               int pos = instanceName.indexOf("#");
               if (pos != -1)
View Full Code Here

         {
            Customization<Portlet> customization;
            if (instanceName.startsWith("@"))
            {
               String id = instanceName.substring(1);
               UIWindow window = session.findObjectById(ObjectType.WINDOW, id);
               customization = (Customization<Portlet>)window.getCustomization();
            }
            else
            {
               int pos = instanceName.indexOf('#');
               if (pos == -1)
View Full Code Here

            }

            //
            if (srcChild instanceof UIWindow)
            {
               UIWindow srcWindow = (UIWindow)srcChild;
               UIWindow dstWindow = (UIWindow)dstChild;
               Customization<?> customization = srcWindow.getCustomization();
               ContentType contentType = customization.getType();
               String contentId = customization.getContentId();
               Customization parent = customization.getParent();
               Customization dstParent = null;
               if (parent != null)
               {
                  WorkspaceCustomizationContext parentCtx = (WorkspaceCustomizationContext)parent.getContext();
                  String name = parentCtx.nameOf(parent);
                  if (parentCtx == srcPage)
                  {
                     dstParent = dstPage.getCustomizationContext().getCustomization(name);
                     if (dstParent == null)
                     {
                        Object state = parent.getVirtualState();
                        dstParent = dstPage.getCustomizationContext().customize(name, contentType, contentId, state);
                     }
                  }
                  if (dstParent != null)
                  {
                     Object state = customization.getState();
                     Customization dstCustomization = dstWindow.customize(dstParent);
                     dstCustomization.setState(state);
                  }
                  else
                  {
                     Object state = customization.getVirtualState();
                     dstWindow.customize(contentType, contentId, state);
                  }
               }
               else
               {
                  Object state = customization.getVirtualState();
                  dstWindow.customize(contentType, contentId, state);
               }
            }
            else if (srcChild instanceof UIContainer)
            {
               UIContainer srcContainer = (UIContainer)srcChild;
View Full Code Here

                dstAttrs.setObject(key, value);
            }

            //
            if (srcChild instanceof UIWindow) {
                UIWindow srcWindow = (UIWindow) srcChild;
                UIWindow dstWindow = (UIWindow) dstChild;
                Customization<?> customization = srcWindow.getCustomization();
                ContentType contentType = customization.getType();
                String contentId = customization.getContentId();
                Customization parent = customization.getParent();
                Customization dstParent = null;
                if (parent != null) {
                    WorkspaceCustomizationContext parentCtx = (WorkspaceCustomizationContext) parent.getContext();
                    String name = parentCtx.nameOf(parent);
                    if (parentCtx == srcPage) {
                        dstParent = dstPage.getCustomizationContext().getCustomization(name);
                        if (dstParent == null) {
                            Object state = parent.getVirtualState();
                            dstParent = dstPage.getCustomizationContext().customize(name, contentType, contentId, state);
                        }
                    }
                    if (dstParent != null) {
                        Object state = customization.getState();
                        Customization dstCustomization = dstWindow.customize(dstParent);
                        dstCustomization.setState(state);
                    } else {
                        Object state = customization.getVirtualState();
                        dstWindow.customize(contentType, contentId, state);
                    }
                } else {
                    Object state = customization.getVirtualState();
                    dstWindow.customize(contentType, contentId, state);
                }
            } else if (srcChild instanceof UIContainer) {
                UIContainer srcContainer = (UIContainer) srcChild;
                UIContainer dstContainer = (UIContainer) dstChild;
                copy(srcPage, dstPage, srcContainer, dstContainer);
View Full Code Here

               mo = load(srcContainer, dstChildren);
            }
         }
         else if (component instanceof UIWindow)
         {
            UIWindow window = (UIWindow)component;
            ApplicationData application = load(window);
            mo = application;
         }
         else if (component instanceof UIBody)
         {
View Full Code Here

TOP

Related Classes of org.gatein.mop.api.workspace.ui.UIWindow

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.