Tuesday May 26, 2009

JavaOne Hidden Treasure

JaveOne is 1 week away! Hurray!  What are you going to be doing at JavaOne?  Reply with what you're looking forward to seeing at JavaOne, I'm curious. :)

One cool thing during JavaOne that I suspect many people didn't know existed, are the Hands-on Labs.  Everyone knows about the traditional sessions where you hear a good (usually) speaker talk about an interesting topic (or where you can relax and check email in peace).  However, the Hands-on Labs are the hidden treasure of JavaOne.

The Hands-on Labs take a topic and let you learn about them by doing.  Topics range from several JavaFX labs (REST, WebServices, Mobile, and more), to cloud computing, to SIP applications, or the lab that I co-authored: Building OSGi Plugins for the GlassFish v3 Administration Console.   Each lab is either presented in a Bring Your Own Laptop (BYOL) format, or has machines already configured with the lab software ready to go at JavaOne.  Regardless of format, they provide step-by-step instructions on how to complete the lab.

Hands-on Lab Instructions

The building OSGi plugins lab that I helped write shows how the GlassFish Admin Console web application was written to take advantage of OSGi bundles.  The lab walks you through the process of creating several OSGi plugin bundles which add new features to the web application.  You have a chance to create a twitter plugin (thanks to Ryan Lubke), make a Jeopardy game, add a tagging capability to the console, and more.  And best of all, the concepts in the lab can be applied to your own GlassFish web applications.  Here's a screenshot of what the tagging plugin looks like after you're done (also with a "notes" plugin installed):

GlassFish v3 Admin Console with Tags and Notes Plugin

So... if you didn't know about the JavaOne Hands-on labs, or you haven't checked them out in the past.  Give them a shot this year -- you won't be disappointed.  Remember to Bring Your Own Laptop to the ones listed as BYOL when you search Schedule Builder (the Building OSGi plugins lab will be in a machine-provided room on Wed at 1:35PM).

Whether you choose a Hands-on Lab or not, I hope everyone attending JavaOne has a great time.  Don't forget to reply and post what you're looking forward to seeing at JavaOne this year.  Also, if you're planning on attending my OSGi plugins lab, let me know!

See you at JavaOne!

Sunday May 04, 2008

GlassFish Birds Of a Feather (BOF) Session at JavaOne 2008

Tuesday night from 7:30PM - 8:20PM, there will be a GlassFish BOF (BOF 7900: GlassFish Application Server: Open Source, Fast, Easy and Reliable) in Gateway 104.  You'll be able to meet with many of the big names behind GlassFish, or get your tough questions answered by GlassFish experts.  In addition, the GlassFish team will challenge the audience to see what they know by playing a round of Glassfish Jeopardy for cool prizes!  This will be a fun BOF and a great networking opportunity -- see you there!

GlassFish game board

Friday May 02, 2008

Don't forget your laptop!

Are you lucky enough to be going to JavaOne 2008?  If so, don't forget your laptop!

This year at JavaOne there will be quite a few Hands-on Lab sessions where you will be able to try out cool technologies rather than just hear about them.  In many of them you'll be given courseware and the software needed to use the technology on your laptop, other labs will provide machines for you to use.

I will be one of the presenters for the "Plug into GlassFish v3 with JavaServer Faces and jMaki" lab.  The lab will show how GlassFish v3 will provide a pluggable platform which enables anyone to extend the functionality provided by the GlassFish v3 administration console.  This is done in the context of our JavaServer Faces application with the help of OSGi bundles and our plugin API for our application.  If you're already signed up, great!  If not, you can try to get in (the lab is already full) or stop by the GlassFish booth #175 in the Pavilion and you can get a copy of the lab to try on your own time.  Oh... and if you do create a GlassFish v3 plugin during JavaOne, you're eligible for a chance to win a Canon PowerShot SD1000 Digital Camera!  See the contest rules for more details.

Thursday May 01, 2008

Where will you be at JavaOne?

Here's my schedule of events I'm considering:

Ken's JavaOne Calendar

I'm unsure about many of them, but I will definitely be at the GlassFish BOF at 7:30 PM on Tuesday, (Gateway 104).  I am speaking at the "Plug into GlassFish v3 with JavaServer Faces and jMaki" Hands-on Lab (Wednesday @ 6:30PM, Hall E 132).  I also helped out with a demo that will be shown during the 1:30 PM General Session on Tuesday, so I don't want to miss that.  Everything else I'll try to make on a best effort basis.

