<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Tutorial</title><link>https://sourceforge.net/p/esciencecentral/wiki/Tutorial/</link><description>Recent changes to Tutorial</description><atom:link href="https://sourceforge.net/p/esciencecentral/wiki/Tutorial/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 09 May 2014 16:15:22 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/esciencecentral/wiki/Tutorial/feed" rel="self" type="application/rss+xml"/><item><title>Tutorial modified by Jacek</title><link>https://sourceforge.net/p/esciencecentral/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -21,7 +21,7 @@

 #### Creating a Java block ####

-To create your first e-SC Java block we can use maven archetype that generates an *empty* block with single input and output. To use the archetype generator issue command:
+To create your first e-SC Java block you can use a maven archetype that generates an *empty* block with single input and output. To use the archetype generator issue command:

 ~~~~~
 mvn archetype:generate \
@@ -35,6 +35,8 @@
 ~~~~~

 **Note:** on Windows to join multiple lines in cmd window use '^' instead of '\'.
+
+**Note:** if this command fails reporting "The desired archetype does not exist (com.connexience:workflow-block-java:3.1-SNAPSHOT)" you need to [build the archetypes project](Tutorial-Maven Archetypes).

 The command will create a directory `FirstOne' with the contents of the default, *empty* block. You may change directory to `FirstOne' and build the block with commands:

@@ -81,4 +83,3 @@

 Both files include some basic information, so please look inside to get a better understanding.

-
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacek</dc:creator><pubDate>Fri, 09 May 2014 16:15:22 -0000</pubDate><guid>https://sourceforge.net9feec8f3fa2e5592711603ae1cf07cfa2a93ae73</guid></item><item><title>Tutorial modified by Jacek</title><link>https://sourceforge.net/p/esciencecentral/wiki/Tutorial/</link><description>&lt;div class="markdown_content"&gt;&lt;h1&gt;Tutorial for e-Science Central&lt;/h1&gt;
&lt;p&gt;This tutorial will include basic information about how to use and program e-Science Central. Currently, it is work in progress, so please post a message to &lt;a class="" href="mailto:esciencecentral-users@lists.sourceforge.net"&gt;esciencecentral-users@lists.sourceforge.net&lt;/a&gt; if you can't find here the information you need or the information provided is incorrect/incomplete.&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#users-guide"&gt;Users Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#developers-guide"&gt;Developers Guide&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#developing-e-sc-blocks"&gt;Developing e-SC blocks&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#creating-a-java-block"&gt;Creating a Java block&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#customizing-a-java-block"&gt;Customizing a Java block&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="users-guide"&gt;Users Guide&lt;/h2&gt;
&lt;p&gt;to be continued...&lt;/p&gt;
&lt;h2 id="developers-guide"&gt;Developers Guide&lt;/h2&gt;
&lt;h3 id="developing-e-sc-blocks"&gt;Developing e-SC blocks&lt;/h3&gt;
&lt;p&gt;Currently, e-SC supports a number programming languages in which a block can be written. These include: Java, JavaScript, Octave, R and Gnuplot. The following sections show how to develop a simple block in each of the supported languages.&lt;/p&gt;
&lt;p&gt;The system gives two options how blocks can be created: using the CODE web tool available through the web UI and using your favourite IDE and maven to upload blocks to a selected instance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; for Java blocks the CODE web tool is not available, so the only option is to develop a block on your desktop and then use maven to compile and upload it.&lt;/p&gt;
&lt;h4 id="creating-a-java-block"&gt;Creating a Java block&lt;/h4&gt;
&lt;p&gt;To create your first e-SC Java block we can use maven archetype that generates an &lt;em&gt;empty&lt;/em&gt; block with single input and output. To use the archetype generator issue command:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;mvn&lt;/span&gt; &lt;span class="n"&gt;archetype&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;generate&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DarchetypeGroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connexience&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DarchetypeArtifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;workflow&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DarchetypeVersion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;3.1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;SNAPSHOT&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DgroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;myblocks&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DartifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;FirstOne&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Dversion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; \
    &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DinteractiveMode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; on Windows to join multiple lines in cmd window use '^' instead of '\'.&lt;/p&gt;
&lt;p&gt;The command will create a directory &lt;code&gt;FirstOne' with the contents of the default, *empty* block. You may change directory to&lt;/code&gt;FirstOne' and build the block with commands:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;FirstOne&lt;/span&gt;
&lt;span class="n"&gt;mvn&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If your configuration is correct, you should be able to have block FirstOne uploaded to your instance under category 'My Services'. Try creating a new workflow and add your FirstOne block to the designer pane.&lt;/p&gt;
&lt;h4 id="customizing-a-java-block"&gt;Customizing a Java block&lt;/h4&gt;
&lt;p&gt;The maven archetype template generates everything which is needed to build a simple block. The directory structure of the FirstOne block generated in the previous section should look like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;FirstOne&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
   &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
      &lt;span class="n"&gt;main&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
        &lt;span class="n"&gt;assembly&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
            &lt;span class="n"&gt;assembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;
         &lt;span class="n"&gt;java&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
            &lt;span class="n"&gt;MyService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;
         &lt;span class="n"&gt;lib&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
         &lt;span class="n"&gt;resources&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
            &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
               &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;
            &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;
            &lt;span class="n"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jpg&lt;/span&gt;
            &lt;span class="n"&gt;library&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;
            &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;
      &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
         &lt;span class="n"&gt;java&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
   &lt;span class="n"&gt;pom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; if you decided to build the block the directory structure shown above will include also the `target' directory with the compiled and bundled block code.&lt;/p&gt;
&lt;p&gt;Depending on the complexity of your block, to customize it you may need to change only a few of the generated files or all of them. However, most often you will work only with two files: &lt;code&gt;src/main/resources/service.xml' and&lt;/code&gt;src/main/java/MyService.java'.&lt;/p&gt;
&lt;p&gt;File `service.xml' defines the interface of the block as seen by both the block user and block developer. Among other things in defines block properties, input and output ports and entry point for the Java class that implements block's function.&lt;/p&gt;
&lt;p&gt;File `MyService.java' implements the actual functionality that the block is supposed to provide. In our FirstOne example the block just copies input data to the output port depending on the value of the "Copy Input" property.&lt;/p&gt;
&lt;p&gt;Both files include some basic information, so please look inside to get a better understanding.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacek</dc:creator><pubDate>Thu, 08 May 2014 15:32:46 -0000</pubDate><guid>https://sourceforge.net133743c1f4df548e7bc9fe59e20d4d9b1cd227d0</guid></item></channel></rss>