From: Eric Hodel Date: 2004-03-10T13:27:40-08:00 Subject: Re: Borges app registration --HKOZ/JADkehwFk9I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jim Menard (jimm@io.com) wrote: > I'm playing with Borges, and I'm trying to understand the application > registration process. I grepped for 'register_application' and found > calls to register 'counter', 'rates', 'examples', 'calendar', and > 'test'. The application registration process is complicated :) > The /config page lists three apps, one of which is the config app itself.= I > don't see a way to add apps. Is there one? The functionality exists to dynamically load applications, but not to remove them, I believe I disabled both features, since reloading is not handled very gracefully. When writing a new application, you'll have to call Controller#register_application. Its arguments are a name, and an optional session class. Since anything you register as an application is a subclass of Controller, you simply need to call register_application('name') from the class you are defining. You don't need to register every new Controller subclass you create, only the entry points. The application will be mounted as 'name' under /borges. (http://yourserver/borges/name) For a good example, see the SushiNet example application, it should be installed in something like: /usr/local/share/examples/ruby/Borges/SushiNet You want to look at StoreTask.rb, and StoreSession.rb. > Why don't I see 'calendar', 'test', 'examples', and 'tutorial' > in the list on the config page? Where in the code are 'rates' and > 'counter' added (but not 'examples', 'calendar', and 'test')? 'calendar' is still broken, there's a bug with its Observer that I haven't had the time to fix yet. I think 'rates' is dependent upon it, and won't work. To load 'test', require 'Borges/Test' To load 'examples', require 'Borges/Component/ExampleBrowser' 'counter' is added in Borges/Component/Counter, from require 'Borges'. 'rates' is added in Borges/Component/DateRangeSelector, also from require 'Borges'. =20 --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --HKOZ/JADkehwFk9I Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFAT4hMMypVHHlsnwQRAvzHAKCiEWV4vjF8TNrmXf+htTmusCoI6gCgjVYd /1mHeGOEX6OacEvAicClKQs= =E3ee -----END PGP SIGNATURE----- --HKOZ/JADkehwFk9I--