Google Groups Home
Help | Sign in
Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Oliver.Steele@gmail.com  
View profile
 More options Jan 10 2006, 2:48 pm
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Tue, 10 Jan 2006 11:48:43 -0800
Local: Tues, Jan 10 2006 2:48 pm
Subject: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Download page: http://osteele.com/sources/ruby/contacts-0.1.zip
Wiki page: http://wiki.openlaszlo.org/Rails_Scaffolding
Online readme: http://osteele.com/sources/ruby/contacts/README

Contacts is a sample application that demonstrates the integration of
the OpenLaszlo client framework with the Ruby on Rails server
framework.  Contacts is a Ruby application, one of whose assets is an
OpenLaszlo applet that uses REST and AJAX to communicate with the
server.

Contacts is also a temporary container for the helpers and scaffolding
that make it easy to integrate OpenLaszlo and Rails.  (For now, these
live in the 'vendors' subdirectory of the Contacts source
distribution.)  These helpers are intended to make it easy to add
OpenLaszlo integration to your own application.

Both contacts, and these helpers, are pre-alpha code.  A list of known
omissions is at the bottom of the readme
<http://osteele.com/sources/ruby/contacts/README>.  Much of what's
missing, however, is unknown.  The helper files in contacts have only
been used in this one application, without unit tests, and only for a
few hours.  I'm distributing this very early, so that enthusiasts can
look at it while I continue to work on it.

As an example of how to use the helpers, the Contacts controller looks
like this, in its entirety:
  require 'openlaszlo/rest_scaffolding.rb'
  require 'openlaszlo/rest_helper.rb'

  class ContactsController < ApplicationController
    rest_scaffold :contact
  end

This, together with the default Rails routing rules, implements these
requests from the Database Connector spec
<http://wiki.openlaszlo.org/Database_Connector>:

Retrieve the schema:
  /contacts/schema

Retrieve records by id:
  /contacts/1
  /contacts/1,3
  /contacts/1-10
  /contacts/-10
  /contacts/-10,14-17
  /contacts/11-

Retrieve records by offset and limit:
  /page/1
  /page/1,3
  /page/1-10
  /page/-10
  /page/-10,14-17
  /page/11-

Create, update, and delete:
  /create/firstname=Oliver&lastname=Steele
  /update?id=1&firstname=Oliver&lastname=Steele
  /delete/1

(In some cases these are variants of the URLs described in the spec.
Over time, we will bring the code and spec together.)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Pence  
View profile
 More options Jan 10 2006, 3:06 pm
From: Mike Pence <mike.pe...@gmail.com>
Date: Tue, 10 Jan 2006 15:06:14 -0500
Local: Tues, Jan 10 2006 3:06 pm
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Wow. And I thought I was going to be getting some sleep tonight.
Thanks, Oliver! This is awesome -- saves us weeks of work on doing
some proof-of-concept stuff.

Two things have been bothering me that I think I have found a
resolution for: binding to tables and where (or when) to allow
arbitrary SQL calls.

I think that the problem I have with binding to tables is historical
-- I have seen too many tools come out that treated a row in a table
as a self-contained entitiy, as if real-world objects aren't the
product of joining many tables. Anyway, Martin Fowler's description of
ActiveRecord (the pattern) specifies that it is an object wrapper for
a row from a table *or view*. That works for me. In Rails, we would
just have to override the save method to update many tables (or call a
stored proc, heaven forbid!) if the data source is actually a view or
the product of a join. I just don't want to propogate the simplistic
view that objects = table.rows all the time. That is just not the
case.

When to allow SQL? I just learned last night from argv[0] on
#rubyonrails that you can arbitrarily create a model object anytime
you call find_by_sql. For example:

./script/console →
s = ActiveRecord::Base.find_by_sql("SELECT 'hello' as word").first
puts s.word

That is way cool. So, I think that our approach should be similar:

1. Design so that the developer never needs to resort to SQL
2. Allow the developer to resort to SQL all the time

Mike Pence

