Amalegeni-WS setupJava 7 / GoYou need to have Java on your system, as well as Ant. Since Amalegeni-WS is using the latest Jetty libraries (well, what was considered the latest in Aug 2013), you need Java 7 The jdk that was used to write these examples was jdk1.7.0_25. And of course: if you want to run the generated Go code, then you better have Go installed too! Setup AmalegeniSee the amalegeni ../download page. Getting the latest version is always the best advice. The version used for writing these examples was 1.1.4. Sample installation run :
Download the Amalegeni-WS tar-ballGrab this tarball: amalegeniws-0.9.tgz and unpack it somewhere on your system. Your ~/tmp directory would be a good location!
Configure your databaseCreate a user in your oracle database: connect with sql-plus as an administrator, and run these commands:
Change the database connection parameters of amalegeni-wsEdit the OracleBaseService java file, to define the hostname for your database server, and the database instance name.
Goto line 18, and swap 'YOUR_DB_SERVER' for the hostname of your db server (which may be localhost), and replace 'YOUR_DB_INSTANCE' with the Oracle instance name of your database.
Let's see if it compiles and runs!As stated earlier, you need Java 7, so ensure that it's installed and your PATH and CLASSPATH variables are pointing to the right JDK! Now enter 'ant run' (assuming you are still in the amalegeniws-0.9 subdir) :
No errors? Perfect! Your webserver is now up and running, ready to serve! (Keep it running, don't kill it yet) Let's see if we can talk to the dbFollowing commands can be executed on the command line or enter the URL's into a browser.
The country table has not been created yet, so it's normal to get the table-doesn-t-exist error. Interludium: in case you are wondering where to find the source code of what gets executed, it's defined in the file: src/amalegeniws/proc/CountrySetup-csae.mlg Let's move ahead now, and create the table, insert data, then check again.
That's better! The country table exists now, with 252 entries. By the way: thanks to Geonames for the data! Hint: if you leave out the method-name, you get a list of the methods in that package:
.. and if you leave out the package name, then you get a list of packages:
Alternative setupAs an alternative way to create and populate the table, you can also run the following ant target:
And in the end, when you are done experimenting and want to get rid of the table, run this (but don't do it now) :
Try goTry to run the generated go code:
DoneOkay, you've completed the setup: congrats! Now you can continue with creating your own service classes, see the examples in directory src/amalegeniws/proc/ |