Package org.gatein.mop.api

Examples of org.gatein.mop.api.Attributes


      Described described = dst.adapt(Described.class);
      described.setName(src.getTitle());
      described.setDescription(src.getDescription());

      //
      Attributes attrs = dst.getAttributes();
      attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
      attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());

      //
      UIContainer rootContainer = dst.getRootComponent();

      // We are creating a new Page with the root container id as this one is lost
View Full Code Here


      Described described = dst.adapt(Described.class);
      described.setName(src.getTitle());
      described.setDescription(src.getDescription());

      Attributes dstAttrs = dst.getAttributes();
      dstAttrs.setValue(MappedAttributes.ID, src.getId());
      dstAttrs.setValue(MappedAttributes.TYPE, src instanceof DashboardData ? "dashboard" : null);
      dstAttrs.setValue(MappedAttributes.ICON, src.getIcon());
      dstAttrs.setValue(MappedAttributes.TEMPLATE, src.getTemplate());
      dstAttrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
      dstAttrs.setValue(MappedAttributes.WIDTH, src.getWidth());
      dstAttrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
      dstAttrs.setValue(MappedAttributes.NAME, src.getName());
   }
View Full Code Here

                     UIContainer dstDashboard = session.findObjectById(ObjectType.CONTAINER, app.getStorageId());
                     data = loadDashboard(dstDashboard);

                     // Update those attributes as we have to do it now, they don't exist in a container
                     // but do exist in a dashboard container
                     Attributes attrs = dstDashboard.getAttributes();
                     attrs.setValue(MappedAttributes.SHOW_INFO_BAR, app.isShowInfoBar());
                     attrs.setValue(MappedAttributes.SHOW_MODE, app.isShowApplicationMode());
                     attrs.setValue(MappedAttributes.SHOW_WINDOW_STATE, app.isShowApplicationState());
                     attrs.setValue(MappedAttributes.THEME, app.getTheme());
                  }
                  else
                  {
                     data = DashboardData.INITIAL_DASHBOARD;
                  }
View Full Code Here

      }
   }

   private <S> ApplicationData<S> load(UIWindow src)
   {
      Attributes attrs = src.getAttributes();

      //
      Customization<?> customization = src.getCustomization();

      //
      ContentType<?> contentType = customization.getType();

      //
      String customizationid = customization.getId();

      // julien: should type check that
      ApplicationType<S> type = (ApplicationType<S>)ApplicationType.getType(contentType);

      //
      PersistentApplicationState<S> instanceState = new PersistentApplicationState<S>(customizationid);

      //
      HashMap<String, String> properties = new HashMap<String, String>();
      load(attrs, properties, windowPropertiesBlackList);

      //
      List<String> accessPermissions = Collections.emptyList();
      if (src.isAdapted(ProtectedResource.class))
      {
         ProtectedResource pr = src.adapt(ProtectedResource.class);
         accessPermissions = pr.getAccessPermissions();
      }

      //
      Described described = src.adapt(Described.class);

      //
      boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR, false);
      boolean showWindowState = attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE, false);
      boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
      String theme = attrs.getValue(MappedAttributes.THEME, null);

      //
      return new ApplicationData<S>(
         src.getObjectId(),
         src.getName(),
         type,
         instanceState,
         null,
         described.getName(),
         attrs.getValue(MappedAttributes.ICON),
         described.getDescription(),
         showInfoBar,
         showWindowState,
         showMode,
         theme,
         attrs.getValue(MappedAttributes.WIDTH),
         attrs.getValue(MappedAttributes.HEIGHT),
         Utils.safeImmutableMap(properties),
         Utils.safeImmutableList(accessPermissions)
      );
   }
View Full Code Here

      Described described = dst.adapt(Described.class);
      described.setName(src.getTitle());
      described.setDescription(src.getDescription());

      //
      Attributes attrs = dst.getAttributes();
      attrs.setValue(MappedAttributes.SHOW_INFO_BAR, src.isShowInfoBar());
      attrs.setValue(MappedAttributes.SHOW_WINDOW_STATE, src.isShowApplicationState());
      attrs.setValue(MappedAttributes.SHOW_MODE, src.isShowApplicationMode());
      attrs.setValue(MappedAttributes.THEME, src.getTheme());
      attrs.setValue(MappedAttributes.ICON, src.getIcon());
      attrs.setValue(MappedAttributes.WIDTH, src.getWidth());
      attrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
      save(src.getProperties(), attrs, windowPropertiesBlackList);

      //
      ApplicationState<S> instanceState = src.getState();
