Miles to go …

October 31, 2007

TOTD #15: Delete/Update Row from Database using jMaki Data Table

Filed under: web2.0 — arungupta @ 12:02 am

A Previous Entry explained how a Data Table widget can be populated from a database using Java Persistence API (JPA). This TOTD extends that entry and explains how a selected row from the Data Table can be deleted from the database. This entry is created based upon a requirement from Dave Briccetti at Silicon Valley Code Camp 2007 last weekend.

The first part of the entry is also a re-write of using NetBeans 6 and the latest jMaki NetBeans plugin.

  1. Create the Web application project
    1. In NetBeans 6 IDE, create a new ‘Web Application‘ project and name it as ‘jmaki-database‘.
    2. Choose GlassFish V2 as the server as shown below:

    3. Click on ‘Next‘ button, add ‘jMaki Ajax Framework‘ and choose ‘Standard‘ layout as shown below:

      and click on ‘Finish‘ button.

  2. Configure the Database
    1. In NetBeans IDE, ‘Runtime‘ tab, expand Databases, connect to the default database (with the URL ‘jdbc:derby://localhost:1527/sample [app on APP]‘). Specify the username ‘app‘ and password ‘app‘.
    2. Right-click again on the URL and select ‘Execute Command...‘ and issue the command:

      create table BOOKS (title varchar(255),
                          author varchar(255),
                          isbn varchar(255),
                          description varchar(255),
                          PRIMARY KEY (isbn))

      This will create the database table.

    3. Add data to the newly created table using the following command:

      INSERT INTO BOOKS VALUES('Galloway Book of Running', 'Jeff Galloway', 'ABC001', 'The best book on running');
      INSERT INTO BOOKS VALUES('The Complete Book of Running', 'James Fixx', 'ABC002', 'Oldest book of running');
      INSERT INTO BOOKS VALUES('The Runners Handbook', 'Bob Glover', 'ABC003', 'Bestselling Guide for Beginning and Intermediate Runners');
      INSERT INTO BOOKS VALUES('Daniel Running Formula', 'Jack Tupper Daniels', 'ABC004', 'Proven programs 800m to Marathon');
      INSERT INTO BOOKS VALUES('Chi Running', 'Danny Drever', 'ABC005', 'Revolutionary approach to effortless, injury-free running');
      INSERT INTO BOOKS VALUES('Running for Mortals', 'John Bingham', 'ABC006', 'A common sense plan for changing your life through running');
      INSERT INTO BOOKS VALUES('Marathoning for Mortals', 'John Bingham', 'ABC007', 'Regular person guide to marathon');
      INSERT INTO BOOKS VALUES('Marathon', 'Hal Higdon', 'ABC008', 'The Ultimate Training Guide');

      This will add 8 rows to the table. You can enter additional rows if you like.

  3. Create the JPA Entity class that maps to the database
    1. In the projects window, select the project ‘jmaki-database‘, right-click and select ‘New‘ and choose ‘Entity Classes From Database...‘.
    2. Select ‘jdbc/sample‘ as ‘Data Source‘.
    3. Select ‘BOOKS‘ in ‘Available Tables‘ and click on ‘Add‘ and enter the values as shown below:

      and click on ‘Next‘.

    4. Specify the package name as ‘server‘ as shown below:

    5. Click on ‘Create Persistence Unit...‘ to create the persistence unit and enter the values as shown below:


      and click on ‘Create‘.

    and click on ‘Finish‘.

  4. Add the following named query to the generated JPA class:

    @NamedQuery(name = "Books.findAll", query = "SELECT b FROM Books b")

  5. Configure Persistence Unit
    1. In your project, expand ‘Configuration Files‘ and open ‘persistence.xml‘.
    2. Click on ‘Add Class‘ button and  choose ‘server.Books‘ class and click ‘OK‘. This will ensure that the generated entity class is explicitly recognized by the EntityManagerFactory.
  6. In your project, right-click on ‘Web Pages‘, select ‘New‘ and then ‘JSP...‘. Give the name as ‘data‘ as shown:

    and then click on ‘Finish‘.

  7. Replace the entire content of template ‘data.jsp‘ with the following:

    <%@ page import="java.util.*" %>
    <%@ page import="server.Books" %>
    <%@ page import="javax.persistence.*" %>

    <%
      EntityManagerFactory emf = Persistence.createEntityManagerFactory("jmaki-databasePU");
      EntityManager em = emf.createEntityManager();

      List<Books> list = em.createNamedQuery("Books.findAll").getResultList();

      out.println("{columns : [" +
        "{ label : 'Title', id : 'title'}," +
        "{ label :'Author', id : 'author'}," +
        "{ label :'ISBN', id : 'isbn'}," +
        "{ label :'Description', id : 'description'}" +
        "],");

        out.println("rows: [");
        for (int i=0; i<list.size(); i++) {
          Books b = list.get(i);
          out.print("{ id: '" + b.getIsbn() + "', " +
            "title: '" + b.getTitle() + "'," +
            "author: '" + b.getAuthor() + "'," +
            "isbn: '" + b.getIsbn() + "'," +
            "description: '" + b.getDescription() + "'}");
          if (i < list.size()-1)
            out.println(",");
          else
            out.println();
        }
        out.println("] }");
      %>

  8. Add and Configure a jMaki Data Table widget
    1. In the generated ‘index.jsp‘, drag-and-drop a ‘Yahoo Data Table‘ widget from the jMaki Palette in the ‘Main Content Area‘.
    2. Change the generated code fragment from:

      <a:widget name="yahoo.dataTable"
          value="{columns :
       &
      nbsp;         [
                     { label : 'Title', id : 'title'},
                     { label :'Author', id : 'author'},
                     { label : 'ISBN', id : 'isbn'},
                     { label : 'Description', id : 'description'}
                 ],
                  rows :
                 [
                     { title : 'Book Title 1', author : 'Author 1', isbn: '4412', description : 'A Some long description'},
                     { id : 'bar', title : 'Book Title 2', author : 'Author 2', isbn : '4412', description : 'A Some long description'}
                 ]
                 }" />

      to

      <a:widget name="yahoo.dataTable" service="data.jsp" />

      The ‘service’ attribute tells jMaki runtime to retrieve the data for DataTable widget from ‘data.jsp‘ instead of the using static data.

    3. Click on the Green button in NetBeans IDE to run the project or default keyboard shortcut (F6). And your browser shows the application deployed as:

      This jMaki-wrapped Yahoo Table Table widget is pulling data from JavaDB.

  9. Now update the project to enable deletion of rows from database based upon row selection. Expand ‘Source Packages‘, ‘server‘, edit ‘Books.java‘ and add the following NamedQuery:

    @NamedQuery(name = "Books.deleteByIsbn", query = "DELETE FROM Books b WHERE b.isbn = :isbn")

  10. In your project, right-click on ‘Web Pages‘, select ‘New‘ and then ‘JSP...‘. Give the name as shown:

    and then click on ‘Finish‘.

  11. Replace the entire content of template ‘delete.jsp‘ with the following:

    <%@ page import="javax.persistence.*" %>

    <%
      String isbn = request.getParameter("isbn");
      EntityManagerFactory emf = Persistence.createEntityManagerFactory("jmaki-databasePU");
      EntityManager em = emf.createEntityManager();

      em.getTransaction().begin();
      em.createNamedQuery("Books.deleteByIsbn").
        setParameter("isbn", isbn).
        executeUpdate();
      em.getTransaction().commit();
    %>

  12. Expand ‘Web pages‘ and edit ‘glue.js‘ to add the following fragment in ‘*onSelect‘ subscribe method:

    jmaki.doAjax({method: "POST",
      url: "delete.jsp?isbn=" + encodeURIComponent(args.value.isbn),
      callback: function(_req) {
        jmaki.publish('/jmaki/table/removeRow', { targetId: args.value.isbn });
      }
    });

  13. Change the generated code fragment in ‘index.jsp‘ as:

    <a:widget name="yahoo.dataTable" service="data.jsp" subscribe="/jmaki/table"/>

That’s it! Now clicking on any row of the table will delete that particular row from the database and also from the table. If jMaki Debugger Console is enabled, then the messages are shown as below:

Using the similar steps described in bullet #9-13, a row can be updated in the database.

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd jmaki glassfish netbeans jpa database

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 30, 2007

Silicon Valley Code Camp Trip Report

Filed under: webservices — arungupta @ 12:02 am

Rama and I presented on Metro and jMaki in Silicon Valley Code Camp last Saturday. Here are the pictures

It was good to meet Peter Kellner (SVCC Orgaznier, Aaron Houston (Program Coordinator for JUGs), Van Riper (Silicon Valley JUG Founder), Kevin Nelson (Silicon Valley Web JUG Founder), Juval Lowy (of iDesign) and many others.

And here is a recap of the question/answers asked during the two sessions:

  • Takes 2 Tango: Java and .NET Interoperability
    • Are slides available ?

      Yes, very well. They are available here. A link to the demos shown in the talk is available at:
       

      • Excel 2007 (source code, screencast)
      • NetBeans 6 screencast demo (screencast)
    • There are changed signatures when using JAX-WS 2.1.3 with JDK 6. How does it work ?

      JDK 6 U3 contains JAX-WS 2.0 APIs. JAX-WS 2.1.x contains JAX-WS 2.1 APIs. In order to override the default APIs, the endorsed directory mechanism needs as explained here.

    • How can I send PDF files in SOAP messages ?

      Metro implements MTOM/XOP that allows to send any form of binary attachments (including PDF).

    • How do I achieve higher performance in Web services messages ?

      Metro is a high-performance stack. It can be further boosted by using FastInfoset that uses standard binary encoding for the XML Infoset.

    • How does a client know the request expects a String or Integer ?

      The JAXB specification defines Java-to-XML and XML-to-Java mapping. JAX-WS uses JAXB for mapping of all XML schema to Java constructs..

  • jMaki: Multiple Languages, Multiple Toolkits
    • Are slides available ?

      Yes, very well. They are available here. A link to the demos shown in the talk is available at:
       

      • jMaki Maps mashup
      • jMaki on Rails
      • Sun Tech Days
    • How can the messages in jMaki be localized ?

      Client-side localization is achieved using JSON on the client and is described here. Server-side localization will use property files and will be delivered in the next release.

    • What part of Flash is supported ?

      Flash can be wrapped and the only example we have is jMaki sound. In general, jMaki strives to be 100% plug-in free.

    • How much support is available in Eclipse ?

      The jMaki plugin for Eclipse is available here. A detailed screencast showing all the steps clearly is available here.

    • Why do we use embedded JavaScript instead of keeping it in a separate .js file ?

      Even though jMaki does not promote embedded JavaScript, but in this case we have to use it to get the correct JavaScript parameters in. There is easy way in a platform neutral way around this to allow for multiple calls back to the server. There is a complicated alternative that requires more steps and that’s why not followed.

    • Can custom layouts be used for index.jsp ?

      Yes, jMaki layouts are CSS-based and can be replaced with any standard CSS.

    • How much drag/drop support is available in NetBeans/PHP ?

      NetBeans PHP support is available in Daily Build. Once PHP support is baked, jMaki modules will be made available.

    • What are minimum browser requirements for jMaki ?

      jMaki runs on all current generation of browsers as mentioned here.Here is the list:
       

      • IE 6 and 7 on Windows XP and Vista
      • Firefox 1.5 and 2.x on Solaris, Linux, Windows XP/Vista
      • Safari 2.x and Firefox 1.5 on Mac OS X
    • Can jMaki CSS layouts be used instead of Rails layouts ?

      This functionality is not available in jMaki 1.0. However you can create a Stylized RHTML using jMaki CSS layouts.

Next stop, GlassFish Day @ Beijing.

Technorati: conf siliconvalleycodecamp metro webservices interoperability jmaki web2.0 glassfish netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 29, 2007

GlassFish Day @ Beijing

Filed under: webservices — arungupta @ 12:02 am

What are the dates ? Nov 1 – 2, 2007 for Sun Tech Days and Nov 3, 2007 for GlassFish Day

Where is the venue ? Beijing International Conference Center. More details here.

What is the agenda ? Sun Tech Days agenda here, GlassFish Day agenda here. You experience multiple tracks dedicated to Java and Solaris, Hands-on-labs, Community events such as GlassFish Day. And above all you get 1-1 interaction with industry experts.

What do you get ? Complete immersion in GlassFish and it’s ecosystem.

How to register ? Click here.

See you there!

Technorati: conf suntechdays glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 23, 2007

Metro & jMaki @ Silicon Valley Code Camp – FREE event on Oct 27 & 28

Filed under: webservices — arungupta @ 11:00 pm
CodeCamp at FootHill College. Click Here for Details and Registration Metro (Takes 2 to Tango: Java Web services and .NET interoperability) Room 4306 Saturday (10/27) 11:15am
jMaki: Multiple Languages, Multiple Toolkits Room 4204 Saturday (10/27) 1:45pm

Venue: Foothill College, Los Altos Hills, CA

In the first session (Metro), I’ll show how Metro enables interoperability with .NET 3.0 platform. The talk shows how a Secure and Reliable Web service deployed on GlassFish V2 can be invoked from Excel 2007 spreadsheet. It also shows how such a Web service can be easily built using NetBeans 6 IDE.

The second talk explains how jMaki provides a light-weight framework to build Ajax-enabled applications using standard practices and using the best toolkits and libraries. Using multiple demos, it shows how this framework spans multiple languages.

Aaron promised to distribute some nice goodies if you attend these two talks :)

Technorati: conf siliconvalleycodecamp metro webservices interoperability jmaki web2.0 glassfish netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 22, 2007

Boycott yaari.com – “Spam 2.0″

Filed under: General — arungupta @ 8:47 pm
This is a "Web 2.0" world so I join different community sites (such as facebook, linkedin, orkut etc.) in order to be not left behind :) One such site happen to be yaari.com which brought me embarrassment instead of any apparent benefit.

After I registered with their website, it sent an email of the following format to random set of addresses from my GMail address book:

Subject:     Arun is your Yaar! :)
Date:     Sat, 13 Oct 2007 10:51:15 -0500
From:     Arun MY_EMAIL_ID
Reply-To:    
To:     EMAIL-ID FROM GMAIL

Arun
San Jose
    
Arun Gupta wants you to join Yaari!
Is Arun your friend?
Yes <http://www.yaari.com/y-register.php?i=SOME_WEIRD_NUMBER> No <http://www.yaari.com/y-register.php>
Please respond or Arun might think you said no :(

To stop receiving emails from Yaari.com, click here <http://yaari.com/y-email-opt-out.php?param=YET_ANOTHER_WEIRD_NUMBER>.
If you have any concerns regarding the content of this message, please email .
Yaari LLC, 358 Angier Ave, Atlanta, GA 30312

I apologize for unknowingly sending a message from my account.

This is absolute shame. The website says "social networking site created by Indian youth, for Indian youth". I really don’t care who has created the website but this is complete invasion of privacy. Stop it yaari.com and get some real work done!

If you get an invitation to join yaari.com, send it back to the original sender along with the link to this blog. An already created account can be deleted by going to Accounts tab and selecting "Deactivate Account" and, of course, never joining back.

Read more horrid experiences here and here.

Boycott yaari.com image used from Aalaap.com. I could not inline the image for an unknown reason.

Technorati: spam yaari

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 19, 2007

Mid West Java Tech Days 2007 – Chicago Trip Report

Filed under: webservices — arungupta @ 6:19 am

Mid West Java Tech Days concluded in Chicago yesterday.

With approximately 160 participants, the conference attendees were slightly larger in number than the Minneapolis Tech Days. The interaction with the audience was also good. The day started with Tim Bray’s key note and it was a repeat of Minneapolis.

I delivered two talks (same as in Minneapolis)- "Metro: Web services interoperability with Microsoft .NET" and  "jMaki: Framework for Ajax-enabled Web 2.0 apps". Here are the questions (with answers) that were asked during the presentation:

Metro: Web services interoperability with Microsoft .NET

  • Are slides available ?
    Yes, very well. They are available here. A link to the demos shown in the talk is available at:
     
    • Excel 2007 (source code, screencast)
    • NetBeans 6 screencast demo (screencast)
  • Can Metro apps be deployed on JBoss ?
    JBoss WS 2.1.0 will support Metro. Read more details here.
  • .NET 2.0  ?
    Metro provides interoperability with .NET 3.0. We have not tested explicitly with .NET 2.0 however it would be nice if you can test and let us know.
  • Can the WAR created by NetBeans be deployed on other containers ?
    Yes, NetBeans IDE allows to configure Tomcat as a container. After Tomcat is Metro-enabled, using the script bundled with the standalone build of Metro (downloadable from http://metro.dev.java.net), a Metro WAR can be easily deployed on Tomcat directly from within the NetBeans IDE. All the Metro features, except Transactional Web services will work on Tomcat.

jMaki: Framework for Ajax-enabled Web 2.0 apps

  • Are slides available ?
    Yes, very well. They are available here. A link to the demos shown in the talk is available at:
     
    • jMaki Maps mashup
    • jMaki on Rails
    • Sun Tech Days
  • Can jMaki be integrated with other MVC controllers such as Spring ?
    Currently jMaki integrates very well with Rails. Support for other MVC frameworks can be added by community participation. Let us know if you are interested.
  • Are jMaki widgets available as part of standard plugin ?
    Yes, jMaki plugin for NetBeans and Eclipse comes with all the palettes and widgets that are available.
  • Can the jMaki WAR be deployed on any container ?
    The only requirement for jMaki for Java is Servlet 2.4 and JSP 1.2. If you are using JSF then JSF 1.1 support is required as well.
  • Can a jMaki WAR be hosted on a public site ?
    Yes, The ISP need to have WAR hosting capabilities. If the WAR needs to access external services, then the ISP may also need to allow that explicitly.
  • Can I use it in production ?
    jMaki is ready for production. jmaki.com is using jMaki on PHP. Let us know if we can help you in any manner.

Here is the picture album:

And I met one my avid blog readers – Roman Kuzmik. He was pretty excited to meet me and it’s great to hear you like the content produced on this blog :)

Next stop Silicon Valley Code Camp (Nov 27-28).

Technorati: conf webservices glassfish metro jmaki netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 18, 2007

Crowne Plaza Chicago O’Hare – Thumbs Up

Filed under: General — arungupta @ 8:44 am

I arrived Chicago yesterday for Sun Mid West Java Tech Days.

The stay at The Crowne Plaza Hotel Chicago O’Hare, although just one night, but was just the way I like it. Everything from checking into the hotel to checking out this morning was great. There were minor things which made the stay a pleasant one:

  • The hotel is approx 10 minutes ride from the airport and they have a courtesy shuttle running from 6am to midnight.
  • The checking-in experience was seamless. I was called 30 minutes after the check-in to make sure everything in the room is correct. I’ve stayed at multiple hotels around the world but in this case the hotel desk went an extra step to ensure I was comfortable in the room.
  • They offered the Priority Club member ship which provided me free wi-fi access in the hotel and free water. Even though offering a water bottle is a minor detail but staying in a hotel is all about convenience and adds to the overall experience.
  • The temperature in the hotel room was pre-set and there was no need to alter it.
  • The restaurant in the hotel had a good variety of cuisines. A flat-screen TV was mounted all over the restaurant and I enjoyed TV and my meal together. And the subtitles were turned on to provide a choice.
  • The wi-fi connection speed was very good and allowed me to catch up on email (with my travel schedule) at a high speed.
  • The machines in the Fitness Center were of high quality with good pre-defined fitness programs. The defaults are just exactly what I use most of the time.

Definitely would recommend to stay there on your next visit to Chicago.

Technorati: conf crowneplaza chicago traveltips

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 16, 2007

Mid West Java Tech Days 2007 – Minneapolis Trip Report

Filed under: webservices — arungupta @ 11:16 pm

Mid West Java Tech Days concluded in Minneapolis earlier today.

First, here are some facts I learned about Minneapolis:

  • Minneapolis is a Twin City with St Paul
  • Has 20 lakes and wetlands
  • Mall of America - Biggest retail and entertainment complex in the USA
  • Target headquarters is in the downtown
  • Has the First Basilica in USA
  • 7 miles of skyways linking 8 blocks downtown. Really useful for those rainy and snowy times.
  • Has one of the biggest Tibetan populations in the World (read more here)
  • Abundance of public parks – Accessible within 0.5 mile of every home

Second, the Internet connection at the hotel is ridiculously slow (at least for me) as shown here:

I talked to other colleagues staying at the same hotel and it seemed to work fine for them. Anyway, it took 6 calls to the Tech Support to resolve the issue partly. Or may be it’s 1:15am in the morning here, the usage is down and that’s why I’m seeing a better response time ;-) But when I explained the issue to the hotel, they happily removed the ISP charges for my first day stay @ the hotel.

Now back to the event.

The event kick started with Tim Bray‘s keynote.

Tim Bray gave the keynote to an audience of approx 125 people and talked about "Business and Cultural aspect of Web 2.0" and "Programming Language and Infrastructure". Everybody in the room raised a hand when asked if they were a developer which was kind of cool because typically we see a mix of IT managers, Engineering Managers, Sys Admins and of course Developers.

One of the key messages in the talk was to start thinking about outside-in (how the community is going to interact/provide feedback about the product) and inside-out (how open the discussions can be) for a product and see how the community can be involved.

Tim presented Tree View of the Programming Languages. It shows how different programming languages are getting adopted year-by-year. The data is created by collecting book purchasing data from different publishers and then taggin each book with language. They point to notice is that only JavaScript and Ruby are growing. Here are some of the points that he mentioned about PHP & Rails:

PHP

  • Low barrier entry
  • Some of the apps are great (MediaWiki, WordPress, Drupal)
  • Horrible security issues
  • Horrible maintainability story (~ 5000 functions at the top level)
  • May not be good for enterprise apps.

Rails

  • Don’t Repeat Yourself (DRY)
  • Convention over Configuration (CoC)
  • MVC to the core
  • Unit testing is hard to avoid
  • Incredibly compact code (good maintainability)
  • Developers love it but slow.
  • Good choice for the Enterprise and for Web 2.0 developers

