120 likes | 227 Views
Installing and Building GTLAB. GTLAB and OGCE. OGCE contains multiple sub-projects Portlet-based Grid portal (with Gridsphere and Tomcat). Workflow suite (services and add-ins to the portal) Information Web services Gadget container JavaScript libraries GTLAB
E N D
GTLAB and OGCE • OGCE contains multiple sub-projects • Portlet-based Grid portal (with Gridsphere and Tomcat). • Workflow suite (services and add-ins to the portal) • Information Web services • Gadget container • JavaScript libraries • GTLAB • These are packaged with Maven and include everything you need except Java and (for some services) MySQL. • We try to make things installable with minimal fuss. • Edit one config file (pom.xml) • Run one command (mvn clean install) • You may need to futz a little with MySQL
Getting GTLAB • See http://www.collab-ogce.org/ogce/index.php/GTLAB • You can use your favorite SVN client to check out. • svn co https://ogce.svn.sourceforge.net/svnroot/ogce/GTLAB (latest) • svn co https://ogce.svn.sourceforge.net/svnroot/ogce/tags/GTLAB-release-SC08-1.1 (tagged) • The tagged represents a stable preview release. The latest is whatever was checked in last. • “Latest” will also give you easy access to any updates • “svn update” • Best option if you want to actively develop and get fixes right away.
No SVN? Get the TAR • SourceForge’s SVN/CVS viewer now provides a “Download GNU Tar” option. • http://ogce.svn.sourceforge.net/viewvc/ogce/GTLAB/ for latest. • http://ogce.svn.sourceforge.net/viewvc/ogce/tags/GTLAB-release-SC08-1.1/ for tag
Build GTLAB <properties> <portal.server.ip> 156.56.104.143 </portal.server.ip> <host.base.url> http://${portal.server.ip}:8080/ </host.base.url> <project.home> ${env.HOME}/GTLAB </project.home> <tomcat.version> apache-tomcat-5.5.27 </tomcat.version> <catalina.home> ${project.home}/portal_deploy/${tomcat.version}/ </catalina.home> <dot.globus.home> ${env.HOME}/.globus/ </dot.globus.home> </properties> • Unpack or checkout code • Cd GTLAB • All commands are executed from here. • Edit properties at the top of pom.xml. • Change IP • Change project.home if you unpack someplace besides $HOME. • Run “mvn clean install”
Run Examples • From GTLAB, start tomcat with ./startup.sh. • From GTLAB, stop Tomcat with ./shutdown.sh • Point browser to http://localhost:8080/GTLAB • Start with MyProxy Example
Next Steps • Play with examples. • These are really bare bones. Make something interesting. • Make a Google gadget. • Mix and match tags in a pipeline to make a new application. • Use the dependency tag. • Note you can mix and match JSF and JSP if you are not familiar with JSF. • Try making a new tag. • Explained next.
Making a New JSF Page from Tags • I recommend starting from the examples. • jsf_standalone/src/main/webapp/examples • “Build” the examples with • mvn –o clean install –f jsf_standalone/pom.xml • The “-o” option is used to build offline. Will also avoid unnecessary Maven repository updates. • The “-f” specifies only build this specific module. • I recommend not futzing with the deployed versions under portal_deploy. • A computer is a state machine. State must be reproducible.
Making a New Tag • Run the following command from GTLAB: • mvn clean process-resources -Dtag.name=test -Dprojectname=Test -f templateTag/pom.xml • Add -Ddest.dir=/tmp for a dry run. • Replace “test” with the name of your tag. • Replace “Test” with the name for your Bean. • This will make 4 files • TestBean.java, TestTag.java, TestBeanFactory.java, UITest.java • Edits also 3 config files • gtlab-factory.xml, managed-beans.xml, components.xml • This will compile but to implement something useful, you will need to edit the highlighted files.
Implementing a Tag • The place to start is TestBean.java (or whatever you used for –Dprojectname=…). • This includes several inherited methods that can be implemented. • Most important is submit(). Use the try/catch block. This is where the action is. • If you need to hook tags into chains, implement getOutput() and setInput(). • Also take a look at the other beans.
What Can You Implement as a Tag? • What can you do in your bean? Anything server-side Java can do. • Some suggestions: • Implement a tag client to a remote Web service. Amazon has some interesting ones…. • Implement an RSS/Atom feed client to Twitter, your blog, Facebook, etc. • Combine the feeds as a mash-up. • Connect to a database with JDBC. • Implement a JMS publisher or subscriber. • Use Google Java APIs to interact with Blogger, Calendar, and YouTube. • Try interacting with Facebook.