View Full Code Here

      //
      Described described = container.adapt(Described.class);

      //
      Attributes attrs = container.getAttributes();
      List<ComponentData> children = loadChildren(container);
      return new DashboardData(
         container.getObjectId(),
         attrs.getValue(MappedAttributes.ID),
         attrs.getValue(MappedAttributes.NAME),
         attrs.getValue(MappedAttributes.ICON),
         attrs.getValue(MappedAttributes.TEMPLATE),
         attrs.getValue(MappedAttributes.FACTORY_ID),
         described.getName(),
         described.getDescription(),
         attrs.getValue(MappedAttributes.WIDTH),
         attrs.getValue(MappedAttributes.HEIGHT),
         Utils.safeImmutableList(accessPermissions),
         children
      );
   }
View Full Code Here

        //
        Described described = container.adapt(Described.class);

        //
        Attributes attrs = container.getAttributes();
        List<ComponentData> children = loadChildren(container);
        return new DashboardData(container.getObjectId(), attrs.getValue(MappedAttributes.ID),
                attrs.getValue(MappedAttributes.NAME), attrs.getValue(MappedAttributes.ICON),
                attrs.getValue(MappedAttributes.TEMPLATE), attrs.getValue(MappedAttributes.FACTORY_ID), described.getName(),
                described.getDescription(), attrs.getValue(MappedAttributes.WIDTH), attrs.getValue(MappedAttributes.HEIGHT),
                Utils.safeImmutableList(accessPermissions), children);
    }
View Full Code Here

        this.session = session;
    }

    public PortalData load(Site src) {
        String type = Mapper.getOwnerType(src.getObjectType());
        Attributes attrs = src.getAttributes();

        //
        Templatized templarized = src.getRootNavigation().getTemplatized();
        org.gatein.mop.api.workspace.Page template = templarized.getTemplate();
        UIContainer srcLayout = template.getRootComponent();

        //
        Map<String, String> properties = new HashMap<String, String>();
        load(attrs, properties, portalPropertiesBlackList);

        //
        List<ComponentData> layoutChildren = loadChildren(srcLayout);
        ContainerData layout = load(srcLayout, layoutChildren);

        //
        List<String> accessPermissions = Collections.emptyList();
        String editPermission = null;
        if (src.isAdapted(ProtectedResource.class)) {
            ProtectedResource pr = src.adapt(ProtectedResource.class);
            accessPermissions = pr.getAccessPermissions();
            editPermission = pr.getEditPermission();
        }

        //
        List<RedirectData> redirects = null;
        if (src.isAdapted(Redirectable.class)) {
            Redirectable redirectAble = src.adapt(Redirectable.class);
            redirects = loadRedirects(src, redirectAble.getRedirects());
        }

        Described described = src.adapt(Described.class);

        //
        return new PortalData(src.getObjectId(), src.getName(), type, attrs.getValue(MappedAttributes.LOCALE),
                described.getName(), described.getDescription(), accessPermissions, editPermission,
                Collections.unmodifiableMap(properties), attrs.getValue(MappedAttributes.SKIN), layout, redirects);
    }
View Full Code Here

                        + dst.getObjectType() + "/" + dst.getName();
                throw new IllegalArgumentException(msg);
            }

            //
            Attributes attrs = dst.getAttributes();
            attrs.setValue(MappedAttributes.LOCALE, src.getLocale());
            attrs.setValue(MappedAttributes.SKIN, src.getSkin());
            if (src.getProperties() != null) {
                save(src.getProperties(), attrs, portalPropertiesBlackList);
            }

            ProtectedResource pr = dst.adapt(ProtectedResource.class);
View Full Code Here

        Site site = src.getSite();
        String ownerType = getOwnerType(site.getObjectType());
        String ownerId = site.getName();
        String name = src.getName();
        List<ComponentData> children = loadChildren(src.getRootComponent());
        Attributes attrs = src.getAttributes();

        //
        return new PageData(src.getObjectId(), null, name, null, null, null, null, null, null, null,
                Collections.<String> emptyList(), children, ownerType, ownerId, null, false);
    }
View Full Code Here

TOP

Related Classes of org.gatein.mop.api.Attributes

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.