Java is a 3-legged stool comprising of APIs, JVM and Java language. All the scripting languages (Ruby, PHP, JavaScript, etc) are supported in the JVM using JSR 223 APIs.

Tim also compared PHP, Rails and Java in terms of scaling, dev speed, dev tools & maintainability. The talk concluded by stating that Single Architecture IT shop is never going away. PHP, Java, Ruby, .NET – all will continue to exist and live together. REST allows a cleaner integration of these technologies. In my talk on Metro, I discussed an alternate strategy for a heterogeneous systems where Java and .NET can co-exist with each using WS-*-based interoperability achieved in GlassFish.

I delivered two talks – "Metro: Web services interoperability with Microsoft .NET" and  "jMaki: Framework for Ajax-enabled Web 2.0 apps".

The first talk (Metro) was scheduled to start at 11:15 am and there were only 3 people in the room at that time. I started the talk few minutes late giving time for people to show up but even by 11:25 (after I’ve done the initial introductions) there were only approx 12 people in the room. And then somebody from the audience mentioned that the previous session just finished and I did see a splurge of audience right around that time. On audience’s request, I did a recap and then continued with rest of the presentation. I was glad that the room was full in few more minutes :)

The slides are available here. Here is the list of questions asked with their answers:

  • Can Metro apps be deployed on Web Sphere ?
    This is not a tested/supported configuration but Metro apps can be deployed on Web Sphere provided all the libraries are bundled in the WEB-INF/lib directory of the web application itself.
  • Can Metro apps be deployed on JBoss ?
    JBoss WS 2.1.0 will support Metro. Read more details here.
  • How can contract-first endpoint be developed and still utilize interoperability with .NET feature ?
    Use the "New Web Service From WSDL" feature in NetBeans IDE and the enable Security/Reliability/Transactions feature as shown here.
  • Link to demos shown in the talk
    • Excel 2007 (source code, screencast)
    • NetBeans 6 screencast demo (screencast)