On 1/10/06, Oliver.Ste...@gmail.com <Oliver.Ste...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver.Steele@gmail.com  
View profile
 More options Jan 11 2006, 11:38 pm
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Wed, 11 Jan 2006 20:38:14 -0800
Local: Wed, Jan 11 2006 11:38 pm
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
I've factored the OpenLaszlo helper and scaffolding code out from this
application, into a Rails plugin.  This makes it easier to use it in
other applications.  To use OpenLaszlo in a Rails application, do this:
  > gem install ropenlaszlo
  # In the application directory:
  > script/plugin install
svn://rubyforge.org/var/svn/ropenlaszlo/rails/plugins/openlaszlo

And create a controller that looks like this:
  class ContactsController < ApplicationController
    rest_scaffold :contact
  end

http://osteele.com/sources/ruby/openlaszlo has a new copy of Contacts,
that is ready to be used with the gem and the plugin.

I'm planning to work next on generators, a rake task, and a view
helper, and then probably call it a day.

What I'm *not* working on, even though I'd very much like to see them,
includes:
* Writing a sexier example, such as an RSS reader
* Writing an example that uses Create, Update, or Delete
* Reviewing the REST spec
* Matching the REST spec to this implementation, or vice versa (at
least for now)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver.Steele@gmail.com  
View profile
 More options Jan 11 2006, 11:40 pm
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Wed, 11 Jan 2006 20:40:09 -0800
Local: Wed, Jan 11 2006 11:40 pm
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Oh yeah, I'm also not working on any OpenLaszlo components that consume
this data.  I believe that that (and some good demos) are what this
project really needs in order to be compelling to people who aren't
already sold on it.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Pence  
View profile
 More options Jan 12 2006, 12:04 am
From: Mike Pence <mike.pe...@gmail.com>
Date: Thu, 12 Jan 2006 00:04:29 -0500
Local: Thurs, Jan 12 2006 12:04 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Ok, I am confused. When you say "I'm also not working on any
OpenLaszlo components that consume this data," do you mean that you
are leaving this for others to do? Also, do you intend for this to be
a complementary project to Laszlo on Rails?

Mike Pence

On 1/11/06, Oliver.Ste...@gmail.com <Oliver.Ste...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Max Carlson  
View profile
 More options Jan 12 2006, 1:07 am
From: Max Carlson <m...@laszlosystems.com>
Date: Wed, 11 Jan 2006 22:07:58 -0800
Local: Thurs, Jan 12 2006 1:07 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
I'm happy to do this.  I have a paging data controller that can help
manage reads and be extended for updates and inserts.

I can also imagine a dynamic client-side view generator based on the
/schema url.  It would be very cool to be able get rails validation
fields sent in schema requests for client-side validation.

-Max


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Uncle D  
View profile
 More options Jan 12 2006, 4:28 am
From: Uncle D <theunc...@gmail.com>
Date: Thu, 12 Jan 2006 00:28:40 -0900
Local: Thurs, Jan 12 2006 4:28 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1

Excellent start on the project! This gives us all a chance to "fiddle" with
these latest developments and present something new and unique as a result.
Start fiddling :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver.Steele@gmail.com  
View profile
 More options Jan 12 2006, 10:12 am
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Thu, 12 Jan 2006 07:12:06 -0800
Local: Thurs, Jan 12 2006 10:12 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
I'm hoping the work that I'm doing can be used in Laszlo on Rails.  I
just meant that there are a lot of other parts of that project that I'm
not planning to touch.  Since I had charged ahead on some of the
server-side integration pieces without any project coordination, I
wanted to make it clear what the boundaries of the area that I'm trying
to tackle this week.

I'm trying to do this in such a way that the same code could be used in
the RSS reader you proposed, or a cookbook, or other applications ---
although I'm sure you'll uncover bugs in in when you do this.

Sorry for the confusion.  It was late at night (for me) when I wrote
that.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver.Steele@gmail.com  
View profile
 More options Jan 12 2006, 10:35 am
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Thu, 12 Jan 2006 07:35:05 -0800
Local: Thurs, Jan 12 2006 10:35 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Version 0.3 of the plugin and the demo app are available now.

