GTLAB Overview

1,031 views

Published on

Description of the GTLAB JSF tag libraries.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,031
On SlideShare
0
From Embeds
0
Number of Embeds
51
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

GTLAB Overview

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

×