Skip to content
Snippets Groups Projects
Commit 06d07961 authored by felmer's avatar felmer
Browse files

update openBIS KNIME nodes to KNIME 2.7.2

SVN: 28599
parent edbebe24
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,6 @@
<classpathentry kind="lib" path="/libraries/jmock/hamcrest/hamcrest-library.jar"/>
<classpathentry kind="lib" path="/libraries/jmock/jmock.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="/libraries/knime/org.knime.core.data.urltype.jar"/>
<classpathentry kind="lib" path="/libraries/openbis-apis/dss/dss_client.jar"/>
<classpathentry kind="lib" path="/libraries/commons-logging/commons-logging.jar" sourcepath="/libraries/commons-logging/src.zip"/>
<classpathentry kind="lib" path="/libraries/commons-lang/commons-lang.jar" sourcepath="/libraries/commons-lang/src.zip"/>
......@@ -22,5 +21,6 @@
<classpathentry kind="lib" path="/libraries/knime/eclipse-equinox-common.jar"/>
<classpathentry kind="lib" path="/libraries/knime/eclipse-osgi.jar"/>
<classpathentry kind="lib" path="/libraries/commons-io/commons-io.jar" sourcepath="/libraries/commons-io/src.zip"/>
<classpathentry kind="lib" path="/libraries/knime/knime-core-data-uritype.jar" sourcepath="/libraries/knime/org.knime.core.data.uritype.source_2.7.0.0036089.jar"/>
<classpathentry kind="output" path="targets/classes"/>
</classpath>
......@@ -2,7 +2,7 @@
<import file="../../build_resources/ant/build-common.xml" />
<project-classpath name="ecp" classes="${classes}" />
<property name="mainfolder" value="openbis_knime"/>
<property name="version" value="12.04.0"/>
<property name="version" value="13.03.0"/>
<property name="jar.file.name" value="openbis-knime.jar"/>
<property name="jar.file" value="${dist}/${jar.file.name}"/>
<property name="original.dist" value="../${ant.project.name}/dist" />
......
......@@ -2,14 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: openBIS nodes
Bundle-SymbolicName: ch.systemsx.cisd.openbis.knime; singleton:=true
Bundle-Version: 10.05.0
Bundle-Version: 13.03.0
Bundle-ClassPath: openbis-knime.jar,lib/cisd-base.jar,lib/commons-codec.jar,lib/commons-lang.jar,
lib/commons-httpclient.jar,lib/commons-logging.jar,lib/log4j.jar,lib/openbis-query-api.jar,
lib/dss_client.jar,lib/spring.jar,lib/stream-supporting-httpinvoker.jar
Bundle-Vendor: CISD
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,org.knime.workbench.core,
org.knime.workbench.repository,org.knime.base
org.knime.workbench.repository,org.knime.base,org.knime.core.data.uritype
Eclipse-RegisterBuddy: org.knime.base
Export-Package: ch.systemsx.cisd.openbis.knime
Bundle-ActivationPolicy: lazy
......@@ -24,10 +24,9 @@ import java.util.Arrays;
import javax.activation.MimetypesFileTypeMap;
import org.knime.core.data.url.MIMEType;
import org.knime.core.data.url.URIContent;
import org.knime.core.data.url.port.MIMEURIPortObject;
import org.knime.core.data.url.port.MIMEURIPortObjectSpec;
import org.knime.core.data.uri.URIContent;
import org.knime.core.data.uri.URIPortObject;
import org.knime.core.data.uri.URIPortObjectSpec;
import org.knime.core.node.ExecutionContext;
import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.NodeSettingsRO;
......@@ -67,7 +66,7 @@ public class DataSetFileImportNodeModel extends AbstractOpenBisNodeModel
public DataSetFileImportNodeModel(IDataSetProvider dataSetProvider)
{
super(new PortType[] {}, new PortType[]
{ new PortType(MIMEURIPortObject.class) });
{ new PortType(URIPortObject.class) });
this.dataSetProvider = dataSetProvider;
}
......@@ -93,9 +92,9 @@ public class DataSetFileImportNodeModel extends AbstractOpenBisNodeModel
@Override
protected PortObjectSpec[] configure(PortObjectSpec[] inSpecs) throws InvalidSettingsException
{
MIMEType type = createType();
String type = createType();
return new PortObjectSpec[]
{ new MIMEURIPortObjectSpec(type) };
{ new URIPortObjectSpec(type) };
}
@Override
......@@ -106,10 +105,10 @@ public class DataSetFileImportNodeModel extends AbstractOpenBisNodeModel
{
downloadTo(file);
}
MIMEType type = createType();
String type = createType();
logger.info("Content MIME type: " + type);
return new PortObject[]
{ new MIMEURIPortObject(Arrays.asList(new URIContent(file.toURI())), type) };
{ new URIPortObject(new URIPortObjectSpec(type), Arrays.asList(new URIContent(file.toURI(), type))) };
}
private void downloadTo(File file) throws Exception
......@@ -141,10 +140,10 @@ public class DataSetFileImportNodeModel extends AbstractOpenBisNodeModel
}
}
private MIMEType createType()
private String createType()
{
String contentType = MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(filePath);
return MIMEType.getType(contentType);
return contentType;
}
}
......@@ -24,9 +24,9 @@ import java.util.Random;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.knime.core.data.url.URIContent;
import org.knime.core.data.url.port.MIMEURIPortObject;
import org.knime.core.data.url.port.MIMEURIPortObjectSpec;
import org.knime.core.data.uri.URIContent;
import org.knime.core.data.uri.URIPortObject;
import org.knime.core.data.uri.URIPortObjectSpec;
import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.NodeSettings;
import org.knime.core.node.NodeSettingsRO;
......@@ -147,8 +147,8 @@ public class DataSetFileImportNodeModelTest extends AbstractFileSystemTestCase
PortObjectSpec[] portSpecs = model.configure(null);
assertEquals("[MIMEType ext:text/plain]", ((MIMEURIPortObjectSpec) portSpecs[0])
.getMIMEType().toString());
assertEquals("[text/plain]", ((URIPortObjectSpec) portSpecs[0])
.getFileExtensions().toString());
assertEquals(1, portSpecs.length);
context.assertIsSatisfied();
}
......@@ -165,8 +165,8 @@ public class DataSetFileImportNodeModelTest extends AbstractFileSystemTestCase
PortObject[] portObjects = model.execute(null, null);
MIMEURIPortObject uriPortObject = (MIMEURIPortObject) portObjects[0];
assertEquals("[MIMEType ext:text/plain]", uriPortObject.getSpec().getMIMEType().toString());
URIPortObject uriPortObject = (URIPortObject) portObjects[0];
assertEquals("[text/plain]", uriPortObject.getSpec().getFileExtensions().toString());
List<URIContent> uriContents = uriPortObject.getURIContents();
assertEquals(file.toURI().toString(), uriContents.get(0).getURI().toString());
assertEquals(1, uriContents.size());
......@@ -186,8 +186,8 @@ public class DataSetFileImportNodeModelTest extends AbstractFileSystemTestCase
PortObject[] portObjects = model.execute(null, null);
assertEquals("hello world", FileUtilities.loadToString(file).trim());
MIMEURIPortObject uriPortObject = (MIMEURIPortObject) portObjects[0];
assertEquals("[MIMEType ext:text/plain]", uriPortObject.getSpec().getMIMEType().toString());
URIPortObject uriPortObject = (URIPortObject) portObjects[0];
assertEquals("[text/plain]", uriPortObject.getSpec().getFileExtensions().toString());
List<URIContent> uriContents = uriPortObject.getURIContents();
assertEquals(file.toURI().toString(), uriContents.get(0).getURI().toString());
assertEquals(1, uriContents.size());
......@@ -216,8 +216,8 @@ public class DataSetFileImportNodeModelTest extends AbstractFileSystemTestCase
PortObject[] portObjects = model.execute(null, null);
assertEquals(exampleContent, FileUtilities.loadToString(file).trim());
MIMEURIPortObject uriPortObject = (MIMEURIPortObject) portObjects[0];
assertEquals("[MIMEType ext:text/plain]", uriPortObject.getSpec().getMIMEType().toString());
URIPortObject uriPortObject = (URIPortObject) portObjects[0];
assertEquals("[text/plain]", uriPortObject.getSpec().getFileExtensions().toString());
List<URIContent> uriContents = uriPortObject.getURIContents();
assertEquals(file.toURI().toString(), uriContents.get(0).getURI().toString());
assertEquals(1, uriContents.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment