<?xml version="1.0" encoding="UTF-8"?>
<page>
  <created-at type="datetime">2009-05-30T15:05:53Z</created-at>
  <description></description>
  <id type="integer">1985</id>
  <name>GettingStartedGuide</name>
  <number type="integer">19</number>
  <person-id type="integer">3555</person-id>
  <text>== How to write your first app in Java using ZCL?==

* Download JDK 5 or 6 from [http://java.sun.com java]
* Download the [http://kenai.com/projects/zcl/downloads/download/zcl4j.zip zcl4j.zip] library and unzip into your home directory
**Structure of zclfx.zip (See [http://kenai.com/projects/zcl/pages/Dependencies Dependencies] page for information on the contents of all jars)
 +zcl4j / license.txt
       / readme.txt
       / javadoc
       / lib / zcl4j.jar (Contains zcl4j classes and all the dependent such as JSON.org.jar, zclcore.jar)
               zcl4j_min.jar (Contains only zcl4j classes)
               zclcore.jar (core classes such as OAuth signature generation, http client,...)
               JSON.org.jar (used to convert result into JSON object if necessary)
* Using your favorite editor create a java file GoogleTraslator.java with the following:

 /* 
  * Access Google translator service in Zembly.net using ZCL
  *
  */
 
 import com.zembly.gateway.client.Zembly;
 
 public class GoogleTranslator {
 
     public static void main(String[] args) {
         try {
             String result = Zembly.getInstance().callService(&quot;google.language.translate&quot;, new String[][]{{&quot;langpair&quot;, &quot;en|it&quot;}, {&quot;q&quot;, &quot;Hello World=&quot;}, {&quot;format&quot;, null}});
            System.out.println(&quot;result: &quot; + result);
        } catch (Exception ex) {
            ...
        }
    }
 }

* Compile GoogleTranslator.java

javac -classpath &lt;path of zcl4j&gt;/lib/zcl4j.jar GoogleTranslator.java

* Run GoogleTranslator

java -classpath &lt;path of zcl4j&gt;/lib/zcl4j.jar GoogleTranslator

* Read the wiki on [http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly calling data services in zembly]
for getting code snippets for other data services in Zembly.
* Read [http://kenai.com/projects/zcl/pages/ProgrammingGuideJava ZCL for Java programming guide for  Java] for types, exception handling,...
* See [http://kenai.com/svn/zcl~svn/trunk/www/docs/apidocs/zcl4j/0_5/index.html javadocs]

== How to write your first app in JavaFx using ZCL?==

* Download JDK 6 from [http://java.sun.com java]
* Download JavaFx 1.2 from [http://javafx.com/ JavaFx SDK1.2]
* Download the [http://kenai.com/projects/zcl/downloads/download/zclfx.zip zclfx.zip] library and unzip into your home directory
**Structure of zclfx.zip (See [http://kenai.com/projects/zcl/pages/Dependencies Dependencies] page for information on the contents of all jars)
 +zclfx / license.txt
       / readme.txt
       / lib / zclfx.jar (Contains zclfx classes and all the dependent such as JSON.org.jar, zclcore.jar)
               zclfx.html (JavaFx artifacts)
               zclfx.jnlp (JavaFx artifacts)
               zclfx_browser.jnlp (JavaFx artifacts)
...
* Sign-up for zembly wag key/secret pair @ http://zembly.com (select 'Your Keys' tab and click 'Regenerate key' button next to 'Zembly Web API Gateway'), and use this key/secret pair inside zcl.properties
in default package. The key/secret properties are as show below

 # Use following parameters to access data services using your key chain in Zembly.com
 consumerKey=
 consumerSecret=

* Using your favourite editor create a java file GoogleTraslator.fx with the following


import com.zembly.gateway.client.fx.Zembly;
import com.zembly.gateway.client.fx.Parameter;
 
   try {
            //ZemblyAsync class uses javafx.async api's to do asynchronous communication with zembly.net.
            var request = ZemblyAsync {
                serviceName: &quot;web.google.language.translate&quot;,
                parameters: [
                    Parameter{name: &quot;langpair&quot;, value: &quot;en|it&quot;}, 
                    Parameter{name: &quot;q&quot;, value: &quot;Hello!&quot;}
                ],
                onInput : function(input: java.io.InputStream) {//parse input using PullParser
                    input.close();
                }
            }
            request.start();
        } catch (e:Exception) {
            println(&quot;WARNING: {e}&quot;);
        }

* Compile GoogleTranslator.fx

javafxc -classpath &lt;path of zcl4j&gt;/lib/zclfx.jar GoogleTranslator.fx zcl.properties

* Run GoogleTranslator

javafx -classpath &lt;path of zcl4j&gt;/lib/zcl4j.jar;. GoogleTranslator

* Read the wiki on [http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly calling data services in zembly]
for getting code snippets for other data services in Zembly.
* Read [http://kenai.com/projects/zcl/pages/ProgrammingGuideJavaFx ZCL for Java programming guide for  JavaFx] for types, exception handling,...

== How to write your first app in PHP using ZCL?==

* Download one of the LAMP stack such as XAMPP from [http://xxxx]
* Download the [http://kenai.com/projects/zcl/downloads/download/zclphp.zip zclphp.zip] library and unzip into your home directory
**Structure of zclphp.zip  
 zclphp / license.txt
            / readme.txt    
            / zclphp /  (Contains all the zclphp source files)
            / samples

* Add the location of your zclphp library to your php.ini file. (You may need to restart your Apache server for this to take effect.)
* Using your favorite editor such as NetBeans to create a PHP project and in the index.php file, add the following:

 &lt;?php
      require_once('zclphp/zembly.php');
      $config = new Configuration();
      // Get your zembly keys from http://zembly.com (select 'Your Keys' tab and click 'Regenerate key' button next to 'Zembly Web API Gateway')
      //$config-&gt;setConsumerKey('your_key');
      //$config-&gt;setConsumerSecret('your_secret');
      try {
           echo Zembly::getInstance($config)-&gt;callService('web.google.language.translate',
                                                                                         array('langpair' =&gt; 'en|it', 'q' =&gt; 'Hello World!'));
      } catch (Exception $ex) {
           echo $ex-&gt;getMessage();
      }
 ?&gt;

* Running Your PHP Application
If you are using NetBeans, simply right click on the project and select Run.

* Read the wiki on [http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly calling data services in zembly]
for getting code snippets for other data services in Zembly.

== How to use Netbeans 6.7 to access Zembly data services==

A NetBeans plugin is available from the  NetBeans 6.7 IDE Development Update Center (search for Zembly within the Update Center).  It uses the latest version of the ZCL client libraries.

The link to the NetBeans 6.7 IDE Development Update Center is:

http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz 

====Steps====
Perform the following steps to access Zembly data services in the NetBeans 6.7 IDE:

# Install NB 6.7 from http://download.netbeans.org/netbeans/6.7/rc/
# Open NB 6.7, go to Tools-&gt;Plugins-&gt;Settings.
# Click &quot;Add&quot;, then enter name and URL (see above url).
# Click on the &quot;Available Plugins&quot; tab, search for Zembly. 
# Install the plugins and restart the IDE.
#.Create a new Java project.
# Go to Services tab, right click on &quot;Zembly Web API Gateway&quot;, do &quot;Add Search&quot;, enter &quot;google.language&quot; and hit &quot;OK&quot;
# Expand &quot;google.language&quot; and drag-and-drop &quot;google.language.translate&quot; into file Main.java.
# Run the new Java Application.

[[image: wag.png]]</text>
  <text-as-html>&lt;h2&gt;&lt;a name='How_to_write_your_first_app_in_Java_using_ZCL?'&gt;&lt;/a&gt; How to write your first app in Java using ZCL?&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt; Download JDK 5 or 6 from &lt;a class='external' href=&quot;http://java.sun.com&quot;&gt;java&lt;/a&gt;&lt;/li&gt;&lt;li&gt; Download the &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/downloads/download/zcl4j.zip&quot;&gt;zcl4j.zip&lt;/a&gt; library and unzip into your home directory
&lt;ul&gt;&lt;li&gt;Structure of zclfx.zip (See &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/pages/Dependencies&quot;&gt;Dependencies&lt;/a&gt; page for information on the contents of all jars)
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt; +zcl4j / license.txt
       / readme.txt
       / javadoc
       / lib / zcl4j.jar (Contains zcl4j classes and all the dependent such as JSON.org.jar, zclcore.jar)
               zcl4j_min.jar (Contains only zcl4j classes)
               zclcore.jar (core classes such as OAuth signature generation, http client,...)
               JSON.org.jar (used to convert result into JSON object if necessary)
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Using your favorite editor create a java file GoogleTraslator.java with the following:
&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt; /* 
  * Access Google translator service in Zembly.net using ZCL
  *
  */
 
 import com.zembly.gateway.client.Zembly;
 
 public class GoogleTranslator {
 
     public static void main(String[] args) {
         try {
             String result = Zembly.getInstance().callService(&amp;quot;google.language.translate&amp;quot;, new String[][]);
            System.out.println(&amp;quot;result: &amp;quot; + result);
        } catch (Exception ex) {
            ...
        }
    }
 }
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Compile GoogleTranslator.java
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
javac -classpath &amp;lt;path of zcl4j&amp;gt;/lib/zcl4j.jar GoogleTranslator.java

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Run GoogleTranslator
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
java -classpath &amp;lt;path of zcl4j&amp;gt;/lib/zcl4j.jar GoogleTranslator

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Read the wiki on &lt;a class='external' href=&quot;http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly&quot;&gt;calling data services in zembly&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;for getting code snippets for other data services in Zembly.
&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Read &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/pages/ProgrammingGuideJava&quot;&gt;ZCL for Java programming guide for  Java&lt;/a&gt; for types, exception handling,...
&lt;/li&gt;&lt;li&gt; See &lt;a class='external' href=&quot;http://kenai.com/svn/zcl~svn/trunk/www/docs/apidocs/zcl4j/0_5/index.html&quot;&gt;javadocs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;a name='How_to_write_your_first_app_in_JavaFx_using_ZCL?'&gt;&lt;/a&gt; How to write your first app in JavaFx using ZCL?&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt; Download JDK 6 from &lt;a class='external' href=&quot;http://java.sun.com&quot;&gt;java&lt;/a&gt;&lt;/li&gt;&lt;li&gt; Download JavaFx 1.2 from &lt;a class='external' href=&quot;http://javafx.com/&quot;&gt;JavaFx SDK1.2&lt;/a&gt;&lt;/li&gt;&lt;li&gt; Download the &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/downloads/download/zclfx.zip&quot;&gt;zclfx.zip&lt;/a&gt; library and unzip into your home directory
&lt;ul&gt;&lt;li&gt;Structure of zclfx.zip (See &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/pages/Dependencies&quot;&gt;Dependencies&lt;/a&gt; page for information on the contents of all jars)
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt; +zclfx / license.txt
       / readme.txt
       / lib / zclfx.jar (Contains zclfx classes and all the dependent such as JSON.org.jar, zclcore.jar)
               zclfx.html (JavaFx artifacts)
               zclfx.jnlp (JavaFx artifacts)
               zclfx_browser.jnlp (JavaFx artifacts)
&lt;/pre&gt;&lt;p&gt;...
&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Sign-up for zembly wag key/secret pair @ &lt;a class='external' href=&quot;http://zembly.com&quot;&gt;http://zembly.com&lt;/a&gt; (select 'Your Keys' tab and click 'Regenerate key' button next to 'Zembly Web API Gateway'), and use this key/secret pair inside zcl.properties
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;in default package. The key/secret properties are as show below

&lt;/p&gt;&lt;pre&gt; # Use following parameters to access data services using your key chain in Zembly.com
 consumerKey=
 consumerSecret=
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Using your favourite editor create a java file GoogleTraslator.fx with the following
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;

&lt;/p&gt;&lt;p&gt;import com.zembly.gateway.client.fx.Zembly;
import com.zembly.gateway.client.fx.Parameter;
&lt;/p&gt;&lt;pre&gt; 
   try {
            //ZemblyAsync class uses javafx.async api's to do asynchronous communication with zembly.net.
            var request = ZemblyAsync {
                serviceName: &amp;quot;web.google.language.translate&amp;quot;,
                parameters: [
                    Parameter{name: &amp;quot;langpair&amp;quot;, value: &amp;quot;en|it&amp;quot;}, 
                    Parameter{name: &amp;quot;q&amp;quot;, value: &amp;quot;Hello!&amp;quot;}
                ],
                onInput : function(input: java.io.InputStream) {//parse input using PullParser
                    input.close();
                }
            }
            request.start();
        } catch (e:Exception) {
            println(&amp;quot;WARNING: {e}&amp;quot;);
        }
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Compile GoogleTranslator.fx
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
javafxc -classpath &amp;lt;path of zcl4j&amp;gt;/lib/zclfx.jar GoogleTranslator.fx zcl.properties

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Run GoogleTranslator
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
javafx -classpath &amp;lt;path of zcl4j&amp;gt;/lib/zcl4j.jar;. GoogleTranslator

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Read the wiki on &lt;a class='external' href=&quot;http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly&quot;&gt;calling data services in zembly&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;for getting code snippets for other data services in Zembly.
&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Read &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/pages/ProgrammingGuideJavaFx&quot;&gt;ZCL for Java programming guide for  JavaFx&lt;/a&gt; for types, exception handling,...
&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;a name='How_to_write_your_first_app_in_PHP_using_ZCL?'&gt;&lt;/a&gt; How to write your first app in PHP using ZCL?&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt; Download one of the LAMP stack such as XAMPP from &lt;a class='external' href=&quot;http://xxxx&quot;&gt;http://xxxx&lt;/a&gt;&lt;/li&gt;&lt;li&gt; Download the &lt;a class='external' href=&quot;http://kenai.com/projects/zcl/downloads/download/zclphp.zip&quot;&gt;zclphp.zip&lt;/a&gt; library and unzip into your home directory
&lt;ul&gt;&lt;li&gt;Structure of zclphp.zip  
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt; zclphp / license.txt
            / readme.txt    
            / zclphp /  (Contains all the zclphp source files)
            / samples
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Add the location of your zclphp library to your php.ini file. (You may need to restart your Apache server for this to take effect.)
&lt;/li&gt;&lt;li&gt; Using your favorite editor such as NetBeans to create a PHP project and in the index.php file, add the following:
&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt; &amp;lt;?php
      require_once('zclphp/zembly.php');
      $config = new Configuration();
      // Get your zembly keys from &lt;a class='external' href=&quot;http://zembly.com&quot;&gt;http://zembly.com&lt;/a&gt; (select 'Your Keys' tab and click 'Regenerate key' button next to 'Zembly Web API Gateway')
      //$config-&amp;gt;setConsumerKey('your_key');
      //$config-&amp;gt;setConsumerSecret('your_secret');
      try {
           echo Zembly::getInstance($config)-&amp;gt;callService('web.google.language.translate',
                                                                                         array('langpair' =&amp;gt; 'en|it', 'q' =&amp;gt; 'Hello World!'));
      } catch (Exception $ex) {
           echo $ex-&amp;gt;getMessage();
      }
 ?&amp;gt;
&lt;/pre&gt;&lt;ul&gt;&lt;li&gt; Running Your PHP Application
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If you are using NetBeans, simply right click on the project and select Run.

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Read the wiki on &lt;a class='external' href=&quot;http://wiki.zembly.com/wiki/How_to_Call_Data_Service_from_Outside_zembly&quot;&gt;calling data services in zembly&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;for getting code snippets for other data services in Zembly.

&lt;/p&gt;&lt;h2&gt;&lt;a name='How_to_use_Netbeans_6.7_to_access_Zembly_data_services'&gt;&lt;/a&gt; How to use Netbeans 6.7 to access Zembly data services&lt;/h2&gt;
&lt;p&gt;
A NetBeans plugin is available from the  NetBeans 6.7 IDE Development Update Center (search for Zembly within the Update Center).  It uses the latest version of the ZCL client libraries.

&lt;/p&gt;&lt;p&gt;The link to the NetBeans 6.7 IDE Development Update Center is:

&lt;/p&gt;&lt;p&gt;&lt;a class='external' href=&quot;http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz&quot;&gt;http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz&lt;/a&gt; 

&lt;/p&gt;&lt;h4&gt;&lt;a name='Steps'&gt;&lt;/a&gt;Steps&lt;/h4&gt;
&lt;p&gt;Perform the following steps to access Zembly data services in the NetBeans 6.7 IDE:

&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Install NB 6.7 from &lt;a class='external' href=&quot;http://download.netbeans.org/netbeans/6.7/rc/&quot;&gt;http://download.netbeans.org/netbeans/6.7/rc/&lt;/a&gt;&lt;/li&gt;&lt;li&gt; Open NB 6.7, go to Tools-&amp;gt;Plugins-&amp;gt;Settings.
&lt;/li&gt;&lt;li&gt; Click &amp;quot;Add&amp;quot;, then enter name and URL (see above url).
&lt;/li&gt;&lt;li&gt; Click on the &amp;quot;Available Plugins&amp;quot; tab, search for Zembly. 
&lt;/li&gt;&lt;li&gt; Install the plugins and restart the IDE.
&lt;/li&gt;&lt;li&gt;.Create a new Java project.
&lt;/li&gt;&lt;li&gt; Go to Services tab, right click on &amp;quot;Zembly Web API Gateway&amp;quot;, do &amp;quot;Add Search&amp;quot;, enter &amp;quot;google.language&amp;quot; and hit &amp;quot;OK&amp;quot;
&lt;/li&gt;&lt;li&gt; Expand &amp;quot;google.language&amp;quot; and drag-and-drop &amp;quot;google.language.translate&amp;quot; into file Main.java.
&lt;/li&gt;&lt;li&gt; Run the new Java Application.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;?link_for_image wag.png?&gt;&lt;/p&gt;</text-as-html>
  <updated-at type="datetime">2009-08-04T17:20:13Z</updated-at>
  <wiki-id type="integer">7146</wiki-id>
</page>