The jMaki talk was SRO and we had to borrow multiple chairs from another room to accommodate the audience. The slides are available here. Here is the list of questions asked with their answers:

  • Can jMaki apps be deployed on other containers, such as Tomcat ?
    jMaki web applications are deployed as WAR files and can be easily deployed on any other container.
  • What does it take to create your own widget and make it available in the palette ?
    This page provides low-level details on how to create your own jMaki widgets.
  • What is the total size of jMaki wrapper ?
    18KB
  • Can jMaki apps be developed using JDeveloper ?
    Currently jMaki apps can be developed using NetBeans IDE, Eclipse and Ant-based tasks only. However please send us an email if you are interested in contributing the jMaki plug-in for JDeveloper.
  • Link to demos shown in the talk
    • jMaki Maps mashup
    • jMaki on Rails
    • Sun Tech Days

And, of course, there were some Hudson enthusiasts.

The evening concluded with a great dinner at Solera along with Charlie, Thomas, Tim and Greg and some interesting discussions about scripting languages.

Here is the picture album so far:

Next step Chicago on Oct 18, there is still time to register!

Technorati: conf webservices glassfish metro jmaki netbeans hudson

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

TOTD #14: How to generate JRuby-on-Rails Controller on Windows (#9893)

Filed under: web2.0 — arungupta @ 1:25 pm

