gtlab overview

12
Installing and Building GTLAB

Upload: marpierc

Post on 25-Jan-2015

676 views

Category:

Technology


0 download

DESCRIPTION

Description of the GTLAB JSF tag libraries.

TRANSCRIPT

Page 1: GTLAB Overview

Installing and Building GTLAB

Page 2: GTLAB Overview

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

Page 3: GTLAB Overview

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.

Page 4: GTLAB Overview

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

Page 5: GTLAB Overview

What’s in GTLAB?

Page 6: GTLAB Overview

Build GTLAB

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”

<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>

Page 7: GTLAB Overview

Run ExamplesFrom GTLAB, start tomcat with ./startup.sh.

From GTLAB, stop Tomcat with ./shutdown.sh

Point browser to http://localhost:8080/GTLAB

Start with MyProxy Example

Page 8: GTLAB Overview

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.

Page 9: GTLAB Overview

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.

Page 10: GTLAB Overview

Making a New TagRun 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.

Page 11: GTLAB Overview

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.

Page 12: GTLAB Overview

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.