Home > General, Technology > Rails and OpenLaszlo integration

Rails and OpenLaszlo integration


This post explains step-by-step approach for Rails and OpenLaszlo integration. Understanding of Rails and Openlaszlo is out of scope of this post…

Note: It’s been a while since I worked on these technologies, some parts may stand invalid.

STEP 1:

‘am executing this project from my eclipse workspace, you may use different folder to your liking.

</code>
C:\eclipse-workspace>gem install ropenlaszlo
Successfully installed ropenlaszlo-0.5
1 gem installed
Installing ri documentation for ropenlaszlo-0.5...
Installing RDoc documentation for ropenlaszlo-0.5...
<pre><code>

STEP 2: Creating rails application

</code>
C:\eclipse-workspace>rails contacts
create
create  app/controllers
create  app/helpers
create  app/models
create  app/views/layouts
create  config/environments
create  config/initializers
create  db
create  doc
create  lib
create  lib/tasks
create  log
create  public/images
create  public/javascripts
create  public/stylesheets
create  script/performance
create  script/process
create  test/fixtures
create  test/functional
create  test/integration
create  test/unit
create  vendor
create  vendor/plugins
create  tmp/sessions
create  tmp/sockets
create  tmp/cache
create  tmp/pids
create  Rakefile
create  README
create  app/controllers/application.rb
create  app/helpers/application_helper.rb
create  test/test_helper.rb
create  config/database.yml
create  config/routes.rb
create  config/initializers/inflections.rb
create  config/initializers/mime_types.rb
create  config/initializers/new_rails_defaults.rb
create  config/boot.rb
create  config/environment.rb
create  config/environments/production.rb
create  config/environments/development.rb
create  config/environments/test.rb
create  script/about
create  script/console
create  script/dbconsole
create  script/destroy
create  script/generate
create  script/performance/benchmarker
create  script/performance/profiler
create  script/performance/request
create  script/process/reaper
create  script/process/spawner
create  script/process/inspector
create  script/runner
create  script/server
create  script/plugin
create  public/dispatch.rb
create  public/dispatch.cgi
create  public/dispatch.fcgi
create  public/404.html
create  public/422.html
create  public/500.html
create  public/index.html
create  public/favicon.ico
create  public/robots.txt
create  public/images/rails.png
create  public/javascripts/prototype.js
create  public/javascripts/effects.js
create  public/javascripts/dragdrop.js
create  public/javascripts/controls.js
create  public/javascripts/application.js
create  doc/README_FOR_APP
create  log/server.log
create  log/production.log
create  log/development.log
create  log/test.log
<pre><code>

STEP 3: Install OpenLaszlo plugin

Change directory

</code>
C:\eclipse-workspace>cd contacts
C:\eclipse-workspace\contacts>ruby script/plugin install http://laszlo-plugin.rubyforge.org/svn/tags/openlaszlo/
+ ./CHANGES 
+ ./MIT-LICENSE 

+ ./README 

+ ./Rakefile 

+ ./TODO
+ ./generators/applet/USAGE
+ ./generators/applet/applet_generator.rb
+ ./generators/applet/templates/applet.lzx
+ ./generators/applet/templates/datamanager.lzx
+ ./generators/applet/templates/modelcontroller.lzx
+ ./generators/applet/templates/modelgrid.lzx
+ ./generators/applet/templates/view.rhtml
+ ./generators/rest_controller/USAGE
+ ./generators/rest_controller/rest_controller_generator.rb
+ ./generators/rest_controller/templates/controller.rb
+ ./generators/rest_scaffold/USAGE
+ ./generators/rest_scaffold/rest_scaffold_generator.rb
+ ./generators/rest_scaffold/templates/controller.rb
+ ./init.rb
+ ./javascripts/flashobject.js
+ ./lib/active_record_rest.rb
+ ./lib/active_record_xml.rb
+ ./lib/extensions.rb
+ ./lib/flashobject_view_helper.rb
+ ./lib/range_list.rb
+ ./lib/rest_helper.rb
+ ./lib/rest_scaffolding.rb
+ ./tasks/compile_applets.rake
+ ./tasks/update_flashobject.rake
+ ./trunk/CHANGES
+ ./trunk/MIT-LICENSE
+ ./trunk/README
+ ./trunk/Rakefile
+ ./trunk/TODO
+ ./trunk/generators/applet/USAGE
+ ./trunk/generators/applet/applet_generator.rb
+ ./trunk/generators/applet/templates/applet.lzx
+ ./trunk/generators/applet/templates/datamanager.lzx
+ ./trunk/generators/applet/templates/modelcontroller.lzx
+ ./trunk/generators/applet/templates/modelgrid.lzx
+ ./trunk/generators/applet/templates/view.rhtml
+ ./trunk/init.rb
+ ./trunk/install.rb
+ ./trunk/javascripts/flashobject.js
+ ./trunk/lib/flashobject_view_helper.rb
+ ./trunk/lib/openlaszlo_build_support.rb
+ ./trunk/lib/openlaszlo_installer.rb
+ ./trunk/tasks/compile_applets.rake
+ ./trunk/tasks/update_javascripts.rake
<pre><code>

STEP 4: Generate Applet now

</code>

C:\eclipse-workspace\contacts>ruby script/generate applet contacts applet
exists  app/views/
dependency  model
exists    app/models/
exists    test/unit/
exists    test/fixtures/
create    app/models/contacts.rb
create    test/unit/contacts_test.rb
create    test/fixtures/contacts.yml
create    db/migrate
create    db/migrate/20080918153823_create_contacts.rb
dependency  rest_controller
exists    app/controllers/
exists    app/helpers/
exists    test/functional/
dependency    model
exists      app/models/
exists      test/unit/
exists      test/fixtures/
identical      app/models/contacts.rb
identical      test/unit/contacts_test.rb
identical      test/fixtures/contacts.yml
exists      db/migrate
Another migration is already named create_contacts: db/migrate/20080918153823_create_contacts.rb
./script/generate applet contacts applet
This will create:
app/applets/contacts/contacts.lzx
app/views/contacts/applet.rhtml
<pre><code>

STEP 5 (OPTIONAL): Set java_opts

</code></pre>
set JAVA_OPTS=-Xms256m -Xmx512m -XX:MaxPermSize=128m
<pre><code>

STEP 5: Rake applets

</code>
C:\eclipse-workspace\contacts>rake applets
C:\eclipse-workspace\contacts>cp C:/ eclipse-workspace/contacts/vendor/plugins/openlaszlo/javascripts/flashobject.js C:/ eclipse-workspace/contacts/public/javascripts
C:\eclipse-workspace\contacts>mkdir -p C:/eclipse-workspace/contacts/public/appletsC:\eclipse-workspace\contacts>lzc -dir public/applets app/applets/applet/applet.lzx
Compiling: app\applets\applet\applet.lzx to public\applets\applet.lzr=swf8.swf
<pre><code>


Hope it helps some one who are looking to integrate both these technologies.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: