private void checkRealizingDataflow() throws RegistryException { if (realizingDataflow == null) { // realizingDataflow = ComponentDataflowCache.getDataflow(getConfiguration()); realizingDataflow = ComponentUtil.calculateComponentVersion(getConfiguration()).getDataflow(); } }
/** * Check if the user has changed the configuration from the original */ @Override public boolean isConfigurationChanged() { Integer version = ((Version) componentVersionChoice.getSelectedItem()) .getVersionNumber(); return !version.equals(configBean.getComponentVersion()); }
private void updateToolTipText() { Version selectedVersion = (Version) componentVersionChoice .getSelectedItem(); componentVersionChoice.setToolTipText(selectedVersion.getDescription()); } }
@Test public void testAddVersionBasedOn() throws Exception { assertNotNull(component.getComponentVersion(1)); assertNull(component.getComponentVersion(2)); Version componentVersion = component.addVersionBasedOn(dataflow, "Some description"); assertNotNull(componentVersion); assertEquals(component, componentVersion.getComponent()); assertEquals(2, componentVersion.getVersionNumber().intValue()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
@Override public final Version createComponentBasedOn(String componentName, String description, Dataflow dataflow) throws RegistryException { if (componentName == null) throw new RegistryException("Component name must not be null"); if (dataflow == null) throw new RegistryException("Dataflow must not be null"); checkComponentCache(); if (componentCache.containsKey(componentName)) throw new RegistryException("Component name already used"); Version version = internalCreateComponentBasedOn(componentName, description, dataflow); synchronized (componentCache) { Component c = version.getComponent(); componentCache.put(componentName, c); } return version; }
@Test public void testUploadWorkflow() throws Exception { URL dataflowUrl = getClass().getClassLoader().getResource( "beanshell_test.t2flow"); Dataflow dataflow = getDataflowFromUri(dataflowUrl.toString()); NewComponentRegistry registry = (NewComponentRegistry) getComponentRegistry(componentRegistryUrl); Version v = registry.createComponentFrom(null, "Test Workflow", "test description", dataflow, null, Policy.PRIVATE); assertEquals("test description", v.getDescription()); registry.deleteComponent((NewComponent) v.getComponent()); }
Version targetVersion = targetFamily.createComponentBasedOn(componentName, sourceComponent.getDescription(), sourceVersion.getDataflow()); try { refreshComponentServiceProvider(new ComponentServiceProviderConfig( targetVersion.getID())); } catch (ConfigurationException e) { logger.error(e);
URL helpURL = null; try { helpURL = ComponentUtil.calculateComponentVersion(id).getHelpURL(); if (version != null) appendDescriptionHtml(html, VERSION_DESCRIPTION_LABEL, version.getDescription()); } catch (RegistryException e) { logger.error("failed to get component version description", e);
public URL getHelpURL() { try { Version version = ComponentUtil.calculateComponentVersion(getIdentification()); return version.getHelpURL(); } catch (RegistryException e) { logger.error(e); } return null; } }
@Test public void testAddVersionBasedOn() throws Exception { assertNotNull(component.getComponentVersion(1)); assertNull(component.getComponentVersion(2)); Version componentVersion = component.addVersionBasedOn(dataflow, "Some description"); assertNotNull(componentVersion); assertEquals(component, componentVersion.getComponent()); assertEquals(2, componentVersion.getVersionNumber().intValue()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
@Override public final Version createComponentBasedOn(String componentName, String description, Dataflow dataflow) throws RegistryException { if (componentName == null) throw new RegistryException("Component name must not be null"); if (dataflow == null) throw new RegistryException("Dataflow must not be null"); checkComponentCache(); if (componentCache.containsKey(componentName)) throw new RegistryException("Component name already used"); Version version = internalCreateComponentBasedOn(componentName, description, dataflow); synchronized (componentCache) { Component c = version.getComponent(); componentCache.put(componentName, c); } return version; }
@Test public void testUploadWorkflow() throws Exception { URL dataflowUrl = getClass().getClassLoader().getResource( "beanshell_test.t2flow"); Dataflow dataflow = getDataflowFromUri(dataflowUrl.toString()); NewComponentRegistry registry = (NewComponentRegistry) getComponentRegistry(componentRegistryUrl); Version v = registry.createComponentFrom(null, "Test Workflow", "test description", dataflow, null, Policy.PRIVATE); assertEquals("test description", v.getDescription()); registry.deleteComponent((NewComponent) v.getComponent()); }
@Override protected String doInBackground() throws Exception { Component chosenComponent = componentChooserPanel .getChosenComponent(); if (chosenComponent != null) for (Version version : chosenComponent.getComponentVersionMap() .values()) { Integer versionNumber = version.getVersionNumber(); componentVersionMap.put(versionNumber, version); } return null; }
@Test public void testGetComponent() throws Exception { assertNotNull(componentVersion.getComponent()); }
public static Dataflow getDataflow(Version.ID id) throws RegistryException { synchronized (id) { if (!cache.containsKey(id)) { logger.info("Before Calculate component version"); Version componentVersion; try { componentVersion = calculateComponentVersion(id); } catch (Exception e) { throw new RegistryException(e.getMessage(), e); } logger.info("Calculated component version"); Dataflow dataflow = componentVersion.getDataflow(); dataflow.checkValidity(); cache.put(id, dataflow); } } return cache.get(id); }
protected void updateToolTipText() { Version chosenComponentVersion = getChosenComponentVersion(); if (chosenComponentVersion != null) componentVersionChoice.setToolTipText(chosenComponentVersion .getDescription()); else componentVersionChoice.setToolTipText(null); }
@Override protected final void populateComponentVersionMap() { for (Element version : componentRegistry.getResourceElements(urlString, "versions")) { String versionUri = version.getAttributeValue("uri"); Version componentVersion = new MyExperimentComponentVersion(componentRegistry, this, versionUri); versionMap.put(componentVersion.getVersionNumber(), componentVersion); } }
@Test public void testGetComponent() throws Exception { assertNotNull(componentVersion.getComponent()); }
public static Dataflow getDataflow(Version.ID id) throws RegistryException { synchronized (id) { if (!cache.containsKey(id)) { logger.info("Before Calculate component version"); Version componentVersion; try { componentVersion = calculateComponentVersion(id); } catch (Exception e) { throw new RegistryException(e.getMessage(), e); } logger.info("Calculated component version"); Dataflow dataflow = componentVersion.getDataflow(); dataflow.checkValidity(); cache.put(id, dataflow); } } return cache.get(id); }
@Test public void testGetDescription() throws Exception { assertNotNull(componentVersion.getDescription()); }