I have created a node wizard to create KNIME plugins using Scala language. There is no update-site (or feature) yet, but if you want to test it, that is really appreciated.
You can grab them with SVN or git. It requires Scala IDE plugin for Scala 2.10.
In my opinion it is easier to program in Scala, with it's functional libraries, but I am not so sure about the templates with implicits (example), so feedback in that regard is really appreciated.
Thanks, gabor
PS: everything is type-safe, nothing is dynamically typed.
Thanks for sharing. Implementing algorithms in Scala is so much easier. I will try out your plugin and try to give you some feedback. Implicits are good, but I think you defined too much (especially for inherited classes). For details, I will open a pull request.
Do you have an idea for the view template? Should it contain reference to scala.react or scala.swing? (I doubt scala.swing is available for Java 7 yet.) Do you have preference? Or it is ok to be as is (Scala version of the Java template)?
3. Replace desired pieces in Scala (i.e. typically for me just Model where hte "work" happens - would still use Java / Swing for GUI, etc in Dialog).
Any chance this mixed setup would work? Would I have to manually add libs, etc to get the Scala code to work or would that just "come out in the wash" b/c the .jar would be compiled to bytecode....
I'm going to try anyhow probably but fun to ponder the thought experiment before I blow up my Knime Dev environment ;)
I have just committed some changes. I hope you do not mind switching to Scala IDE 4 and Scala 2.11.4 (I know, 2.11.5 is on its way, but it is not yet bundled to a Scala IDE).
I have added some project specific Scala compiler settings too. In case you have problems with them, feel free to raise an issue on github.
Cheers, gabor
PS.: Sorry, the distribution is still not user-friendly. :(
So I was able to add the Scala Nature to my Knime Dev environment (via Scala IDE plugin) and pretty easy to create a NodeModel using scala extending knime NodeModel:
class CloneNodeModel extends NodeModel(1,1)
And everything works great inside of Eclipse Debugger. When I build as a Feature/Update Site though and install in Knime I get the following erorrs:
java.lang.IllegalArgumentException: Can't load factory class for node: com.pg.util.clone.CloneNodeFactory
at org.knime.workbench.repository.RepositoryFactory.createNode(RepositoryFactory.java:132)
at org.knime.workbench.repository.RepositoryManager.readNodes(RepositoryManager.java:356)
at org.knime.workbench.repository.RepositoryManager.readRepository(RepositoryManager.java:167)
at org.knime.workbench.repository.RepositoryManager.getRoot(RepositoryManager.java:610)
at org.knime.workbench.repository.view.AbstractRepositoryView.readRepository(AbstractRepositoryView.java:220)
at org.knime.workbench.repository.view.AbstractRepositoryView$2.run(AbstractRepositoryView.java:201)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.Error: Unresolved compilation problems:
The type CloneNodeFactory must implement the inherited abstract method NodeFactory<CloneNodeModel>.createNodeView(int, CloneNodeModel)
CloneNodeModel cannot be resolved to a type
CloneNodeModel cannot be resolved to a type
CloneNodeModel cannot be resolved to a type
CloneNodeModel cannot be resolved to a type
CloneNodeModel cannot be resolved to a type
Since it works in one and not the other I'm guessing something to do with Classpath? I've tried adding scala-library.jar to plugins lib. Are oher libs needed too?
Hm... looked in the installed .jar file for the plugin and the scala file is still .scala so I'm guessing it isn't getting built by the Feature Project / Update Site Build :( All the Java files are .class so they are being converted but Eclipse is treating .scala like a resource (.txt, .img, etc) apparently. Not sure how to fix / change that - any thoughts?
Looks like I might have to build through Buckminister instead: https://www.assembla.com/wiki/show/scala-ide/Eclipse_Plugin_Development_using_the_Scala_IDE
I only have a workaround yet. Check the export wizard's Options | Use class files compiled in the workspace. I try to make things work with Buckminster. (I was hoping this might help, but I was tricked by the option I used before. Here is myattempt.)
I actually went the Buckminster route to but using this article: https://www.assembla.com/wiki/show/scala-ide/Eclipse_Plugin_Development_using_the_Scala_IDE
3. Instead of creating an Update Site Project create *another* Feature project and add your existing Features to this project (I have no idea why Buckminster wants a Multi-Feature projects instead of an Update site project but oh well...)
4. Select the Multi-Feature project (i.e. Update Site wanna-be) and click Buckminster... Invoke Actions ... site.p2