Demo application: http://osteele.com/sources/ruby/contacts-0.1.zip
OpenLaszlo gem: 'gem install ropenlaszlo' (this hasn't changed since
yesterday)
OpenLaszlo Rails plugin: "script/plugin install
svn://rubyforge.org/var/svn/ropenlaszlo/rails/plugins/openlaszlo" (or
"script/plugin update" if you've got it installed already)

The main changes are:
* The plugin now installs the flashobject.js javascript file into
public/javascripts (when you execute 'rake update_javascripts)
* <%= javascript_include_tag :default %> includes flashobject.js by
default.  Or you can use <%= javascript_include_tag 'flashobject' %> if
you just want the one file.
* The plugin defines a tag <%= flashobject_tags 'applet'' %> that
generates the HTML to include a Flash object.
* The demo app uses these new features.  It no longer includes its own
copy of flashobject.js.
* 'rake initialize' will do most of the demo app setup: create and seed
the database tables, update javascripts, and compile the applet.  You
still need to create the database and database user (as with any rails
application).

I'm planning to write some generators next and then put this on the
back burner (at least, for me).  Later today I'll jump on over to the
basecamp project for a discussion of how best to make the sources
available for collaborative development.

I don't anticipate any incompatabilities between this and future
versions, so get coding!

-- Oliver


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Pence  
View profile
 More options Jan 12 2006, 10:58 am
From: Mike Pence <mike.pe...@gmail.com>
Date: Thu, 12 Jan 2006 10:58:04 -0500
Local: Thurs, Jan 12 2006 10:58 am
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Oliver,

This is all insanely great. Your contributions are invaluable!

Mike Pence


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver.Steele@gmail.com  
View profile
 More options Jan 12 2006, 1:18 pm
From: "Oliver.Ste...@gmail.com" <Oliver.Ste...@gmail.com>
Date: Thu, 12 Jan 2006 10:18:58 -0800
Local: Thurs, Jan 12 2006 1:18 pm
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Okay, version 0.4 of the plugin is available.  This one adds generators
for the controller, applet (LZX source file), and view:
  > script/generate rest_controller contacts
  > script/generate applet contacts applet

The default applet doesn't *do* anything, and you still need to edit
your rakefile to manually add tasks to compile the applet.  And the
failure mode for forgetting to do any of this is just that nothing
appears.  Once these things are fixed, I'll make a new top-level
announcement on this mailing list, that ties all this back together.

After that, I think we should bang on this for a while in our little
closed community, and then add these to the plugin and generator
sections of the Rails wiki once we know that they work.  I'd like to
redirect the docs for these to laszloonrails.com before that too.
Maybe we can also put the rdoc for these packages up there.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shodZ  
View profile
 More options Jan 13 2006, 11:52 pm
From: shodZ <shodhan.sh...@gmail.com>
Date: Sat, 14 Jan 2006 10:22:03 +0530
Local: Fri, Jan 13 2006 11:52 pm
Subject: Re: Announcement: Contacts demo and OpenLaszlo scaffolding, version 0.1
Hi
i cant seem to installt the plugin. i have installed ropenlaszlo 0.2
but the script/plugin install command throws me the following

E:\Eclipse_Projects\ropenlaszlo>ruby script/plugin install svn://rubyforge.org/v
ar/svn/ropenlaszlo/rails/plugins/openlaszlo
script/plugin: No such file or directory - svn --version
c:/ruby/lib/ruby/1.8/open-uri.rb:87:in `initialize': Invalid argument - svn://ru
byforge.org/var/svn/ropenlaszlo/rails/plugins/openlaszlo (Errno::EINVAL)
        from c:/ruby/lib/ruby/1.8/open-uri.rb:87:in `open_uri_original_open'
        from c:/ruby/lib/ruby/1.8/open-uri.rb:87:in `open'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/plugin.rb:8
15:in `fetch_dir'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/plugin.rb:8
09:in `fetch'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/plugin.rb:8
08:in `each'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0