Package gov.nasa.arc.mct.services.internal.component

Examples of gov.nasa.arc.mct.services.internal.component.ComponentInitializer


     * Returns the view properties of this view type.
     * @return non-null <code>ExtendedProperties</code>
     */
    public ExtendedProperties getViewProperties() {
        String viewType = getInfo().getType();
        ComponentInitializer capability = getManifestedComponent().getCapability(ComponentInitializer.class);
        ExtendedProperties props = capability.getViewRoleProperties(viewType);
        if (props == null) {
            props = new ExtendedProperties();
            capability.setViewRoleProperty(viewType, props);           
        }
        return props;
    }
View Full Code Here


                        Platform platform = PlatformAccess.getPlatform();
                        PersistenceProvider persistenceService = platform.getPersistenceProvider();
                        CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
                        AbstractComponent mySandbox = componentRegistry.newInstance(MineTaxonomyComponent.class.getName());
                        ComponentInitializer mysandboxCapability = mySandbox.getCapability(ComponentInitializer.class);
                        mysandboxCapability.setCreator(userId);
                        mysandboxCapability.setOwner(userId);
                        mySandbox.setDisplayName("My Sandbox");
                                               
                        AbstractComponent dropbox = componentRegistry.newInstance(TelemetryUserDropBoxComponent.class.getName());
                        ComponentInitializer dropboxCapability = dropbox.getCapability(ComponentInitializer.class);
                        dropboxCapability.setCreator("admin");
                        dropboxCapability.setOwner("*");
                        dropbox.setDisplayName(userId + "\'s drop box");

                        persistenceService.addNewUser(userId, disciplineComponent.getDisplayName(), mySandbox, dropbox);
                        disciplineComponent.componentSaved();
                        textField.setText(EM_STR);
View Full Code Here

      }
      cs.getReferencedComponents().add(refCs);
    }
   
    // save views
    ComponentInitializer ci = ac.getCapability(ComponentInitializer.class);
    if (ci.getMutatedViewRoleProperties() != null) {
      for (Entry<String,ExtendedProperties> viewEntry : ci.getAllViewRoleProperties().entrySet()) {
        createViewState(viewEntry.getKey(), cs.getComponentId(), viewEntry.getValue(),em,cs);
      }
    }
  }
View Full Code Here

        updateComponentSpec(c, em.find(ComponentSpec.class, c.getComponentId()), em, true);
      }
      em.flush();
      em.getTransaction().commit();
      for (AbstractComponent c : componentsToPersist) {
        ComponentInitializer ci = c.getCapability(ComponentInitializer.class);
        ci.componentSaved();
        if (c.getCreationDate() == null) {
          ci.setCreationDate(em.find(ComponentSpec.class, c.getComponentId()).getDateCreated());
        }
        c.getCapability(Updatable.class).setVersion(em.find(ComponentSpec.class, c.getComponentId()).getObjVersion());
        c.componentSaved();
        List<WeakReference<AbstractComponent>> list = cache.get(c.getComponentId());
        if (list == null) {
View Full Code Here

      return platform.getComponentRegistry().newInstance(cs.getComponentType());
    }

    private AbstractComponent createAbstractComponent(ComponentSpec cs) {
      AbstractComponent ac = newAbstractComponent(cs);
    ComponentInitializer initializer = ac.getCapability(ComponentInitializer.class);
    initializer.setCreationDate(cs.getDateCreated());
    initializer.setCreator(cs.getCreatorUserId());
    initializer.setOwner(cs.getOwner());
    initializer.setId(cs.getComponentId());
    ac.setExternalKey(cs.getExternalKey());
    ac.setDisplayName(cs.getComponentName());
    ac.getCapability(Updatable.class).setVersion(cs.getObjVersion());
        ModelStatePersistence persister = ac.getCapability(ModelStatePersistence.class);
        if ((persister != null) && (cs.getModelInfo() != null)) {
View Full Code Here

        };
    }
   
    void setupUserAndComponent(String user, String originalOwner, String id) {
        Mockito.when(testUser.getUserId()).thenReturn(user);
        ComponentInitializer ci = component.getCapability(ComponentInitializer.class);
        ci.setOwner(originalOwner);
        ci.setId(id);
    }
View Full Code Here

    @Override
    public AbstractComponent createDropbox(String userId) {
        Platform platform = PlatformAccess.getPlatform();
        AbstractComponent dropbox = platform.getComponentRegistry().newInstance(TelemetryUserDropBoxComponent.class.getName());
        ComponentInitializer dropboxCapability = dropbox.getCapability(ComponentInitializer.class);
        dropboxCapability.setCreator(userId);
        dropboxCapability.setOwner("*");
        dropbox.setDisplayName(userId + resource.getString("user_drop_box"));
       
        return dropbox;
    }
View Full Code Here

    @Override
    public AbstractComponent createSandbox(String userId) {
        Platform platform = PlatformAccess.getPlatform();
        CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
        AbstractComponent mySandbox = componentRegistry.newInstance(MineTaxonomyComponent.class.getName());
        ComponentInitializer mysandboxCapability = mySandbox.getCapability(ComponentInitializer.class);
        mysandboxCapability.setCreator(userId);
        mysandboxCapability.setOwner(userId);
        mySandbox.setDisplayName("My Sandbox");
       
        return mySandbox;
    }
View Full Code Here

        CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
       
        AbstractComponent dropBoxes = componentRegistry.newInstance(TelemetryDataTaxonomyComponent.class.getName());
        dropBoxes.setDisplayName("User Drop Boxes");
        dropBoxes.setExternalKey("/UserDropBoxes");
        ComponentInitializer dropBoxesCapability = dropBoxes.getCapability(ComponentInitializer.class);
        dropBoxesCapability.setCreator("admin");
        dropBoxesCapability.setOwner("admin");
       
        platform.getPersistenceProvider().persist(Collections.singleton(dropBoxes));
        platform.getPersistenceProvider().tagComponents("bootstrap:admin", Collections.singleton(dropBoxes));
    }
View Full Code Here

            String userId, String group, AbstractComponent mySandbox) {
       
        // Create DropBox under My Sandbox
        AbstractComponent userDropBox = createComponent(TelemetryUserDropBoxComponent.class);
        userDropBox.setOwner(userId);
        ComponentInitializer ci = userDropBox.getCapability(ComponentInitializer.class);
        ci.setCreator(userId);
        ci.setCreationDate(new Date());
       
        userDropBox.setDisplayName(userId + "'s Drop Box");
        mySandbox.addDelegateComponent(userDropBox);
        Collection<AbstractComponent> dropboxParents = new LinkedHashSet<AbstractComponent>();
        dropboxParents.add(mySandbox);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.services.internal.component.ComponentInitializer

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.