Thursday March 27, 2008
Slides & Demos for Rails/GlassFish/jMaki session at TSS JS
As reported earlier,
I presented on "Rails
powered by GlassFish and jMaki" yesterday at The
Server Side Java Symposium - Las Vegas. The slides are
available here.
The demos shown in the talk are available at:
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Tuesday March 25, 2008
Rails powered by GlassFish & jMaki @ The Server Side Java Symposium, Las Vegas - Mar 26, 2008
If you want to learn more about:
| Date: | Mar 26, 2008 |
| Time: | 2:30 - 3:30pm |
| Track: | Language & Coding |
| Title: | Rails powered by GlassFish & jMaki |
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Wednesday March 12, 2008
jMaki on Rails - Reloaded for NetBeans 6.1 beta & Rails 2.0
NetBeans
6.1 Beta was released last week. Amongst the many
improvements, one of them is the bundled JRuby 1.1 RC2 and Rails 2.0.2. The jMaki plugin used
to work fine with Rails 1.2.3 but need to be updated because of changed
file name extensions for the default generated views (".rhtml.erb"
instead of ".rhtml"). With this release of NetBeans, jMaki plugin has
been updated to work in this configuration as well.
This blog provide detailed steps to install jMaki plugin, create a
simple Rails 2.0 application using NetBeans IDE and update the
generated scaffold to use a Yahoo Data Table widget for displaying the
data. It is an update to screencast
#web8, lets get started!






{ :actions => 'Action', :id =>
'actions' }{ :label => 'Description', :id =>
'description'}
<%
@rows_data = []
for book in @books
@rows_data << { :id => book.id,
:title => book.title,
:author => book.author,
:isbn => book.isbn,
:description => book.description,
:actions => link_to('Show', book)
+ ' ' + link_to('Edit', edit_book_path(book)) + ' ' +
link_to('Destroy', book, :confirm => 'Are you sure?', :method
=> :delete)
}
end
%>


Posted by Arun Gupta in web2.0 | Comments[6]
|
|
|
|
|
Monday January 28, 2008
GlassFish at WebGuild Web 2.0 Conference & Expo 2008 - Jan 29

Sun Microsystems is a sponsor of WebGuild's Web 2.0 Conference & Expo and you can meet me at Sun booth in the exhibitor hall. Register for a FREE exhibitor pass here.
Ask me about:
Technorati: conf jmaki jruby netbeans glassfish rubyonrails jruby jersey
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Saturday January 26, 2008
"Rails powered by GlassFish & jMaki" @ South Bay Ruby Meetup - Jan 29, 7pm
![]() |
I'll be speaking on "Rails powered by GlassFish & jMaki" at South Bay Ruby Meetup on Jan 29 (Tuesday) @ 7pm. Read more details here. |
You'll learn:
Thanks to Bala for providing an opportunity to talk about our efforts! Let's keep an interactive dialog and learn from each other :)
Technorati: conf jruby rubyonrails glassfish netbeans meetup
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Thursday January 24, 2008
RESTful representation of "sakila" using GlassFish and NetBeans IDE
"sakila" is the sample database shipped with MySQL (pronounced as my ess-kew-ell). In the context of Sun Microsystems announcing the agreement to acquire MySQL, I'd like to dedicate this entry to show how this sample database can be exposed as a RESTful Web service endpoint and deployed on GlassFish using Jersey Tooling Plugin (0.4.1 with Jersey 0.4) in NetBeans IDE.
Lets get started!
sakila".mysqld-nt --user root
--console' in bin directory on Windows or './bin/mysqld_safe'
from MySQL directory on Unix flavors.sakila".
Choose "GlassFish v2" as the "Server:".Services" tab of NetBeans IDE, expand "Drivers" and add
MySQL
Connector/J driver if it does not exist already.
New", "Entity Classes from
Database...". In "Data Source", select "New Data Source..." and specify the
values as shown below:
film" in "Available Tables" and click on "Add >" as shown
below:
Next >".Create Persistence Unit..." and take all the defaults as shown
below:
Create".sakila" as shown below:
Finish".Configuration Files"
and open "persistence.xml". Specify the username and password
by replacing <properties/> with the following fragment:<properties>
<property name="toplink.jdbc.user" value="root"/>
<property name="toplink.jdbc.password" value=""/>
</properties>Tools", "Plugins", "Available Plugins", "RESTful
Web Services" and then click on "Install". This installs the
Jersey Tooling
Plugin in the IDE.New", "RESTful Web Services from
Entity Classes...".Add >>", take all other defaults as shown
below:
Next >", take all defaults and then "Finish".Test RESTful Web Services".
The following web page is presented in the browser:
films" and then on "Test" as shown
below:
Test" button or the URL "http://localhost:8080/sakila/resources/films/"
shows the RESTful representation of the "Film" table. The
default representation shows 10 records from the table where each entry
returns the "id" of the film and a reference to the detailed
entry.http://localhost:8080/sakila/resources/films/?max=40".
Additional fields from the table can be displayed by adding getter methods
to "converter.FilmRefConverter" class such as:@XmlElement
public String getTitle() {
return entity.getTitle();
}

