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

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


                                                            selectedComponent.getDisplayName());
            String name = dialog.getConfirmedTelemetryGroupName();

            if (!StringUtil.isEmpty(name)) {
                AbstractComponent duplicate = selectedComponent.clone();
                ComponentInitializer ci = duplicate.getCapability(ComponentInitializer.class);
                ci.setCreator(GlobalContext.getGlobalContext().getUser().getUserId());
                ci.setOwner(GlobalContext.getGlobalContext().getUser().getUserId());
                duplicate.setDisplayName(name);
                duplicate.save();
                parentComponent.addDelegateComponent(duplicate);
                parentComponent.save();
            }
View Full Code Here


            return clones;
        }
       
        private AbstractComponent clone(AbstractComponent component) {
            AbstractComponent duplicate = component.clone();
            ComponentInitializer ci = duplicate.getCapability(ComponentInitializer.class);
            ci.setCreator(PlatformAccess.getPlatform().getCurrentUser().getUserId());
            ci.setOwner(PlatformAccess.getPlatform().getCurrentUser().getUserId());
            duplicate.setDisplayName("copy of " + component.getDisplayName());
            duplicate.save();
            return duplicate;
        }
View Full Code Here

            throw new RuntimeException(ie);
        }
       
        if (newComponent != null) {
            newComponent.setOwner(getDefaultUser());
            ComponentInitializer ci = newComponent.getCapability(ComponentInitializer.class);
            ci.setCreator(getDefaultUser());
           
            parent.addDelegateComponent(newComponent)
            parent.save();
            newComponent.save();
        }
View Full Code Here

    @Override
    public AbstractComponent newInstance(String componentType) {
        try {
            AbstractComponent comp = createComponent(componentType);
            ComponentInitializer ci = comp.getCapability(ComponentInitializer.class);
            String user = getDefaultUser();
            if( user != null) { // i.e.: we found a user --Harleigh;Issue127
                ci.setCreator(user);
                comp.setOwner(user);
            }
            return comp;
           
        } catch (InstantiationException e) {
View Full Code Here

            clonedComponent.creator = creator;
            clonedComponent.displayName = displayName;
            clonedComponent.externalKey = externalKey;
            clonedComponent.version = version;

            ComponentInitializer clonedCapability = clonedComponent.getCapability(ComponentInitializer.class);
           
            clonedCapability.initialize();
            return clonedComponent;
        } catch (SecurityException e) {
            throw new MCTRuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new MCTRuntimeException(e);
View Full Code Here

    return createAbstractComponent(componentName, id, "creator");
  }
 
  private TestAbstractComponent createAbstractComponent(String componentName, String id, String creator) {
    TestAbstractComponent comp = new TestAbstractComponent();
    ComponentInitializer ci = comp.getCapability(ComponentInitializer.class);
    ci.setId(id);
    comp.setDisplayName(componentName);
    comp.setModelValue(componentName);
    comp.setOwner("test");
    ci.setCreator(creator);
    comp.save();
   
    return comp;
  }
View Full Code Here

  }
 
  private AbstractComponent newCompWOChildren(AbstractComponent component, String id,
                             String externalKey) {
      component = new TestAbstractComponent();
      ComponentInitializer ci = component.getCapability(ComponentInitializer.class);
      ci.setId(id);
      ci.setCreator("Ginger");
      ci.setCreationDate(new Date());
      component.setDisplayName("Test Name");
      component.setOwner("Fred");
   
    // Add view state
    Map<String, ExtendedProperties> viewRoleProperties =
View Full Code Here

    return componentA;
  }
 
  private TestAbstractComponent createAbstractComponent(String componentName, String id) {
      TestAbstractComponent comp = new TestAbstractComponent();
      ComponentInitializer ci = comp.getCapability(ComponentInitializer.class);
      ci.setId(id);
      return comp;
  }
View Full Code Here

    }
  }

  private TestAbstractComponent createAbstractComponent(String componentName, String id) {
    TestAbstractComponent comp = new TestAbstractComponent();
    ComponentInitializer ci = comp.getCapability(ComponentInitializer.class);
    ci.setId(id);
    return comp;
  }
View Full Code Here

public final class RootComponent extends AbstractComponent {
   
    public RootComponent() {
        setDisplayName("All");
        ComponentInitializer capability = getCapability(ComponentInitializer.class);
        capability.setOwner("admin");
        capability.setCreator("admin");
    }
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.