See you at JavaOne!

Thursday May 10, 2007

Howto win a Helicopter

How to win a helicopter @ JavaONE

BT had a booth at JavaONE for their Web21C SDK.  The SDK, among other things, allows you to write software that invokes a WebService hosted by BT to place a phone call between 2 parties.  You simply need to provide 2 phone numbers and BT calls both parties and connects the two.  They provide a limited amount of usage for free, and for a small fee you can use their service more, here's a link to their pricing.  The Web21C SDK opens up the door to many possibilities, however, that's outside the scope of this blog.

BT was offering a challenge at their booth: Use their SDK to place a phone call and win a remote controlled helicopter.  My son is 5 and would love to crash the helicopter, and it sounded like any easy task for GlassFish + JSFTemplating... so I got to work!

Here's what I had to do:

1) I started with the JSFTemplating demo application. (Note: I used the version from CVS so that I would already have a build environment setup which uses APT.)

2) I added the Web21C jar files to my WEB-INF/lib directory of the demo app.  They gave me a memory stick with these, but I think you can find them here.

3) I had problems w/ some of their jar files because many of them are already part of GlassFish and were not needed.  Also some of the versions may not have been compatible.  I ended up turning off classloader delegation by adding this to my sun-web.xml file:

  <class-loader delegate="false"/>

4) I registered my application.  BT requires you to register your application.  This was a necessary, but the most painful part of the process.  It required me to download the Web21C-Certificate-Tool, patch the JDK with the unlimited strength policy files, run their certificate tool, place the generated file in the WEB-INF/classes directory of the demo app, and create / place a security.properties file in the WEB-INF/classes directory that pointed to the generated file.

5) With the environment finally setup, I was ready to write the app!  I created the following JSFTemplating page:


call.jsf

<sun:page>
<sun:html>
<sun:head />
<sun:body>
<sun:form>
<sun:messageGroup />
<sun:propertySheet>
<sun:propertySheetSection label="Web21 Phone Dialer">
<sun:property>
<sun:textField required="true" label="Call From:" value="#{requestScope.from}" />
</sun:property>
<sun:property>
<sun:textField required="true" label="Call To:" value="#{requestScope.to}" />
</sun:property>
<sun:property>
<sun:button text="Make Call">
<!command
Web21.call(from="#{requestScope.from}", to="#{requestScope.to}");
navigate("calling.jsf");
/>
</sun:button>
</sun:property>
</sun:propertySheetSection>
</sun:propertySheet>
</sun:form>
</sun:body>
</sun:html>
</sun:page>



6) I created the following handler in a new java file called Web21Handlers.java (see above call.jsf page where the button is invoking this handler):

Web21Handlers.java

package org.example.handlers;

import com.sun.jsftemplating.annotation.Handler;
import com.sun.jsftemplating.annotation.HandlerInput;
import com.sun.jsftemplating.annotation.HandlerOutput;
import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext;


/\*\*
\* <p> This class is written to demonstrate how to write a
\* <code>Handler</code>.</p>
\*/
public class Web21CHandlers {

/\*\*
\* <p> This is a handler makes phone calls.</p>
\*
\* @param context The <code>HandlerContext</code>.
\*/
@Handler(id="Web21.call",
input={
@HandlerInput(name="to", type=String.class, required=true),
@HandlerInput(name="from", type=String.class, required=true)
})
public static void calculateResponse(HandlerContext context) {
// Get the input.
String to = (String) context.getInputValue("to");
if (!to.startsWith("tel:+")) {
to = "tel:+" + to;
}
String from = (String) context.getInputValue("from");
if (!from.startsWith("tel:+")) {
from = "tel:+" + from;
}

com.bt.sdk.thirdpartycall.ThirdPartyCall tpc = new com.bt.sdk.thirdpartycall.ThirdPartyCall(to, from);
tpc.startCall();
}
}



7) I compiled the app (just typed "ant" on the command line, the demo application already has the build environment setup), started the server and went to http://localhost:8080/demo/call.jsf where I saw:

Screenshot 

After typing in the 2 phone numbers and clicking the "Make Call" button... the 2 phones rang! 

8) Finally... I showed this to the Web21C people and they gave me a helicopter!

Ken and Senthil 

(I'm in the blue Sun shirt.  You can also see this on flickr.)

That's how to get a helicopter using JSFTemplating + Web21C + GlassFish at JavaONE.


About

paulsen

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today