Here are few more ideas for you to explore:
A JRuby-on-Rails application using MySQL is explained here. TOTD #9 explains how JDBC connection pooling in GlassFish can be used for a JRuby-on-Rails application using MySQL.
The key message here is MySQL can be very easily used with GlassFish and NetBeans IDE makes it possible! Once MySQL becomes part of Sun, this integration is going to be much more seamless for the betterment of community.
All the entries on this blog using MySQL can be found here. And last but not the least, Welcome aboard MySQL!
A NetBeans project with all the source code can be downloaded from here. You will still need to setup the database connection and need to make sure the correct version of Jersey plug-in as well :)
Technorati: glassfish netbeans jersey mysql sakila jpa jmaki rubyonrails
Posted by Arun Gupta in webservices | Comments[28]
|
|
|
|
|
Wednesday September 19, 2007
Rails Conf Europe 2007 - Day 3
Day 3 started with reminders about RubyConf 2007 and upcoming Euruko. Marcel and Koz (from Rails core team) gave the keynote talking about the best practices for Rails (theRailsWay.com). Here are some of the tips they explained:
with_scope to subset a model's collection - More
details
here.The Sun booth was swamped today as well, just like yesterday. There were some great interactions and I do plan to follow up on them.
I missed the "Meet the JRuby team" BoF yesterday night. But I was very excited to know that Ola Bini made a statement in the bof that amongst all the free and fee-based Application Servers, GlassFish is the best. GlassFish V2 was released earlier this week and read all about it's capabilities here.
Craig and Nick's talk on Rails Hydra was SRO with even all the floor space occupied and was attended by DHH. Brian mesmerized the audience with NetBeans Ruby magic in his talk. There were lots of users who came by the booth afterwards and were very happy with the NetBeans Ruby support. All the presentations will be available here.
|
|
|
|
|
|
|
Andrea won the SunFire T-1000 Server, Congratulations! And Sharat gave out 5 copies of RESTful Web services books as well.
|
|
|
|
|
|
|
|
And the food of course was quite a blast, the desserts were completely outstanding!
|
|
|
|
We'll see you at another conference now.
Here are some useful entries (with numerous pointers on screencasts, blogs, tips & extensive feature sets) to get you started with JRuby on Rails, NetBeans IDE, GlassFish and jMaki:
The updated picture album is available at:
Technorati: conf railsconf railsconfeurope glassfish netbeans jmaki rubyonrails
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
|
Tuesday September 18, 2007
Rails Conf Europe 2007 - Day 2
Day 2 started with regular announcements and keynote by DHH. The demographic distribution of approximately 750 attendees was shown in the filler slides right before the keynote:
| Germany | 29% | Sweden | 3% |
| UK | 17% | Spain | 3% |
| United States | 11% | Norway | 3% |
| Denmark | 7% | Italy | 2% |
| Netherlands | 5% | France | 2% |
The technical sessions and BoFs started today and the exhibit hall was opened as well. Sun booth was swamped and we showed "NetBeans Tooling for Ruby on Rails", "Rails and Software as a Service" and "Rails powered by jMaki and GlassFish".
|
|
|
|
The demo showed at "Rails powered by jMaki and GlassFish" is available here. And here are some other pointers mentioned in the booth:
GlassFish is an open-source, production-quality and Java EE 5 compatible Application Server. Here are some of the key benefits of GlassFish for Rails developers:
There are few others and they will be consolidated in an article later.
Both of Sun's talks today were well attended:
|
|
|
|
The lunch was quite a treat:
|
|
|
|
Here are some useful entries (with numerous pointers on screencasts, blogs, tips & extensive feature sets) to get you started with JRuby on Rails, NetBeans IDE, GlassFish and jMaki:
The updated picture album is available at:
Use the tag "railsconfeurope" to ensure your blog/photos are aggregated appropriately.
Technorati: conf railsconf railsconfeurope glassfish netbeans jmaki rubyonrails
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
|
Monday September 17, 2007
Rails Conf Europe 2007 - Day 1
Arrived in Berlin 2 days ago for Rails Conf Europe. Sun Microsystems is a diamond sponsor and you can meet me at the "Rails powered by jMaki and GlassFish" booth in the Exhibit Hall. You can read about overall Sun's presence here.
I realized in the morning that my Full Conference pass did not account for any of the tutorials. And all of them were completely sold out with approx 750 attendees flooding all the rooms. So there was no chance to even sneak in :( I decided to spend the time taking the city tour and visiting other places. Here are some tips for travelers to Europe (Berlin in particular):
And here is Berlin in pictures
Thanks to Joyent for hosting the beer bust. That's all for today! See you tomorrow at the booth :)
All my travel tips to Europe are aggregated here.
Technorati: conf railsconf railsconfeurope glassfish netbeans jmaki traveltips europe
Posted by Arun Gupta in web2.0 | Comments[6]
|
|
|
|
| Screencast #Web8: jMaki on Rails for Dummies - 2nd edition
The support for Rails in NetBeans IDE has improved considerably in the past few days. Greg and Ludo have been working on ramping up the jMaki NetBeans module as well. This screencast is an update to #web2 and shows how the development experience for creating a jMaki-enabled Rails application is drastically simplified.
The screencast shows how a jMaki-wrapped Yahoo and Dojo DataTable widget can be used to pull data from MySQL database using ActiveRecord in a Rails application. The screencast also shows how multiple widgets on a RHTML View can talk to each other using simple tags.
Enjoy it here!
Technorati: screencast jmaki netbeans rubyonrails mysql
Posted by Arun Gupta in web2.0 | Comments[24]
|
|
|
|
|
Monday July 23, 2007
jMaki on Rails - Updated for NetBeans 6 M10
Based upon a user request, this is a follow up entry to show how jMaki on Rails For Dummies work on NetBeans 6 Milestone 10. Some of the steps are simplified and more details are provided. The updates from the previous blog entry are highlighted in this color.
Tools', 'Plugins',
select 'Downloaded', click on 'Add
Plugins ...'.Tools', 'Plugins',
select 'Installed'. It should show 'jMaki
Ajax support' with today's installation date.jmaki_ror'.
Take everything else as default.Generate ...', select 'controller',
specify the Name as 'jmaki' and Views as 'yahoo'.http://jmaki-goodies.googlecode.com/svn/trunk/rails_plugins".
This adds the plug-in registry to the list of repositories used for
searching plug-ins. jmaki_core and
jmaki_yahoo and press "Install". Follow the instructions and the
two plug-ins will be installed. After the installation is complete,
you'll see the following:
Views', right-click on
'layouts', select 'New', select
'RHTML file ...'.
Enter the 'File Name' as 'standard'.
This will add 'standard.rhtml' in layouts
sub-tree. Enter the following fragment before <body>:<head>
<%= stylesheet_link_tag "jmaki-standard", :media
=> "all" -%>
<%= javascript_include_tag "jmaki" -%>
<%= jmaki_setup -%>
</head><%= @content_for_layout %>Controllers', 'jmaki_controller.rb',
add the following fragment before 'def yahoo'
line:layout "standard"mysqld-nt --user root'.mysqladmin -u root create
jmaki_ror_development'. You need to make sure that the database
name in this script is changed to match the project name.Generate',
select 'model', specify the arguments as 'grid',
click 'OK'. This will
generate, in NetBeans project, Database Migrations, migrate,
001_create_grids.rb.001_create_grids.rb,
change self.up
helper
method such that it looks like:def self.up
create_table :grids do |t|
t.column :company, :string
t.column :price, :float
t.column :change, :float
t.column :percent_change, :float
t.column :last_updated, :string
end
end Run
Rake
Target', 'db', 'migrate'.
This generates the database
table. mysql --user root'.
use
jmaki_ror_development' to see the following interaction:mysql> use jmaki_ror_development;
Database changedinsert into grids values (1, 'A Co', 71.72,
0.02, 0.03, 'Jan 1, 2007, 10:00am' );
insert into grids values (2, 'B Inc', 29.01, 0.42, 1.47, 'Feb 1, 2007,
10:00am' );
insert into grids values (3, 'C Group Inc', 83.81, 0.28, 0.34, 'Mar 1,
2007, 10:00am' );
insert into grids values (4, 'D Company', 52.55, 0.01, 0.02, 'Apr 1,
2007, 10:00am' );Views',
'jmaki', 'yahoo.rhtml',
drag-and-drop 'Data Table' widget from the 'Yahoo'
category of jMaki palette.
yahoo.rhtml' with the
following:<%= jmaki_widget 'yahoo.dataTable',
:args => {
:columns => [
{ :title => 'Company', :width => 200, :locked =>
false },
{ :title => 'Price', :width => 75, :renderer =>
'usMoney' },
{ :title => 'Change', :width => 75, :renderer =>
'change' },
{ :title => '% Change', :width => 75, :renderer =>
'pctChange' },
{ :title => 'Last Updated', :width => 85, :renderer
=> 'italic' }
]
},
:value => @table_data
-%>@table_data' is defined
in 'jmaki_controller' in 'def yahoo'
as:def yahoo
@table_data = []
Grid.find_all().each do |data|
@table_data
<< [ data.company, data.price, data.change,
data.percent_change, data.last_updated]
end
endhttp://localhost:3000/jmaki/yahoo'.
Now jMaki-wrapped Yahoo DataTable widget is picking data from the MySQL
database. And as a next step, you can WAR'up this RoR application and deploy it on GlassFish V2 using these instructions.
Technorati: jmaki rubyonrails ror netbeans mysql glassfish
Posted by Arun Gupta in web2.0 | Comments[12]
|
|
|
|
|
Sunday June 10, 2007
Screencast #Web2: jMaki on Rails for Dummies
This screencast shows how a jMaki-wrapped Yahoo DataTable widget can be used to pull data from MySQL database using ActiveRecord in a Rails application. This is a screencast of the detailed instructions posted earlier.
Enjoy it here!
Technorati: jmaki rubyonrails ror netbeans mysql screencast
Posted by Arun Gupta in web2.0 | Comments[12]
|
|
|
|
|
Thursday May 17, 2007
Craig announced jMaki on Rails. Here I provide detailed steps to read data from a MySQL database and display it in a jMaki-wrapped Yahoo DataTable widget.
Tools', 'Plugins',
select 'Downloaded', click on 'Add
Plugins ...'.Tools', 'Plugins',
select 'Installed'. It should show 'jMaki
Ajax support' with '1.6.9.7'
version number.jmaki_ror'.Generate ...', select 'controller',
specify the Name as 'jmaki' and Views as 'yahoo'.script/plugin source
http://jmaki-goodies.googlecode.com/svn/trunk/rails_plugins
script/plugin install jmaki_core
script/plugin install jmaki_yahoo
The first step adds the plug-in registry to the list of
registries used for searching plug-ins. The second two steps install the
core and yahoo plug-ins.Views', right-click on
'layouts', select 'New',
select 'Empty RHTML (Embedded Ruby) file ...'.
Enter the 'File Name' as 'standard'.
This will add 'standard.rhtml' in layouts
sub-tree. Enter the following fragment before <body>:<head>
<%= stylesheet_link_tag "jmaki-standard", :media
=> "all" -%>
<%= javascript_include_tag "jmaki" -%>
<%= jmaki_setup -%>
</head><%= @content_for_layout %>Controllers', 'jmaki_controller.rb',
add the following fragment before 'def yahoo'
line:layout "standard"mysqladmin -u root create
jmaki_ror_development'. You need to make sure that the database
name in this script is changed to match the project name.Generate',
select 'model', specify the arguments as 'grid',
click 'OK'. This will
generate, in NetBeans project, Database Migrations, migrate,
001_create_grids.rb.001_create_grids.rb,
change self.up
helper
method such that it looks like:def self.up
create_table :grids do |t|
t.column :company, :string
t.column :price, :float
t.column :change, :float
t.column :percent_change, :float
t.column :last_updated, :string
end
end Run
Rake
Target', 'db', 'migrate'.
This generates the database
table. Execute the
following query to insert data into the table:insert into grids values (1, 'A Co', 71.72,
0.02, 0.03, 'Jan 1, 2007, 10:00am' );
insert into grids values (2, 'B Inc', 29.01, 0.42, 1.47, 'Feb 1, 2007,
10:00am' );
insert into grids values (3, 'C Group Inc', 83.81, 0.28, 0.34, 'Mar 1,
2007, 10:00am' );
insert into grids values (4, 'D Company', 52.55, 0.01, 0.02, 'Apr 1,
2007, 10:00am' );Views',
'jmaki', 'yahoo.rhtml',
drag-and-drop 'Data Table' widget from the 'Yahoo'
category of jMaki palette.
yahoo.rhtml' with the
following:<%= jmaki_widget 'yahoo.dataTable',
:args => {
:columns => [
{ :title => 'Company', :width => 200, :locked =>
false },
{ :title => 'Price', :width => 75, :renderer =>
'usMoney' },
{ :title => 'Change', :width => 75, :renderer =>
'change' },
{ :title => '% Change', :width => 75, :renderer =>
'pctChange' },
{ :title => 'Last Updated', :width => 85, :renderer
=> 'italic' }
]
},
:value => @table_data
-%>@table_data' is defined
in 'jmaki_controller' in 'def yahoo'
as:def yahoo
@table_data = []
Grid.find_all().each do |data|
@table_data
<< [ data.company, data.price, data.change,
data.percent_change, data.last_updated]
end
endhttp://localhost:3000/jmaki/yahoo'.
Now jMaki-wrapped Yahoo DataTable widget is picking data from the MySQL
database. And as a next step, you can WAR'up this RoR application and deploy it on GlassFish V2 using these instructions.
Technorati: jmaki rubyonrails ror netbeans mysql glassfish
Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Tuesday May 15, 2007
jMaki, NetBeans and GlassFish in Rails Conf
![]() |
Sun Microsystems is a diamond sponsor of Rails Conference (May 17 - 20). In the conference, you'll hear from Sun luminaries on different topics. You'll see how NetBeans IDE and GlassFish provide a complete development and deployment environment for your Rails application. You'll also see how RIA can be easily created using jMaki. |
Here is list of sessions from Sun speakers:
| Your First Day with JRuby on Rails | Charles Nutter, Thomas Enebo | Thu, 5/17 | 8:30am - 12pm |
| Keynote | Tim Bray | Sat, 5/19 | 9:15am - 10:15am |
| Ruby Tooling: State of the Art | Brian Leonard | Sat, 5/19 | 10:45am - 11:30am |
| JRuby on Rails: A Taste of Honey (for the Enterprise) | Charles Nutter, Thomas Enebo | Sun, 5/20 | 10:45am - 11:35am |
Other than this, you can always find us in the exhibitor pavilion. Joyent, one of our partners, will be sharing the booth space and showcasing their Ruby on Rails powerful and scalable development and deployment systems.
See you there!
Technorati: sun railsconf ror rubyonrails netbeans jmaki glassfish
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Today's Page Hits: 2373
Total # blog entries: 1002