The current Rails Gem (version 1.2.5) gives an error when creating a Controller in a JRuby-on-Rails application on Windows. It gives the following error during controller creation as shown below:

C:/testbed/ruby/jruby-1.0.1/lib/ruby/1.8/pathname.rb:420:in `realpath_rec': No such file or directory -C:/testbed/ruby/jruby-1.0.1/samples/rails/hello/C: (Errno::ENOENT)
    from C:/testbed/ruby/jruby-1.0.1/lib/ruby/1.8/pathname.rb:453:in `realpath'
    from C:/testbed/ruby/jruby-1.0.1/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/initializer.rb:543:in `set_root_path!'
    from C:/testbed/ruby/jruby-1.0.1/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/initializer.rb:509:in `initialize'
    from ./script/../config/boot.rb:35:in `new'
    from ./script/../config/boot.rb:35:in `run'
    from ./script/../config/boot.rb:35
    from :1:in `require'
    from :1

and Rails 1.2.4 gives exactly the same error. This is Ticket #9893. This actually happens because of JRUBY-1401.

The workaround is to use Rails 1.2.3. If you have already installed the latest Rails plugin, then you can uninstall it using the command:

C:\testbed\ruby\jruby-1.0.1\bin>gem uninstall rails
Successfully uninstalled rails version 1.2.5
Remove executables and scripts for
'rails' in addition to the gem? [Yn] y
Removing rails

And then install Rails 1.2.3 as:

gem install rails --include-dependencies --version 1.2.3 --no-ri --no-rdoc
Successfully installed rails-1.2.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3

Now create a new application as shown below:

jruby -S rails hello

And then create a controller as:

jruby script\generate controller say hello
exists app/controllers/
exists app/helpers/
create app/views/say
exists test/functional/
create app/controllers/say_controller.rb
create test/functional/say_controller_test.rb
create app/helpers/say_helper.rb
create app/views/say/hello.rhtml

Hope you find it useful and this bug is fixed in the next version of Rails.

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd rubyonrails jruby windows

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

Web 2 Summit – Cool Applications on Industry-grade Operating System

Filed under: web2.0 — arungupta @ 6:31 am
Sun Microsystems is a gold sponsor of Web 2 Summit (nee Web 2.0 Conference). Registration to this conference by invitation only. If you are an attendee, here is one session that you don’t want to miss:

Betting on OpenSolaris for Success

In this session, Sun Chief OS Platform Strategist Ian Murdock, Joyent CTO Jason Hoffman and Director of Systems Ben Rockwood will show that the latest innovations in operating system technology are happening in OpenSolaris and will explore how even though the OS is invisible to developers much of the time, it very much still matters for writing cool "Web 2.0" applications.

Technorati: conf opensolaris web2summit web2.0

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress