From deb at ysabel.org Mon Aug 1 00:52:35 2005 From: deb at ysabel.org (Ysabel) Date: Sun, 31 Jul 2005 22:52:35 -0600 Subject: [Nitro] Problems using Og In-Reply-To: <6fcd26f1050731123853760e76@mail.gmail.com> References: <6fcd26f1050731123853760e76@mail.gmail.com> Message-ID: <0C3C48907CEC568C62736967@[10.19.0.236]> --On Sunday, July 31, 2005 12:38 PM -0700 John Lloyd-Jones wrote: > .. and that give the error message : > (eval):23:in `add_address': undefined method `personal_customer_oid=' > for # (NoMethodError) > from og-test.rb:53:in `addAddress' > from og-test.rb:124 On a quick skim, at least, it looks like what you're doing is correct, and the relationship is somehow getting enchanted at the child class as well as the parent class, but only half-right down at the child. I'd have to play with it a bit more to be sure, but I'm pretty sure you're running across a bug. add_address should be picking up Party.add_address, which should be referencing party_oid=. It looks like there's a PersonalCustomer.add_address, through, which there shouldn't be. -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From deb at ysabel.org Mon Aug 1 01:02:23 2005 From: deb at ysabel.org (Ysabel) Date: Sun, 31 Jul 2005 23:02:23 -0600 Subject: [Nitro] Problems using Og In-Reply-To: <0C3C48907CEC568C62736967@[10.19.0.236]> References: <6fcd26f1050731123853760e76@mail.gmail.com> <0C3C48907CEC568C62736967@[10.19.0.236]> Message-ID: --On Sunday, July 31, 2005 10:52 PM -0600 Ysabel wrote: > add_address should be picking up Party.add_address, which should be > referencing party_oid=. It looks like there's a > PersonalCustomer.add_address, through, which there shouldn't be. That said, I suspect you could work around it by doing this on Address: def personal_customer_oid self.party_oid end def personal_customer_oid=(oid) self.party_oid = oid end (Which is a gross hack, but it'd be interesting at least to know if it works.) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From john.lloydjones at gmail.com Mon Aug 1 01:42:15 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Sun, 31 Jul 2005 22:42:15 -0700 Subject: [Nitro] Problems using Og In-Reply-To: References: <6fcd26f1050731123853760e76@mail.gmail.com> <0C3C48907CEC568C62736967@10.19.0.236> Message-ID: <6fcd26f1050731224233a00d6@mail.gmail.com> Ysabel > That said, I suspect you could work around it by doing this on Address: > > def personal_customer_oid > self.party_oid > end > def personal_customer_oid=(oid) > self.party_oid = oid > end > > (Which is a gross hack, but it'd be interesting at least to know if it > works.) > Yes, that did work. Not pretty, but it moves me forwards. Thanks, John From george.moschovitis at gmail.com Mon Aug 1 02:42:08 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 1 Aug 2005 09:42:08 +0300 Subject: [Nitro] Problems using Og In-Reply-To: <6fcd26f1050731224233a00d6@mail.gmail.com> References: <6fcd26f1050731123853760e76@mail.gmail.com> <0C3C48907CEC568C62736967@10.19.0.236> <6fcd26f1050731224233a00d6@mail.gmail.com> Message-ID: Ok, I 'll have a look at this! Thanks for reporting! -g. On 8/1/05, John Lloyd-Jones wrote: > Ysabel > > > That said, I suspect you could work around it by doing this on Address: > > > > def personal_customer_oid > > self.party_oid > > end > > def personal_customer_oid=(oid) > > self.party_oid = oid > > end > > > > (Which is a gross hack, but it'd be interesting at least to know if it > > works.) > > > Yes, that did work. Not pretty, but it moves me forwards. > Thanks, > John > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.nitrohq.com From george.moschovitis at gmail.com Mon Aug 1 06:40:29 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 1 Aug 2005 13:40:29 +0300 Subject: [Nitro] My Nitro powered Blog Message-ID: Hello everyone :) My new blog is online at http://www.gmosx.com! Of course it is powered by Nitro and Og. Please have a look. I plan to update this daily, mostly with Nitro/Ruby related stuff :) have fun, George PS: and report any bugs, this was a quick job. -- http://www.nitrohq.com From progrium at gmail.com Mon Aug 1 12:19:13 2005 From: progrium at gmail.com (Jeff Lindsay) Date: Mon, 1 Aug 2005 09:19:13 -0700 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: The RSS feed content is URL encoded and doesn't have a very good title. That's all I've noticed. On 8/1/05, George Moschovitis wrote: > Hello everyone :) > > My new blog is online at http://www.gmosx.com! > > Of course it is powered by Nitro and Og. Please have a look. I plan to > update this daily, mostly with Nitro/Ruby related stuff :) > > have fun, > George > > PS: and report any bugs, this was a quick job. > > > -- > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Jeff Lindsay http://blogrium.com/ From mneumann at ntecs.de Mon Aug 1 12:32:31 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Mon, 01 Aug 2005 18:32:31 +0200 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: <42EE4E9F.5090001@ntecs.de> George Moschovitis wrote: > Hello everyone :) > > My new blog is online at http://www.gmosx.com! > > Of course it is powered by Nitro and Og. Please have a look. I plan to > update this daily, mostly with Nitro/Ruby related stuff :) > > have fun, > George > > PS: and report any bugs, this was a quick job. Will you release the source code? :) Regards, Michael From jforeman at hark.org Mon Aug 1 19:40:22 2005 From: jforeman at hark.org (Jason Foreman) Date: Mon, 1 Aug 2005 18:40:22 -0500 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: Congrats George! FYI, I like the theme in the examples blog better than this overdone round blue theme :) Also, what's your deployment look like (Webrick, FastCGI, ?)? Did you have a look at the FCGI problem I had with web services? If I could get around that issue, you'd not be the only blog running on Nitro/Og... Jason On Aug 1, 2005, at 5:40 AM, George Moschovitis wrote: > Hello everyone :) > > My new blog is online at http://www.gmosx.com! > > Of course it is powered by Nitro and Og. Please have a look. I plan to > update this daily, mostly with Nitro/Ruby related stuff :) > > have fun, > George > > PS: and report any bugs, this was a quick job. > > > -- > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From john.lloydjones at gmail.com Mon Aug 1 23:06:06 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Mon, 1 Aug 2005 20:06:06 -0700 Subject: [Nitro] Problems using Og In-Reply-To: References: <6fcd26f1050731123853760e76@mail.gmail.com> <0C3C48907CEC568C62736967@10.19.0.236> <6fcd26f1050731224233a00d6@mail.gmail.com> Message-ID: <6fcd26f1050801200626811ec1@mail.gmail.com> I have another error that appears to rooted in the same problem as I previously reported. As before I have Party, Person and PersonalCustomer. where Party :has_many, Address I have saved a PersonalCustomer and now try to add multiple addresses. I get an error when trying to retrieve an address by name. Here's the code that fails: def test_multiple_addresses p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' p2.add_address( @a_primary ) p2.add_address( @a_maling ) p2.save p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' a1 = p3.addresses['primary'] end Here's the message I get: DEBUG: SELECT * FROM ogcrm_personalcustomer WHERE customer_number=1002 DEBUG: SELECT * FROM ogcrm_address WHERE personal_customer_oid = 1 /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/errors.rb:94:in `check': no suchcolumn: personal_customer_oid (SQLite3::SQLException) John On 7/31/05, George Moschovitis wrote: > Ok, I 'll have a look at this! > > Thanks for reporting! > -g. > > On 8/1/05, John Lloyd-Jones wrote: > > Ysabel > > > > > That said, I suspect you could work around it by doing this on Address: > > > > > > def personal_customer_oid > > > self.party_oid > > > end > > > def personal_customer_oid=(oid) > > > self.party_oid = oid > > > end > > > > > > (Which is a gross hack, but it'd be interesting at least to know if it > > > works.) > > > > > Yes, that did work. Not pretty, but it moves me forwards. > > Thanks, > > John > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://www.nitrohq.com > From george.moschovitis at gmail.com Tue Aug 2 02:07:45 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 2 Aug 2005 09:07:45 +0300 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: > FYI, I like the theme in the examples blog better than this overdone > round blue theme :) Oh, it is FULLY themable :) > Also, what's your deployment look like (Webrick, FastCGI, ?)? Did > you have a look at the FCGI problem I had with web services? If I > could get around that issue, you'd not be the only blog running on > Nitro/Og... The blog runs using Webrick, Og in thread safe mode, output caching is enabled, and an Apache server handles the static files. The fix will be available in 0.22.0 but I 'll probably release some preview gems in the next days, stay tuned! regards, George. -- http://www.nitrohq.com From george.moschovitis at gmail.com Tue Aug 2 02:11:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 2 Aug 2005 09:11:25 +0300 Subject: [Nitro] Problems using Og In-Reply-To: <6fcd26f1050801200626811ec1@mail.gmail.com> References: <6fcd26f1050731123853760e76@mail.gmail.com> <0C3C48907CEC568C62736967@10.19.0.236> <6fcd26f1050731224233a00d6@mail.gmail.com> <6fcd26f1050801200626811ec1@mail.gmail.com> Message-ID: I 'll look at this along with your earlier post, later today. -g. On 8/2/05, John Lloyd-Jones wrote: > I have another error that appears to rooted in the same problem as I > previously reported. > > As before I have Party, Person and PersonalCustomer. where Party > :has_many, Address > > I have saved a PersonalCustomer and now try to add multiple addresses. > I get an error when trying to retrieve an address by name. > > Here's the code that fails: > > def test_multiple_addresses > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > p2.add_address( @a_primary ) > p2.add_address( @a_maling ) > p2.save > > p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > a1 = p3.addresses['primary'] > end > > Here's the message I get: > > DEBUG: SELECT * FROM ogcrm_personalcustomer WHERE customer_number=1002 > DEBUG: SELECT * FROM ogcrm_address WHERE personal_customer_oid = 1 > /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/errors.rb:94:in > `check': no suchcolumn: personal_customer_oid (SQLite3::SQLException) > > John > > > On 7/31/05, George Moschovitis wrote: > > Ok, I 'll have a look at this! > > > > Thanks for reporting! > > -g. > > > > On 8/1/05, John Lloyd-Jones wrote: > > > Ysabel > > > > > > > That said, I suspect you could work around it by doing this on Address: > > > > > > > > def personal_customer_oid > > > > self.party_oid > > > > end > > > > def personal_customer_oid=(oid) > > > > self.party_oid = oid > > > > end > > > > > > > > (Which is a gross hack, but it'd be interesting at least to know if it > > > > works.) > > > > > > > Yes, that did work. Not pretty, but it moves me forwards. > > > Thanks, > > > John > > > > > > _______________________________________________ > > > Nitro-general mailing list > > > Nitro-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > > > > -- > > http://www.nitrohq.com > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.nitrohq.com From redentis at gmail.com Tue Aug 2 04:36:39 2005 From: redentis at gmail.com (Marcus Edwards) Date: Tue, 2 Aug 2005 09:36:39 +0100 Subject: [Nitro] Controller not being picked up by dispatcher Message-ID: All, Please can someone help with the follow (extraordinarily) simple problem: my controller isn't being recognised, what's wrong? ---8<--- run.rb #!/usr/bin/env ruby require 'nitro' require 'src/controller' STDERR.sync = true if not STDERR.sync # $DBG = true include Nitro Nitro.run do |conf| conf.dispatcher = Dispatcher.new( '/book' => BookController ) conf.set( :name => 'Pendleton House Library', :host => '127.0.0.1', :port => 9999 ) end ---8<--- ---8<--- controller.rb require 'nitro/controller' include Nitro class BookController < Controller # should use the default index method def search puts "BookController.search" end end ---8<--- ---8<--- index.xhtml Search ---8<--- The output I get on the console is: ---8<--- (stdout) $ ruby run.rb ==> Listening at 127.0.0.1:9999. (debug mode) [2005-08-02 08:59:30] INFO WEBrick 1.3.1 [2005-08-02 08:59:30] INFO ruby 1.8.2 (2004-12-25) [i386-cygwin] [2005-08-02 08:59:30] INFO WEBrick::HTTPServer#start: pid=4500 port=9999 DEBUG: Rendering '/'. DEBUG: Compiling action 'Nitro::SimpleController#index' DEBUG: Compiling template 'Nitro::SimpleController: public/index.xhtml' DEBUG: Rendering '/book/search'. DEBUG: Compiling action 'Nitro::SimpleController#book' ERROR: Error while handling '/book/search'. ERROR: undefined method `book_action' for # /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/controller.rb:165:in `metho d_missing' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/render.rb:111:in `send' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/render.rb:111:in `render' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/adapter/webrick.rb:120:in ` do_GET' /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__' /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:94:in `start' /usr/lib/ruby/1.8/webrick/server.rb:89:in `each' /usr/lib/ruby/1.8/webrick/server.rb:89:in `start' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/adapter/webrick.rb:42:in `s tart' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/server/runner.rb:278:in `in voke_server' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/server/runner.rb:246:in `in voke' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/server.rb:107:in `run' /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro.rb:74:in `run' run.rb:24 LOGGED FROM: /usr/lib/ruby/gems/1.8/gems/nitro-0.21.2/lib/nitro/render.rb:160: in `log_error' DEBUG: Rendering '/error'. DEBUG: Compiling action 'Nitro::SimpleController#error' DEBUG: Compiling template 'Nitro::SimpleController: public/error.xhtml' ---8<--- My guess is that there is something wrong with the dispatcher configuration but I can't work out what it is. I haven't defined a dispatcher for '/' as I was expecting that to pick up /public/index.xhtml and render that. As it is, it looks like attempts to render '/book/search' are being dispatched to the default SimpleController and not my BookController. Any help much appreciated. Thanks, Marcus From george.moschovitis at gmail.com Tue Aug 2 04:56:41 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 2 Aug 2005 11:56:41 +0300 Subject: [Nitro] Controller not being picked up by dispatcher In-Reply-To: References: Message-ID: First of all, you should update to the latest version of Nitro 0.21.2 Then I would suggest that you have a look at the intialization code in examples/blog/run.rb Uou should probably add something like: Server.map = { '/book' => BookController, '/api' => ApiController .. } Nitro.run If you still have problems let me know! -g. -- http://www.nitrohq.com From progrium at gmail.com Tue Aug 2 08:17:08 2005 From: progrium at gmail.com (Jeff Lindsay) Date: Tue, 2 Aug 2005 05:17:08 -0700 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: So you're running two web servers? On 8/1/05, George Moschovitis wrote: > > FYI, I like the theme in the examples blog better than this overdone > > round blue theme :) > > Oh, it is FULLY themable :) > > > Also, what's your deployment look like (Webrick, FastCGI, ?)? Did > > you have a look at the FCGI problem I had with web services? If I > > could get around that issue, you'd not be the only blog running on > > Nitro/Og... > > The blog runs using Webrick, Og in thread safe mode, output caching is > enabled, and an Apache server handles the static files. > > The fix will be available in 0.22.0 but I 'll probably release some > preview gems in the next days, stay tuned! > > regards, > George. > > -- > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Jeff Lindsay http://blogrium.com/ From redentis at gmail.com Tue Aug 2 11:47:25 2005 From: redentis at gmail.com (Marcus Edwards) Date: Tue, 2 Aug 2005 16:47:25 +0100 Subject: [Nitro] Help understanding ... process Message-ID: Hi All, I've been working through the Nitro tutorial at NitroHQ and have a question based on section "Chapter 7: Shaping Up" http://www.nitrohq.com/view/NSBS_Shaping_Things_Up. The tutorial states: "...The form action is set to "post_entry," so you'll need to add some server code to respond to that request ... First, Nitro will look for post_entry.html. If not found, then post_entry.xhtml is the target. If that does not exist, Nitro will attempt to invoke post_entry on the default component..." This is all perfectly logical and it what I would expect. However, the text then goes on to say: "...Finally, add a new template (named post_entry.xhtml to map to the method) to render the new entry..." My question then is this: if the dispatch sequence for requests looks for .xhtml templates *ahead* of the controllers (first quote), wouldn't adding the .xhtml template "to render the results of the request" (second quote) short-circuit the process and prevent the dispatcher from using the controller? It would help me enormously if someone could describe the whole decision chain from when a request is received until the response is returned. E.g. 1. Server: request received 2. Server: apply request filters... 3. Dispatcher: find controller 3.1 .html? ... 3.1.1 html controller (SimpleController) ... 3.2 .xhtml 3.2.1 xhtml controller (SimpleController? Compiler?) ... 3.3 Server.map[request url fragment #1]? 3.3.1 Controller: has method matching request url fragment #2? etc. Obviously a UML sequence diagram would be superb but a description at the very least would help. I'm more then happy to sketch up the diagram if someone can explain how it works. I'll try walking through the code to get at the answer to this but if someone has a ready explanation, I'm all ears. Thanks, Marcus From ak at navel.gr Tue Aug 2 11:59:35 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Tue, 02 Aug 2005 18:59:35 +0300 Subject: [Nitro] My Nitro powered Blog In-Reply-To: References: Message-ID: <42EF9867.5050609@navel.gr> Jeff Lindsay wrote: >So you're running two web servers? > > yes! webrick will answer to all requests for dynamic pages, which will be cached for future requests (as static html pages). apache will serve all requests for static files (media and cached html pages). tasos >On 8/1/05, George Moschovitis wrote: > > >>>FYI, I like the theme in the examples blog better than this overdone >>>round blue theme :) >>> >>> >>Oh, it is FULLY themable :) >> >> >> >>>Also, what's your deployment look like (Webrick, FastCGI, ?)? Did >>>you have a look at the FCGI problem I had with web services? If I >>>could get around that issue, you'd not be the only blog running on >>>Nitro/Og... >>> >>> >>The blog runs using Webrick, Og in thread safe mode, output caching is >>enabled, and an Apache server handles the static files. >> >>The fix will be available in 0.22.0 but I 'll probably release some >>preview gems in the next days, stay tuned! >> >>regards, >>George. >> >>-- >>http://www.nitrohq.com >> >>_______________________________________________ >>Nitro-general mailing list >>Nitro-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/nitro-general >> >> >> > > > > -- Navel, Greece http://www.navel.gr @@ +30 210 6898050 Navel does not accept liability for any errors, viruses or omissions in the contents of this message, which arise as a result of e-mail transmission. The full corporate policy is available on our web site. ____________________________________ Did you joy today? www.JOY.GR !!! From tim at keow.org Tue Aug 2 14:06:59 2005 From: tim at keow.org (Tim Larson) Date: Tue, 2 Aug 2005 19:06:59 +0100 Subject: [Nitro] Help understanding ... process In-Reply-To: References: Message-ID: <20050802180658.GB1193@localhost> On Tue, Aug 02, 2005 at 04:47:25PM +0100, Marcus Edwards wrote: ... > It would help me enormously if someone could describe the whole > decision chain from when a request is received until the response is > returned. E.g. > > 1. Server: request received > 2. Server: apply request filters... > 3. Dispatcher: find controller > 3.1 .html? ... > 3.1.1 html controller (SimpleController) > ... > 3.2 .xhtml > 3.2.1 xhtml controller (SimpleController? Compiler?) > ... > 3.3 Server.map[request url fragment #1]? > 3.3.1 Controller: has method matching request url fragment #2? > etc. > > Obviously a UML sequence diagram would be superb but a description at > the very least would help. I'm more then happy to sketch up the > diagram if someone can explain how it works. I'll try walking through > the code to get at the answer to this but if someone has a ready > explanation, I'm all ears. I am also walking through the code trying to figure this all out, with the disadvantage that I am also new to Ruby so the code is a little foreign to my eyes :( At this stage, before my mental map of Ruby has had a chance to settle in comfortably, all those nice Ruby features that make programming faster and easier are just making the code that much harder for me to read. In the mean time... If (when?) some kind soul does clarify the sequence above, could you also explain how the system maps from the handling method back to the choice of which template file to use? It seems like just a *tiny* bit of hand holding documentation like this would make all the difference for us Nitro newcomers/evaluators. --Tim Larson From tim at keow.org Tue Aug 2 17:36:13 2005 From: tim at keow.org (Tim Larson) Date: Tue, 2 Aug 2005 22:36:13 +0100 Subject: [Nitro] compound keys Message-ID: <20050802213612.GC1193@localhost> What is the prefered way of handling compound keys, compound foreign keys, and compound indexes using Og? I have read the tutorials and looked at examples, but they all seem to only handle simple databases like you would use to support a blog, rather than more complex schemas such as you would find in financial applications. ActiveRecord also seems to have this limitation (at least from the documentation I could find) and that is what made me start looking at Og, to see if it addresses this scope. --Tim Larson From steven at lumos.us Tue Aug 2 20:58:23 2005 From: steven at lumos.us (Steven Lumos) Date: Tue, 02 Aug 2005 17:58:23 -0700 Subject: [Nitro] composite primary key Message-ID: <868xzjzvio.fsf@bitty.lumos.us> I think I remember hearing that Og support for composite primary keys was in progress or at least planned, but I can't find any information on the web site or the parts of the source that I read. Is there any status / eta available? I guess I might as well ask while I'm at it, does anyone know of a viable / non-abandoned ORM that can use composite primary keys, can work with Oracle (even if I have to write the code for it), and can work with Nitro or Rails? Steve From progrium at gmail.com Wed Aug 3 00:39:04 2005 From: progrium at gmail.com (Jeff Lindsay) Date: Tue, 2 Aug 2005 21:39:04 -0700 Subject: [Nitro] Custom dispatcher Message-ID: In version 0.21.2 how do I configure Nitro to use a custom Dispatcher? In earlier versions I could just set it in the conf variable passed to Nitro.run... -- Jeff Lindsay http://blogrium.com/ From george.moschovitis at gmail.com Wed Aug 3 02:55:10 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Aug 2005 09:55:10 +0300 Subject: [Nitro] Help understanding ... process In-Reply-To: References: Message-ID: Hello Marcus, For more details on this check out the file lib/nitro/compiler.rb (#compile_action). Process goes more or less like this: You get a request uri in the following general format: http://www.site.com/controller/action. First the Dispatcher uses the the controller part to select the appropriate controller. This controller acts as the Render from now on. The the action part of the uri is extracted. The Render tries to call the method "#{action}_action" If the method does not exists the Compiler kicks in an tries to generate the method. The body of this method is built dynamically. If a method called "#{action}" exists in the Controller it is called. Then if a template called "#{action}.xhtml" exists in the Controllers template_root, it is converted to a method called "#{action}_template" and then called by "#{action}_action" after the call to "#{action}". A lot of other things happen in the generated method, have a look at the code for more details. Hope this helps :) regards, George On 8/2/05, Marcus Edwards wrote: > Hi All, > > I've been working through the Nitro tutorial at NitroHQ and have a > question based on section > "Chapter 7: Shaping Up" http://www.nitrohq.com/view/NSBS_Shaping_Things_Up. > > The tutorial states: > "...The form action is set to "post_entry," so you'll need to add some > server code to respond to that request ... First, Nitro will look for > post_entry.html. If not found, then post_entry.xhtml is the target. If > that does not exist, Nitro will attempt to invoke post_entry on the > default component..." > > This is all perfectly logical and it what I would expect. However, the > text then goes on to say: > "...Finally, add a new template (named post_entry.xhtml to map to the > method) to render the new entry..." > > My question then is this: if the dispatch sequence for requests looks > for .xhtml templates *ahead* of the controllers (first quote), > wouldn't adding the .xhtml template "to render the results of the > request" (second quote) short-circuit the process and prevent the > dispatcher from using the controller? > > It would help me enormously if someone could describe the whole > decision chain from when a request is received until the response is > returned. E.g. > > 1. Server: request received > 2. Server: apply request filters... > 3. Dispatcher: find controller > 3.1 .html? ... > 3.1.1 html controller (SimpleController) > ... > 3.2 .xhtml > 3.2.1 xhtml controller (SimpleController? Compiler?) > ... > 3.3 Server.map[request url fragment #1]? > 3.3.1 Controller: has method matching request url fragment #2? > etc. > > Obviously a UML sequence diagram would be superb but a description at > the very least would help. I'm more then happy to sketch up the > diagram if someone can explain how it works. I'll try walking through > the code to get at the answer to this but if someone has a ready > explanation, I'm all ears. > > Thanks, > Marcus > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Wed Aug 3 02:58:02 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Aug 2005 09:58:02 +0300 Subject: [Nitro] compound keys In-Reply-To: <20050802213612.GC1193@localhost> References: <20050802213612.GC1193@localhost> Message-ID: Hello Tim, How whould you like this to work? Can you give me a concrete example? There is some support for compound keys in Og, and I plan to overhaul the primary key issue in a forthcoming version, so if you could provide an example this would better help me address the issue. regards, George. On 8/3/05, Tim Larson wrote: > What is the prefered way of handling compound keys, compound > foreign keys, and compound indexes using Og? I have read the > tutorials and looked at examples, but they all seem to only > handle simple databases like you would use to support a blog, > rather than more complex schemas such as you would find in > financial applications. > > ActiveRecord also seems to have this limitation (at least > from the documentation I could find) and that is what made > me start looking at Og, to see if it addresses this scope. > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Wed Aug 3 02:59:02 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Aug 2005 09:59:02 +0300 Subject: [Nitro] composite primary key In-Reply-To: <868xzjzvio.fsf@bitty.lumos.us> References: <868xzjzvio.fsf@bitty.lumos.us> Message-ID: As I said to Tim, provide me with an example and propose an API for this an we can worki this in Og :) On 8/3/05, Steven Lumos wrote: > I think I remember hearing that Og support for composite primary keys > was in progress or at least planned, but I can't find any information > on the web site or the parts of the source that I read. Is there any > status / eta available? > > I guess I might as well ask while I'm at it, does anyone know of a > viable / non-abandoned ORM that can use composite primary keys, can > work with Oracle (even if I have to write the code for it), and can > work with Nitro or Rails? > > Steve > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Wed Aug 3 03:01:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Aug 2005 10:01:25 +0300 Subject: [Nitro] Custom dispatcher In-Reply-To: References: Message-ID: try: Server.map( '/' => RootController, '/blog' => BlogController, '/forum' => ForumController ) or server.root = RootController server.root.blog = BlogController server.root.forum = ForumController -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From progrium at gmail.com Wed Aug 3 03:06:21 2005 From: progrium at gmail.com (Jeff Lindsay) Date: Wed, 3 Aug 2005 00:06:21 -0700 Subject: [Nitro] Custom dispatcher In-Reply-To: References: Message-ID: But I want my own logic, not just a controller mapping. That's why I want to specify the Dispatcher instance that is used like before, so I can instansiate my own class. :P On 8/3/05, George Moschovitis wrote: > try: > > > Server.map( > '/' => RootController, > '/blog' => BlogController, > '/forum' => ForumController > ) > > or > > server.root = RootController > server.root.blog = BlogController > server.root.forum = ForumController > > -- > http://www.gmosx.com > http://www.nitrohq.com > http://www.joy.gr > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Jeff Lindsay http://blogrium.com/ From george.moschovitis at gmail.com Wed Aug 3 03:14:28 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Aug 2005 10:14:28 +0300 Subject: [Nitro] Custom dispatcher In-Reply-To: References: Message-ID: well, do it like this: server.dispatcher = MyDispatcher.new but i think the Nitro.run/Server.run helper is not very ..helpful then :) I 'll improve this. -g. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From transfire at gmail.com Wed Aug 3 13:15:38 2005 From: transfire at gmail.com (TRANS) Date: Wed, 3 Aug 2005 13:15:38 -0400 Subject: [Nitro] composite primary key In-Reply-To: References: <868xzjzvio.fsf@bitty.lumos.us> Message-ID: <4b6f054f05080310153b42ca21@mail.gmail.com> How does one set the a user-defined primary key now? It should be as simple as setting that to to an array of keys instead of a singe key. And the rest should be automatic. I imagine that'll require some simple improvements to the SQL generation code to take multiple keys into account. Sorry, I can't be more specific but I'm still too busy with other things at the moment (i.e. Facets) to devel into Og any deeper. T. From steven at lumos.us Wed Aug 3 16:03:16 2005 From: steven at lumos.us (Steven Lumos) Date: Wed, 03 Aug 2005 13:03:16 -0700 Subject: [Nitro] composite primary key References: <868xzjzvio.fsf@bitty.lumos.us> Message-ID: <86oe8ewzy3.fsf@bitty.lumos.us> George Moschovitis writes: > As I said to Tim, provide me with an example and propose an API for > this an we can worki this in Og :) I went and found the original post I was thinking of: http://groups-beta.google.com/group/comp.lang.ruby/msg/e28b993a1b102c32 > * Support for fully customizable primary keys. You are no longer > forced to use xxx_oid primary keys. Appart from the extra > flexibility this feature provides, this is an essential step towards > the planed 'reverse engineering' mode that will allow the use of > existing schemas with Og. I read "fully customizable" and "use of existing schemas" and thought there was already a design for composite keys just waiting to be implemented. (Probably because that's what I need.) I'm not very familiar with Og yet, but I guess here's a pseudo API proposal / example: class Document property :volume, String property :accession, String property :path, String set_primary_key :volume, :accession has_many :pages, Page end class Page property :volume, String property :accession, String property :page, Fixnum property :skew, Float property :rotation, String property :status, String set_primary_key :volume, :accession, :page belongs_to :document, Document end That's pretty close to a subset of my real situation. I'm thinking there is going to be a problem with schema creation. Does Og currently handle adding constraints to tables it creates? Steve From george.moschovitis at gmail.com Thu Aug 4 05:17:05 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 12:17:05 +0300 Subject: [Nitro] composite primary key In-Reply-To: <86oe8ewzy3.fsf@bitty.lumos.us> References: <868xzjzvio.fsf@bitty.lumos.us> <86oe8ewzy3.fsf@bitty.lumos.us> Message-ID: > set_primary_key :volume, :accession, :page > belongs_to :document, Document > end Most of the infrastructure to do this is already in place. I 'll rework the missing details for the next version. > Does Og > currently handle adding constraints to tables it creates? yeah, add an :sql_constrain to your class, ie meta :sql_constrain, 'your sql constrain here' regards, George. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Thu Aug 4 05:17:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 12:17:52 +0300 Subject: [Nitro] composite primary key In-Reply-To: <4b6f054f05080310153b42ca21@mail.gmail.com> References: <868xzjzvio.fsf@bitty.lumos.us> <4b6f054f05080310153b42ca21@mail.gmail.com> Message-ID: > things at the moment (i.e. Facets) Get the next version of Facets ready!!! :-D -g. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From epiperak at softlab.ece.ntua.gr Thu Aug 4 05:39:35 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 4 Aug 2005 12:39:35 +0300 (EEST) Subject: [Nitro] Nitro HQ Message-ID: ... and I am not referring to the wiki! I had the pleasure to visit the offices of Navel this monday during my short visit to Greece. I saw the place where Nitro was born! Exciting ;-) George and Tasos, keep up the great work! and please visit Tokyo soon... hopefully by then I will know where Matz hangs out... ;-) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Thu Aug 4 05:44:30 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 12:44:30 +0300 Subject: [Nitro] Nitro HQ In-Reply-To: References: Message-ID: ;-) you *are* crazy! :) On 8/4/05, Emmanuel Piperakis wrote: > ... and I am not referring to the wiki! -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Thu Aug 4 05:58:35 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 12:58:35 +0300 Subject: [Nitro] test stuff Message-ID: I am planning to remove the tc_xx prefixe from test cases in the test directories. I wonder if anyone sees any problems with this. -g. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From arcatan at gmail.com Thu Aug 4 06:09:46 2005 From: arcatan at gmail.com (Miikka Koskinen) Date: Thu, 4 Aug 2005 03:09:46 -0700 Subject: [Nitro] Recursive structures with Og In-Reply-To: <95f80630508040308184e0947@mail.gmail.com> References: <95f80630508040308184e0947@mail.gmail.com> Message-ID: <95f8063050804030927658e27@mail.gmail.com> Hello! I'm wondering how to build recursive database structures with Og. Like this: class Foo belongs_to parent, Foo has_many children, Foo end bar = Foo[1] bar.children.each do |child| # .. end The problem is that then Og tries to SELECT * FROM ogfoo WHERE foo_oid = 1. I think I've seen a solution on this list or somewhere, but I can't find it. From george.moschovitis at gmail.com Thu Aug 4 06:34:03 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 13:34:03 +0300 Subject: [Nitro] Recursive structures with Og In-Reply-To: <95f8063050804030927658e27@mail.gmail.com> References: <95f80630508040308184e0947@mail.gmail.com> <95f8063050804030927658e27@mail.gmail.com> Message-ID: Better have a look at: lib/og/mixin/hierarchivcal.rb test/og/mixin/tc_hierarchical.rb -g. On 8/4/05, Miikka Koskinen wrote: > Hello! > > I'm wondering how to build recursive database structures with Og. Like this: > > class Foo > belongs_to parent, Foo > has_many children, Foo > end > > bar = Foo[1] > bar.children.each do |child| > # .. > end > > The problem is that then Og tries to SELECT * FROM ogfoo WHERE foo_oid > = 1. I think I've seen a solution on this list or somewhere, but I > can't find it. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Thu Aug 4 09:34:31 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 4 Aug 2005 16:34:31 +0300 Subject: [Nitro] composite primary key In-Reply-To: <86oe8ewzy3.fsf@bitty.lumos.us> References: <868xzjzvio.fsf@bitty.lumos.us> <86oe8ewzy3.fsf@bitty.lumos.us> Message-ID: > class Document > property :volume, String > property :accession, String > property :path, String > > set_primary_key :volume, :accession > > has_many :pages, Page > end At the moment you can do: class Document property :volume, String property :accession, String property :path, String sql_index :volume, accession has_many :pages, Page def self.[](volume, accession) Document.find(:condition => "volume=#{volume} AND accession=#{accession}") end end then you can use the proposed api: doc = Document[vol, acc] Is this all you want? Some new features of 0.22.0 will make this much more transparent. regards, George. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From mneumann at ntecs.de Fri Aug 5 08:09:15 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Fri, 05 Aug 2005 14:09:15 +0200 Subject: [Nitro] Problems with templates Message-ID: <42F356EB.5070505@ntecs.de> Hi, I've a controller mounted as /main: class MainController < Nitro::Controller def index # render_template 'templates/this_or_that_template' end end I'd like to render a template from within an action. How can I achieve that, without need of a special directory layout? Regards, Michael From george.moschovitis at gmail.com Fri Aug 5 08:28:59 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 5 Aug 2005 15:28:59 +0300 Subject: [Nitro] Problems with templates In-Reply-To: <42F356EB.5070505@ntecs.de> References: <42F356EB.5070505@ntecs.de> Message-ID: Hello, In your case, you probably want to do: def my_action end alias_action :index, :my_action anyway, you are probably looking for: def index end action :index, :view => 'your view...' I should probably add a render template method though. -g. On 8/5/05, Michael Neumann wrote: > Hi, > > I've a controller mounted as /main: > > class MainController < Nitro::Controller > def index > # render_template 'templates/this_or_that_template' > end > end > > I'd like to render a template from within an action. How can I achieve > that, without need of a special directory layout? > > Regards, > > Michael > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From mneumann at ntecs.de Fri Aug 5 08:42:48 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Fri, 05 Aug 2005 14:42:48 +0200 Subject: [Nitro] Problems with templates In-Reply-To: References: <42F356EB.5070505@ntecs.de> Message-ID: <42F35EC8.1020209@ntecs.de> George Moschovitis wrote: > Hello, > > In your case, you probably want to do: > > def my_action > end > alias_action :index, :my_action > > anyway, you are probably looking for: > > def index > end > action :index, :view => 'your view...' > > I should probably add a render template method though. Hm, the problem is, that it always goes through the dispatcher. Or am I wrong? A template always needs an associated controller. But I'd like for example to use a Page Element, which renders some templates. I just want to use template-files instead of embedding the HTML inside the Ruby code. But using does not work as expected, as it requires a mounted controller. Regards, Michael From zimba.tm at gmail.com Fri Aug 5 10:02:35 2005 From: zimba.tm at gmail.com (zimba-tm) Date: Fri, 5 Aug 2005 16:02:35 +0200 Subject: [Nitro] Problem on Nitro's tutorial Message-ID: <3ff63f9b05080507025571ec75@mail.gmail.com> Hello, I was following the nitro's tutorial, but got really stuck on the following page : http://www.nitrohq.com/view/NSBS_Page_Generation_with_Class I'm supposed to be able to run the following code : ------ #!/usr/bin/env ruby require 'nitro' require 'feeds' a = App.new a.map['/feeds'] = Feeds a.start ----- Unfortunately, a.start doesn't launch webrick and no error appears. My lib/feeds.rb is also ok I think. I'm really stuck on this. My environnement is Windows 2k with OneClickRubyInstaller v1.8.2-15. The installed gems are : facets (0.7.2) fxri (0.3.2) fxruby (1.2.6) glue (0.21.2) nitro (0.21.2) og (0.21.2) RedCloth (3.0.3) ruby-breakpoint (0.5.0) sources (0.0.1) Do you have any idea what it could be ? -- Cheers, zimba http://zimba.oree.ch From zimba.tm at gmail.com Fri Aug 5 10:40:50 2005 From: zimba.tm at gmail.com (zimba-tm) Date: Fri, 5 Aug 2005 16:40:50 +0200 Subject: [Nitro] Og questions Message-ID: <3ff63f9b05080507402fc3e21@mail.gmail.com> Hello, I have some stupid questions to ask about Og's functionning. I'm really a newbie, and thus I'd understand that you don't loose your time. But I'm also really excited and like to ask anyway. - Why do I have to tell the relations to Og ? I've read that active-record uses a dictionnary to find singular and plural terms. I'm wondering if it could be used to tell the relations so that def Post has_many :comments, Comment end def Comments belongs_to :post, Post end could become def Post property :comments, Comment end def Comment property :post, Post end - Is it possible to define customized data types and also can they encapsulate validation ? Depending of the field of application, you often have a set of data types that you find everywhere. Typically in web forms. You'll have the Password, the Country, the Email. Those types also have the same validation rules all over the place. Maybe something like that : def Email < String validate_value validate_length :range => 2..100, :msg_long => 'argh' validate_format :format => /[mysterious_regexp]/, :msg => 'wrong format' end def Author property :email, Email end a = Author.new a.email = "user at tld.com" a.email.valid? => true That's all for today :-P -- Cheers, zimba http://zimba.oree.ch From douggorley at shaw.ca Fri Aug 5 12:32:13 2005 From: douggorley at shaw.ca (Doug Gorley) Date: Fri, 05 Aug 2005 09:32:13 -0700 Subject: [Nitro] Problem on Nitro's tutorial, Part 2 Message-ID: <14f742114f94ae.14f94ae14f7421@shaw.ca> Greeting list, I'm having the same problem as mentioned this morning in "Problem on Nitro's tutorial" (sorry, just joined the list a couple minutes ago, so I didn't have that email to reply to. I'm using Ubuntu Hoary 5.04, and have nitro 0.21.2 installed from rubygems. To make this easy to repro, I set up my example in a bash script. My problem is the same as the OP's; when I try to start the app with run.tb, nothing happens. ################################################## # Create the new web app nitrogen app ~/test_app # Make a lib/ folder for the Feeds class mkdir ~/test_app/lib # Create the Feeds class cat <~/test_app/lib/feeds.rb include Nitro class Feeds < Controller def opml o.opml { o.comment 'My blog opml' o.body { o.outline("Nitro bloggers rule") { o.outline( :title => "Foo", :htmlUrl => "http://localhost:9999/entries/foo", :xmlUrl => "http://localhost:9999/feeds/rss/foo") } } } @context.content_type = 'text/xml' end end EOF # Modify the run.rb file as shown in the example. cat <~/test_app/run.rb #!/usr/bin/env ruby require 'nitro' require 'feeds' a = App.new a.map['/feeds'] = Feeds a.start EOF ################################################## Doug Gorley | douggorley at shaw.ca From george.moschovitis at gmail.com Fri Aug 5 14:00:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 5 Aug 2005 21:00:07 +0300 Subject: [Nitro] Problem on Nitro's tutorial In-Reply-To: <3ff63f9b05080507025571ec75@mail.gmail.com> References: <3ff63f9b05080507025571ec75@mail.gmail.com> Message-ID: Nitro is changing really fast, so the tutorial is a bit outdated. I would suggest that you have a look at the blog example, or at the source code for Spark. -g. On 8/5/05, zimba-tm wrote: > Hello, > > I was following the nitro's tutorial, but got really stuck on the > following page : > http://www.nitrohq.com/view/NSBS_Page_Generation_with_Class > > I'm supposed to be able to run the following code : > ------ > #!/usr/bin/env ruby > > require 'nitro' > require 'feeds' > > a = App.new > a.map['/feeds'] = Feeds > a.start > ----- > Unfortunately, a.start doesn't launch webrick and no error appears. > My lib/feeds.rb is also ok I think. > I'm really stuck on this. > > > My environnement is Windows 2k with OneClickRubyInstaller v1.8.2-15. > The installed gems are : > facets (0.7.2) > fxri (0.3.2) > fxruby (1.2.6) > glue (0.21.2) > nitro (0.21.2) > og (0.21.2) > RedCloth (3.0.3) > ruby-breakpoint (0.5.0) > sources (0.0.1) > > Do you have any idea what it could be ? > > -- > Cheers, > zimba > > http://zimba.oree.ch > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Fri Aug 5 14:02:42 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 5 Aug 2005 21:02:42 +0300 Subject: [Nitro] Og questions In-Reply-To: <3ff63f9b05080507402fc3e21@mail.gmail.com> References: <3ff63f9b05080507402fc3e21@mail.gmail.com> Message-ID: > - Why do I have to tell the relations to Og ? > I've read that active-record uses a dictionnary to find singular and > plural terms. I'm wondering if it could be used to tell the relations > so that > ... > property :post, Post > end No in AR you have to use belongs_to, etc as well. BTW, Og also uses the inflector so that you can say: belongs_to Comment instead of belongs_to :comments, Comment > - Is it possible to define customized data types and also can they > encapsulate validation ? > Depending of the field of application, you often have a set of data > ... > That's all for today :-P never actually tried that, but most probably it should work :) Try it! In any case I 'll check this. -g. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Fri Aug 5 14:04:33 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 5 Aug 2005 21:04:33 +0300 Subject: [Nitro] Problem on Nitro's tutorial, Part 2 In-Reply-To: <14f742114f94ae.14f94ae14f7421@shaw.ca> References: <14f742114f94ae.14f94ae14f7421@shaw.ca> Message-ID: As I said have a look at the examples. Your code should be like this: require 'nitro' require 'feeds' Nitro.run(Feeds) there are alternative ways to do this, but this should get you started. regards, George. > #!/usr/bin/env ruby > require 'nitro' > require 'feeds' > a = App.new > a.map['/feeds'] = Feeds > a.start -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From transfire at gmail.com Fri Aug 5 19:38:20 2005 From: transfire at gmail.com (TRANS) Date: Fri, 5 Aug 2005 19:38:20 -0400 Subject: [Nitro] test stuff In-Reply-To: References: Message-ID: <4b6f054f05080516386294c181@mail.gmail.com> On 8/4/05, George Moschovitis wrote: > I am planning to remove the tc_xx prefixe from test cases in the > test directories. I wonder if anyone sees any problems with this. I'm inclined to do the same for Facets. I don't see why it should be a problem. On the other hand I've cautiously moving toward including tests in with the code itself, i.e. # code ... require 'test/unit' if $0= __FILE__ # test ... This may not be a viable solution for a web-engine like nitro, but it seems to work find for extensions. Any comments/caveats to this approach? T. P.S. Perhaps I should foward this discussion to ruby-talk? From steven at lumos.us Fri Aug 5 20:57:45 2005 From: steven at lumos.us (Steven Lumos) Date: Fri, 05 Aug 2005 17:57:45 -0700 Subject: [Nitro] test stuff References: <4b6f054f05080516386294c181@mail.gmail.com> Message-ID: <868xzfq3ue.fsf@bitty.lumos.us> TRANS writes: > I'm inclined to do the same for Facets. I don't see why it should be a > problem. On the other hand I've cautiously moving toward including > tests in with the code itself, i.e. > > # code > ... > > require 'test/unit' if $0= __FILE__ > > # test > ... > > This may not be a viable solution for a web-engine like nitro, but it > seems to work find for extensions. Any comments/caveats to this > approach? > > T. > > P.S. Perhaps I should foward this discussion to ruby-talk? I think I've mentioned this on ruby-talk before, but my group likes to combine code and dependencies into a single file. Aside from greatly simplifying delivery, we've seen surprisingly large runtime benefits. The $0 == __FILE__ convention makes writing a program to do the bundling a lot more complicated. Of course, it's already popular enough that I wouldn't blame you for ignoring our situation. :-) Steve P.S. There was a thread about adding a TEST{} block like BEGIN{} and END{}, if you can find that you'll get a good overview. From redentis at gmail.com Sat Aug 6 03:53:17 2005 From: redentis at gmail.com (Marcus Edwards) Date: Sat, 6 Aug 2005 08:53:17 +0100 Subject: [Nitro] Problem on Nitro's tutorial, Part 2 In-Reply-To: References: <14f742114f94ae.14f94ae14f7421@shaw.ca> Message-ID: On 8/5/05, George Moschovitis wrote: > ... > Nitro.run(Feeds) Something to be aware of: this way of running the application will map the Feeds controller to the root URL fragment. I've made a stab at updating the tutorial section to use working code. From dcorbin at machturtle.com Sun Aug 7 11:53:13 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 11:53:13 -0400 Subject: [Nitro] Og relationships Message-ID: <200508071153.14312.dcorbin@machturtle.com> I have something like this: class Foo has_many :bars def sna bars << Bar.new end end It complains that there is no bars. I've dug around, and I've not been able to figure out what methods the 'has_many' provides. What's the right way to add a Bar to a Foo in this case? Logic tells me I need to initialize an "@bars = []", (and that does make the immediate problems go away), but I can find no example that shows that. Does has_many also provide 'accessors'? David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050807/37372a6b/attachment.html From dcorbin at machturtle.com Sun Aug 7 12:24:04 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 12:24:04 -0400 Subject: [Nitro] Mock Persistence Message-ID: <200508071224.04819.dcorbin@machturtle.com> What support already exists in Og to support unit-testing that persistent methods have been properly called? David From george.moschovitis at gmail.com Sun Aug 7 14:54:34 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 7 Aug 2005 21:54:34 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 Message-ID: Hello everyone, New versions of Nitro (Web Application Framework) and Og (Object Relational Mapping) were released: Homepage: http://www.nitrohq.com Download: http://rubyforge.org/projects/ nitro Mailing List: http://rubyforge.org/mailman/l istinfo/nitro-general A snapshot of the latest developments. Many requested features where implemented, and many reported bugs fixed. * The much requested Og 'reverse mode' is implemented. Og's domain specific language and API is extended to allow fine-grained customization of the schema-to-objects mapping. Og can now handle most of the legacy schemas you can throw at it. Here is an example: class User property :name, String, :field => :thename, :uniq => true property :password, String property :age, Fixnum, :field => :age3 has_many Comment, :foreign_field => :user set_table :my_users set_primary_key :name, String end class Comment property :cid, Fixnum property :body, String belongs_to User, :field => :user set_table :my_comments set_primary_key :cid end As you can see, even relation fields can be customized. For higher level customization you can overload methods like #table, #field_for_property etc. * Og now handles multiple connections to multiple stores even in thread safe mode. This means you can now have objects serialized in different RDBM systems in the same application. Or you can have some objects managed by an RDBMS store and others by a FAST in-memory store. You can still have relations between objects in different stores. An example: mysql = Og.setup(:store => :mysql, ..) psql = Og.setup(:store => :psql, ..) class User has_many Comment end class Comment belongs_to User end mysql.manage_class User psql.manage_class Comment user.comments << comment * Greatly improved support for testing and test-driven-development. A reworked testing infrastructure for controllers is in place. Moreover, support for Og fixtures and automatic test database setup is provided. Fixtures can be defined with yml or csv files. For an example of the testing infrastructure check out the Spark 0.4.0 sources. Spark is a Wiki powered by Nitro. * Reworked mailer implementation. The new mailer allows for incoming email handling. Here is an example: class Mailman < Glue::Mailer def receive(mail) article = Article.new(mail.subject, mail.body) article.category = Category.find_by_name(mail.to.split('@').first) article.save end end * Added script/runner in proto as a convenience to running ruby code in your application environment. * Many fixes in the caching infrastructure. * Many fixes in the XMLRPC service infrastructure. * Many smaller changes and new features that make development with Nitro so much more pleasurable. Nitro provides everything you need to develop professional Web applications using Ruby and Javascript. Nitro redefines Rapid Application Development by providing a clean, yet efficient API, a layer of domain specific languages implemented on top of Ruby and the most powerful and elegant object relational mapping solution available everywhere. have fun, George Moschovitis http://www.gmosx.com -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Sun Aug 7 14:55:13 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 7 Aug 2005 21:55:13 +0300 Subject: [Nitro] Mock Persistence In-Reply-To: <200508071224.04819.dcorbin@machturtle.com> References: <200508071224.04819.dcorbin@machturtle.com> Message-ID: Check out Og 0.22.0 (just released) for improved testing support. More is coming, suggestions are welcome. -g. On 8/7/05, David Corbin wrote: > What support already exists in Og to support unit-testing that persistent > methods have been properly called? > > David > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Sun Aug 7 14:55:34 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 7 Aug 2005 21:55:34 +0300 Subject: [Nitro] Og relationships In-Reply-To: <200508071153.14312.dcorbin@machturtle.com> References: <200508071153.14312.dcorbin@machturtle.com> Message-ID: This should work, I 'll look at his. -g. On 8/7/05, David Corbin wrote: > > > I have something like this: > > > > class Foo > > has_many :bars > > > > def sna > > bars << Bar.new > > end > > end > > > > It complains that there is no bars. I've dug around, and I've not been able > to figure out what methods the 'has_many' provides. What's the right way to > add a Bar to a Foo in this case? > > > > Logic tells me I need to initialize an "@bars = []", (and that does make the > immediate problems go away), but I can find no example that shows that. Does > has_many also provide 'accessors'? > > > > David > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From dcorbin at machturtle.com Sun Aug 7 15:02:35 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 15:02:35 -0400 Subject: [Nitro] Og relationships In-Reply-To: References: <200508071153.14312.dcorbin@machturtle.com> Message-ID: <200508071502.35918.dcorbin@machturtle.com> Is there documentation about what makes these available? (Also, I'm a bit behind on version wise (0.19, I think)). > This should work, I 'll look at his. > > -g. > > On 8/7/05, David Corbin wrote: > > I have something like this: > > > > > > > > class Foo > > > > has_many :bars > > > > > > > > def sna > > > > bars << Bar.new > > > > end > > > > end > > > > > > > > It complains that there is no bars. I've dug around, and I've not been > > able to figure out what methods the 'has_many' provides. What's the right > > way to add a Bar to a Foo in this case? > > > > > > > > Logic tells me I need to initialize an "@bars = []", (and that does make > > the immediate problems go away), but I can find no example that shows > > that. Does has_many also provide 'accessors'? > > > > > > > > David > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general From dcorbin at machturtle.com Sun Aug 7 15:09:01 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 15:09:01 -0400 Subject: [Nitro] Mock Persistence In-Reply-To: References: <200508071224.04819.dcorbin@machturtle.com> Message-ID: <200508071509.01855.dcorbin@machturtle.com> On Sunday 07 August 2005 02:55 pm, George Moschovitis wrote: > Check out Og 0.22.0 (just released) for improved testing support. > More is coming, suggestions are welcome. > >From your release announcement: > * Greatly improved support for testing and test-driven-development. > A reworked testing infrastructure for controllers is in place. > Moreover, support for Og fixtures and automatic test database > setup is provided. Fixtures can be defined with yml or csv files. > Not what I'm looking for. I want to be able to assert that particular objects were 'saved', without actually having a persistence service. I want to be able to arrange for particular objects to be returned for various 'queries'. (A traditional (in my mind) mock persistence layer). From dcorbin at machturtle.com Sun Aug 7 15:15:17 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 15:15:17 -0400 Subject: [Nitro] Og relationships In-Reply-To: <200508071502.35918.dcorbin@machturtle.com> References: <200508071153.14312.dcorbin@machturtle.com> <200508071502.35918.dcorbin@machturtle.com> Message-ID: <200508071515.17439.dcorbin@machturtle.com> On Sunday 07 August 2005 03:02 pm, David Corbin wrote: I upgraded to 0.22. Same behavior. > Is there documentation about what makes these available? (Also, I'm a bit > behind on version wise (0.19, I think)). > > > This should work, I 'll look at his. > > > > -g. > > > > On 8/7/05, David Corbin wrote: > > > I have something like this: > > > > > > > > > > > > class Foo > > > > > > has_many :bars > > > > > > > > > > > > def sna > > > > > > bars << Bar.new > > > > > > end > > > > > > end > > > > > > > > > > > > It complains that there is no bars. I've dug around, and I've not been > > > able to figure out what methods the 'has_many' provides. What's the > > > right way to add a Bar to a Foo in this case? > > > > > > > > > > > > Logic tells me I need to initialize an "@bars = []", (and that does > > > make the immediate problems go away), but I can find no example that > > > shows that. Does has_many also provide 'accessors'? > > > > > > > > > > > > David > > > _______________________________________________ > > > Nitro-general mailing list > > > Nitro-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/nitro-general > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From Aleksi.Niemela at cs.helsinki.fi Sun Aug 7 15:22:56 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Sun, 07 Aug 2005 22:22:56 +0300 Subject: [Nitro] Og relationships In-Reply-To: <200508071502.35918.dcorbin@machturtle.com> References: <200508071153.14312.dcorbin@machturtle.com> <200508071502.35918.dcorbin@machturtle.com> Message-ID: <42F65F90.2020802@cs.helsinki.fi> David Corbin wrote: >Is there documentation about what makes these available? (Also, I'm a bit >behind on version wise (0.19, I think)). > > The source code. But here's the beginning of something which might become Og API walkthrough. http://www.cs.helsinki.fi/u/kaniemel/walkthrough.txt I've posted it before on the list. In it I explain how Relations (like HasMany) get the keyword (like has_many) and how they're initialized. This is not real documentation, but might shed some light to the dark corners. - Aleksi From dcorbin at machturtle.com Sun Aug 7 16:18:30 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 16:18:30 -0400 Subject: [Nitro] Og relationships In-Reply-To: <42F65F90.2020802@cs.helsinki.fi> References: <200508071153.14312.dcorbin@machturtle.com> <200508071502.35918.dcorbin@machturtle.com> <42F65F90.2020802@cs.helsinki.fi> Message-ID: <200508071618.31540.dcorbin@machturtle.com> On Sunday 07 August 2005 03:22 pm, Aleksi Niemela wrote: > David Corbin wrote: > >Is there documentation about what makes these available? (Also, I'm a bit > >behind on version wise (0.19, I think)). > > The source code. But here's the beginning of something which might > become Og API walkthrough. > > http://www.cs.helsinki.fi/u/kaniemel/walkthrough.txt > > I've posted it before on the list. In it I explain how Relations (like > HasMany) get the keyword (like has_many) and how they're initialized. > This is not real documentation, but might shed some light to the dark > corners. That does help some. Thanks. From dcorbin at machturtle.com Sun Aug 7 16:58:56 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sun, 7 Aug 2005 16:58:56 -0400 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: Message-ID: <200508071658.57382.dcorbin@machturtle.com> I'm not sure if this is new in 22, but I'm getting the following stack trace: /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation/has_many.rb:24:in `resolve_polymorphic': undefined method `relations' for nil:NilClass (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:157:in `send' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:157:in `resolve' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:156:in `each' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:156:in `resolve' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in `manage_classes' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in `each' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in `manage_classes' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og.rb:157:in `setup' I've looked through the code, and it appears that target_class is nil. I've looked, and I can't find anywhere target_class is defined anywhere. In fact, I'd expect to get the "undefined local variable or method" error. Help. David From john.lloydjones at gmail.com Sun Aug 7 18:34:15 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Sun, 7 Aug 2005 15:34:15 -0700 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: Message-ID: <6fcd26f105080715344dd44be1@mail.gmail.com> > * The much requested Og 'reverse mode' is implemented. This is very good. Using what you call 'reverse mode' I am able to work in a more natural (for me, at least) way. I still need to use Aleksi's hack to get around the inheritance issue, but I have enough working that I can move ahead. Thanks for the good work. From george.moschovitis at gmail.com Mon Aug 8 00:59:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 8 Aug 2005 07:59:32 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <200508071658.57382.dcorbin@machturtle.com> References: <200508071658.57382.dcorbin@machturtle.com> Message-ID: Please. give me some source code that triggers this behaviour. -g. On 8/7/05, David Corbin wrote: > I'm not sure if this is new in 22, but I'm getting the following stack trace: > > /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation/has_many.rb:24:in > `resolve_polymorphic': undefined method `relations' for nil:NilClass > (NoMethodError) > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:157:in `send' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:157:in > `resolve' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:156:in `each' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/relation.rb:156:in > `resolve' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in > `manage_classes' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in `each' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/manager.rb:181:in > `manage_classes' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og.rb:157:in `setup' > > I've looked through the code, and it appears that target_class is nil. I've > looked, and I can't find anywhere target_class is defined anywhere. In fact, > I'd expect to get the "undefined local variable or method" error. > > Help. > David > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Mon Aug 8 01:00:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 8 Aug 2005 08:00:32 +0300 Subject: [Nitro] Mock Persistence In-Reply-To: <200508071509.01855.dcorbin@machturtle.com> References: <200508071224.04819.dcorbin@machturtle.com> <200508071509.01855.dcorbin@machturtle.com> Message-ID: Show my in (pseudo)code what you want. I think it will probably already doable, If not I 'll add this. Show me an example. regards, George. > Not what I'm looking for. I want to be able to assert that particular objects > were 'saved', without actually having a persistence service. I want to be > able to arrange for particular objects to be returned for various 'queries'. > > (A traditional (in my mind) mock persistence layer). -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From john.lloydjones at gmail.com Mon Aug 8 01:17:34 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Sun, 7 Aug 2005 22:17:34 -0700 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: <200508071658.57382.dcorbin@machturtle.com> Message-ID: <6fcd26f1050807221726bc1f3e@mail.gmail.com> See the class Address. Comment out tthe two personal_customer_oid, personal_customer_oid= methods and the code fails. This is code was updated to use Og 0.22. Tell me if I am using it incorrectly. On 8/7/05, George Moschovitis wrote: > Please. give me some source code that triggers this behaviour. > ===== customer.rb ===== require 'og' module Created prop_accessor :created, Date pre "@created ||= Date.today", :on => :og_insert end module Status property :status, String pre "@status ||= 'entered'", :on => :og_insert end module Customer include Created include Status property :customer_number, String, :unique => true property :creditLimit, String end module CRM # class Party; end class Phone property :type, String property :countryCode, String property :areaCode, String property :number, String property :extension, String property :comments, String end class ContactInfo property :email, String property :url, String property :phone, Phone property :fax, Phone end class DateRange property :from_dt, Date property :to_dt, Date end class ExternalId; end class ExtraInfo property :name, String property :type, String property :value, String property :externalId, ExternalId belongs_to :externalId, ExternalId end class ExternalId property :type, String property :value, String property :status, String property :validity, DateRange property :extraInfo, FixedNum # belongs_to Party, :field => :extid has_many :extraInfos, ExtraInfo end class Party; end class Address property :street1, String property :street2, String property :city, String property :state, String property :postcode, String property :name, String # property :party, Party belongs_to Party, :field => :party # Need to put this in by hand otherwise I get something like this: #(eval):23:in `add_address': undefined method `personal_customer_oid=' # for # (NoMethodError) # from og-test.rb:53:in `addAddress' # from og-test.rb:124 def personal_customer_oid self.party_oid end def personal_customer_oid=(oid) self.party_oid = oid end end class Party # property :address, Fixnum property :contactInfo, ContactInfo property :externalIds, ExternalId has_many Address, :foreign_field => :party # has_many ExternalId, :foreign_field => extid def initialize puts "Party: initialize..." end def addAddress( a ) puts "addAddress: @address = #{@address}" add_address( a ) @address += 1 end end class Person < Party property :firstName, String property :middleName, String property :lastName, String property :knownBy, String property :mobile, Phone end class Organization < Party property :name, String end class CorporateCustomer < Organization; end class Department < Organization belongs_to :corporateCustomer, CorporateCustomer end class PersonalCustomer < Person include Customer def initialize (number, first, middle, last) super() @customer_number = number @firstName = first @middleName = middle @lastName = last end end class CorporateCustomer < Organization include Customer property :departments, Department property :contact, Person property :parent, Organization has_many :departments, Department end class EnterpriseCustomer < Organization include Customer property :companies, CorporateCustomer has_many :companies, CorporateCustomer end end ==== tc_customer.rb ===== $:.unshift File.join(File.dirname(__FILE__), 'lib') $DBG = true require 'test/unit' require 'og' require 'customer.rb' class TC_Customer < Test::Unit::TestCase # :nodoc: all include Og puts "Og Version #{Og::Version}" @og = Og.setup( :destroy => true, :store => :sqlite, :name => 'tc_customer' ) def setup puts "create a (fictious) primary address" @a_primary = CRM::Address.new @a_primary.street1 = '1370 Dunlap Ave' @a_primary.street2 = 'Apt # 786' @a_primary.city = 'Phoenix' @a_primary.state = 'AZ' @a_primary.name = 'primary' puts "create a (fictious) mailing address" @a_mailing = CRM::Address.new @a_mailing.street1 = '1290 Ray Ave' @a_mailing.street2 = 'P.O Box 15' @a_mailing.city = 'Chandler' @a_mailing.state = 'AZ' @a_mailing.name = 'mailing' end def teardown end def test_store_and_retrieve puts "create personal customer" p1 = CRM::PersonalCustomer.new('1001', 'John', '', 'Lloyd-Jones') puts "save the personal customer" p1.save p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1001' assert_equal p1.firstName, p2.firstName, "Expect first name to be same" assert_equal p1.lastName, p2.lastName, "Expect last name to be same" end def test_address puts "create personal customer" p1 = CRM::PersonalCustomer.new('1002', 'Kalpana', '', 'Lloyd-Jones') puts "save the personal customer" p1.save p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' p2.addresses << @a_primary p2.save p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' p3.addresses.each { |a| puts "#{a.street1} #{a.city}, #{a.state}" } # assert_equal( p2.address, 1, "p2.address should be 1 (first address)" ) assert_equal( @a_primary.party_oid, p1.oid, "@a_primary should belong to p1") end def test_multiple_addresses p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' puts "add mailing address" p2.addresses << @a_mailing p2.save p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' puts "p3 party id is #{p3.oid}" p3.addresses.each do |a| puts "id #{a.oid}: #{a.street1} #{a.city}, #{a.state}" a1 = case a.name when 'primary' then @a_primary when 'mailing' then @a_mailing end assert_equal(a1.street1, a.street1, "street1 should match") assert_equal(a1.city, a.city, "city should match") assert_equal(a1.state, a.state, "state should match") end end end From epiperak at softlab.ece.ntua.gr Mon Aug 8 05:17:01 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 8 Aug 2005 12:17:01 +0300 (EEST) Subject: [Nitro] 0.22.0 error message Message-ID: After installing the new version I have the following problem (after changing all the appropriate files) DEBUG: Rendering '/'. DEBUG: Compiling action 'ReportingController#index' DEBUG: Compiling template 'ReportingController: src/view/index.xhtml' ERROR: Error while handling '/'. ERROR: undefined method `transform' for Glue::Localization:Class run.rb:16:in `transform_template' run.rb:14:in `transform_template' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:72:in `compile_template' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:238:in `compile_action' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:247:in `compile' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/controller.rb:162:in `method_missing' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb:112:in `send' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb:112:in `render' Any ideas? Thanx Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Aug 8 05:26:44 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 8 Aug 2005 12:26:44 +0300 (EEST) Subject: [Nitro] 0.22.0 error message In-Reply-To: References: Message-ID: No worries, found the problem ;-) > After installing the new version I have the following problem (after changing > all the appropriate files) > > DEBUG: Rendering '/'. > DEBUG: Compiling action 'ReportingController#index' > DEBUG: Compiling template 'ReportingController: src/view/index.xhtml' > ERROR: Error while handling '/'. > ERROR: undefined method `transform' for Glue::Localization:Class > run.rb:16:in `transform_template' > run.rb:14:in `transform_template' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:72:in > `compile_template' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:238:in > `compile_action' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/compiler.rb:247:in > `compile' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/controller.rb:162:in > `method_missing' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb:112:in `send' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb:112:in > `render' > > > Any ideas? > Thanx > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From robbie.wilhelm at gmail.com Mon Aug 8 13:20:58 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Mon, 8 Aug 2005 19:20:58 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: Message-ID: <5371ac740508081020667e6379@mail.gmail.com> hi, i'm trying to og my legacy tables with the new reverse feature: class Person property :id, Fixnum property :title, String property :fname, String property :lname, String ... set_table :efa_persons set_primary_key :id has_many Note belongs_to Company, :field=>:company_id end p=Person[1] # thats me # sql ist right but it # gives me an error: DEBUG: SELECT * FROM efa_persons WHERE id=1 /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col 19: `t/string/unix_ ' (ArgumentError) from /usr/lib/ruby/1.8/yaml.rb:119:in `load' from (eval):4:in `og_read' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in `read_one' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in `load' from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' from ogtest.rb:31 alternative: t=db.load(1, Person) gives ogtest.rb:30: private method `load' called for # (NoMethodError) anybody knows whats wrong? thanks, robert 2005/8/7, George Moschovitis : > Hello everyone, > > * The much requested Og 'reverse mode' is implemented. Og's > domain specific language and API is extended to allow fine-grained > customization of the schema-to-objects mapping. Og can now handle > most of the legacy schemas you can throw at it. Here is an > example: > From robbie.wilhelm at gmail.com Mon Aug 8 13:41:36 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Mon, 8 Aug 2005 19:41:36 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac740508081020667e6379@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> Message-ID: <5371ac7405080810418239fe9@mail.gmail.com> argh. found the error. somewhere i had an invalid property type 'Date' instead of Time. the db.load() error persists. --robert 2005/8/8, Robert Wagner : > hi, > i'm trying to og my legacy tables with the new reverse feature: > > class Person > property :id, Fixnum > property :title, String > property :fname, String > property :lname, String > ... > set_table :efa_persons > set_primary_key :id > has_many Note > belongs_to Company, :field=>:company_id > end > > p=Person[1] # thats me > > # sql ist right but it > # gives me an error: > > DEBUG: SELECT * FROM efa_persons WHERE id=1 > /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col > 19: `t/string/unix_ ' (ArgumentError) > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > from (eval):4:in `og_read' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in > `read_one' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in > `load' > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' > from ogtest.rb:31 > > alternative: > > t=db.load(1, Person) > > gives > > ogtest.rb:30: private method `load' called for > # (NoMethodError) > > anybody knows whats wrong? > > thanks, > robert > > 2005/8/7, George Moschovitis : > > Hello everyone, > > > > * The much requested Og 'reverse mode' is implemented. Og's > > domain specific language and API is extended to allow fine-grained > > customization of the schema-to-objects mapping. Og can now handle > > most of the legacy schemas you can throw at it. Here is an > > example: > > > From robbie.wilhelm at gmail.com Mon Aug 8 14:01:51 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Mon, 8 Aug 2005 20:01:51 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac7405080810418239fe9@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> Message-ID: <5371ac740508081101744850ad@mail.gmail.com> is it possible to change the sequenz-name (pgsql)? from like: efa_notes_oid_seq to efa_notes_id_seq ? thanks, --robert 2005/8/8, Robert Wagner : > argh. found the error. somewhere i had an invalid property type 'Date' > instead of Time. > the db.load() error persists. > --robert > > > 2005/8/8, Robert Wagner : > > hi, > > i'm trying to og my legacy tables with the new reverse feature: > > > > class Person > > property :id, Fixnum > > property :title, String > > property :fname, String > > property :lname, String > > ... > > set_table :efa_persons > > set_primary_key :id > > has_many Note > > belongs_to Company, :field=>:company_id > > end > > > > p=Person[1] # thats me > > > > # sql ist right but it > > # gives me an error: > > > > DEBUG: SELECT * FROM efa_persons WHERE id=1 > > /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col > > 19: `t/string/unix_ ' (ArgumentError) > > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > > from (eval):4:in `og_read' > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in > > `read_one' > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in > > `load' > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' > > from ogtest.rb:31 > > > > alternative: > > > > t=db.load(1, Person) > > > > gives > > > > ogtest.rb:30: private method `load' called for > > # (NoMethodError) > > > > anybody knows whats wrong? > > > > thanks, > > robert > > > > 2005/8/7, George Moschovitis : > > > Hello everyone, > > > > > > * The much requested Og 'reverse mode' is implemented. Og's > > > domain specific language and API is extended to allow fine-grained > > > customization of the schema-to-objects mapping. Og can now handle > > > most of the legacy schemas you can throw at it. Here is an > > > example: > > > > > > From bernd at bdebl.de Tue Aug 9 02:19:16 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Tue, 09 Aug 2005 08:19:16 +0200 Subject: Code walkthrough (Re: [Nitro] Og relationships) In-Reply-To: <42F65F90.2020802@cs.helsinki.fi> References: <200508071153.14312.dcorbin@machturtle.com> <200508071502.35918.dcorbin@machturtle.com> <42F65F90.2020802@cs.helsinki.fi> Message-ID: <42F84AE4.5020901@bdebl.de> Aleksi Niemela wrote > ... But here's the beginning of something which might become Og API > walkthrough. > > http://www.cs.helsinki.fi/u/kaniemel/walkthrough.txt > > I've posted it before on the list. In it I explain how Relations (like > HasMany) get the keyword (like has_many) and how they're initialized. > This is not real documentation, but might shed some light to the dark > corners. Thanks a lot. That's exactly what I needed. You dont't want to put this in the wiki? Whatever you call that, code walkthrough, concepts or big picture... I wish someone who can distingish about the current Nitro development and deprecated modules and classes would set up a skeleton (format like the code walkthrough) in the wiki, so people with too much spare time could start writing documentation. - Bernd From george.moschovitis at gmail.com Tue Aug 9 04:57:04 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 9 Aug 2005 11:57:04 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac740508081101744850ad@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> <5371ac740508081101744850ad@mail.gmail.com> Message-ID: Not yet, but thanks for pointing this out, will add it (or you can send a patch ;-)) Btw, I am on vacations at the moment... so expect some slower response time :) -g. On 8/8/05, Robert Wagner wrote: > is it possible to change the sequenz-name (pgsql)? > from like: efa_notes_oid_seq > to efa_notes_id_seq > ? > thanks, > --robert > > 2005/8/8, Robert Wagner : > > argh. found the error. somewhere i had an invalid property type 'Date' > > instead of Time. > > the db.load() error persists. > > --robert > > > > > > 2005/8/8, Robert Wagner : > > > hi, > > > i'm trying to og my legacy tables with the new reverse feature: > > > > > > class Person > > > property :id, Fixnum > > > property :title, String > > > property :fname, String > > > property :lname, String > > > ... > > > set_table :efa_persons > > > set_primary_key :id > > > has_many Note > > > belongs_to Company, :field=>:company_id > > > end > > > > > > p=Person[1] # thats me > > > > > > # sql ist right but it > > > # gives me an error: > > > > > > DEBUG: SELECT * FROM efa_persons WHERE id=1 > > > /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col > > > 19: `t/string/unix_ ' (ArgumentError) > > > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > > > from (eval):4:in `og_read' > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in > > > `read_one' > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in > > > `load' > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' > > > from ogtest.rb:31 > > > > > > alternative: > > > > > > t=db.load(1, Person) > > > > > > gives > > > > > > ogtest.rb:30: private method `load' called for > > > # (NoMethodError) > > > > > > anybody knows whats wrong? > > > > > > thanks, > > > robert > > > > > > 2005/8/7, George Moschovitis : > > > > Hello everyone, > > > > > > > > * The much requested Og 'reverse mode' is implemented. Og's > > > > domain specific language and API is extended to allow fine-grained > > > > customization of the schema-to-objects mapping. Og can now handle > > > > most of the legacy schemas you can throw at it. Here is an > > > > example: > > > > > > > > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From george.moschovitis at gmail.com Tue Aug 9 05:05:00 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 9 Aug 2005 12:05:00 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac740508081020667e6379@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> Message-ID: > > t=db.load(1, Person) this should probably be: db.store.load(1, Person) -g. -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From robbie.wilhelm at gmail.com Tue Aug 9 05:46:28 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 9 Aug 2005 11:46:28 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> <5371ac740508081101744850ad@mail.gmail.com> Message-ID: <5371ac74050809024648bf7434@mail.gmail.com> 2005/8/9, George Moschovitis : > Not yet, but thanks for pointing this out, will add it (or you can > send a patch ;-)) thanx - i'll try to find the spot for a patch :) happy holidays. --robert > Btw, I am on vacations at the moment... so expect some slower response time :) > > -g. > > On 8/8/05, Robert Wagner wrote: > > is it possible to change the sequenz-name (pgsql)? > > from like: efa_notes_oid_seq > > to efa_notes_id_seq > > ? > > thanks, > > --robert > > > > 2005/8/8, Robert Wagner : > > > argh. found the error. somewhere i had an invalid property type 'Date' > > > instead of Time. > > > the db.load() error persists. > > > --robert > > > > > > > > > 2005/8/8, Robert Wagner : > > > > hi, > > > > i'm trying to og my legacy tables with the new reverse feature: > > > > > > > > class Person > > > > property :id, Fixnum > > > > property :title, String > > > > property :fname, String > > > > property :lname, String > > > > ... > > > > set_table :efa_persons > > > > set_primary_key :id > > > > has_many Note > > > > belongs_to Company, :field=>:company_id > > > > end > > > > > > > > p=Person[1] # thats me > > > > > > > > # sql ist right but it > > > > # gives me an error: > > > > > > > > DEBUG: SELECT * FROM efa_persons WHERE id=1 > > > > /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col > > > > 19: `t/string/unix_ ' (ArgumentError) > > > > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > > > > from (eval):4:in `og_read' > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in > > > > `read_one' > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in > > > > `load' > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' > > > > from ogtest.rb:31 > > > > > > > > alternative: > > > > > > > > t=db.load(1, Person) > > > > > > > > gives > > > > > > > > ogtest.rb:30: private method `load' called for > > > > # (NoMethodError) > > > > > > > > anybody knows whats wrong? > > > > > > > > thanks, > > > > robert > > > > > > > > 2005/8/7, George Moschovitis : > > > > > Hello everyone, > > > > > > > > > > * The much requested Og 'reverse mode' is implemented. Og's > > > > > domain specific language and API is extended to allow fine-grained > > > > > customization of the schema-to-objects mapping. Og can now handle > > > > > most of the legacy schemas you can throw at it. Here is an > > > > > example: > > > > > > > > > > > > > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://www.gmosx.com > http://www.nitrohq.com > http://www.joy.gr > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From dcorbin at machturtle.com Tue Aug 9 05:49:44 2005 From: dcorbin at machturtle.com (David Corbin) Date: Tue, 9 Aug 2005 05:49:44 -0400 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <6fcd26f1050807221726bc1f3e@mail.gmail.com> References: <6fcd26f1050807221726bc1f3e@mail.gmail.com> Message-ID: <200508090549.45417.dcorbin@machturtle.com> This gets the same exception I had? David On Monday 08 August 2005 01:17 am, John Lloyd-Jones wrote: > See the class Address. Comment out tthe two personal_customer_oid, > personal_customer_oid= methods and the code fails. This is code was > updated to use Og 0.22. Tell me if I am using it incorrectly. > > On 8/7/05, George Moschovitis wrote: > > Please. give me some source code that triggers this behaviour. > > ===== customer.rb ===== > require 'og' > > module Created > prop_accessor :created, Date > pre "@created ||= Date.today", :on => :og_insert > end > > module Status > property :status, String > pre "@status ||= 'entered'", :on => :og_insert > end > > module Customer > include Created > include Status > property :customer_number, String, :unique => true > property :creditLimit, String > end > > > module CRM > > # class Party; end > > class Phone > property :type, String > property :countryCode, String > property :areaCode, String > property :number, String > property :extension, String > property :comments, String > end > > class ContactInfo > property :email, String > property :url, String > property :phone, Phone > property :fax, Phone > > end > > class DateRange > property :from_dt, Date > property :to_dt, Date > end > > class ExternalId; end > class ExtraInfo > property :name, String > property :type, String > property :value, String > property :externalId, ExternalId > > belongs_to :externalId, ExternalId > end > > class ExternalId > property :type, String > property :value, String > property :status, String > property :validity, DateRange > property :extraInfo, FixedNum > > # belongs_to Party, :field => :extid > has_many :extraInfos, ExtraInfo > end > > class Party; end > class Address > property :street1, String > property :street2, String > property :city, String > property :state, String > property :postcode, String > property :name, String > # property :party, Party > belongs_to Party, :field => :party > > # Need to put this in by hand otherwise I get something like this: > #(eval):23:in `add_address': undefined method > `personal_customer_oid=' # for # (NoMethodError) > # from og-test.rb:53:in `addAddress' > # from og-test.rb:124 > > def personal_customer_oid > self.party_oid > end > def personal_customer_oid=(oid) > self.party_oid = oid > end > end > > class Party > # property :address, Fixnum > property :contactInfo, ContactInfo > property :externalIds, ExternalId > > has_many Address, :foreign_field => :party > # has_many ExternalId, :foreign_field => extid > > def initialize > puts "Party: initialize..." > end > > > def addAddress( a ) > puts "addAddress: @address = #{@address}" > add_address( a ) > @address += 1 > end > end > > class Person < Party > property :firstName, String > property :middleName, String > property :lastName, String > property :knownBy, String > property :mobile, Phone > end > > class Organization < Party > property :name, String > end > > class CorporateCustomer < Organization; end > class Department < Organization > belongs_to :corporateCustomer, CorporateCustomer > end > > class PersonalCustomer < Person > include Customer > > def initialize (number, first, middle, last) > super() > @customer_number = number > @firstName = first > @middleName = middle > @lastName = last > end > > end > > class CorporateCustomer < Organization > include Customer > > property :departments, Department > property :contact, Person > property :parent, Organization > > has_many :departments, Department > end > > class EnterpriseCustomer < Organization > include Customer > > property :companies, CorporateCustomer > > has_many :companies, CorporateCustomer > end > end > > ==== tc_customer.rb ===== > $:.unshift File.join(File.dirname(__FILE__), 'lib') > > $DBG = true > > require 'test/unit' > require 'og' > require 'customer.rb' > > > class TC_Customer < Test::Unit::TestCase # :nodoc: all > include Og > > puts "Og Version #{Og::Version}" > > @og = Og.setup( > > :destroy => true, > :store => :sqlite, > :name => 'tc_customer' > > ) > > def setup > > puts "create a (fictious) primary address" > @a_primary = CRM::Address.new > @a_primary.street1 = '1370 Dunlap Ave' > @a_primary.street2 = 'Apt # 786' > @a_primary.city = 'Phoenix' > @a_primary.state = 'AZ' > @a_primary.name = 'primary' > > puts "create a (fictious) mailing address" > @a_mailing = CRM::Address.new > @a_mailing.street1 = '1290 Ray Ave' > @a_mailing.street2 = 'P.O Box 15' > @a_mailing.city = 'Chandler' > @a_mailing.state = 'AZ' > @a_mailing.name = 'mailing' > > end > > def teardown > end > > def test_store_and_retrieve > puts "create personal customer" > p1 = CRM::PersonalCustomer.new('1001', 'John', '', 'Lloyd-Jones') > puts "save the personal customer" > p1.save > > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1001' > assert_equal p1.firstName, p2.firstName, "Expect first name to be same" > assert_equal p1.lastName, p2.lastName, "Expect last name to be same" > end > > def test_address > puts "create personal customer" > p1 = CRM::PersonalCustomer.new('1002', 'Kalpana', '', 'Lloyd-Jones') > puts "save the personal customer" > p1.save > > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > p2.addresses << @a_primary > p2.save > > p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > p3.addresses.each { |a| > puts "#{a.street1} #{a.city}, #{a.state}" > } > # assert_equal( p2.address, 1, "p2.address should be 1 (first address)" > ) assert_equal( @a_primary.party_oid, p1.oid, "@a_primary should belong to > p1") > end > > def test_multiple_addresses > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > > puts "add mailing address" > p2.addresses << @a_mailing > p2.save > > p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > puts "p3 party id is #{p3.oid}" > p3.addresses.each do |a| > puts "id #{a.oid}: #{a.street1} #{a.city}, #{a.state}" > a1 = case a.name > when 'primary' then @a_primary > when 'mailing' then @a_mailing > end > assert_equal(a1.street1, a.street1, "street1 should match") > assert_equal(a1.city, a.city, "city should match") > assert_equal(a1.state, a.state, "state should match") > end > end > > end > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From robbie.wilhelm at gmail.com Tue Aug 9 12:46:40 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 9 Aug 2005 18:46:40 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: <5371ac740508081020667e6379@mail.gmail.com> Message-ID: <5371ac74050809094657dc4558@mail.gmail.com> that works. i changed that in the tutorial --r 2005/8/9, George Moschovitis : > > > > t=db.load(1, Person) > > > this should probably be: > > db.store.load(1, Person) > > -g. > > -- > http://www.gmosx.com > http://www.nitrohq.com > http://www.joy.gr > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From robbie.wilhelm at gmail.com Tue Aug 9 12:48:44 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 9 Aug 2005 18:48:44 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <200508090549.45417.dcorbin@machturtle.com> References: <6fcd26f1050807221726bc1f3e@mail.gmail.com> <200508090549.45417.dcorbin@machturtle.com> Message-ID: <5371ac740508090948553155d2@mail.gmail.com> no, not quite. sorry your example is slightly too complex... -robert 2005/8/9, David Corbin : > This gets the same exception I had? > > David > On Monday 08 August 2005 01:17 am, John Lloyd-Jones wrote: > > See the class Address. Comment out tthe two personal_customer_oid, > > personal_customer_oid= methods and the code fails. This is code was > > updated to use Og 0.22. Tell me if I am using it incorrectly. > > > > On 8/7/05, George Moschovitis wrote: > > > Please. give me some source code that triggers this behaviour. > > > > ===== customer.rb ===== > > require 'og' > > > > module Created > > prop_accessor :created, Date > > pre "@created ||= Date.today", :on => :og_insert > > end > > > > module Status > > property :status, String > > pre "@status ||= 'entered'", :on => :og_insert > > end > > > > module Customer > > include Created > > include Status > > property :customer_number, String, :unique => true > > property :creditLimit, String > > end > > > > > > module CRM > > > > # class Party; end > > > > class Phone > > property :type, String > > property :countryCode, String > > property :areaCode, String > > property :number, String > > property :extension, String > > property :comments, String > > end > > > > class ContactInfo > > property :email, String > > property :url, String > > property :phone, Phone > > property :fax, Phone > > > > end > > > > class DateRange > > property :from_dt, Date > > property :to_dt, Date > > end > > > > class ExternalId; end > > class ExtraInfo > > property :name, String > > property :type, String > > property :value, String > > property :externalId, ExternalId > > > > belongs_to :externalId, ExternalId > > end > > > > class ExternalId > > property :type, String > > property :value, String > > property :status, String > > property :validity, DateRange > > property :extraInfo, FixedNum > > > > # belongs_to Party, :field => :extid > > has_many :extraInfos, ExtraInfo > > end > > > > class Party; end > > class Address > > property :street1, String > > property :street2, String > > property :city, String > > property :state, String > > property :postcode, String > > property :name, String > > # property :party, Party > > belongs_to Party, :field => :party > > > > # Need to put this in by hand otherwise I get something like this: > > #(eval):23:in `add_address': undefined method > > `personal_customer_oid=' # for # (NoMethodError) > > # from og-test.rb:53:in `addAddress' > > # from og-test.rb:124 > > > > def personal_customer_oid > > self.party_oid > > end > > def personal_customer_oid=(oid) > > self.party_oid = oid > > end > > end > > > > class Party > > # property :address, Fixnum > > property :contactInfo, ContactInfo > > property :externalIds, ExternalId > > > > has_many Address, :foreign_field => :party > > # has_many ExternalId, :foreign_field => extid > > > > def initialize > > puts "Party: initialize..." > > end > > > > > > def addAddress( a ) > > puts "addAddress: @address = #{@address}" > > add_address( a ) > > @address += 1 > > end > > end > > > > class Person < Party > > property :firstName, String > > property :middleName, String > > property :lastName, String > > property :knownBy, String > > property :mobile, Phone > > end > > > > class Organization < Party > > property :name, String > > end > > > > class CorporateCustomer < Organization; end > > class Department < Organization > > belongs_to :corporateCustomer, CorporateCustomer > > end > > > > class PersonalCustomer < Person > > include Customer > > > > def initialize (number, first, middle, last) > > super() > > @customer_number = number > > @firstName = first > > @middleName = middle > > @lastName = last > > end > > > > end > > > > class CorporateCustomer < Organization > > include Customer > > > > property :departments, Department > > property :contact, Person > > property :parent, Organization > > > > has_many :departments, Department > > end > > > > class EnterpriseCustomer < Organization > > include Customer > > > > property :companies, CorporateCustomer > > > > has_many :companies, CorporateCustomer > > end > > end > > > > ==== tc_customer.rb ===== > > $:.unshift File.join(File.dirname(__FILE__), 'lib') > > > > $DBG = true > > > > require 'test/unit' > > require 'og' > > require 'customer.rb' > > > > > > class TC_Customer < Test::Unit::TestCase # :nodoc: all > > include Og > > > > puts "Og Version #{Og::Version}" > > > > @og = Og.setup( > > > > :destroy => true, > > :store => :sqlite, > > :name => 'tc_customer' > > > > ) > > > > def setup > > > > puts "create a (fictious) primary address" > > @a_primary = CRM::Address.new > > @a_primary.street1 = '1370 Dunlap Ave' > > @a_primary.street2 = 'Apt # 786' > > @a_primary.city = 'Phoenix' > > @a_primary.state = 'AZ' > > @a_primary.name = 'primary' > > > > puts "create a (fictious) mailing address" > > @a_mailing = CRM::Address.new > > @a_mailing.street1 = '1290 Ray Ave' > > @a_mailing.street2 = 'P.O Box 15' > > @a_mailing.city = 'Chandler' > > @a_mailing.state = 'AZ' > > @a_mailing.name = 'mailing' > > > > end > > > > def teardown > > end > > > > def test_store_and_retrieve > > puts "create personal customer" > > p1 = CRM::PersonalCustomer.new('1001', 'John', '', 'Lloyd-Jones') > > puts "save the personal customer" > > p1.save > > > > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1001' > > assert_equal p1.firstName, p2.firstName, "Expect first name to be same" > > assert_equal p1.lastName, p2.lastName, "Expect last name to be same" > > end > > > > def test_address > > puts "create personal customer" > > p1 = CRM::PersonalCustomer.new('1002', 'Kalpana', '', 'Lloyd-Jones') > > puts "save the personal customer" > > p1.save > > > > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > > p2.addresses << @a_primary > > p2.save > > > > p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > > p3.addresses.each { |a| > > puts "#{a.street1} #{a.city}, #{a.state}" > > } > > # assert_equal( p2.address, 1, "p2.address should be 1 (first address)" > > ) assert_equal( @a_primary.party_oid, p1.oid, "@a_primary should belong to > > p1") > > end > > > > def test_multiple_addresses > > p2 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > > > > puts "add mailing address" > > p2.addresses << @a_mailing > > p2.save > > > > p3 = CRM::PersonalCustomer.one :condition => 'customer_number=1002' > > puts "p3 party id is #{p3.oid}" > > p3.addresses.each do |a| > > puts "id #{a.oid}: #{a.street1} #{a.city}, #{a.state}" > > a1 = case a.name > > when 'primary' then @a_primary > > when 'mailing' then @a_mailing > > end > > assert_equal(a1.street1, a.street1, "street1 should match") > > assert_equal(a1.city, a.city, "city should match") > > assert_equal(a1.state, a.state, "state should match") > > end > > end > > > > end > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From robbie.wilhelm at gmail.com Tue Aug 9 13:07:01 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 9 Aug 2005 19:07:01 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac74050809024648bf7434@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> <5371ac740508081101744850ad@mail.gmail.com> <5371ac74050809024648bf7434@mail.gmail.com> Message-ID: <5371ac740508091007634c8749@mail.gmail.com> i got something, that works for me: entity.rb: def set_sequence(seq) meta :sequence, seq end store/psql: def enchant(klass, manager) if klass.metadata.sequence klass.const_set 'OGSEQ', klass.metadata.sequence.to_s else if sclass = klass.metadata.superclass klass.const_set 'OGSEQ', "#{table(sclass.first)}_oid_seq" else klass.const_set 'OGSEQ', "#{table(klass)}_oid_seq" end end if klass.metadata.primary_key.flatten.first == :oid unless klass.properties.find { |p| p.symbol == :oid } klass.property :oid, Fixnum, :sql => 'serial PRIMARY KEY' end end super end -robert 2005/8/9, Robert Wagner : > 2005/8/9, George Moschovitis : > > Not yet, but thanks for pointing this out, will add it (or you can > > send a patch ;-)) > thanx - i'll try to find the spot for a patch :) happy holidays. > --robert > > > Btw, I am on vacations at the moment... so expect some slower response time :) > > > > -g. > > > > On 8/8/05, Robert Wagner wrote: > > > is it possible to change the sequenz-name (pgsql)? > > > from like: efa_notes_oid_seq > > > to efa_notes_id_seq > > > ? > > > thanks, > > > --robert > > > > > > 2005/8/8, Robert Wagner : > > > > argh. found the error. somewhere i had an invalid property type 'Date' > > > > instead of Time. > > > > the db.load() error persists. > > > > --robert > > > > > > > > > > > > 2005/8/8, Robert Wagner : > > > > > hi, > > > > > i'm trying to og my legacy tables with the new reverse feature: > > > > > > > > > > class Person > > > > > property :id, Fixnum > > > > > property :title, String > > > > > property :fname, String > > > > > property :lname, String > > > > > ... > > > > > set_table :efa_persons > > > > > set_primary_key :id > > > > > has_many Note > > > > > belongs_to Company, :field=>:company_id > > > > > end > > > > > > > > > > p=Person[1] # thats me > > > > > > > > > > # sql ist right but it > > > > > # gives me an error: > > > > > > > > > > DEBUG: SELECT * FROM efa_persons WHERE id=1 > > > > > /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col > > > > > 19: `t/string/unix_ ' (ArgumentError) > > > > > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > > > > > from (eval):4:in `og_read' > > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:881:in > > > > > `read_one' > > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:308:in > > > > > `load' > > > > > from /usr/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' > > > > > from ogtest.rb:31 > > > > > > > > > > alternative: > > > > > > > > > > t=db.load(1, Person) > > > > > > > > > > gives > > > > > > > > > > ogtest.rb:30: private method `load' called for > > > > > # (NoMethodError) > > > > > > > > > > anybody knows whats wrong? > > > > > > > > > > thanks, > > > > > robert > > > > > > > > > > 2005/8/7, George Moschovitis : > > > > > > Hello everyone, > > > > > > > > > > > > * The much requested Og 'reverse mode' is implemented. Og's > > > > > > domain specific language and API is extended to allow fine-grained > > > > > > customization of the schema-to-objects mapping. Og can now handle > > > > > > most of the legacy schemas you can throw at it. Here is an > > > > > > example: > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Nitro-general mailing list > > > Nitro-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > > > > -- > > http://www.gmosx.com > > http://www.nitrohq.com > > http://www.joy.gr > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > From george.moschovitis at gmail.com Tue Aug 9 16:16:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 9 Aug 2005 23:16:18 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac740508091007634c8749@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> <5371ac740508081101744850ad@mail.gmail.com> <5371ac74050809024648bf7434@mail.gmail.com> <5371ac740508091007634c8749@mail.gmail.com> Message-ID: seems nice, I 'll add something like this :) Thanks. -g. > i got something, that works for me: > > entity.rb: > > def set_sequence(seq) > meta :sequence, seq > end > > > store/psql: > > def enchant(klass, manager) > if klass.metadata.sequence > klass.const_set 'OGSEQ', klass.metadata.sequence.to_s > else > if sclass = klass.metadata.superclass > klass.const_set 'OGSEQ', "#{table(sclass.first)}_oid_seq" > else > klass.const_set 'OGSEQ', "#{table(klass)}_oid_seq" > end > end > > if klass.metadata.primary_key.flatten.first == :oid > unless klass.properties.find { |p| p.symbol == :oid } > klass.property :oid, Fixnum, :sql => 'serial PRIMARY KEY' > end > end > super > end -- http://www.gmosx.com http://www.nitrohq.com http://www.joy.gr From john.lloydjones at gmail.com Tue Aug 9 22:17:09 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Tue, 9 Aug 2005 19:17:09 -0700 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <200508090549.45417.dcorbin@machturtle.com> References: <6fcd26f1050807221726bc1f3e@mail.gmail.com> <200508090549.45417.dcorbin@machturtle.com> Message-ID: <6fcd26f10508091917389f6c75@mail.gmail.com> On 8/9/05, David Corbin wrote: > This gets the same exception I had? > No, this give the error I reported earlier: (eval):23:in `add_address': undefined method `personal_customer_oid=' for # (NoMethodError) from og-test.rb:53:in `addAddress' from og-test.rb:124 Right now, I am getting along using the hack suggested by Aleksi (adding personal_customer_oid, and personal_customer_oid= methods), but it is not a working solution when I have many derived classes. John From aglarond at gmail.com Wed Aug 10 03:33:54 2005 From: aglarond at gmail.com (Dimitri Aivaliotis) Date: Wed, 10 Aug 2005 09:33:54 +0200 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <5371ac740508091007634c8749@mail.gmail.com> References: <5371ac740508081020667e6379@mail.gmail.com> <5371ac7405080810418239fe9@mail.gmail.com> <5371ac740508081101744850ad@mail.gmail.com> <5371ac74050809024648bf7434@mail.gmail.com> <5371ac740508091007634c8749@mail.gmail.com> Message-ID: <55c107bf05081000335c462967@mail.gmail.com> Hi George, I'm having a problem importing the structure from a legacy MySQL DB into a PostgreSQL one. The problem is with the pre-defined 'oid' field: in MySQL it's 'auto_increment' and in PostgreSQL it's 'serial'. Is there an elegant way to convert the values? On 8/9/05, Robert Wagner wrote: > store/psql: > > def enchant(klass, manager) > > if klass.metadata.primary_key.flatten.first == :oid > unless klass.properties.find { |p| p.symbol == :oid } > klass.property :oid, Fixnum, :sql => 'serial PRIMARY KEY' > end > end > super > end Or, do I need to comment-out the 'unless' clause (leaving, of course, the klass.property assignment)? I.e., is there a really good reason to preserve any pre-defined oid definition? Thanks, - Dimitri From dyn at ond.vein.hu Thu Aug 11 11:10:50 2005 From: dyn at ond.vein.hu (Kristof Jozsa) Date: Thu, 11 Aug 2005 17:10:50 +0200 Subject: [Nitro] Og newbie problems Message-ID: <42FB6A7A.1060106@ond.vein.hu> Hi, admittedly I started to play with Og today so please feel free to correct me with anything (or just send over /dev/null :), but I'd like to share my experiences and ask for suggestions. All my experiments happened on my gentoo linux box, Og installed by gem, version 0.22.0 on ruby 1.8.2. The first problem I bumped into can be demonstrated with the following piece of code: ---- #!/usr/bin/ruby -rubygems require 'test/unit' require 'og' require 'og/relation' class Order property :name, String has_many :items, LineItem end class LineItem belongs_to Order end class TestOg < Test::Unit::TestCase include Og def test_basic end def setup og = Og.setup(:store => :memory, :name => 'test') end end ---- running this script dumps this error: /test_og.rb:15: undefined method `belongs_to' for LineItem:Class (NoMethodError) I kept on fighting and after some time I realized that adding any property to LineItem before the belongs_to declaration fixes the problem. Is there any other way to trigger initializing Og (I think that's what fails to happen in this case) than this? Next I had set up an unidirectional many-to-many relationship. I tried very hard to set it up correctly and get the join table generated, right until I realized that it IS generated just not in the logs.. (the two other create table sql statements were displayed as INFO messages but not the join table :) Do you think it would make sense displaying that info as well? Still at the many-to-many relationship (example was many SoftwarePackage can contain many Software), I tried to create a constructor for SoftwarePackage which accepted an array of Software (simplifying the example here): ---- class Software property :name, String end class SoftwarePackage < Software many_to_many :software, Software def initialize(software) software.each { |x| add_software x } end end ---- and well, it did not really work out. I find out that I have to call save first in the SoftwarePackage constructor, else an invalid sql will be generated like: INSERT INTO j_software_softwarepackage (software_oid,softwarepackage_oid) VALUES (1, ) with a missing id. Again, I've got a workaround here so I'm not sure if that's the way it's meant to work or that's clarified as a rough edge and you plan to smooth it a bit :) Still at this topic slightly against following the least surprise principle first I assumed the following line to work in the constructor: software.each { |x| @software << x } Maybe it would be nice to have that too if possible. As a last question, is there a way to change the oid naming strategy followed by Og? A similar approach as setting Og.table_prefix = nil would be really useful. Wrapping up, I'm absolutely amazed with the power of Og. I'm actually sketching a new java project's software design from scratch with ruby and Og (first time attempting this), and I'm blown away with the speed I could build/test and play around with my domain objects using Og. Thanks much, and keep up the excellent work, Kristof Jozsa From john.lloydjones at gmail.com Thu Aug 11 11:57:18 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Thu, 11 Aug 2005 08:57:18 -0700 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: Message-ID: <6fcd26f105081108571067f50e@mail.gmail.com> I notice that when I attempt to run the unit tests on Og 0.22.0, I get this error message: c:/ruby-182/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/errors .rb:94:in `check': table "ogtc_oginheritance_document" has more than one primary key (SQLite3::SQLException) from c:/ruby-182/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/s qlite3/statement.rb:70:in `initialize' from c:/ruby-182/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/s qlite3/database.rb:183:in `new' from c:/ruby-182/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/s qlite3/database.rb:183:in `prepare' from c:/ruby-182/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/s qlite3/database.rb:274:in `query' from ./lib/og/store/sqlite.rb:141:in `create_table' from (eval):5:in `send' from (eval):5:in `og_create_schema' from ./lib/og/store/sql.rb:290:in `enchant' I checked the generated sql and, sure enough it is attempting to create a column 'oid' as primary key three times. The behaviour is specific to schema_inheritance. From george.moschovitis at gmail.com Thu Aug 11 12:51:35 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 11 Aug 2005 19:51:35 +0300 Subject: [Nitro] Og newbie problems In-Reply-To: <42FB6A7A.1060106@ond.vein.hu> References: <42FB6A7A.1060106@ond.vein.hu> Message-ID: Hello Kristof, > I kept on fighting and after some time I realized that adding any property to > LineItem before the belongs_to declaration fixes the problem. Is there any other > way to trigger initializing Og (I think that's what fails to happen in this > case) than this? you can use either: class MyObject < Og::Entity .. end or class MyObject # so you can still inherit from another class include Og::EntityMixin .. end as a shortcut, if you define a property, the Mixin is automatically included. > Next I had set up an unidirectional many-to-many relationship. I tried very hard > .. > think it would make sense displaying that info as well? nice point. > Still at the many-to-many relationship (example was many SoftwarePackage can > contain many Software), I tried to create a constructor for SoftwarePackage > which accepted an array of Software (simplifying the example here): > ... > Maybe it would be nice to have that too if possible. A feature that will make this possible is planned for the next version (in-memory building of collections). However, if someone cares to provide an implementation for this please feel free to submit a patch. > As a last question, is there a way to change the oid naming strategy followed by > Og? A similar approach as setting Og.table_prefix = nil would be really useful. you can use either class MyObject property :mykey, String, :primary_key => true .. end or (prefered) class MyObject propety :mykey, String ... set_primary_key :mykey, String end > Thanks much, and keep up the excellent work, Hope you will be able to help this project too :) We need all the help we can get. regards, George. -- http://www.gmosx.com http://www.nitrohq.com http://www.navel.gr From george.moschovitis at gmail.com Thu Aug 11 12:58:01 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 11 Aug 2005 19:58:01 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: <6fcd26f105081108571067f50e@mail.gmail.com> References: <6fcd26f105081108571067f50e@mail.gmail.com> Message-ID: Hello John, The Og unit tests need some refactoring to work through rake. I am running them one after the other and everything works. I hope a member of the community can step in and help with the refactoring of the unit tests. A related effort was started by Aleksi, and to facilitate this, improves support for Og testing was added in the latest version. If anyone has got some time this would be a good project to work on. regards, George. -- http://www.gmosx.com http://www.nitrohq.com http://www.navel.gr From Aleksi.Niemela at cs.helsinki.fi Thu Aug 11 12:57:45 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Thu, 11 Aug 2005 19:57:45 +0300 Subject: [Nitro] Og newbie problems In-Reply-To: <42FB6A7A.1060106@ond.vein.hu> References: <42FB6A7A.1060106@ond.vein.hu> Message-ID: <42FB8389.5070307@cs.helsinki.fi> Kristof Jozsa wrote: > Hi, > Hello there, nice to see you got yourself going well fast! > The first problem I bumped into can be demonstrated with the following > piece of code: > class LineItem > belongs_to Order > end > running this script dumps this error: > /test_og.rb:15: undefined method `belongs_to' for LineItem:Class > (NoMethodError) > > I kept on fighting and after some time I realized that adding any > property to LineItem before the belongs_to declaration fixes the > problem. Is there any other way to trigger initializing Og (I think > that's what fails to happen in this case) than this? > There's patch for this functionality already. But I'm not sure if George ended up adding a new keyword just to enchant the class with relation macros. Refer to http://rubyforge.org/pipermail/nitro-general/2005-June/000448.html if you want to implement it by yourself. > Next I had set up an unidirectional many-to-many relationship. I tried > very hard to set it up correctly and get the join table generated, > right until I realized that it IS generated just not in the logs.. > (the two other create table sql statements were displayed as INFO > messages but not the join table :) Do you think it would make sense > displaying that info as well? > Sure. Here's the patch. I wasn't able to test it but doesn't seem complicated enough to really break anything, and I'm sure George will test it before commiting. $ svn diff psql.rb Index: psql.rb =================================================================== --- psql.rb (revision 250) +++ psql.rb (working copy) @@ -218,6 +218,7 @@ begin create_join_table_sql(info).each do |sql| @conn.exec(sql).clear + Logger.info "Created jointable '#{info[:table]}'." end rescue Object => ex # gmosx: any idea how to better test this? > Still at the many-to-many relationship (example was many > SoftwarePackage can contain many Software), I tried to create a > constructor for SoftwarePackage which accepted an array of Software > (simplifying the example here): > > ---- > class Software > property :name, String > end > > class SoftwarePackage < Software > many_to_many :software, Software > > def initialize(software) > software.each { |x| add_software x } > end > end > ---- > > and well, it did not really work out. I find out that I have to call > save first in the SoftwarePackage constructor, else an invalid sql > will be generated like: > The example at the end of this mail works for me. So perhaps you can adapt to similar technique until George has sorted this out at some later revision. - Aleksi #!/usr/bin/ruby -rubygems $DBG = true require 'test/unit' require 'og' #require 'og/relation' class Order property :name, String has_many :items, LineItem def initialize(name, its) @name = name save! its.each { |it| items << it } end end class LineItem property :name, String belongs_to Order def initialize(name) @name = name end end class Software property :name, String def initialize(name) @name = name end end class SoftwarePackage < Software property :name, String many_to_many :software, Software def initialize(name, softwares) @name = name save! softwares.each { |x| add_software x } end end class TestOg < Test::Unit::TestCase include Og def test_basic items = [LineItem.create("foo"), LineItem.create("bar")] o = Order.create("order", items) sws = [Software.create("og"), Software.create("nitro")] o = SoftwarePackage.create("package", sws) end def setup db_conf = { :name => "testing2", :store => "psql" } og = Og.setup(db_conf) end end From george.moschovitis at gmail.com Thu Aug 11 13:56:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 11 Aug 2005 20:56:32 +0300 Subject: [Nitro] OT: Anyone used darcs? Message-ID: I have a small question not directly related with nitro. Has anyone on this list any (positive/negative) experience with Darcs? -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From mneumann at ntecs.de Thu Aug 11 14:19:16 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Thu, 11 Aug 2005 20:19:16 +0200 Subject: [Nitro] OT: Anyone used darcs? In-Reply-To: References: Message-ID: <42FB96A4.2010902@ntecs.de> George Moschovitis wrote: > I have a small question not directly related with nitro. Has anyone on this > list any (positive/negative) experience with Darcs? I've used it last year, for a small university project. It's *very* easy to setup. Commands are a little bit different if you come from CVS/svn, but it's easy to learn. Nice is that you can view every diff or only apply partially diffs, so for example you can hack a new prototyp and then selectively commit only parts of the changes to the repository. I missed that feature serveral times in subversion/CVS, where you can only commit all at once or selected files. I don't know whether darcs can 'move' modified files. Subversion can't. Sometimes you need to move a file and make a change. That has to be split across two commit, which is not very nice. And CVS can't even rename ;-) But I never tried Darcs with multiple users. Then I tried to maintain configuration files with Darcs and realized that it does not handle permissions. For this task it's not suited. In total, mostly positive experience (except the long build duration of Haskell GHC ;-). My feeling is that Darcs is much more mature than subversion. Regards, Michael From vagabond at cataclysm-software.net Thu Aug 11 21:01:56 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Fri, 12 Aug 2005 03:01:56 +0200 Subject: [Nitro] Og and derived classes... Message-ID: <42FBF504.7030309@cataclysm-software.net> I'm trying to write some code that stores ruby classes, modules and methods. A class can contain both a module and methods, a method can also contain methods. In my code classes are a derived class of methods, and I've set the has_many to be methods for the module class. The method class has belongs_to set to be a module... However og doesn't seem to like this idea much, is this kinda arrangement even possible? It seems that og isn't smart enough to notice that class is derived from module. Here's my stripped down example of what I'm trying to do: ============================ require 'rubygems' require_gem 'og' #turn on debugging $DBG = true class Doc property :name, String def initialize(name) @name = name end end class DocModule < Doc has_many :functions, DocMethod #contains many methods end class DocClass < DocModule many_to_many :modules, DocModule #may have many modules, and those modules may be in other classes end class DocMethod < Doc belongs_to :parent, DocModule #belong to a DocModule as DocClass is a subclass of DocModule end db = Og.setup( :store => 'mysql', :name => 'test', :user => 'bleh', :password => 'something' ) testclass = DocClass.new('Testd') testmethod = DocMethod.new('test') testmodule = DocModule.new('module') testmethod.parent = testclass #save the objects testclass.save testmethod.save #this works testmethod.parent = testclass #but reports no parents... puts testmethod.parent #this causes a crash #testclass.add_function(testmethod) #this causes a crash #puts testclass.functions =============================== I'm also having problems using a filesys store, are there any tips on that, developing on a mysql db is a bit annoying as I have to keep manually deleting the tables when I mess with the structre. I thought Og.create_schema = true would help with that, but apparently it does not.. I really like the idea of og, and really want to use it and nitro, great job so far (tho the docs could be better). Andrew From john.lloydjones at gmail.com Thu Aug 11 23:06:17 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Thu, 11 Aug 2005 20:06:17 -0700 Subject: [Nitro] Og and derived classes... In-Reply-To: <42FBF504.7030309@cataclysm-software.net> References: <42FBF504.7030309@cataclysm-software.net> Message-ID: <6fcd26f105081120061e1a9e41@mail.gmail.com> Andrew Here's a couple of tips: use something like: db = Og.setup( :destroy => true, :store => 'sqlite', :name => 'andrew' ) This re-creates your database each time. Note that I use sqlite3 -- it's good for this sort of work. What error message do you get when your test crashes? Maybe it is related to the problem I reported? John From vagabond at cataclysm-software.net Fri Aug 12 03:22:49 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Fri, 12 Aug 2005 09:22:49 +0200 Subject: [Nitro] Og and derived classes... In-Reply-To: <6fcd26f105081120061e1a9e41@mail.gmail.com> References: <42FBF504.7030309@cataclysm-software.net> <6fcd26f105081120061e1a9e41@mail.gmail.com> Message-ID: <42FC4E49.4000706@cataclysm-software.net> John, It does indeed seem to be similar to your problem, when I do: testclass.add_function(testmethod) I get: (eval):23:in `add_function': undefined method `doc_class_oid=' for # (NoMethodError) and if I do: puts testclass.functions it errors out with: ERROR: DB error Unknown column 'doc_class_oid' in 'where clause', [SELECT * FROM ogdocmethod WHERE doc_class_oid = 1] I get similar errors doing a add_function using a DocModule. but strangely if I do: testmodule.save testmethod.parent = testclass puts testmethod.parent.inspect It looks like its assigning testmodule as the parent, not testclass... Very bizarre. Oh, destroy => true was just what I needed, thanks. Andrew John Lloyd-Jones wrote: > Andrew > > Here's a couple of tips: > > use something like: > > db = Og.setup( > :destroy => true, > :store => 'sqlite', > :name => 'andrew' > ) > This re-creates your database each time. Note that I use sqlite3 -- > it's good for this sort of work. > > What error message do you get when your test crashes? Maybe it is > related to the problem I reported? > > John > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > From epiperak at softlab.ece.ntua.gr Fri Aug 12 03:25:18 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 12 Aug 2005 10:25:18 +0300 (EEST) Subject: [Nitro] Somebody mess up the WIKI Message-ID: George, somebody messed up the wiki. Check your logs to find the IP. I hope we have a backup somewhere? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Fri Aug 12 03:26:51 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 12 Aug 2005 10:26:51 +0300 (EEST) Subject: [Nitro] Somebody mess up the WIKI In-Reply-To: References: Message-ID: The IP is obvious 70.71.15.166 Lets find thing guy... > George, somebody messed up the wiki. Check your logs to find the IP. > > I hope we have a backup somewhere? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From vagabond at cataclysm-software.net Fri Aug 12 03:51:19 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Fri, 12 Aug 2005 09:51:19 +0200 Subject: [Nitro] Somebody mess up the WIKI In-Reply-To: References: Message-ID: <42FC54F7.7030402@cataclysm-software.net> Its a wiki, of course there's a backup, that's the idea... Emmanuel Piperakis wrote: > George, somebody messed up the wiki. Check your logs to find the IP. > > I hope we have a backup somewhere? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > From dyn at ond.vein.hu Fri Aug 12 06:06:35 2005 From: dyn at ond.vein.hu (Kristof Jozsa) Date: Fri, 12 Aug 2005 12:06:35 +0200 Subject: [Nitro] Og newbie problems In-Reply-To: <42FB8389.5070307@cs.helsinki.fi> References: <42FB6A7A.1060106@ond.vein.hu> <42FB8389.5070307@cs.helsinki.fi> Message-ID: <42FC74AB.9040602@ond.vein.hu> Hi George & Aleksi, thanks much for your help, it's always a pleasure to meet a very friendly and responsive community :) I hope the patch about displaying the join table makes its way into the next release. It's a minor (ok, a trivial) issue, but I seriously spend over 10 mins trying to 'fix' my relation setup before realized what was going on.. There's one issue you did not response to: about using the @entities << entity syntax at many-to-many relationships. I'd absolutely prefer that to using the add_entity() method. Aleksi, thanks for cleaning up my testcase :) I applied the same workaround (saving the collection in the initalize method before adding related objects), it works fine for now.. George, I'm not sure what (or how much) I could help you with the project. My freetime is another term I could hardly define... ;) I'm basically a java dev who heard the noise on Rails some months ago and some weeks later realized the beauty and power of Ruby.. On the other side I could never accept the AR approach about thinking about the database. I prefer OO design and use a relational store only to persist. Therefore Og fits me perfectly sketching the design, writing a couple of testcases verifying domain logic and I get the DB schema for free (yeah Hibernate gives me that too but Og running my tests in 0.2s on my developer box can hardly be beaten with anything java ;) Kristof From alang at cronosys.com Fri Aug 12 10:28:28 2005 From: alang at cronosys.com (Alan Garrison) Date: Fri, 12 Aug 2005 10:28:28 -0400 Subject: [Nitro] Nuby templating question Message-ID: <42FCB20C.60608@cronosys.com> I'm still trying to wrap my poor little brain around the templating stuff. Looking at Spark 0.4.0, do the tags in the template/ xhtml files directly refer to the fact that the skin.rb class is a subclass of the Element class? "class Page < Nitro::Element" -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From john.lloydjones at gmail.com Fri Aug 12 11:07:58 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Fri, 12 Aug 2005 08:07:58 -0700 Subject: [Nitro] Og and derived classes... In-Reply-To: <42FC4E49.4000706@cataclysm-software.net> References: <42FBF504.7030309@cataclysm-software.net> <6fcd26f105081120061e1a9e41@mail.gmail.com> <42FC4E49.4000706@cataclysm-software.net> Message-ID: <6fcd26f10508120807640c9c3a@mail.gmail.com> Andrew I have been experimenting with a patch in HasMany#enchant # self[:foreign_key] = "#{foreign_name || owner_singular_name}_#{owner_pk}" #original self[:foreign_key] = "#{foreign_field || owner_singular_name}_#{owner_pk}" # *** hack *** This actually fixes my problem and doesn't appear to break any of the unit tests I have run. Alas, it has no effect on the many_to_many side of things. For that a deeper solution is needed. I hope George gets around to fixing it. John On 8/12/05, Andrew Thompson wrote: > John, > > It does indeed seem to be similar to your problem, when I do: > > testclass.add_function(testmethod) > > I get: > > (eval):23:in `add_function': undefined method `doc_class_oid=' for > # (NoMethodError) > > and if I do: > > puts testclass.functions > > it errors out with: > ERROR: DB error Unknown column 'doc_class_oid' in 'where clause', > [SELECT * FROM ogdocmethod WHERE doc_class_oid = 1] > > I get similar errors doing a add_function using a DocModule. but > strangely if I do: > > testmodule.save > > testmethod.parent = testclass > > puts testmethod.parent.inspect > > It looks like its assigning testmodule as the parent, not testclass... > > Very bizarre. > > Oh, destroy => true was just what I needed, thanks. > > Andrew > > John Lloyd-Jones wrote: > > Andrew > > > > Here's a couple of tips: > > > > use something like: > > > > db = Og.setup( > > :destroy => true, > > :store => 'sqlite', > > :name => 'andrew' > > ) > > This re-creates your database each time. Note that I use sqlite3 -- > > it's good for this sort of work. > > > > What error message do you get when your test crashes? Maybe it is > > related to the problem I reported? > > > > John > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From george.moschovitis at gmail.com Fri Aug 12 11:31:38 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 12 Aug 2005 18:31:38 +0300 Subject: [Nitro] Somebody mess up the WIKI In-Reply-To: <42FC54F7.7030402@cataclysm-software.net> References: <42FC54F7.7030402@cataclysm-software.net> Message-ID: Ok, thanks for reporting. -g. On 8/12/05, Andrew Thompson wrote: > Its a wiki, of course there's a backup, that's the idea... > > Emmanuel Piperakis wrote: > > George, somebody messed up the wiki. Check your logs to find the IP. > > > > I hope we have a backup somewhere? > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > > {To explore is Human, to Create is Devine, > > To teach is Primal, to Rule is Sin} > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 12 11:39:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 12 Aug 2005 18:39:17 +0300 Subject: [Nitro] OT: Anyone used darcs? In-Reply-To: <42FB96A4.2010902@ntecs.de> References: <42FB96A4.2010902@ntecs.de> Message-ID: I played a bit and it seems much better than SVN. And easy to understand. CVS is just a piece of crap! -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 12 11:41:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 12 Aug 2005 18:41:32 +0300 Subject: [Nitro] Og newbie problems In-Reply-To: <42FC74AB.9040602@ond.vein.hu> References: <42FB6A7A.1060106@ond.vein.hu> <42FB8389.5070307@cs.helsinki.fi> <42FC74AB.9040602@ond.vein.hu> Message-ID: > I hope the patch about displaying the join table makes its way into the next > release. already added. > There's one issue you did not response to: about using the @entities << entity > syntax at many-to-many relationships. I'd absolutely prefer that to using the > add_entity() method. try entities << entity (without the @) > I'm basically a java dev who heard the noise on Rails some months ago and some > ... > java ;) Welcome on board, spread the word :) The more people that use Og/Nitro the better for the project. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 12 11:43:49 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 12 Aug 2005 18:43:49 +0300 Subject: [Nitro] Nuby templating question In-Reply-To: <42FCB20C.60608@cronosys.com> References: <42FCB20C.60608@cronosys.com> Message-ID: Yeah, if you define a subclass of Nitro::Element you can use it in your tempates as a cheap form of macro or tag. class MyTag < Nitro::Element end responds to ... or ... to be xhtml compliant you can customize the x: prefix if you want. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 12 11:54:06 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 12 Aug 2005 18:54:06 +0300 Subject: [Nitro] Og and derived classes... In-Reply-To: <42FBF504.7030309@cataclysm-software.net> References: <42FBF504.7030309@cataclysm-software.net> Message-ID: > It seems that og isn't smart enough to notice > that class is derived from module. Og IS supposed to be smart enough to handle classes that i derive from modules. I 'll have to take a closer look at your example. Be patient. > I'm also having problems using a filesys store, are there any tips on The filesys store is not updated. A better filesys/memory store will be available soon, stay tuned. We are considering some patches provided by members of this community. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From vagabond at cataclysm-software.net Fri Aug 12 12:38:51 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Fri, 12 Aug 2005 18:38:51 +0200 Subject: [Nitro] Og and derived classes... In-Reply-To: References: <42FBF504.7030309@cataclysm-software.net> Message-ID: <42FCD09B.3060808@cataclysm-software.net> I look forward to it, I really really like the ideas behind og/nitro and can't wait to write something using them, I guess I'll just dump to YAML for the moment until you fix og. Thanks Andrew George Moschovitis wrote: >>It seems that og isn't smart enough to notice >>that class is derived from module. > > > Og IS supposed to be smart enough to handle classes that i derive from > modules. I 'll have to take a closer look at your example. Be patient. > > >>I'm also having problems using a filesys store, are there any tips on > > > The filesys store is not updated. A better filesys/memory store will > be available soon, stay tuned. We are considering some patches > provided by members of this community. > > -g. > From transfire at gmail.com Fri Aug 12 14:27:42 2005 From: transfire at gmail.com (TRANS) Date: Fri, 12 Aug 2005 14:27:42 -0400 Subject: [Nitro] OT: Anyone used darcs? In-Reply-To: References: <42FB96A4.2010902@ntecs.de> Message-ID: <4b6f054f050812112729ca45a9@mail.gmail.com> On 8/12/05, George Moschovitis wrote: > I played a bit and it seems much better than SVN. And easy to understand. > CVS is just a piece of crap! I agree. I generally won;t touch CVS unless I have to. Rubyforge now supports SVN, yes? Sure would like them to add Darcs though. T. From dyn at ond.vein.hu Sat Aug 13 19:52:05 2005 From: dyn at ond.vein.hu (Kristof Jozsa) Date: Sun, 14 Aug 2005 01:52:05 +0200 Subject: [Nitro] Og 1-n relation alias bug Message-ID: <42FE87A5.7000600@ond.vein.hu> Hello guys, I think I've got something real bad for you this time. Consider the following testcase: ------ #!/usr/bin/ruby -rubygems $DBG = true require 'og' require 'test/unit' class Book include Og::EntityMixin property :title belongs_to :owner, Person end class Person include Og::EntityMixin property :name, Og::VarChar(128) has_many :books, Book end class TestOg < Test::Unit::TestCase include Og def test_basic book = Book.create person = Person.create person.books << book # blows here end def setup Og.table_prefix = nil og = Og.setup(:store => :memory, :name => 'test') end end ------ At the marked line the relationships blows with the message: NoMethodError: undefined method `person_oid=' for # Now I gave it some time and try to dig down to the root of the problem to a be bit more help now just whine here ;) Unfortunately all I could find out is that around that has_many.rb uses a slighly naive-looking approach at setting up the collection's options. 'foreign_name' is not set at all so foreign_key is made up of owner_singular_name which does not care much about the alias set up for the collection. No wonder the whole thing crashes then on the enchanted add_stuff method :( As a side note, eg. for refers_to the foreign_key is filled according to my added logs but I still could not find where it was set from, some black magic might be happening here.. :) George, while you're into it, please try to delete any of the plain properties from the classes defined above and rerun the test. It dies for me with: NoMethodError: undefined method `store' for nil:NilClass The very same happens when trying to define the Og::Entity superclass instead of the mixin.. cheers, Kristof From bernd at bdebl.de Sun Aug 14 00:56:30 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Sun, 14 Aug 2005 06:56:30 +0200 Subject: [Nitro] user registration / authentication: email validation Message-ID: <42FECEFE.9010204@bdebl.de> Hi all, I finally had the opportunaty to work half-way through the tutorial and I'm looking forward for my own 20-30 mins a day nitro development. One thing that I'd really need is the standard user registration per email, i.e. user registers with user name, email and password, gets an email with a link she has to click to become authorized to enter the site. Does this funcitionality already exist? Or will nitro-auth cover it soon? Thanks! - Bernd From george.moschovitis at gmail.com Sun Aug 14 03:20:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 14 Aug 2005 10:20:18 +0300 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FECEFE.9010204@bdebl.de> References: <42FECEFE.9010204@bdebl.de> Message-ID: Hello and welcome to the list, the functionality is out of scope for Nitro. Nitro is a 'low' level framework. However, I expect spinoff projects to provide this functionality. Nitro-auth is a likely candidate. regards, -g. On 8/14/05, Martin Bernd Schmeil wrote: > Hi all, > > I finally had the opportunaty to work half-way through the tutorial and > I'm looking forward for my own 20-30 mins a day nitro development. One > thing that I'd really need is the standard user registration per email, > i.e. user registers with user name, email and password, gets an email > with a link she has to click to become authorized to enter the site. > > Does this funcitionality already exist? Or will nitro-auth cover it soon? > > Thanks! - Bernd > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sun Aug 14 03:40:10 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 14 Aug 2005 10:40:10 +0300 Subject: [Nitro] Og 1-n relation alias bug In-Reply-To: <42FE87A5.7000600@ond.vein.hu> References: <42FE87A5.7000600@ond.vein.hu> Message-ID: Hello Kristof, thanks for the report, here is a workaround till this situation is improved: class Book property :title belongs_to :owner, Person # this creates a problem? end class Person property :name, Og::VarChar(128) has_many :books, Book, :foreign_name => :owner end > George, while you're into it, please try to delete any of the plain > .. > NoMethodError: undefined method `store' for nil:NilClass Well you cannot create an opject w/o properties. Perhaps a better error message is needed though. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sun Aug 14 04:56:33 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 14 Aug 2005 11:56:33 +0300 Subject: [Nitro] A break... Message-ID: Hello all, I 'll not have internet access for 2-3 days :) See ya all when I get back (but feel free to post questions/suggestions and especially patches!) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From bernd at bdebl.de Sun Aug 14 05:26:14 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Sun, 14 Aug 2005 11:26:14 +0200 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: References: <42FECEFE.9010204@bdebl.de> Message-ID: <42FF0E36.5050305@bdebl.de> George Moschovitis wrote: >Hello and welcome to the list, > > > Hi George, I'm on the list for about a month. I'm the guy who's constantly complaining about the documentation without providing any value to the projoject. Thanks anyway. >the functionality is out of scope for Nitro. Nitro is a 'low' level >framework. However, I expect spinoff projects to provide this >functionality. Nitro-auth is a likely candidate. > > OK. Can anyone tell me how good or bad nitro-auth integrates into Nitro? If I would be more experienced with Ruby (just started about two months ago) I would probably try to add that to nitro-auth myself. I just don't want to introduce bad design and code to the nitro projects. I believe handling authentication and the registering process is one the most important functionalites / services a web framework has to have. In my case I would like to avoid paying bandwith, CPU, IO, etc. for robots / spammers while opening doors to increase the data quality of the event calendar I'm planing to implement with nitro. I'm thinking about a half open system, where everyone can read data related to _one_ object (like a club) by providing an additional key (hardcoded in the URL) while every write or global read requires registration and authentication. This way people could include dynamic services in their static webpages like news boards, calendar information, etc. >On 8/14/05, Martin Bernd Schmeil wrote: > >> >>One thing that I'd really need is the standard user registration per email, >>i.e. user registers with user name, email and password, gets an email >>with a link she has to click to become authorized to enter the site. >> >>Does this funcitionality already exist? Or will nitro-auth cover it soon? >> >> Thanks! - Bernd (who got the Agile Web Developement with Rails book yesterday) From george.moschovitis at gmail.com Sun Aug 14 05:54:35 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 14 Aug 2005 12:54:35 +0300 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FF0E36.5050305@bdebl.de> References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> Message-ID: We at Navel (my company) are working on a super-duper user/identity system for our (Navel) internal high level framework. I 'll discuss this with my partners, perhaps we can just release this single component (part) as an example. But this will take a lonf time. I would suggest that you work with Deborah to improve the existing nitro-auth package. regards, George. On 8/14/05, Martin Bernd Schmeil wrote: > George Moschovitis wrote: > > >Hello and welcome to the list, > > > > > > > Hi George, I'm on the list for about a month. I'm the guy who's > constantly complaining > about the documentation without providing any value to the projoject. > Thanks anyway. > > >the functionality is out of scope for Nitro. Nitro is a 'low' level > >framework. However, I expect spinoff projects to provide this > >functionality. Nitro-auth is a likely candidate. > > > > > OK. Can anyone tell me how good or bad nitro-auth integrates into Nitro? > > If I would be more experienced with Ruby (just started about two months > ago) I would > probably try to add that to nitro-auth myself. I just don't want to > introduce bad design > and code to the nitro projects. > > I believe handling authentication and the registering process is one the > most important > functionalites / services a web framework has to have. In my case I > would like to avoid > paying bandwith, CPU, IO, etc. for robots / spammers while opening > doors to increase the > data quality of the event calendar I'm planing to implement with nitro. > > I'm thinking about a half open system, where everyone can read data > related to _one_ > object (like a club) by providing an additional key (hardcoded in the > URL) while > every write or global read requires registration and authentication. > > This way people could include dynamic services in their static webpages like > news boards, calendar information, etc. > > >On 8/14/05, Martin Bernd Schmeil wrote: > > > >> > >>One thing that I'd really need is the standard user registration per email, > >>i.e. user registers with user name, email and password, gets an email > >>with a link she has to click to become authorized to enter the site. > >> > >>Does this funcitionality already exist? Or will nitro-auth cover it soon? > >> > >> > Thanks! - Bernd (who got the Agile Web Developement with Rails book > yesterday) > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From john.lloydjones at gmail.com Sun Aug 14 11:31:20 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Sun, 14 Aug 2005 08:31:20 -0700 Subject: [Nitro] Og 1-n relation alias bug In-Reply-To: References: <42FE87A5.7000600@ond.vein.hu> Message-ID: <6fcd26f1050814083163d160fd@mail.gmail.com> This is another variant of the same bug that Andrew and I have reported earlier. We both receievd "NoMethodError: undefined method `xxx_oid=" messages. In our cases, the bug was triggered by our inheritance relationships. The root cause is the failure to use the correct foreign_key value. I will check to see if setting foriegn_name helps (I had been experimenting with fudging it in the has_many.rb file) On 8/14/05, George Moschovitis wrote: > Hello Kristof, > > thanks for the report, here is a workaround till this situation is improved: > > class Book > property :title > belongs_to :owner, Person # this creates a problem? > end > > class Person > property :name, Og::VarChar(128) > has_many :books, Book, :foreign_name => :owner > end > > > George, while you're into it, please try to delete any of the plain > > .. > > NoMethodError: undefined method `store' for nil:NilClass > > Well you cannot create an opject w/o properties. Perhaps a better > error message is needed though. > > regards, > George. > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From mneumann at ntecs.de Sun Aug 14 14:45:11 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Sun, 14 Aug 2005 20:45:11 +0200 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FECEFE.9010204@bdebl.de> References: <42FECEFE.9010204@bdebl.de> Message-ID: <42FF9137.3000007@ntecs.de> Martin Bernd Schmeil wrote: > Hi all, > > I finally had the opportunaty to work half-way through the tutorial and > I'm looking forward for my own 20-30 mins a day nitro development. One > thing that I'd really need is the standard user registration per email, > i.e. user registers with user name, email and password, gets an email > with a link she has to click to become authorized to enter the site. > > Does this funcitionality already exist? Or will nitro-auth cover it soon? I just finished the implementation for this in Rails ;-) (and i've done one in Wee, too :))). So, it's not that hard to do in Nitro either ;-) I've two tables: accounts and activation_ids. Accounts has a field active, which by default is false. When a user signs up for an account, the account is created (inserted into table accounts) but is inactive. Furthermore an entry is inserted into activation_ids, with a unique SHA1 sum, which is sent out to the user by id. A controller /account/activate/"checksum" will then delete the corresponding activation_id and set the account.active to true. Regards, Michael From mneumann at ntecs.de Sun Aug 14 14:46:47 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Sun, 14 Aug 2005 20:46:47 +0200 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> Message-ID: <42FF9197.3070400@ntecs.de> George Moschovitis wrote: > We at Navel (my company) are working on a super-duper user/identity > system for our (Navel) internal high level framework. I 'll discuss > this with my partners, perhaps we can just release this single > component (part) as an example. But this will take a lonf time. I > would suggest that you work with Deborah to improve the existing > nitro-auth package. Can you explain what this user/identity system is capable of? Just curious ;-) Regards, Michael From deb at ysabel.org Mon Aug 15 01:26:55 2005 From: deb at ysabel.org (Ysabel) Date: Sun, 14 Aug 2005 23:26:55 -0600 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FECEFE.9010204@bdebl.de> References: <42FECEFE.9010204@bdebl.de> Message-ID: <72F877FA3E5590419673C3F4@[10.19.0.236]> --On Sunday, August 14, 2005 6:56 AM +0200 Martin Bernd Schmeil wrote: > I finally had the opportunaty to work half-way through the tutorial and > I'm looking forward for my own 20-30 mins a day nitro development. One > thing that I'd really need is the standard user registration per email, > i.e. user registers with user name, email and password, gets an email > with a link she has to click to become authorized to enter the site. > > Does this funcitionality already exist? Or will nitro-auth cover it soon? Certainly it's within the scope of what I had in mind for nitro-auth. I've not messed around with the auth stuff in the last week or two, been fiddling with low-level Og::Store stuffs. I'm open to patches/tweaks/suggestions, though, definitely. -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From deb at ysabel.org Mon Aug 15 01:31:26 2005 From: deb at ysabel.org (Ysabel) Date: Sun, 14 Aug 2005 23:31:26 -0600 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FF0E36.5050305@bdebl.de> References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> Message-ID: --On Sunday, August 14, 2005 11:26 AM +0200 Martin Bernd Schmeil wrote: > OK. Can anyone tell me how good or bad nitro-auth integrates into Nitro? Well, it's written with the specific purpose of being an authentication system for Nitro, so I'd say it's designed to integrate pretty well. Whether it does or not on any given day might be up to more contention. :) > If I would be more experienced with Ruby (just started about two months > ago) I would probably try to add that to nitro-auth myself. I just don't want to > introduce bad design and code to the nitro projects. If you'd like to send me suggested patches, I'm happy to review them and tweak/integrate. One thing nitro-auth desperately needs is a reasonable unit test suite; I was struggling early on with figuring out how to reasonably unit test Nitro applications and I haven't gotten back to that. (The Og::Store stuff I've been playing with has a really extensive suite of unit tests now.) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From bernd at bdebl.de Mon Aug 15 06:27:56 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Mon, 15 Aug 2005 12:27:56 +0200 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> Message-ID: <43006E2C.7050705@bdebl.de> Hi Ysabel, hi Michael, thanks a lot for taking care about this auth-stuff. As I said I don't feel experienced enough to write good Ruby code and I don't know about the nitro-auth design. I'm looking for something that works like the mechanism that Michael described. I might do the task if noone else moves first. But that can take some time... Thanks! - Bernd From B.Candler at pobox.com Mon Aug 15 16:20:30 2005 From: B.Candler at pobox.com (Brian Candler) Date: Mon, 15 Aug 2005 21:20:30 +0100 Subject: [Nitro] Trying Og example Message-ID: <20050815202030.GB1767@uk.tiscali.com> I'm just trying out og-0.22.0 starting with examples/run.rb. I have mysql rather than psql installed, so I made what seems to be the obvious change: --- run.rb~ Mon Aug 15 21:10:41 2005 +++ run.rb Mon Aug 15 21:10:41 2005 @@ -136,10 +136,10 @@ config = { :destroy => true, # destroy table created from earlier runs. - :store => 'psql', + :store => 'mysql', :name => 'test', - :user => "postgres", - :password => "navelrulez" + :user => "root", + :password => "" } # Initialize Og Running it gives the following output: Database "test" dropped INFO: Database 'test' not found! DEBUG: Og manageable classes: [Part, UserComment, ArticleComment, Category, Article, User, Comment] INFO: Created table 'ogpart'. INFO: Created table 'ogusercomment'. INFO: Created table 'ogarticlecomment'. INFO: Created table 'ogcategory'. INFO: Created table 'ogarticle'. DEBUG: Join table already exists /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:453:in `read': BLOB/TEXT column 'name' used in key specification without a key length (Mysql::Error) from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:345:in `read_query_result' from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:160:in `real_query' from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:275:in `query' from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:215:in `create_table' from (eval):5:in `send' from (eval):5:in `og_create_schema' from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:290:in `enchant' from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:138:in `enchant' from /v/build/nitro/og-0.22.0/lib/og/manager.rb:128:in `manage' from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes' from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `each' from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes' from /v/build/nitro/og-0.22.0/lib/og.rb:157:in `setup' from run.rb:147 I'm running ruby-mysql-0.2.6 and mysql 4.1.11. Any suggestions where to look to fix this? Or is mysql not well supported by Og? Thanks, Brian. From kevwil at gmail.com Tue Aug 16 10:11:13 2005 From: kevwil at gmail.com (Kevin Williams) Date: Tue, 16 Aug 2005 08:11:13 -0600 Subject: [Nitro] Og in legacy environments Message-ID: <683a886f05081607116f37c16e@mail.gmail.com> I'm having trouble with primary keys and sequences in a legacy DB. There seems to be a naming convention tha Og expects, something like "oid" for the primary key, "_oid" for foreign keys, and "_oid_seq" for sequences. How do I override these names to match an existing database? From kevwil at gmail.com Tue Aug 16 10:15:42 2005 From: kevwil at gmail.com (Kevin Williams) Date: Tue, 16 Aug 2005 08:15:42 -0600 Subject: [Nitro] OT: Anyone used darcs? In-Reply-To: References: Message-ID: <683a886f05081607151ee68102@mail.gmail.com> I've downloaded it and/or installed it, but haven't found motivation to actually try it. I'm very wary of it being written in haskell. The patch-based revision style is a bit of a paradigm shift, too. Subversion works extremely well for me, so motivation is hard to come by. On 8/11/05, George Moschovitis wrote: > I have a small question not directly related with nitro. Has anyone on this > list any (positive/negative) experience with Darcs? > > -g. > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From robbie.wilhelm at gmail.com Tue Aug 16 10:56:36 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 16 Aug 2005 16:56:36 +0200 Subject: [Nitro] Og in legacy environments In-Reply-To: <683a886f05081607116f37c16e@mail.gmail.com> References: <683a886f05081607116f37c16e@mail.gmail.com> Message-ID: <5371ac740508160756505269fd@mail.gmail.com> hi kevin, currently only primary key and foreign key aliases are supported. set_primary_key :name, :foreign_field sequence aliases will come soon :) george calls it the reverse mode. look at: http://nitrohq.com/view/Release_notes i think, to make og real powerful, there has to be done a few things in this direction. the concept of og is not to care at all at the db ddl. let og do all the work. in practice, i would say, that is simply impossible. fourther more, there are many legacy apps that could be enhanced by ruby og scripts if it was the 'swiss knife' of OR libs. what i'd like to see is a way to read the properties/ relationdeclares/ foreign-key stuff per ogified class from an external file, that is quick to parse like ini or yaml (NOT xml). i was pretty convinced once i saw, how helma (http://helma.org/) handled that stuff with ini files. so i'm doing so with a php OR class and i'm quite happy with it. that could be quite useful to generate ddl from that files and vica versa.... just a few thoughts. regards, robert 2005/8/16, Kevin Williams : > I'm having trouble with primary keys and sequences in a legacy DB. > There seems to be a naming convention tha Og expects, something like > "oid" for the primary key, "_oid" for foreign keys, and > "_oid_seq" for sequences. > > How do I override these names to match an existing database? > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From john.lloydjones at gmail.com Tue Aug 16 10:59:09 2005 From: john.lloydjones at gmail.com (John Lloyd-Jones) Date: Tue, 16 Aug 2005 07:59:09 -0700 Subject: [Nitro] OT: Anyone used darcs? In-Reply-To: <683a886f05081607151ee68102@mail.gmail.com> References: <683a886f05081607151ee68102@mail.gmail.com> Message-ID: <6fcd26f1050816075928c088c7@mail.gmail.com> I have also downloaded and installed some time back, but didn't do anything more than test it. Being written in Haskel is not in itself an issue (as long as I don't have to modify it) but I didn't feel it offered enough over Subversion and I didn't find any mention of an Eclipse plugin. Most of my real work (the stuff they pay me to do) uses the Eclipse IDE, so integration to Eclipse would be a major plus. On 8/16/05, Kevin Williams wrote: > I've downloaded it and/or installed it, but haven't found motivation > to actually try it. I'm very wary of it being written in haskell. The > patch-based revision style is a bit of a paradigm shift, too. > Subversion works extremely well for me, so motivation is hard to come > by. > > > On 8/11/05, George Moschovitis wrote: > > I have a small question not directly related with nitro. Has anyone on this > > list any (positive/negative) experience with Darcs? > > > > -g. > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From kevwil at gmail.com Tue Aug 16 11:15:40 2005 From: kevwil at gmail.com (Kevin Williams) Date: Tue, 16 Aug 2005 09:15:40 -0600 Subject: [Nitro] Og in legacy environments In-Reply-To: <5371ac740508160756505269fd@mail.gmail.com> References: <683a886f05081607116f37c16e@mail.gmail.com> <5371ac740508160756505269fd@mail.gmail.com> Message-ID: <683a886f050816081570029eae@mail.gmail.com> Thanks! On 8/16/05, Robert Wagner wrote: > hi kevin, > currently only primary key and foreign key aliases are supported. > set_primary_key :name, :foreign_field > sequence aliases will come soon :) > > george calls it the reverse mode. > look at: http://nitrohq.com/view/Release_notes > > i think, to make og real powerful, there has to be done a few things in this > direction. the concept of og is not to care at all at the db ddl. let > og do all the > work. in practice, i would say, that is simply impossible. fourther more, there > are many legacy apps that could be enhanced by ruby og scripts if it was the > 'swiss knife' of OR libs. > > what i'd like to see is a way to read the properties/ > relationdeclares/ foreign-key > stuff per ogified class from an external file, that is quick to parse > like ini or yaml (NOT xml). i was pretty convinced once i saw, how > helma (http://helma.org/) handled that stuff with ini files. so i'm > doing so with a php OR class and i'm quite happy with it. > that could be quite useful to generate ddl from that files and vica versa.... > > just a few thoughts. > regards, > robert > > 2005/8/16, Kevin Williams : > > I'm having trouble with primary keys and sequences in a legacy DB. > > There seems to be a naming convention tha Og expects, something like > > "oid" for the primary key, "_oid" for foreign keys, and > > "_oid_seq" for sequences. > > > > How do I override these names to match an existing database? > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From robbie.wilhelm at gmail.com Tue Aug 16 11:49:28 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 16 Aug 2005 17:49:28 +0200 Subject: [Nitro] og regarding legacy apps table hints Message-ID: <5371ac7405081608497dbcbcb4@mail.gmail.com> hi, to be a bit more specific about the way to describe tables in an external file. how do you like that way: class Person look_at_file true end person.ini: ; autogenerated file - generator: generator.php [table] name=persons sequence=persons_id_seq [keys] id=1 [fields] ; 1-number, 2-string, 3-date, 4-datetime, 5-blob id=1 title=2 fname=2 lname=2 address1=2 address2=2 country=2 postalcode=2 city=2 phone=2 fax=2 mobile=2 email=2 web=2 company_id=1 creation=4 lastedit=4 version=1 [autodate] created=creation modified=lastedit [autoinc] version=1 [relations] has_many=notes belongs_to=company company.fkey=company_id notes.class=note ciao, -robert From transfire at gmail.com Tue Aug 16 13:09:49 2005 From: transfire at gmail.com (TRANS) Date: Tue, 16 Aug 2005 13:09:49 -0400 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <5371ac7405081608497dbcbcb4@mail.gmail.com> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> Message-ID: <4b6f054f050816100978a274ef@mail.gmail.com> If a file were to be used, then it should be a YAML file. YAML is universal, INI files are more windows centric. The descriptor-file design is NOT a good one. It's adding yet another layer of duplicate information --far from DRY. The best way is either the Og way or the ActiveRecord way. I.e. either the OO system specifies the data structure, or the relational backend does. There's no need for a third way to tell both of them how to be. Such systems (and there are plenty) are a pain. And I like that Og will be able to support the ActiveRecord way too; so it will have the best of both worlds. FYI, if you are concerned about SOC (Seperation of Concerns), I'm with you. But that can be done in the OO system too. To do so in Og, simply build your classes as normal (don't consider the DB), then afterward create seperate modules to extend the classes with the porper DB interface. This makes for a vry elegant and clean design (with only a slight but worthy sacrifice to DRY) I've talked to George about this and he knows it something to solidly support in Og. T. From transfire at gmail.com Tue Aug 16 13:15:23 2005 From: transfire at gmail.com (TRANS) Date: Tue, 16 Aug 2005 13:15:23 -0400 Subject: [Nitro] [ANN] Nitro + Og 0.22.0 In-Reply-To: References: <6fcd26f105081108571067f50e@mail.gmail.com> Message-ID: <4b6f054f05081610153e6ab734@mail.gmail.com> You may be interested in Reap. Reap is my Ruby packaging assistant. Still maturing obviously, but I've just revamped the Testing task. It runs each test in an independent Ruby enviornment --something Rake doesn't do. I know Reap isn't well documented yet, but I'll get to it soon. T. From robbie.wilhelm at gmail.com Tue Aug 16 14:46:18 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 16 Aug 2005 20:46:18 +0200 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <4b6f054f050816100978a274ef@mail.gmail.com> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> Message-ID: <5371ac7405081611467d4f54df@mail.gmail.com> 2005/8/16, TRANS : > If a file were to be used, then it should be a YAML file. YAML is > universal, INI files are more windows centric. > > The descriptor-file design is NOT a good one. It's adding yet another > layer of duplicate information --far from DRY. The best way is either > the Og way or the ActiveRecord way. I.e. either the OO system > specifies the data structure, or the relational backend does. There's > no need for a third way to tell both of them how to be. i disagree. of course the pure og way doesn't need that (in theory). but even if you don't want to use it for existing tables you *should* give hints about creating indexes and stuff. AR on the other side can't read every information as metadata from the db. think about foreign keys, that simply don't exist in mysql (myisam) tables. the question is: where is this information stored? the classfile is quickly clustered with this stuff. so i like the *option* for saving that in an external file... > Such systems > (and there are plenty) are a pain. i agree, most *existing* systems are pain :) > And I like that Og will be able to > support the ActiveRecord way too; so it will have the best of both > worlds. > this is what i have in mind. feel good with *one* API and use it everywhere you can... > FYI, if you are concerned about SOC (Seperation of Concerns), I'm with > you. But that can be done in the OO system too. To do so in Og, simply > build your classes as normal (don't consider the DB), then afterward > create seperate modules to extend the classes with the porper DB > interface. yes, that could be a way for the separation. -robert >This makes for a vry elegant and clean design (with only a > slight but worthy sacrifice to DRY) I've talked to George about this > and he knows it something to solidly support in Og. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From Aleksi.Niemela at cs.helsinki.fi Tue Aug 16 15:32:15 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Tue, 16 Aug 2005 22:32:15 +0300 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <5371ac7405081608497dbcbcb4@mail.gmail.com> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> Message-ID: <43023F3F.5050404@cs.helsinki.fi> Robert Wagner wrote: >hi, >to be a bit more specific about the way to describe tables in an >external file. how do you like that way: > > > I'm sorry but I don't understand at all what it is that we'd gain from this representation? Why not simply use Ruby and Og and define the same? >class Person > look_at_file true >end > >person.ini: > >; autogenerated file - generator: generator.php >[table] >name=persons >sequence=persons_id_seq > >[keys] >id=1 > >[fields] >; 1-number, 2-string, 3-date, 4-datetime, 5-blob >id=1 >title=2 >fname=2 >lname=2 >address1=2 >address2=2 >country=2 >postalcode=2 >city=2 >phone=2 >fax=2 >mobile=2 >email=2 >web=2 >company_id=1 >creation=4 >lastedit=4 >version=1 > > >[autodate] >created=creation >modified=lastedit > >[autoinc] >version=1 > >[relations] >has_many=notes >belongs_to=company >company.fkey=company_id >notes.class=note > > > In this case all above might not be possible with Og, yet, but something along lines: class Person property :title, :fname, :lname, :address1, :address2, :country, :postalcode, :city, String property :phone, :fax, :mobile, :email, :web, String include Autodate include AutoInc autoinc :version has_many Notes belongs_to Company end There are or at least there will be ways to express foreign keys and indexes, as well as map names of fields and tables etc. There will be more useful parts (like autodate) for objects to be managed for persistence to include when needed. What's that special usefulness that your pure text version provides? If you need this kind of definition to be somehow abstract, one should be able to write a text to Og Ruby code translator pretty easily and then one could convert the above text to above code for run-time evaluation without great pains. So again I making a question what's this all for? What do we gain by adding an extra layer needing conversion? What I can see that we're losing by using pure text (ini-file based or not) data definition mini-language is the ability to use turing-complete, working, easy, simple and useful full language to describe a bit more complex issues. And do so even without having text to code to datastructures conversion library source code, just by extending where Og left. Should you need to write to logfile every time object's accessor is used, you're free to define your own "property" method for definition language inside Ruby. Not to mention Og already supports Aspect Oriented way to inject code. - Aleksi From robbie.wilhelm at gmail.com Tue Aug 16 16:27:43 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Tue, 16 Aug 2005 22:27:43 +0200 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <43023F3F.5050404@cs.helsinki.fi> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <43023F3F.5050404@cs.helsinki.fi> Message-ID: <5371ac740508161327376be56@mail.gmail.com> > There are or at least there will be ways to express foreign keys and > indexes, as well as map names of fields and tables etc. There will be > more useful parts (like autodate) for objects to be managed for > persistence to include when needed. What's that special usefulness that > your pure text version provides? > > If you need this kind of definition to be somehow abstract, one should > be able to write a text to Og Ruby code translator pretty easily and > then one could convert the above text to above code for run-time > evaluation without great pains. > > So again I making a question what's this all for? What do we gain by > adding an extra layer needing conversion? > your right. sorry. maybe you don't need it. it's just me the swinging man, who thinks to need it. cause i'm switching environments that often needs conversion. a simple to parse metafile is quite usefull ... and think of comparing versions - every line is a property... > What I can see that we're losing by using pure text (ini-file based or > not) data definition mini-language is the ability to use > turing-complete, working, easy, simple and useful full language to > describe a bit more complex issues. And do so even without having text > to code to datastructures conversion library source code, just by > extending where Og left. > this is a strong argument. but i thought of the textversion as an *option*, then as a subset (namely the most often used rdbms features) of possibilities. and yes: some converter should be easily done by myself :) -robert > Should you need to write to logfile every time object's accessor is > used, you're free to define your own "property" method for definition > language inside Ruby. Not to mention Og already supports Aspect Oriented > way to inject code. > > - Aleksi > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From bernd at bdebl.de Wed Aug 17 01:33:55 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Wed, 17 Aug 2005 07:33:55 +0200 Subject: [Nitro] tutorial: opml feed stuff doesn't work? Message-ID: <4302CC43.8000308@bdebl.de> *Hi all, recently I went through the Nitro tutorial and updated a few things to make it work again. Something I couldn't solve (and I tried to find that stuff in the sources) is to make the code in http://www.nitrohq.com/view/NSBS_Page_Generation_with_Class run. undefined local variable or method `o' for # I'm not sure if I made another error somewhere. Can someone with a clue please check the tutorial. Since we have not so much documentation at least the tutorial should be kept up to date to find a wider audience for nitro. Thanks! - Bernd PS: If there is indeed an error just let me know what and I try to fix it and update the tutorial accordingly. * From arcatan at gmail.com Wed Aug 17 12:40:28 2005 From: arcatan at gmail.com (Miikka Koskinen) Date: Wed, 17 Aug 2005 19:40:28 +0300 Subject: [Nitro] Problem with controller arguments Message-ID: <200508171940.28720.arcatan@gmail.com> Hello! I'm reimplementing my website in Nitro and I have a little problem. I have code like this: class FooController < Nitro::Controller def view(foo, bar) # do some stuff end end Now, this works fine with urls like http://site/view/some/thing (foo="some", bar="thing"). But, I would like to have also urls like http://site/view/some/thing/nice, where foo = "some", bar = "thing/nice". Is this possible? -- Miikka Koskinen -- Miikka Koskinen From chris.farmiloe at farmiloe.com Wed Aug 17 13:09:50 2005 From: chris.farmiloe at farmiloe.com (Chris Farmiloe) Date: Wed, 17 Aug 2005 18:09:50 +0100 Subject: [Nitro] Problem with controller arguments In-Reply-To: <200508171940.28720.arcatan@gmail.com> References: <200508171940.28720.arcatan@gmail.com> Message-ID: Hi: New to this stuff myself (Hello everyone - I've just joined the list), but I can't see why you would want the entire remainder of the URL to get passed to the last variable? request.uri ^ contains the whole uri string, could be some help? Oo while I'm here: Apache and WebBrick return different URIs ... (apache will give a leading "/" ) would be good if this could be ironed out when request.uri gets built to allow greater portability between design/production. Out of curiosity; Why do you want this rather than def do_something(var_a, var_b, var_c) # ==> http://me.com/ do_something/a/b/c/ #stuff end ?? ... the only common string I can think of with /'s in, is a date.. On 17 Aug 2005, at 17:40, Miikka Koskinen wrote: > Now, this works fine with urls like http://site/view/some/thing > (foo="some", > bar="thing"). But, I would like to have also urls like > http://site/view/some/thing/nice, where foo = "some", bar = "thing/ > nice". -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050817/95cf883d/attachment.html From ulmo at valaraan.de Wed Aug 17 13:25:09 2005 From: ulmo at valaraan.de (manveru) Date: Wed, 17 Aug 2005 19:25:09 +0200 Subject: [Nitro] Problem with controller arguments In-Reply-To: <200508171940.28720.arcatan@gmail.com> References: <200508171940.28720.arcatan@gmail.com> Message-ID: <430372F5.1050206@valaraan.de> Miikka Koskinen schrieb: >Hello! > >I'm reimplementing my website in Nitro and I have a little problem. I have >code like this: > >class FooController < Nitro::Controller > def view(foo, bar) > # do some stuff > end >end > >Now, this works fine with urls like http://site/view/some/thing (foo="some", >bar="thing"). But, I would like to have also urls like >http://site/view/some/thing/nice, where foo = "some", bar = "thing/nice". > >Is this possible? > >-- >Miikka Koskinen > > > one of the most important objects in nitro for me is the 'request', have a look at it via request.inspect and at some point you will find request.headers["QUERY_STRING"] #-> "some;thing;nice;" maybe you could use that... for myself i extract the variables and put them into a get-array, it works great for further working with the variables from the query. hope that helps From george.moschovitis at gmail.com Wed Aug 17 14:44:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 21:44:32 +0300 Subject: [Nitro] Trying Og example In-Reply-To: <20050815202030.GB1767@uk.tiscali.com> References: <20050815202030.GB1767@uk.tiscali.com> Message-ID: Hello Brian, sorry for the late reply, I was camping on a mountain w/o net/telephone access :-) MySQL is well supported in Og. Mysql just needs a maximum length on blob keys. To make the example work just change the following line: property :name, String, :unique => true to property :name, String, :uniq => true :uniq (unlike :unique) does not force a unique constrain (ie key) on the generated table. Thanks for pointing this out though, I 'll improve the examle and mysql code. -g. On 8/15/05, Brian Candler wrote: > I'm just trying out og-0.22.0 starting with examples/run.rb. I have mysql > rather than psql installed, so I made what seems to be the obvious change: > > --- run.rb~ Mon Aug 15 21:10:41 2005 > +++ run.rb Mon Aug 15 21:10:41 2005 > @@ -136,10 +136,10 @@ > > config = { > :destroy => true, # destroy table created from earlier runs. > - :store => 'psql', > + :store => 'mysql', > :name => 'test', > - :user => "postgres", > - :password => "navelrulez" > + :user => "root", > + :password => "" > } > > # Initialize Og > > > Running it gives the following output: > > Database "test" dropped > INFO: Database 'test' not found! > DEBUG: Og manageable classes: [Part, UserComment, ArticleComment, Category, Article, User, Comment] > INFO: Created table 'ogpart'. > INFO: Created table 'ogusercomment'. > INFO: Created table 'ogarticlecomment'. > INFO: Created table 'ogcategory'. > INFO: Created table 'ogarticle'. > DEBUG: Join table already exists > /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:453:in `read': BLOB/TEXT column 'name' used in key specification without a key length (Mysql::Error) > from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:345:in `read_query_result' > from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:160:in `real_query' > from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:275:in `query' > from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:215:in `create_table' > from (eval):5:in `send' > from (eval):5:in `og_create_schema' > from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:290:in `enchant' > from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:138:in `enchant' > from /v/build/nitro/og-0.22.0/lib/og/manager.rb:128:in `manage' > from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes' > from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `each' > from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes' > from /v/build/nitro/og-0.22.0/lib/og.rb:157:in `setup' > from run.rb:147 > > I'm running ruby-mysql-0.2.6 and mysql 4.1.11. Any suggestions where to > look to fix this? Or is mysql not well supported by Og? > > Thanks, > > Brian. > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 14:45:47 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 21:45:47 +0300 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: <42FF9197.3070400@ntecs.de> References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> <42FF9197.3070400@ntecs.de> Message-ID: > Can you explain what this user/identity system is capable of? Just > curious ;-) For the moment, let me just say that it rocks :) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 14:50:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 21:50:52 +0300 Subject: [Nitro] Og in legacy environments In-Reply-To: <5371ac740508160756505269fd@mail.gmail.com> References: <683a886f05081607116f37c16e@mail.gmail.com> <5371ac740508160756505269fd@mail.gmail.com> Message-ID: Hello Robbert, thanks for the suggestions, I 'll have a look at helma. However, I prefer not to have any ini files. And I REALLY think that letting Og handle the ddl, is quite possible, using this all the time :) Give it a try and you will see :) -g. On 8/16/05, Robert Wagner wrote: > hi kevin, > currently only primary key and foreign key aliases are supported. > set_primary_key :name, :foreign_field > sequence aliases will come soon :) > > george calls it the reverse mode. > look at: http://nitrohq.com/view/Release_notes > > i think, to make og real powerful, there has to be done a few things in this > direction. the concept of og is not to care at all at the db ddl. let > og do all the > work. in practice, i would say, that is simply impossible. fourther more, there > are many legacy apps that could be enhanced by ruby og scripts if it was the > 'swiss knife' of OR libs. > > what i'd like to see is a way to read the properties/ > relationdeclares/ foreign-key > stuff per ogified class from an external file, that is quick to parse > like ini or yaml (NOT xml). i was pretty convinced once i saw, how > helma (http://helma.org/) handled that stuff with ini files. so i'm > doing so with a php OR class and i'm quite happy with it. > that could be quite useful to generate ddl from that files and vica versa.... > > just a few thoughts. > regards, > robert > > 2005/8/16, Kevin Williams : > > I'm having trouble with primary keys and sequences in a legacy DB. > > There seems to be a naming convention tha Og expects, something like > > "oid" for the primary key, "_oid" for foreign keys, and > > "_oid_seq" for sequences. > > > > How do I override these names to match an existing database? > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 14:58:02 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 21:58:02 +0300 Subject: [Nitro] Problem with controller arguments In-Reply-To: <200508171940.28720.arcatan@gmail.com> References: <200508171940.28720.arcatan@gmail.com> Message-ID: Hello, On 8/17/05, Miikka Koskinen wrote: > Hello! >... > Is this possible? Dunno why you would do that, but try something like this: def my_action(foo, bar) .. end action :my_action, :route => /my_action\/(.*)\/(.*)/, 'foo' => 'foodefault', 'bar' => 'bardefault' you use a regular expression in the route. The above is an example, it does not much exactly what you want, but I am sure you can work this out yourself with a nice regexp reference. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 14:58:47 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 21:58:47 +0300 Subject: [Nitro] tutorial: opml feed stuff doesn't work? In-Reply-To: <4302CC43.8000308@bdebl.de> References: <4302CC43.8000308@bdebl.de> Message-ID: I 'll have a look and get back to you... -g. On 8/17/05, Martin Bernd Schmeil wrote: > *Hi all, > > recently I went through the Nitro tutorial and updated a few things > to make it work again. Something I couldn't solve (and I tried to find > that stuff in the sources) is to make the code in > http://www.nitrohq.com/view/NSBS_Page_Generation_with_Class run. > > undefined local variable or method `o' for # > > I'm not sure if I made another error somewhere. Can someone with > a clue please check the tutorial. Since we have not so much > documentation at least the tutorial should be kept up to date to find > a wider audience for nitro. > > Thanks! - Bernd > > PS: If there is indeed an error just let me know what and I try to fix > it and update the tutorial accordingly. > * > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 15:01:38 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 22:01:38 +0300 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <4b6f054f050816100978a274ef@mail.gmail.com> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> Message-ID: > interface. This makes for a vry elegant and clean design (with only a > slight but worthy sacrifice to DRY) I've talked to George about this > and he knows it something to solidly support in Og. Yeap, as I said, this feature will be available shortly. I am waiting for debora (ysabel) to send me some rather interesting Og patches before I go on... -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 17 15:05:01 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 17 Aug 2005 22:05:01 +0300 Subject: [Nitro] og regarding legacy apps table hints In-Reply-To: <5371ac7405081611467d4f54df@mail.gmail.com> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <5371ac7405081611467d4f54df@mail.gmail.com> Message-ID: > yes, that could be a way for the separation. As I privately told Tom, in the next version, this: property :name, String, :uniq => true will be just a helper for: attr_accessor :name ann :name, :class => String, :uniq => true so you will be able to do: class User attr_accessor :name end and somewhere else: class User ann :name, :class => String, :uniq => true end regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From alang at cronosys.com Wed Aug 17 15:23:52 2005 From: alang at cronosys.com (Alan Garrison) Date: Wed, 17 Aug 2005 15:23:52 -0400 Subject: [Nitro] Nuby templating question In-Reply-To: References: <42FCB20C.60608@cronosys.com> Message-ID: <43038EC8.1060708@cronosys.com> George Moschovitis wrote: >Yeah, if you define a subclass of Nitro::Element you can use it in >your tempates as a cheap form of macro or tag. > >class MyTag < Nitro::Element >end > >responds to > >... > >or > >... > >to be xhtml compliant > >you can customize the x: prefix if you want. > >regards, >George. > > > > Is there a particular reason that "" are stripped out by the template engine in the .xhtml files? It's not a problem per se, just I was using the comments in different template files to keep track of which ones were rendering when, and I noticed that they weren't being sent at all. -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From george.moschovitis at gmail.com Wed Aug 17 17:17:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 18 Aug 2005 00:17:07 +0300 Subject: [Nitro] Nuby templating question In-Reply-To: <43038EC8.1060708@cronosys.com> References: <42FCB20C.60608@cronosys.com> <43038EC8.1060708@cronosys.com> Message-ID: They are removed to 'compress' output. Perhaps this 'feature' should be removed? -g. On 8/17/05, Alan Garrison wrote: > George Moschovitis wrote: > > >Yeah, if you define a subclass of Nitro::Element you can use it in > >your tempates as a cheap form of macro or tag. > > > >class MyTag < Nitro::Element > >end > > > >responds to > > > >... > > > >or > > > >... > > > >to be xhtml compliant > > > >you can customize the x: prefix if you want. > > > >regards, > >George. > > > > > > > > > Is there a particular reason that "" are > stripped out by the template engine in the .xhtml files? It's not a > problem per se, just I was using the comments in different template > files to keep track of which ones were rendering when, and I noticed > that they weren't being sent at all. > > -- > Alan Garrison > Cronosys, LLC > Phone: 216-221-4600 ext 308 > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From alang at cronosys.com Wed Aug 17 18:31:25 2005 From: alang at cronosys.com (alang at cronosys.com) Date: Wed, 17 Aug 2005 18:31:25 -0400 Subject: [Nitro] Nuby templating question In-Reply-To: References: <42FCB20C.60608@cronosys.com> <43038EC8.1060708@cronosys.com> Message-ID: <20050817183125.pefly67rcrs4ow0o@www.cronosys.com> Quoting George Moschovitis : > They are removed to 'compress' output. Perhaps this 'feature' should > be removed? > > -g. > I'm not thinking it's a big problem either way. I can live without them, I was just experimenting with some funky page layouts with multiple templated sections and was just wanting to make sure things were being loaded in the desired order. Perhaps down the road there could be a "crunch" option to remove comments and extraneous whitespace to save on bandwidth. (This would be a cool caching feature: I was doing some (unrelated) XML work for a client of ours recently and given the bandwidth limitations for data transfer, removing the indenting whitespace halved the size of the transmission. But since I'm still a Nitro nuby mode I'm not going to worry about it right now :) From george.moschovitis at gmail.com Wed Aug 17 18:50:28 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 18 Aug 2005 01:50:28 +0300 Subject: [Nitro] Nuby templating question In-Reply-To: <20050817183125.pefly67rcrs4ow0o@www.cronosys.com> References: <42FCB20C.60608@cronosys.com> <43038EC8.1060708@cronosys.com> <20050817183125.pefly67rcrs4ow0o@www.cronosys.com> Message-ID: This is allready implemented, just use the Squeeze filter: lib/nitro/compiler/squeeze. -g. On 8/18/05, alang at cronosys.com wrote: > Quoting George Moschovitis : > > > They are removed to 'compress' output. Perhaps this 'feature' should > > be removed? > > > > -g. > > > > I'm not thinking it's a big problem either way. I can live without > them, I was > just experimenting with some funky page layouts with multiple templated > sections and was just wanting to make sure things were being loaded in the > desired order. Perhaps down the road there could be a "crunch" option to > remove comments and extraneous whitespace to save on bandwidth. (This > would be > a cool caching feature: I was doing some (unrelated) XML work for a client of > ours recently and given the bandwidth limitations for data transfer, removing > the indenting whitespace halved the size of the transmission. But since I'm > still a Nitro nuby mode I'm not going to worry about it right now :) > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 00:51:21 2005 From: deb at ysabel.org (Deborah Hooker) Date: Thu, 18 Aug 2005 22:51:21 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> Message-ID: <43056549.4080405@ysabel.org> George Moschovitis wrote: >Yeap, as I said, this feature will be available shortly. I am waiting >for debora (ysabel) to send me some rather interesting Og patches >before I go on... > (Posting to the list because I suspect people might be curious -- this code is not in a state where it's all that useful on its own just yet, but is intended to point the way to a new implementation of the underlying store layer for Og, supporting composite keys and multiple kinds of inheritance (single-table and table-per-class and mixed) and easy implementation of new stores. You're welcome to peek at the code but the extent of the warranty right now is "If you break it, you get to keep the pieces!" at best. Assume this all falls under the Og license.) Take a peek at http://darcs.ysabel.org/cgi-bin/darcs.cgi/og-store/?c=browse or just do a "darcs get http://darcs.ysabel.org/nitro/og-store". (I just discovered darcs myself, and I'm really liking it because I do a lot of development disconnected on my laptop and being able to sync my local repository with a server _trivially_ is REALLY nice.) I tried to send email about this this morning but we've been moving our colocated server due to issues with our provider, and I made the mistake of saying "It looks like email is working again" in my email, and we all know how well that summons Murphy. TODO has a list of the things I know are missing at the moment, but there's enough there to stumble along in both MySQL and KirbyBase and I can likely have Postgres and a shot at Oracle pretty quickly. (Need to implement sequences to support Oracle.) Oh, and for the record, the mysql-specific store implementation is 61 lines of code, all very simple and straightforward. Postgres will be about the same, I believe, possibly a line or two more to make sure that it uses "SERIAL" instead of "AUTO_INCREMENT". Here's the three crucial method implementations from the mysql-specific code: def do_query(sql) @connection.query_with_result = true @connection.query sql end def do_exec(sql) @connection.query_with_result = false @connection.query sql @connection.affected_rows end def get_last_insertid @connection.insert_id end -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Fri Aug 19 01:46:59 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 08:46:59 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43056549.4080405@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> Message-ID: > a "darcs get http://darcs.ysabel.org/nitro/og-store". (I just > discovered darcs myself, and I'm really liking it because I do a lot of > development disconnected on my laptop and being able to sync my local > repository with a server _trivially_ is REALLY nice.) Yeap, darcs is great, I am a switcher too :) And it makes the handling of patches trivial. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 19 02:03:23 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 09:03:23 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43056549.4080405@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> Message-ID: Deb, I am sure everyone will aggree that this looks EXTREMELY promising. Some minor remarks: Please try to follow the Og coding conventions, ie: - leave a blank line after the comments before each method. - try to make all lines <= 64 chars (but don't go out of the way to acomplish this, some longer lines are ok) I don't like the name device, isn't device just a store? I would also like to see some none-sql store abstraction. I 'll work a bit with your code today, and possibly send you some patches. MANY thanks, -g. On 8/19/05, Deborah Hooker wrote: > George Moschovitis wrote: > > >Yeap, as I said, this feature will be available shortly. I am waiting > >for debora (ysabel) to send me some rather interesting Og patches > >before I go on... > > > (Posting to the list because I suspect people might be curious -- this > code is not in a state where it's all that useful on its own just yet, > but is intended to point the way to a new implementation of the > underlying store layer for Og, supporting composite keys and multiple > kinds of inheritance (single-table and table-per-class and mixed) and > easy implementation of new stores. You're welcome to peek at the code > but the extent of the warranty right now is "If you break it, you get to > keep the pieces!" at best. Assume this all falls under the Og license.) > > Take a peek at > http://darcs.ysabel.org/cgi-bin/darcs.cgi/og-store/?c=browse or just do > a "darcs get http://darcs.ysabel.org/nitro/og-store". (I just > discovered darcs myself, and I'm really liking it because I do a lot of > development disconnected on my laptop and being able to sync my local > repository with a server _trivially_ is REALLY nice.) > > I tried to send email about this this morning but we've been moving our > colocated server due to issues with our provider, and I made the mistake > of saying "It looks like email is working again" in my email, and we all > know how well that summons Murphy. > > TODO has a list of the things I know are missing at the moment, but > there's enough there to stumble along in both MySQL and KirbyBase and I > can likely have Postgres and a shot at Oracle pretty quickly. (Need to > implement sequences to support Oracle.) > > Oh, and for the record, the mysql-specific store implementation is 61 > lines of code, all very simple and straightforward. Postgres will be > about the same, I believe, possibly a line or two more to make sure that > it uses "SERIAL" instead of "AUTO_INCREMENT". Here's the three crucial > method implementations from the mysql-specific code: > > def do_query(sql) > @connection.query_with_result = true > @connection.query sql > end > > def do_exec(sql) > @connection.query_with_result = false > @connection.query sql > @connection.affected_rows > end > > def get_last_insertid > @connection.insert_id > end > > -- > [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 02:39:24 2005 From: deb at ysabel.org (Deborah Hooker) Date: Fri, 19 Aug 2005 00:39:24 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> Message-ID: <43057E9C.2090509@ysabel.org> George Moschovitis wrote: > Please try to follow the Og coding conventions, ie: > > - leave a blank line after the comments before each method. > - try to make all lines <= 64 chars (but don't go out of the way to > acomplish this, some > longer lines are ok) I was trying to, mostly. I figure I can tweak a bit before it becomes official, but I did change my usual editor settings. (I'd missed the thing about blank lines after comments, though even if I'd caught it I'd still probably add that in later as it annoys me. *grin*) I can definitely shorten a few lines here and there, I haven't been putting that much focus on making sure I kept it shorter than 80 chars. > I don't like the name device, isn't device just a store? Initially I was headed towards Device representing purely low-level stuff and Store being the go-between between a Device and the upper layers of Og. Stores represent the idea of CRUD etc on objects and present a clean interface, and Devices do the low-level translation of objects into and out of device-specific bits for Stores. It didn't work out to be quite so seperate, but I haven't yet gone back and changed the names to Store again. I still have this sense that a Store and a Device cooperate but given that I can't pin down the distinction, they should just be Stores at this point. I just haven't gotten to it. One goal I had is that an object could be persisted in multiple stores without any bad interactions, thus the pulling all the low-level metadata out of the class itself and putting it into a device/store-specific repository indexed by class. However, type selectors and auto-added primary keys still have to get added to the class itself for the interface to be at all sane. This is fine if anything that adds either a type selector or a PK follows the same standards (i.e. uses either Structured* or possibly a PK* thing that might end up a superclass again) but it also means that if you store such an object into a Store/Device that doesn't need them, you'll end up storing them anyway. Not sure how to fix that (or even whether it's really all that important). BTW, I really need a better name than "autogenerated_key" for something that uses AUTO_INCREMENT/SERIAL/SEQUENCE, because I kept having to remind myself that "autogenerated_key" _doesn't_ mean the oid property we just added, it means the values stored in the key. And if I kept having to remind myself while I was writing the stuff that implemented it, it'll confuse people, so I'm open to any clear suggestions for terms for the two concepts that keep 'em obviously seperate. (Confused further, of course, by the fact that the oid key that we add is set to use AUTO_INCREMENT et al by default. *grin*) > I would also like to see some none-sql store abstraction. The KirbyBase implementation is off of StructuredDevice/StructuredTable rather than the Sql* classes. Structured* is for anything that has a table/field-like structure, and in fact I was thinking about tossing in an XML-based flatfile representation off of Structured*, since that'd be pretty trivial at this point. (The KirbyBase implementation, which was quite a bit more work than the MySQL implementation (which took me about 15 minutes), still only took me ~2 hours. Though it could use some work in a few places, but even so...) I figure that between an XML flatfile, Kirby and the SQL stuff, I'll have a good feel for where I have things pushed too far down in the inheritance tree. I'm open to ideas about a representation that wouldn't qualify as Structured*, because I'm sure there are things there that could get split out and end up in some class between Device and StructuredDevice, but I couldn't think of anything offhand. See also my comments in the WISHLIST (I think?) about wanting an abstract expression of find/update/etc conditions. Kirbybase's approach of using Ruby is cool but I'm not sure I want to try to build a general ruby->SQL clause converter. I'm willing to build a quick abstraction of the basic things you'd see in normal condition clauses, since that's pretty simple, but I'm also open to more ideas there, as it's something I looked at and went, "Oooh, big, affects people a lot, I'll stay over here for right now, thanks." *grin* (Admittedly, all of this code is colored by my work on Hibernate/JBoss/EJB3; please do point out places where I'm suffering from blind spots if you see 'em. That's an open invite to anyone on the list, too, btw, not just George.) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Fri Aug 19 03:08:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:08:52 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43057E9C.2090509@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: > That's an open invite to anyone on the list, too, btw, not just George.) Good point! It would be best to hear other people's opinion before working on integrating this with Og. I do feel that the code has a java feel (bloated) in some places, but I am sure we can fix that :) Thanks, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 19 03:12:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:12:32 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: Another small question: What does the name Structured denote, ie, what is an 'Unstructured' store? -g. On 8/19/05, George Moschovitis wrote: > > That's an open invite to anyone on the list, too, btw, not just George.) > > Good point! It would be best to hear other people's opinion before > working on integrating this with Og. > > I do feel that the code has a java feel (bloated) in some places, but > I am sure we can fix that :) > > Thanks, > George. > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 19 03:25:10 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:25:10 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: Deborah, all... I was playing a bit with the directory structure in the patch, and I would like to suggest some changes, to make this more compatible with the rest of Nitro/Og code. I also suggest changing the notion of 'table' into 'schema' to be more compatible with non-sql stores. find_options was changes to finder to be shorter (any ideas for a better name?). I would love to hear your comments. og/: total 8 drwxr-xr-x 2 gmosx gmosx 4096 2005-08-19 10:09 adapter drwxr-xr-x 4 gmosx gmosx 4096 2005-08-19 10:18 store -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:22 store.rb og/adapter: total 0 -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:15 filesys.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:15 kirbybase.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:15 memory.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:14 mysql.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:14 postgresql.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 09:14 psql.rb og/store: total 12 -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:10 error.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:15 finder.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:13 schema.rb drwxr-xr-x 2 gmosx gmosx 4096 2005-08-19 10:18 sql -rw-r--r-- 1 gmosx gmosx 16 2005-08-19 10:18 sql.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:15 structured.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:12 utils.rb drwxr-xr-x 2 gmosx gmosx 4096 2005-08-19 10:17 xml -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:16 xml.rb og/store/sql: total 0 -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:18 evolution.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:18 join.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:14 schema.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:14 utils.rb og/store/xml: total 0 -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:17 schema.rb -rw-r--r-- 1 gmosx gmosx 0 2005-08-19 10:17 utils.rb regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 03:26:30 2005 From: deb at ysabel.org (Deborah Hooker) Date: Fri, 19 Aug 2005 01:26:30 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: <430589A6.2010807@ysabel.org> George Moschovitis wrote: > I do feel that the code has a java feel (bloated) in some places, but > I am sure we can fix that :) Hee! Yeah, it's been a few years since I was doing active work in Lisp or Scheme (or Smalltalk or Eiffel). Though I do seem to keep coming back to persistence mechanisms; I wrote a transparent OODB interface for Eiffel in, mmm, '91? And distributed database systems and JBoss and I can't count the number of times I've had to build persistence in systems for one job or another, usually for political rather than technical reasons, gah. I'm a C++ and python expert and have been stuck professionally in Java and C# the last few years to boot, so it's taking a bit to get back into the functional flow, especially with Ruby's OO-tinted view of functional. I suspect that even the bits where I'm getting away from C++/Java/C# idiom I'm still being pythonesque. Really, python's the only non statically typed strongly typed language I've ever built anything particularly significant in; I like static/strong typing if the underlying support is there for it (and it isn't there in Java, dammit, though 1.5 is at least a HUGE step forward...similarly for C# 2.0, enough so to make it worth using the Microsoft beta stuffs right now). But then both the full C++ STL and XPath/XSLT actually make sense to my brain, so I'm an established nutcase right there. *grin* Anyway, I could bitch about languages all day. I'm enjoying the hell out of Ruby and more than a little glad to find something that uses it that also does what I need in a way that works well, namely, Nitro. Rails has some very cool ideas but I quickly ran into major limitations w.r.t. any kind of complex modular organization, and given that Ruby's _really_ strong when it comes to modules, that annoyed me to no end and turned me off for a while. Then I found Nitro and had a few good yay moments. :) Amusingly, I still haven't written a single line of code specifically for the thing I wanted to use Rails for in the first place. Or, rather, I have a bunch of notes and several possible DB schemas, but I keep ending up building infrastructure bits to do what I need instead of working on the application. That, and having ljArchive work I should do, and another application I'm working on, and JBoss-EJB3 work I should do...oh, yeah, and my job, and my family, and the occasional video game... What were we talking about again? *grin* -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Fri Aug 19 03:34:27 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:34:27 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <430589A6.2010807@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <430589A6.2010807@ysabel.org> Message-ID: > What were we talking about again? *grin* You rule :-) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 03:36:09 2005 From: deb at ysabel.org (Deborah Hooker) Date: Fri, 19 Aug 2005 01:36:09 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: <43058BE9.1090105@ysabel.org> George Moschovitis wrote: > Another small question: > > What does the name Structured denote, ie, what is an 'Unstructured' store? A pure unstructured store would be one that serialized the objects as blobs, I would think. Nominally, a Structured store is one that needs a lot of information about the inherent structure of the objects stored in it (objects/properties/relationships-between-instances) in order to correctly and efficiently store and retrieve the objects. You could even build an unstructured store on top of a SQL database by just serializing the object and storing it in one field (though I wouldn't think you'd usually want to do that). I was considering the idea, btw, that a caching layer could be implemented as an unstructured store on top of another store; as in-memory objects, there's no need to know much about the internals, just enough to keep references resolved correctly and make sure that multiple requests for the same object kick back the same instance. (I actually have an implementation of something much like that in python, on top of pickle/unpickle into a BDB database.) It's likely that the most basic bits of primary keys and relationships between objects needs to get kicked up a level in the inheritance tree -- my first pass through had that separation, but I decided I didn't understand where the line really needed to be drawn yet, so I switched back to having them all together until I sorted out where the line really was. It's also likely that "Structured" is (mmm, gut-feel says) about three different concepts mashed together; I'm hoping that trying to implement a few different underlying layers will tease out where the lines between them belong. The only line that was very clear to me was the line between "object structure" and SQL, thus the Structured/SQL split, which is pretty carefully defined and kept clean (I think). Does that at least make general sense? It's 1:30 am here and so I'm a little spacey. I should go to bed soon. *grin* -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From deb at ysabel.org Fri Aug 19 03:40:10 2005 From: deb at ysabel.org (Deborah Hooker) Date: Fri, 19 Aug 2005 01:40:10 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> Message-ID: <43058CDA.7040908@ysabel.org> George Moschovitis wrote: > I was playing a bit with the directory structure in the patch, and I > would like to suggest > some changes, to make this more compatible with the rest of Nitro/Og > code. I also suggest changing the notion of 'table' into 'schema' to > be more compatible with non-sql stores. find_options was changes to > finder to be shorter (any ideas for a better name?). I like both the structure and the naming changes. "finder" works for me entirely because it implies that we're going to expand on that annoying abstract find conditions thing. And that does seem like the right place for it, long term, anyway. If you get around to patches to shuffle things around, feel free to send 'em, I'll poke and incorporate. (Make sure 'rake' still passes all tests!) If not, I'll probably shuffle/tweak names tomorrow. I've not done anything to set up darcs auto-receive by email yet, but I may do that too at some point here. -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Fri Aug 19 03:56:38 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:56:38 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43058CDA.7040908@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> Message-ID: > I like both the structure and the naming changes. "finder" works for me Nice :) > If you get around to patches to shuffle things around, feel free to send > 'em, I'll poke and incorporate. (Make sure 'rake' still passes all tests!) > If not, I'll probably shuffle/tweak names tomorrow. As I am still on vacations and not fully familiar with your code I would really prefer that you made the changes (my gf will kill me if I am coding all the day ;-)). Another thing that 'bothers' me is the cloning of the property metadata into structured_fields. Can we avoid that? best regards, George. PS: I am attaching an updated version of the proposed dir structure, with some comments to help you. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com -------------- next part -------------- A non-text attachment was scrubbed... Name: og.tar.gz Type: application/x-gzip Size: 946 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20050819/49f86288/attachment.gz From george.moschovitis at gmail.com Fri Aug 19 03:59:24 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 19 Aug 2005 10:59:24 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43058BE9.1090105@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058BE9.1090105@ysabel.org> Message-ID: > A pure unstructured store would be one that serialized the objects as blobs, > I would think. Nominally, a Structured store is one that needs a lot of > ... > and storing it in one field (though I wouldn't think you'd usually want to > do that). Funny, this is how the original (3 year old) version of Og worked. Let me tell you this was a bit problematic (like the instiki guys recently found out). But it IS useful for some applications. > I was considering the idea, btw, that a caching layer could be implemented > ... > of something much like that in python, on top of pickle/unpickle into a BDB > database.) Interesting idea. > Does that at least make general sense? It's 1:30 am here and so I'm a > little spacey. I should go to bed soon. *grin* Yeah, it makes sense :) regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 04:12:54 2005 From: deb at ysabel.org (Deborah Hooker) Date: Fri, 19 Aug 2005 02:12:54 -0600 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> Message-ID: <43059486.1010600@ysabel.org> George Moschovitis wrote: > Another thing that 'bothers' me is the cloning of the property > metadata into structured_fields. Can we avoid that? PLEASE. *grin* The biggest thing in my wishlist right now is that property metadata alone isn't reliable for building tables and the like. I wrote a set of "unit tests" to explain what behaviour I really need (and am having to emulate by walking the properties metadata multiple times to sort out what the user really intended). They're in WISHLIST. I think, given your comment onlist earlier about annotating attributes that're just created with attr_accessor and its ilk, that this should be pretty easy to get to. The big thing that causes pain at the moment is that properties copy themselves down onto subclasses, which means that if you then dynamically add a property to a class, its information doesn't get propagated correctly. The other biggie is that you can't tell where something was declared, so you can't sort out where it belongs without comparing properties on a class to its parent's properties...which may or may not have everything because something might've been added along the way! If we can get properties to be reliable and complete, we can drop nearly all of the need to walk/collect property metadata, and fields can really just be specific to dealing with persisting the properties. On the bright side, if you look at what this collection of code needs out of properties (and can't get right now, and thus has to do "on top of" them), I suspect you'll have a pretty complete set of use cases for property metadata... I _think_ the "tests" listed in my WISHLIST file actually cover pretty much everything I needed in a very concise way, and it's not that much. Though I didn't specifically write a test to express the idea that adding a property dynamically doesn't violate any of the tests, and you'd want something like that for a real set of tests. (That, and the "meta"/"metadata" thing, which drove me up the wall until I got it sorted out far enough that I stopped trying to access .meta all the time.) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From jeff.darklight at gmail.com Fri Aug 19 16:44:15 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 19 Aug 2005 13:44:15 -0700 Subject: [Nitro] ... Og and OCI8 ??? Message-ID: Does Og support using the OCI8 db connector ? j. -- "So long, and thanks for all the fish" Jeff Wood From jeff.darklight at gmail.com Fri Aug 19 16:47:32 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 19 Aug 2005 13:47:32 -0700 Subject: [Nitro] ... Documentation on NitroHQ.com ... Message-ID: Was just at NitroHQ.com ... The "documentation" section shows the apis as of 0.19 ... which as I've been tracking the mailing list ... has been changed significantly ... uh, when somebody gets the chance, it would be good to bring that up to date ... I know I have the local docs for things, but it's still nice when you are trying to show stuff to people to talk them into downloading/installing it... Anyways, just my $0.02USD. j. -- "So long, and thanks for all the fish" Jeff Wood From jeff.darklight at gmail.com Fri Aug 19 16:50:28 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 19 Aug 2005 13:50:28 -0700 Subject: [Nitro] Re: ... Documentation on NitroHQ.com ... In-Reply-To: References: Message-ID: Sorry, that wasn't completely accurate ... I was specifically referring to the API Reference documentation not the document page ( where the sample projects are )... even though those are out of date too... j. On 8/19/05, Jeff Wood wrote: > Was just at NitroHQ.com ... > > The "documentation" section shows the apis as of 0.19 ... which as > I've been tracking the mailing list ... has been changed significantly > ... > > uh, when somebody gets the chance, it would be good to bring that up > to date ... > > I know I have the local docs for things, but it's still nice when you > are trying to show stuff to people to talk them into > downloading/installing it... > > Anyways, just my $0.02USD. > > j. > > -- > "So long, and thanks for all the fish" > > Jeff Wood > -- "So long, and thanks for all the fish" Jeff Wood From jeff.darklight at gmail.com Fri Aug 19 16:54:22 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 19 Aug 2005 13:54:22 -0700 Subject: [Nitro] URL to download a copy of Spark? Message-ID: The subject says it all... I've got a project that needs a WIKI front-end ... and extending Spark would be a great start. So, where can I find it ? j. -- "So long, and thanks for all the fish" Jeff Wood From alang at cronosys.com Fri Aug 19 17:01:30 2005 From: alang at cronosys.com (Alan Garrison) Date: Fri, 19 Aug 2005 17:01:30 -0400 Subject: [Nitro] URL to download a copy of Spark? In-Reply-To: References: Message-ID: <430648AA.804@cronosys.com> Jeff Wood wrote: >The subject says it all... I've got a project that needs a WIKI >front-end ... and extending Spark would be a great start. > >So, where can I find it ? > >j. > > > Click the "Download" link which takes you to the Rubyforge site. The Spark tarball is there. -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From jeff.darklight at gmail.com Fri Aug 19 17:05:06 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 19 Aug 2005 14:05:06 -0700 Subject: [Nitro] URL to download a copy of Spark? In-Reply-To: <430648AA.804@cronosys.com> References: <430648AA.804@cronosys.com> Message-ID: Ah, I didn't expect it to be there ... just Nitro links ... but, thanks. j. On 8/19/05, Alan Garrison wrote: > Jeff Wood wrote: > > >The subject says it all... I've got a project that needs a WIKI > >front-end ... and extending Spark would be a great start. > > > >So, where can I find it ? > > > >j. > > > > > > > Click the "Download" link which takes you to the Rubyforge site. The > Spark tarball is there. > > -- > Alan Garrison > Cronosys, LLC > Phone: 216-221-4600 ext 308 > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- "So long, and thanks for all the fish" Jeff Wood From dcorbin at machturtle.com Fri Aug 19 17:32:13 2005 From: dcorbin at machturtle.com (David Corbin) Date: Fri, 19 Aug 2005 17:32:13 -0400 Subject: [Nitro] Og Store options Message-ID: <200508191732.13721.dcorbin@machturtle.com> What non-SQL stores are available for Og? David From dcorbin at machturtle.com Fri Aug 19 17:51:26 2005 From: dcorbin at machturtle.com (David Corbin) Date: Fri, 19 Aug 2005 17:51:26 -0400 Subject: [Nitro] Connecting Controller to template Message-ID: <200508191751.26996.dcorbin@machturtle.com> I've been poking around the tutorials, examples, and documentation. But I can't really find any information on how a controller renders a page/template. Any pointers? Thanks. David From george.moschovitis at gmail.com Fri Aug 19 19:18:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 20 Aug 2005 02:18:52 +0300 Subject: [Nitro] Re: ... Documentation on NitroHQ.com ... In-Reply-To: References: Message-ID: Well ok, I 'll create an autoupdate script when I get back... -g. On 8/19/05, Jeff Wood wrote: > Sorry, that wasn't completely accurate ... I was specifically > referring to the API Reference documentation not the document page ( > where the sample projects are )... even though those are out of date > too... > > j. > > On 8/19/05, Jeff Wood wrote: > > Was just at NitroHQ.com ... > > > > The "documentation" section shows the apis as of 0.19 ... which as > > I've been tracking the mailing list ... has been changed significantly > > ... > > > > uh, when somebody gets the chance, it would be good to bring that up > > to date ... > > > > I know I have the local docs for things, but it's still nice when you > > are trying to show stuff to people to talk them into > > downloading/installing it... > > > > Anyways, just my $0.02USD. > > > > j. > > > > -- > > "So long, and thanks for all the fish" > > > > Jeff Wood > > > > > -- > "So long, and thanks for all the fish" > > Jeff Wood > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Aug 19 19:21:43 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 20 Aug 2005 02:21:43 +0300 Subject: [Nitro] Connecting Controller to template In-Reply-To: <200508191751.26996.dcorbin@machturtle.com> References: <200508191751.26996.dcorbin@machturtle.com> Message-ID: This works more or less like Rails, ie the controller renders the template 'my_action.xhtml' when rendering the action 'my_action'. This was discussed in more detail earlier in the list. I think the examples illustrate this quite well, if you still have problems, please explain a little better what you do not understand. regards, George. On 8/20/05, David Corbin wrote: > I've been poking around the tutorials, examples, and documentation. But I > can't really find any information on how a controller renders a > page/template. Any pointers? > > Thanks. > David > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Fri Aug 19 20:06:44 2005 From: deb at ysabel.org (Ysabel) Date: Fri, 19 Aug 2005 18:06:44 -0600 Subject: [Nitro] Og Store options In-Reply-To: <200508191732.13721.dcorbin@machturtle.com> References: <200508191732.13721.dcorbin@machturtle.com> Message-ID: <5E803FC1449A599EA564E5BB@[10.19.0.236]> --On Friday, August 19, 2005 5:32 PM -0400 David Corbin wrote: > What non-SQL stores are available for Og? There's KirbyBase and a filesystem implementation, at least, though I don't know for sure the current state of either. The stuff I was spamming the list about late last night will likely open up options for more, though. Is there something in particular you're looking for? -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From dcorbin at machturtle.com Fri Aug 19 21:08:32 2005 From: dcorbin at machturtle.com (David Corbin) Date: Fri, 19 Aug 2005 21:08:32 -0400 Subject: [Nitro] Og Store options In-Reply-To: <5E803FC1449A599EA564E5BB@[10.19.0.236]> References: <200508191732.13721.dcorbin@machturtle.com> <5E803FC1449A599EA564E5BB@[10.19.0.236]> Message-ID: <200508192108.32633.dcorbin@machturtle.com> On Friday 19 August 2005 08:06 pm, Ysabel wrote: > --On Friday, August 19, 2005 5:32 PM -0400 David Corbin > > wrote: > > What non-SQL stores are available for Og? > > There's KirbyBase and a filesystem implementation, at least, though I don't > know for sure the current state of either. The stuff I was spamming the > list about late last night will likely open up options for more, though. > > Is there something in particular you're looking for? Just a light weight storage for my Ruby objects. I don't need the power (or hassle) of a relational database. From george.moschovitis at gmail.com Sat Aug 20 02:11:01 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 20 Aug 2005 09:11:01 +0300 Subject: [Nitro] Og::Store (was Re: og regarding legacy apps table hints) In-Reply-To: <43059486.1010600@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> <43059486.1010600@ysabel.org> Message-ID: > The big thing that causes pain at the moment is that properties copy > themselves down onto subclasses, which means that if you then dynamically > add a property to a class, its information doesn't get propagated correctly. this can be fixed. > The other biggie is that you can't tell where something was declared, so > you can't sort out where it belongs without comparing properties on a class > to its parent's properties...which may or may not have everything because > something might've been added along the way! I guess this can be implemented too.. > If we can get properties to be reliable and complete, we can drop nearly all > of the need to walk/collect property metadata, and fields can really just be > specific to dealing with persisting the properties. This the way to go, the property system must be improved. Duplicating property metadata in fields is not elegant/robust. > (That, and the "meta"/"metadata" thing, which drove me up the wall until I > got it sorted out far enough that I stopped trying to access .meta > all the time.) It's not easy to have both: .meta and class ... meta ... end regards, George -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sat Aug 20 02:37:20 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 20 Aug 2005 09:37:20 +0300 Subject: [Nitro] ... Documentation on NitroHQ.com ... In-Reply-To: References: Message-ID: > uh, when somebody gets the chance, it would be good to bring that up > to date ... fixed! -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sat Aug 20 09:50:41 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 20 Aug 2005 16:50:41 +0300 Subject: [Nitro] ... Og and OCI8 ??? In-Reply-To: References: Message-ID: An older version provided support for Oracle but the adapter is not updated for the latest version. Given the fact that there is a patch for the store subsystem in progress this will have to wait for the moment. regards, George. On 8/19/05, Jeff Wood wrote: > Does Og support using the OCI8 db connector ? > > j. > > -- > "So long, and thanks for all the fish" > > Jeff Wood > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From jeff.darklight at gmail.com Sat Aug 20 13:19:46 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Sat, 20 Aug 2005 10:19:46 -0700 Subject: [Nitro] ... Documentation on NitroHQ.com ... In-Reply-To: References: Message-ID: <43076632.3040503@gmail.com> George Moschovitis wrote: >>uh, when somebody gets the chance, it would be good to bring that up >>to date ... >> >> > >fixed! > >-g. > > > Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050820/a41e4840/attachment.html From ffsnoopy at gmail.com Sat Aug 20 20:36:19 2005 From: ffsnoopy at gmail.com (Mitchell Foral) Date: Sat, 20 Aug 2005 20:36:19 -0400 Subject: [Nitro] Question about Options Message-ID: <379ea2750508201736882d01f@mail.gmail.com> Hello, I've been enjoying my time learning Nitro and Og, but going through some examples brought a question to mind. When you have something like: Og.setup( :name => 'test', :store => 'sqlite3' ) or over_twentyone = People.all( :condition => 'age > 21' ) I notice the ":[option]" syntax. I looked in the rdocs, but couldn't find a list of available options for things like Og.setup or [Klass].all Does such a list exist? (Not limited to just these examples, I mean in general including things like 'property :hits, Fixnum, :sql_index => true', etc.) Thanks a bunch, -Mitchell; From george.moschovitis at gmail.com Sun Aug 21 14:47:35 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 21 Aug 2005 21:47:35 +0300 Subject: [Nitro] Question about Options In-Reply-To: <379ea2750508201736882d01f@mail.gmail.com> References: <379ea2750508201736882d01f@mail.gmail.com> Message-ID: Hello Mitchel, There is no such list at the moment. But I 'll go through the code and add some documentation in time for the next release. regards, George. On 8/21/05, Mitchell Foral wrote: > Hello, > > I've been enjoying my time learning Nitro and Og, but going through > some examples brought a question to mind. When you have something > like: > > Og.setup( > :name => 'test', > :store => 'sqlite3' > ) > > or > > over_twentyone = People.all( :condition => 'age > 21' ) > > I notice the ":[option]" syntax. I looked in the rdocs, but couldn't > find a list of available options for things like Og.setup or > [Klass].all > > Does such a list exist? (Not limited to just these examples, I mean in > general including things like 'property :hits, Fixnum, :sql_index => > true', etc.) > > Thanks a bunch, > -Mitchell; > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From B.Candler at pobox.com Sun Aug 21 16:31:50 2005 From: B.Candler at pobox.com (Brian Candler) Date: Sun, 21 Aug 2005 21:31:50 +0100 Subject: [Nitro] Trying Og example In-Reply-To: References: <20050815202030.GB1767@uk.tiscali.com> Message-ID: <20050821203150.GA1255@uk.tiscali.com> On Wed, Aug 17, 2005 at 09:44:32PM +0300, George Moschovitis wrote: > sorry for the late reply, I was camping on a mountain w/o > net/telephone access :-) > > MySQL is well supported in Og. Mysql just needs a maximum length on blob keys. > To make the example work just change the following line: > > property :name, String, :unique => true > > to > > property :name, String, :uniq => true > > :uniq (unlike :unique) does not force a unique constrain (ie key) on > the generated table. > > Thanks for pointing this out though, I 'll improve the examle and mysql code. OK, that works thanks. There are plenty of other bugs in the tutorial: I started to fix some, but was left with others. (Note that Mysql doesn't like VARCHAR2, you have to change to VARCHAR) I'm currently stuck here: # ** FIXME ** gives "wrong number of arguments (0 for 1) (ArgumentError)" cat.add_post { |po| po.title = 'Title' po.body = 'Body' } What's the correct syntax to use? Thanks, Brian. From steven at lumos.us Mon Aug 22 02:07:02 2005 From: steven at lumos.us (Steven Lumos) Date: Sun, 21 Aug 2005 23:07:02 -0700 Subject: [Nitro] ... Og and OCI8 ??? References: Message-ID: <86oe7qjyih.fsf@bitty.lumos.us> George Moschovitis writes: > An older version provided support for Oracle but the adapter is not > updated for the latest version. Given the fact that there is a patch > for the store subsystem in progress this will have to wait for the > moment. > > regards, > George. FYI, I'm planning to be willing/able to write this as soon as things stabilize. You might want to ping me in case I'm not paying close enough attention. Steve > On 8/19/05, Jeff Wood wrote: >> Does Og support using the OCI8 db connector ? >> >> j. >> >> -- >> "So long, and thanks for all the fish" >> >> Jeff Wood >> >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com From george.moschovitis at gmail.com Mon Aug 22 02:57:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 22 Aug 2005 09:57:19 +0300 Subject: [Nitro] ... Og and OCI8 ??? In-Reply-To: <86oe7qjyih.fsf@bitty.lumos.us> References: <86oe7qjyih.fsf@bitty.lumos.us> Message-ID: Sure, thanks in advance :) -g. On 8/22/05, Steven Lumos wrote: > George Moschovitis writes: > > An older version provided support for Oracle but the adapter is not > > updated for the latest version. Given the fact that there is a patch > > for the store subsystem in progress this will have to wait for the > > moment. > > > > regards, > > George. > > FYI, I'm planning to be willing/able to write this as soon as things > stabilize. You might want to ping me in case I'm not paying close > enough attention. > > Steve > > > On 8/19/05, Jeff Wood wrote: > >> Does Og support using the OCI8 db connector ? > >> > >> j. > >> > >> -- > >> "So long, and thanks for all the fish" > >> > >> Jeff Wood > >> > >> _______________________________________________ > >> Nitro-general mailing list > >> Nitro-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/nitro-general > >> > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Aug 22 02:57:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 22 Aug 2005 09:57:19 +0300 Subject: [Nitro] ... Og and OCI8 ??? In-Reply-To: <86oe7qjyih.fsf@bitty.lumos.us> References: <86oe7qjyih.fsf@bitty.lumos.us> Message-ID: Sure, thanks in advance :) -g. On 8/22/05, Steven Lumos wrote: > George Moschovitis writes: > > An older version provided support for Oracle but the adapter is not > > updated for the latest version. Given the fact that there is a patch > > for the store subsystem in progress this will have to wait for the > > moment. > > > > regards, > > George. > > FYI, I'm planning to be willing/able to write this as soon as things > stabilize. You might want to ping me in case I'm not paying close > enough attention. > > Steve > > > On 8/19/05, Jeff Wood wrote: > >> Does Og support using the OCI8 db connector ? > >> > >> j. > >> > >> -- > >> "So long, and thanks for all the fish" > >> > >> Jeff Wood > >> > >> _______________________________________________ > >> Nitro-general mailing list > >> Nitro-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/nitro-general > >> > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From bernd at bdebl.de Mon Aug 22 03:04:28 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Mon, 22 Aug 2005 09:04:28 +0200 Subject: [Nitro] Trying Og example In-Reply-To: <20050821203150.GA1255@uk.tiscali.com> References: <20050815202030.GB1767@uk.tiscali.com> <20050821203150.GA1255@uk.tiscali.com> Message-ID: <430978FC.1030807@bdebl.de> While you're trying to polish up the Og tutorial: It would be nice if someone could write at least one additional sentence to the relation definitions. I can guess and only guess that belongs_to is the opposite site of has_many, but what is refers_to (and has_one) then? Thanks! - Bernd From julian at coretech.net.au Mon Aug 22 08:16:13 2005 From: julian at coretech.net.au (Julian Leviston) Date: Mon, 22 Aug 2005 22:16:13 +1000 Subject: [Nitro] user registration / authentication: email validation In-Reply-To: References: <42FECEFE.9010204@bdebl.de> <42FF0E36.5050305@bdebl.de> <42FF9197.3070400@ntecs.de> Message-ID: <39B05C01-63CD-4ADA-A7F6-7AE3E17B89A4@coretech.net.au> LoL. Good one. On 18/08/2005, at 4:45 AM, George Moschovitis wrote: >> Can you explain what this user/identity system is capable of? Just >> curious ;-) >> > > For the moment, let me just say that it rocks :) > > -g. > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From ffsnoopy at gmail.com Mon Aug 22 09:17:38 2005 From: ffsnoopy at gmail.com (mitchell foral) Date: Mon, 22 Aug 2005 09:17:38 -0400 Subject: [Nitro] Question about Options Message-ID: <4309D072.6020400@gmail.com> Hello George, Thanks! I'm sure that will be very helpful to everyone. Take care, -Mitchell; > Hello Mitchel, > There is no such list at the moment. But I 'll go through the code > add some documentation in time for the next release. > regards, > George. From alang at cronosys.com Mon Aug 22 14:13:01 2005 From: alang at cronosys.com (Alan Garrison) Date: Mon, 22 Aug 2005 14:13:01 -0400 Subject: [Nitro] Modelling controllers strategies Message-ID: <430A15AD.4080709@cronosys.com> Hi, in my rare pockets of spare time I've been experimenting with a designing a small CRM application using Nitro. (See www.SugarCRM.com for what I'm modelling the UI after, and if you are in a puking mood, download their open source zip and take a peek). I started by looking at Spark and got just some very basic stuff running so far. What I've run into is some confusion on how the controller class should behave for what I'm trying to do. Spark is simple in that it (basically) deals with just one Og object (WikiPage). What I'm trying to do deals with (potentially) numerous business logic objects (Contacts, Accounts, Projects, Leads, etc). I've got basic Og objects for these, and that in itself isn't a problem. For example, I envision talking to the controller like so: /view/Home -- Display homepage (index default page) /view/Contacts -- View Browse/Search/Panel for Contacts /view/Accounts -- View Browse/Search/Panel for Accounts (Or perhaps have a "/search/Contacts", use different controller call) /view/Contacts/239030294083820 -- View this contact's details /edit/Contacts/239030294083820 -- Edit this contact's details All "screens" will have some common header and footer templating logic, but the main guts of the page will behave based on which object type you are loading/editing. So my initial question is "should I try to have one controller try to handle everything?" Like so: -----8<----- class MyController < Nitro::Controller def view(screen = 'Home', oid = '') @someobj = MyBaseClass.find_by_oid(oid) ### now try to determine what to do based on the screen if screen == 'Contacts' # do something... elsif screen == 'Accounts' # do something... end ### and so on... end -----8<----- Or would I be better off having a controller per object type (even though I'm not quite sure how to handle the common header/footer stuff)? -----8<----- class ContactsController < Nitro::Controller def view(oid = '') # We know it's a contact already @somecontact = Contact.find_by_oid(oid) end ### and so on... end ### probably in a separate file: class AccountsController < Nitro::Controller def view(oid = '') # We know it's an account already @someaccount = Account.find_by_oid(oid) end ### and so on... end -----8<----- Years of mod_php style programming is making my grokking of the MVC paradigm a little bit challenging. :) Any suggestions to the above, or maybe there's a better way that I'm missing? -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From deb at ysabel.org Mon Aug 22 21:11:19 2005 From: deb at ysabel.org (Deborah Hooker) Date: Mon, 22 Aug 2005 19:11:19 -0600 Subject: [Nitro] Og::Store In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <4b6f054f050816100978a274ef@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> Message-ID: <430A77B7.4020103@ysabel.org> George Moschovitis wrote: > PS: I am attaching an updated version of the proposed dir structure, > with some comments to help you. Just pushed changes based on the structure you sent, plus a few tweaks to make a few things a little more consistent (or more accurately, less haphazard, really...) You should peek at my module/class naming, particularly for Store and Schema/Schemas, and tell me if it bugs you. :) Sorry I didn't get those sooner, it was a very hectic weekend. -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Tue Aug 23 02:35:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 23 Aug 2005 09:35:18 +0300 Subject: [Nitro] Og::Store In-Reply-To: <430A77B7.4020103@ysabel.org> References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> <430A77B7.4020103@ysabel.org> Message-ID: On first sight, this looks great :) Can you make this code (at least the mysql adapter) plug into the rest of the Og infrastructure? Then I can work on the sqlite/psql adapters. If we can also get the kirby adapter running this would be great! I 'll better investigate this later today. Many thanks, George. On 8/23/05, Deborah Hooker wrote: > George Moschovitis wrote: > > PS: I am attaching an updated version of the proposed dir structure, > > with some comments to help you. > > Just pushed changes based on the structure you sent, plus a few tweaks to > make a few things a little more consistent (or more accurately, less > haphazard, really...) You should peek at my module/class naming, > particularly for Store and Schema/Schemas, and tell me if it bugs you. :) > > Sorry I didn't get those sooner, it was a very hectic weekend. > > -- > [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Tue Aug 23 02:48:13 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 23 Aug 2005 09:48:13 +0300 Subject: [Nitro] Modelling controllers strategies In-Reply-To: <430A15AD.4080709@cronosys.com> References: <430A15AD.4080709@cronosys.com> Message-ID: I would suggest to go with separate controllers for 'important' objects. You can reuse the same layout by defining a common Page element like it is done in spark. Check out the file src/skin.rb. A better example of nitro will be released real soon now. regards, George. On 8/22/05, Alan Garrison wrote: > Hi, in my rare pockets of spare time I've been experimenting with a > designing > a small CRM application using Nitro. (See www.SugarCRM.com for what I'm > modelling the UI after, and if you are in a puking mood, download their > open > source zip and take a peek). I started by looking at Spark and got just > some very basic stuff running so far. What I've run into is some confusion > on how the controller class should behave for what I'm trying to do. Spark > is simple in that it (basically) deals with just one Og object (WikiPage). > What I'm trying to do deals with (potentially) numerous business logic > objects (Contacts, Accounts, Projects, Leads, etc). I've got basic Og > objects for these, and that in itself isn't a problem. > > For example, I envision talking to the controller like so: > > /view/Home -- Display homepage (index default page) > /view/Contacts -- View Browse/Search/Panel for Contacts > /view/Accounts -- View Browse/Search/Panel for Accounts > (Or perhaps have a "/search/Contacts", use different controller call) > /view/Contacts/239030294083820 -- View this contact's details > /edit/Contacts/239030294083820 -- Edit this contact's details > > All "screens" will have some common header and footer templating logic, > but the main guts of the page will behave based on which object type > you are loading/editing. So my initial question is "should I try to > have one controller try to handle everything?" Like so: > > -----8<----- > class MyController < Nitro::Controller > def view(screen = 'Home', oid = '') > @someobj = MyBaseClass.find_by_oid(oid) > ### now try to determine what to do based on the screen > if screen == 'Contacts' # do something... > elsif screen == 'Accounts' # do something... > end > ### and so on... > end > -----8<----- > > Or would I be better off having a controller per object type (even though > I'm not quite sure how to handle the common header/footer stuff)? > > -----8<----- > class ContactsController < Nitro::Controller > def view(oid = '') > # We know it's a contact already > @somecontact = Contact.find_by_oid(oid) > end > ### and so on... > end > > ### probably in a separate file: > class AccountsController < Nitro::Controller > def view(oid = '') > # We know it's an account already > @someaccount = Account.find_by_oid(oid) > end > ### and so on... > end > -----8<----- > > Years of mod_php style programming is making my grokking of the MVC > paradigm a little bit challenging. :) Any suggestions to the above, or > maybe > there's a better way that I'm missing? > > > -- > Alan Garrison > Cronosys, LLC > Phone: 216-221-4600 ext 308 > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Tue Aug 23 03:12:23 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 23 Aug 2005 10:12:23 +0300 Subject: [Nitro] Nested Intervals Message-ID: There is a small project for anyone who wants to help with nitro development. Have a look at lib/og/mixin/tree.rb This is some experimental code for a nested intervals mixins a more sophisticated version of the nested sets algorithm used in the hierarchical mixin for sql tree traversal. If anyone could go on and finish this code it would be very helpful. There is a link in the code that points to an article that describes this algorithm. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Tue Aug 23 05:36:27 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 23 Aug 2005 12:36:27 +0300 Subject: [Nitro] Redirect change. Message-ID: Hello all, I am sightly changing the behaviour of redirect. I think the following excerpt from the test case demonstrates the new behaviour: def test_redirect # relative url, the controller base_url is prepended redirect 'hello' assert_equal 'http://www.nitrohq.com/base/hello', @controller.context.response_headers['location'] # absolute url, use as is. redirect '/main' assert_equal 'http://www.nitrohq.com/main', @controller.context.response_headers['location'] end This will make possible to rewrite more reusable controllers that can be mounted on different paths. If anyone sees a problem with this let me know. This will probably break some existing code, but it is really easy to fix. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From deb at ysabel.org Tue Aug 23 09:13:48 2005 From: deb at ysabel.org (Ysabel) Date: Tue, 23 Aug 2005 07:13:48 -0600 Subject: [Nitro] Og::Store In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <43056549.4080405@ysabel.org> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> <430A77B7.4020103@ysabel.org> Message-ID: --On Tuesday, August 23, 2005 9:35 AM +0300 George Moschovitis wrote: > On first sight, this looks great :) Can you make this code (at least > the mysql adapter) plug into the rest of the Og infrastructure? Then I > can work on the sqlite/psql adapters. If we can also get the kirby > adapter running this would be great! I'll work on that. The Kirby adapter should work already for basic stuff, but it needs more functional tests. All I have in there right now is create some objects, make sure they exist in the KirbyBase, and then do a basic find and make sure we get back what we expect. I'll probably also do a quick sketch of both the sqlite and the psql adapters but I won't do much more than that; it'll give you an easy starting point, they'll definitely both need functional tests to make sure everything's covered. Ideally anything that's used by more than one adapter will be up in a higher level somewhere, possibly configured by one of the db_features flags, so the DB-specific adapters can be really simple. For the record, the functional tests require appropriate configuration and permissions (e.g. the MySQL tests require a mysql user with permissions in a test database) and so they won't be included by default in "rake test", unlike the unit tests. I'll make sure there's some docs on the subject. -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From george.moschovitis at gmail.com Tue Aug 23 09:18:50 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 23 Aug 2005 16:18:50 +0300 Subject: [Nitro] Og::Store In-Reply-To: References: <5371ac7405081608497dbcbcb4@mail.gmail.com> <43057E9C.2090509@ysabel.org> <43058CDA.7040908@ysabel.org> <430A77B7.4020103@ysabel.org> Message-ID: Ok, sounds great, I am waiting for your stuff. Thanks a lot, -g. On 8/23/05, Ysabel wrote: > --On Tuesday, August 23, 2005 9:35 AM +0300 George Moschovitis > wrote: > > On first sight, this looks great :) Can you make this code (at least > > the mysql adapter) plug into the rest of the Og infrastructure? Then I > > can work on the sqlite/psql adapters. If we can also get the kirby > > adapter running this would be great! > > I'll work on that. The Kirby adapter should work already for basic stuff, > but it needs more functional tests. All I have in there right now is > create some objects, make sure they exist in the KirbyBase, and then do a > basic find and make sure we get back what we expect. > > I'll probably also do a quick sketch of both the sqlite and the psql > adapters but I won't do much more than that; it'll give you an easy > starting point, they'll definitely both need functional tests to make sure > everything's covered. Ideally anything that's used by more than one > adapter will be up in a higher level somewhere, possibly configured by one > of the db_features flags, so the DB-specific adapters can be really simple. > > For the record, the functional tests require appropriate configuration and > permissions (e.g. the MySQL tests require a mysql user with permissions in > a test database) and so they won't be included by default in "rake test", > unlike the unit tests. I'll make sure there's some docs on the subject. > > -- > [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From B.Candler at pobox.com Tue Aug 23 16:04:02 2005 From: B.Candler at pobox.com (Brian Candler) Date: Tue, 23 Aug 2005 21:04:02 +0100 Subject: [Nitro] Trying Og example In-Reply-To: References: <20050815202030.GB1767@uk.tiscali.com> <20050821203150.GA1255@uk.tiscali.com> Message-ID: <20050823200402.GA1239@uk.tiscali.com> On Mon, Aug 22, 2005 at 09:56:49AM +0300, George Moschovitis wrote: > po = Post.new > po.title = .. > .. > > cat.posts << po > > And I 'll make the code block work in the next version. Thanks. Here are some more things which don't work from the tutorial: (1) # FIXME cat = Category['Programming'] This gives the following exception: ERROR: DB error Unknown column 'Programming' in 'where clause', [SELECT * FROM ogcategory WHERE oid=Programming] whereas the tutorial says: "As a convenience, Og allows you to lookup the category using the special property 'name'" (2) po = Post[1] p p.title # FIXME p po.categories[0].title gives exception "undefined method `categories' for #" (3) com = Comment.new('Hi there') p.add_comment(com) another 'method missing' exception (4) po = Post[1] # FIXME po.update_properties "body='Hello world'" Gives the following exception: /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:334:in `send': undefined method `body='Hello world'' for # (NoMethodError) from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:334:in `update' from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:333:in `each' from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:333:in `update' from /v/build/nitro/og-0.22.0/lib/og/entity.rb:30:in `update_properties' from run.rb:132 (5) The callback function isn't called: class Post ... def og_post_insert(conn) puts 'Hey, a new post was just posted!' end end I found a few other errors in the tutorial which I was able to fix - these are reflected in the attached patch. Apart from this, it worked just fine :-( Regards, Brian. -------------- next part -------------- --- tutorial.txt.orig Mon Aug 15 21:24:34 2005 +++ tutorial.txt Tue Aug 23 21:01:21 2005 @@ -150,9 +150,9 @@ for PostgreSQL, MySQL, SQLite3, and Oracle. For this example, we'll use the PostgreSQL adapter, so add this code after the class definitions. -db = Og::Database.new( - :database => 'test', - :adapter => 'psql', +db = Og.setup( + :store => 'psql', + :name => 'test', :user => 'postgres', :password => 'navelrulez' ) @@ -180,7 +180,7 @@ Issue the following SQL to see the result: -SELECT * FROM og_post +SELECT * FROM ogpost This is nice, but where does the #save method come from? Og uses Ruby's advanced introspection features to automatically @@ -207,7 +207,7 @@ cat.name = 'Programming' cat.save -If you investigate the generated og_category table, you will +If you investigate the generated ogcategory table, you will see an 'oid' column which serves as the primary key. This column is added automatically by Og. You can use the oid values to lookup objects: @@ -221,6 +221,7 @@ As a convenience, Og allows you to lookup the category using the special property 'name': +** FIXME: This is broken ** cat = Category['Programming'] You can lookup objects by name only if the name property is @@ -317,9 +318,10 @@ cat = Category.create('Programming') +# ** FIXME ** gives "wrong number of arguments (0 for 1) (ArgumentError)" cat.add_post { |p| p.title = 'Title' - p.body = 'Body + p.body = 'Body' } cat.add_post { |p| @@ -340,6 +342,7 @@ p.title => Title +# ** FIXME ** method_missing exception p.categories[0].title => 'Programming' @@ -350,6 +353,7 @@ p.comments.size => 1 +# ** FIXME ** method_missing exception p.add_comment { |c| c.title = 'Hi there' } @@ -365,10 +369,10 @@ Og provides full access to all features of the underlying RDBMS. Look at the following: -post = Post.select("title='Title' and body='Body'") +post = Post.select("where title='Title' and body='Body'") post.size => 1 -post.hits +post[0].hits => 0 Updating existing objects is easy too: @@ -384,6 +388,7 @@ You can also update specific properties, for example: p = Post[1] +# ** FIXME ** undefined method error p.update_properties "body='Hello world'" p = Post[1] @@ -431,12 +436,13 @@ For example, the following code defines a callback for the Post class. +** FIXME ** This doesn't work (the callback isn't called) class Post ... def og_post_insert(conn) puts 'Hey, a new post was just posted!' - end + end end When post.save is called, you'll get this alert: From B.Candler at pobox.com Tue Aug 23 16:44:55 2005 From: B.Candler at pobox.com (Brian Candler) Date: Tue, 23 Aug 2005 21:44:55 +0100 Subject: [Nitro] Foreign key constraints Message-ID: <20050823204455.GA1453@uk.tiscali.com> Question 1: would it be possible for Og to insert foreign key constraints automatically? I'm thinking particularly of the 'belongs_to' and 'many_to_many' relationships. For example: class Tree; end class Tree property :name, String belongs_to :parent, Tree end IMO this ought to do an: ALTER TABLE ogtree ADD FOREIGN KEY oid_parent_oid (oid) REFERENCES tree (parent_oid); If this sort of stuff has to be done by hand on the SQL databases after the fact, then it doesn't really seem worth having Og create the tables automatically from the metadata; it might make more sense to create the SQL tables manually, and generate the class definitions from that. (Although some people might prefer to ignore database integrity checks for convenience of programming, I don't think that's a good way to write a robust application) Aside: there's a slight bootstrapping problem with this particular example, since root = Tree.new root.parent = root root.save inserts an entry with oid=1 but parent=NULL. I would like to have a not-null constraint on parent too; "belongs_to" becomes "must_belong_to" :-) But in the case of a tree, I don't mind having to manually send some SQL to insert the root node: insert into ogtree (oid,parent) VALUES (1,1); Question 2: Are transactions implemented at all? Can someone give me some example code showing how they would be used? I note they are not implemented for mysql: def commit # nop, not supported? # FIXME: InnoDB supports transactions. end However it *is* possible to create the correct table types: db = Og.setup( :store => 'mysql', :name => 'test', :user => 'root', :password => '', :table_type => 'innoDB' ) Having both referential integrity and transactions is I think important for more complex applications, when inserting multiple related objects. Regards, Brian. From reid.thompson at ateb.com Tue Aug 23 23:21:10 2005 From: reid.thompson at ateb.com (Reid Thompson) Date: Tue, 23 Aug 2005 23:21:10 -0400 Subject: [Nitro] latest nitro/wee example broken? Message-ID: <430BE7A6.5010200@ateb.com> What am I missing?.. cyberhome:/lib/ruby/gems/1.8/gems/nitro-0.22.0/examples/wee> $ ruby run.rb /usr/lib/ruby/gems/1.8/gems/wee-0.10.0/lib/wee/adaptors/nitro.rb:1: uninitialized constant Wee::ComponentRunner (NameError) from /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__' from /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' from /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/adapter/wee.rb:4 from /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__' from /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' from run.rb:2 From james_b at neurogami.com Wed Aug 24 00:12:34 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 23 Aug 2005 21:12:34 -0700 Subject: [Nitro] Nitro and rubyscript2exe Message-ID: <430BF3B2.6020804@neurogami.com> Has anyone tried using using rubyscript2exe on a Nitro application to create a complete, standalone distributable application? http://www.erikveen.dds.nl/rubyscript2exe/index.html Thanks, James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From george.moschovitis at gmail.com Wed Aug 24 04:13:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 24 Aug 2005 11:13:18 +0300 Subject: [Nitro] latest nitro/wee example broken? In-Reply-To: <430BE7A6.5010200@ateb.com> References: <430BE7A6.5010200@ateb.com> Message-ID: Perhaps this is an older version of Wee or I used the SVN version to check the example, I 'll investigate again... regards, George. On 8/24/05, Reid Thompson wrote: > What am I missing?.. > > cyberhome:/lib/ruby/gems/1.8/gems/nitro-0.22.0/examples/wee> > $ ruby run.rb > /usr/lib/ruby/gems/1.8/gems/wee-0.10.0/lib/wee/adaptors/nitro.rb:1: > uninitialized constant Wee::ComponentRunner (NameError) > from > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__' > from > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' > from > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/adapter/wee.rb:4 > from > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__' > from > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' > from run.rb:2 > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From Reid.Thompson at ateb.com Wed Aug 24 07:52:31 2005 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Wed, 24 Aug 2005 07:52:31 -0400 Subject: [Nitro] latest nitro/wee example broken? Message-ID: if one were interested in experimenting with/utilizing nitro/wee, would the svn archive be the recommended sources, or the provided gems? reid > -----Original Message----- > From: George Moschovitis [mailto:george.moschovitis at gmail.com] > Sent: Wednesday, August 24, 2005 4:13 AM > To: General discussion about Nitro > Subject: Re: [Nitro] latest nitro/wee example broken? > > > Perhaps this is an older version of Wee or I used the SVN > version to check the example, I 'll investigate again... > > regards, > George. > > On 8/24/05, Reid Thompson wrote: > > What am I missing?.. > > > > cyberhome:/lib/ruby/gems/1.8/gems/nitro-0.22.0/examples/wee> > > $ ruby run.rb > > /usr/lib/ruby/gems/1.8/gems/wee-0.10.0/lib/wee/adaptors/nitro.rb:1: > > uninitialized constant Wee::ComponentRunner (NameError) > > from > > > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in > `require__' > > from > > > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in > `require' > > from > > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/adapter/wee.rb:4 > > from > > > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in > `require__' > > from > > > /usr/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in > `require' > > from run.rb:2 > > > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinf> o/nitro-general > From tim at keow.org Wed Aug 24 11:18:10 2005 From: tim at keow.org (Tim Larson) Date: Wed, 24 Aug 2005 16:18:10 +0100 Subject: [Nitro] anybody using Nitro/Og frequent IRC? Message-ID: <20050824151810.GE1183@localhost> Does anybody here frequent an IRC channel where we could support each other in the use of Nitro/Og? If the ruby channels (#ruby-lang, #ruby-talk, #rubyonrails) are too busy or not focussed enough, we could setup another channel by just agreeing on somewhere to meet (e.g. #nitro on freenode.) WDYT? --Tim Larson From george.moschovitis at gmail.com Wed Aug 24 11:36:40 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 24 Aug 2005 18:36:40 +0300 Subject: [Nitro] anybody using Nitro/Og frequent IRC? In-Reply-To: <20050824151810.GE1183@localhost> References: <20050824151810.GE1183@localhost> Message-ID: #nitro sounds great, I 'll try to login whenever I have time :) -g. On 8/24/05, Tim Larson wrote: > Does anybody here frequent an IRC channel where we > could support each other in the use of Nitro/Og? > > If the ruby channels (#ruby-lang, #ruby-talk, > #rubyonrails) are too busy or not focussed enough, > we could setup another channel by just agreeing > on somewhere to meet (e.g. #nitro on freenode.) > > WDYT? > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From bernd at bdebl.de Wed Aug 24 13:48:08 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Wed, 24 Aug 2005 19:48:08 +0200 Subject: [Nitro] Nested Intervals In-Reply-To: References: Message-ID: <430CB2D8.4030602@bdebl.de> Here's the URL: http://www.dbazine.com/oracle/or-articles/tropashko4 I may or may not be able to have a look on this on the weekend. But maybe someone else is faster... (if so please let me know). - Bernd George Moschovitis wrote: >There is a small project for anyone who wants to help with nitro development. > >Have a look at lib/og/mixin/tree.rb > >This is some experimental code for a nested intervals mixins a more >sophisticated version of the nested sets algorithm used in the >hierarchical mixin for sql tree traversal. If anyone could go on and >finish this code it would be very helpful. There is a link in the code >that points to an article that describes this algorithm. > > From tim at keow.org Wed Aug 24 15:43:14 2005 From: tim at keow.org (Tim Larson) Date: Wed, 24 Aug 2005 20:43:14 +0100 Subject: [Nitro] anybody using Nitro/Og frequent IRC? In-Reply-To: References: <20050824151810.GE1183@localhost> Message-ID: <20050824194314.GF1183@localhost> On Wed, Aug 24, 2005 at 06:36:40PM +0300, George Moschovitis wrote: > #nitro sounds great, I 'll try to login whenever I have time :) > > -g. Thanks for the encouragement. As of this moment we have 6 people in the #nitro channel on freenode, and I have already met some nice people and had one progress-stopper solved. Hint: "require" your model file(s) before you "require" your controller file(s) or it may seem like Og is not weaving in its magic methods. As you see I am still learning the ins and outs of Ruby ;) --Tim Larson > On 8/24/05, Tim Larson wrote: > > Does anybody here frequent an IRC channel where we > > could support each other in the use of Nitro/Og? > > > > If the ruby channels (#ruby-lang, #ruby-talk, > > #rubyonrails) are too busy or not focussed enough, > > we could setup another channel by just agreeing > > on somewhere to meet (e.g. #nitro on freenode.) > > > > WDYT? > > --Tim Larson From tim at keow.org Wed Aug 24 16:31:43 2005 From: tim at keow.org (Tim Larson) Date: Wed, 24 Aug 2005 21:31:43 +0100 Subject: [Nitro] nitro and complex forms? Message-ID: <20050824203143.GG1183@localhost> What is the recommended way of creating complex forms when using Nitro/Og? By complex I mean the form contains data from multiple tables, some fields editable, some not, heavy validation, database-backed list boxes, and careful handling of locking and transactions because multiple people will be trying to look at and edit data potentially at the same time. --Tim Larson From epiperak at softlab.ece.ntua.gr Wed Aug 24 21:02:15 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 25 Aug 2005 04:02:15 +0300 (EEST) Subject: [Nitro] anybody using Nitro/Og frequent IRC? In-Reply-To: <20050824151810.GE1183@localhost> References: <20050824151810.GE1183@localhost> Message-ID: I agree with that... I will login from today to #nitro on freenode. George, I guess you should too... :-) > Does anybody here frequent an IRC channel where we > could support each other in the use of Nitro/Og? > > If the ruby channels (#ruby-lang, #ruby-talk, > #rubyonrails) are too busy or not focussed enough, > we could setup another channel by just agreeing > on somewhere to meet (e.g. #nitro on freenode.) > > WDYT? > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Wed Aug 24 21:23:24 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 25 Aug 2005 04:23:24 +0300 (EEST) Subject: [Nitro] anybody using Nitro/Og frequent IRC? In-Reply-To: References: <20050824151810.GE1183@localhost> Message-ID: I found out that Tim already started the channel. Great! > I agree with that... > I will login from today to #nitro on freenode. George, I guess you should > too... :-) > >> Does anybody here frequent an IRC channel where we >> could support each other in the use of Nitro/Og? >> >> If the ruby channels (#ruby-lang, #ruby-talk, >> #rubyonrails) are too busy or not focussed enough, >> we could setup another channel by just agreeing >> on somewhere to meet (e.g. #nitro on freenode.) >> >> WDYT? >> --Tim Larson >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From bernd at bdebl.de Thu Aug 25 02:13:13 2005 From: bernd at bdebl.de (Martin Bernd Schmeil) Date: Thu, 25 Aug 2005 08:13:13 +0200 Subject: [Nitro] vandalized homepage Message-ID: <430D6179.1030606@bdebl.de> How about introducing authentification to the wiki? There are more attempts of vandalization than additions / updates.... - Bernd From george.moschovitis at gmail.com Thu Aug 25 03:07:05 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 25 Aug 2005 10:07:05 +0300 Subject: [Nitro] nitro and complex forms? In-Reply-To: <20050824203143.GG1183@localhost> References: <20050824203143.GG1183@localhost> Message-ID: Ehm, I guess this is a manual task :) Btw, the forthcoming release of Nitro includes *advanced* scaffolding helpers that are helpful even in non standard cases like the one you describe. -g. On 8/24/05, Tim Larson wrote: > What is the recommended way of creating complex forms > when using Nitro/Og? By complex I mean the form contains > data from multiple tables, some fields editable, some > not, heavy validation, database-backed list boxes, and > careful handling of locking and transactions because > multiple people will be trying to look at and edit > data potentially at the same time. > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Thu Aug 25 05:01:33 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 25 Aug 2005 12:01:33 +0300 Subject: [Nitro] Refactoring Message-ID: Hello all, I would like to factor the CgiUtils out of lib/nitro/adapter/cgi.rb Any idea where should I move them, how to name the file? regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From transfire at gmail.com Thu Aug 25 08:43:39 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 08:43:39 -0400 Subject: [Nitro] vandalized homepage In-Reply-To: <430D6179.1030606@bdebl.de> References: <430D6179.1030606@bdebl.de> Message-ID: <4b6f054f05082505437a47a84a@mail.gmail.com> On 8/25/05, Martin Bernd Schmeil wrote: > How about introducing authentification to the wiki? There are more > attempts of vandalization than additions / updates.... What kind of validation do people prefer? - graphical text entry (what's this called again?) - IP validation - Memberships - Other? T. From aglarond at gmail.com Thu Aug 25 08:47:30 2005 From: aglarond at gmail.com (Dimitri Aivaliotis) Date: Thu, 25 Aug 2005 14:47:30 +0200 Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082505437a47a84a@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> Message-ID: <55c107bf05082505474db170a8@mail.gmail.com> On 8/25/05, TRANS wrote: > > On 8/25/05, Martin Bernd Schmeil wrote: > > How about introducing authentification to the wiki? There are more > > attempts of vandalization than additions / updates.... > > What kind of validation do people prefer? > > - graphical text entry (what's this called again?) It's called CAPTCHA (http://www.captcha.net). That's probably best because it doesn't require registration. - Dimitri -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050825/4d9bfaee/attachment.html From mneumann at ntecs.de Thu Aug 25 09:00:50 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Thu, 25 Aug 2005 15:00:50 +0200 Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082505437a47a84a@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> Message-ID: <430DC102.5080207@ntecs.de> TRANS wrote: > On 8/25/05, Martin Bernd Schmeil wrote: > >>How about introducing authentification to the wiki? There are more >>attempts of vandalization than additions / updates.... > > > What kind of validation do people prefer? > I think a very simple: Please enter the result of #{ rand(10) } + #{ rand(10) } would do, assuming that everyone can add two numbers ;-) Regards, Michael From transfire at gmail.com Thu Aug 25 09:06:31 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 09:06:31 -0400 Subject: [Nitro] nitro and complex forms? In-Reply-To: <20050824203143.GG1183@localhost> References: <20050824203143.GG1183@localhost> Message-ID: <4b6f054f05082506067fc275c5@mail.gmail.com> On 8/24/05, Tim Larson wrote: > What is the recommended way of creating complex forms > when using Nitro/Og? By complex I mean the form contains > data from multiple tables, some fields editable, some > not, heavy validation, database-backed list boxes, and > careful handling of locking and transactions because > multiple people will be trying to look at and edit > data potentially at the same time. You'll want to create some DSL methods to simplify your task. If they're generic enough they may be of use to Nitro in general. For instance I can imagine some validation "ann"-type methods. valid :a, { |a| a =~ /^@/ } Sorry if this is a stupid question (still haven't begun working with Nitro directly) George is it possible to add meta info with #ann? That would be useful. Say like ann :a, :editable => true As for list boxes, I have some xHTML helpers that build just such lovely things for you. But I'm REAL busy at the moment. I'll make them available as soon as I can. Please somene remind me if I don't do anything on this within the next few weeks. As for locking and transactions. The first and foremost thing to do is use an advanced database. PostgreSQL is good for this sort of intense usage. The easiest way to protect records is to compare changes --if someone change something since you accessed the record the warn the user, show the difference, and give an option to overwrite. If you like to inform the use of the potential of conflict prioir to record save operation then there may be a way to get more info from the DB (locks) (not sure as the former always seemed good enough to me), but if you do and want it non-db dependent you'll have to have shared process that keeps track of them. A very simple service really. Put a REST interface on it for good measure. Might be a nice addition to Nitro too. ( o _ ??? // trans. / \ transfire at gmail.com From george.moschovitis at gmail.com Thu Aug 25 09:06:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 25 Aug 2005 16:06:48 +0300 Subject: [Nitro] vandalized homepage In-Reply-To: <430DC102.5080207@ntecs.de> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> Message-ID: Ok, will add something for the next release of spark, perhaps someone can submit a patch? -g. On 8/25/05, Michael Neumann wrote: > TRANS wrote: > > On 8/25/05, Martin Bernd Schmeil wrote: > > > >>How about introducing authentification to the wiki? There are more > >>attempts of vandalization than additions / updates.... > > > > > > What kind of validation do people prefer? > > > > I think a very simple: > > Please enter the result of #{ rand(10) } + #{ rand(10) } > > would do, assuming that everyone can add two numbers ;-) > > Regards, > > Michael > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From transfire at gmail.com Thu Aug 25 09:14:44 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 09:14:44 -0400 Subject: [Nitro] vandalized homepage In-Reply-To: <430DC102.5080207@ntecs.de> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> Message-ID: <4b6f054f05082506146936ea6@mail.gmail.com> On 8/25/05, Michael Neumann wrote: > TRANS wrote: > > On 8/25/05, Martin Bernd Schmeil wrote: > > > >>How about introducing authentification to the wiki? There are more > >>attempts of vandalization than additions / updates.... > > > > > > What kind of validation do people prefer? > > > > I think a very simple: > > Please enter the result of #{ rand(10) } + #{ rand(10) } > > would do, assuming that everyone can add two numbers ;-) Maybe so. But if some went out of their way to target the site, that would quickly be overcome. Of course you could make it a littel tickery, a random set of simple english word problems. I'm sure I could come up with a 100 of these in day. "What is 4 plus the number of legs a dog has?" :-) OTOH, IP validation is more interesting, but I'm not sure of limitations. Essentially your IP is kept on record as valid. If you submit and it's not there it asks for your email address to which it will send a validation email, i.e. either reply back or click link, which then adds your IP to the list. From then on you wont have to do it again, at least not from that location. T. From george.moschovitis at gmail.com Thu Aug 25 09:32:51 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 25 Aug 2005 16:32:51 +0300 Subject: [Nitro] nitro and complex forms? In-Reply-To: <4b6f054f05082506067fc275c5@mail.gmail.com> References: <20050824203143.GG1183@localhost> <4b6f054f05082506067fc275c5@mail.gmail.com> Message-ID: > Sorry if this is a stupid question (still haven't begun working with > Nitro directly) George is it possible to add meta info with #ann? That > would be useful. Say like > > ann :a, :editable => true you can do that with action :a, ... But the whole property/metadata system is being reworked/simplified at the moment. Dunno if this will make it for 0.23.0 though... > As for list boxes, I have some xHTML helpers that build just such > lovely things for you. But I'm REAL busy at the moment. I'll make them > available as soon as I can. Please somene remind me if I don't do > anything on this within the next few weeks. version 0.23.0 will include ADVANCED scaffolding functionality. Stay tuned. > As for locking and transactions. The first and foremost thing to do is > use an advanced database. PostgreSQL is good for this sort of intense > .. > REST interface on it for good measure. Might be a nice addition to > Nitro too. try og/mixin/optimistic_locking.rb -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Thu Aug 25 09:33:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 25 Aug 2005 16:33:48 +0300 Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082506146936ea6@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> <4b6f054f05082506146936ea6@mail.gmail.com> Message-ID: > "What is 4 plus the number of legs a dog has?" :-) hehe :) -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From ulmo at valaraan.de Thu Aug 25 09:54:21 2005 From: ulmo at valaraan.de (manveru) Date: Thu, 25 Aug 2005 15:54:21 +0200 Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082506146936ea6@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> <4b6f054f05082506146936ea6@mail.gmail.com> Message-ID: <430DCD8D.3050000@valaraan.de> TRANS wrote: >On 8/25/05, Michael Neumann wrote: > > >>TRANS wrote: >> >> >>>On 8/25/05, Martin Bernd Schmeil wrote: >>> >>> >>> >>>>How about introducing authentification to the wiki? There are more >>>>attempts of vandalization than additions / updates.... >>>> >>>> >>>What kind of validation do people prefer? >>> >>> >>> >>I think a very simple: >> >> Please enter the result of #{ rand(10) } + #{ rand(10) } >> >>would do, assuming that everyone can add two numbers ;-) >> >> > >Maybe so. But if some went out of their way to target the site, that >would quickly be overcome. Of course you could make it a littel >tickery, a random set of simple english word problems. I'm sure I >could come up with a 100 of these in day. > > "What is 4 plus the number of legs a dog has?" :-) > >OTOH, IP validation is more interesting, but I'm not sure of >limitations. Essentially your IP is kept on record as valid. If you >submit and it's not there it asks for your email address to which it >will send a validation email, i.e. either reply back or click link, >which then adds your IP to the list. From then on you wont have to do >it again, at least not from that location. > >T. > >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > > IP-validation is of no use... IP's change all the time, and i don't like the thought to reregister my IP-address all the time while other people wich get my IP have access... i don't think it's THAT dangerous, but it is not secure and i'm sure it won't be comfortable - especiall for people who need some proxy-server to access the web and whose IP changes all the time due to load-balancing between proxies... and i have one question ... is this all about preventing vandalizing by bots AND humans? for bots the job is done by some simple image, but what hinders humans to access and vandalize? MfG manveru From transfire at gmail.com Thu Aug 25 10:11:49 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 10:11:49 -0400 Subject: [Nitro] vandalized homepage In-Reply-To: <430DCD8D.3050000@valaraan.de> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> <4b6f054f05082506146936ea6@mail.gmail.com> <430DCD8D.3050000@valaraan.de> Message-ID: <4b6f054f0508250711479603ba@mail.gmail.com> > IP-validation is of no use... IP's change all the time, and i don't like > the thought to reregister my IP-address all the time while other people > wich get my IP have access... i don't think it's THAT dangerous, but it > is not secure and i'm sure it won't be comfortable - especiall for > people who need some proxy-server to access the web and whose IP changes > all the time due to load-balancing between proxies... Thanks. exactly the limitations I was wondering about. T. From james_b at neurogami.com Thu Aug 25 10:45:33 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 25 Aug 2005 07:45:33 -0700 Subject: [Nitro] vandalized homepage In-Reply-To: <430DCD8D.3050000@valaraan.de> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> <4b6f054f05082506146936ea6@mail.gmail.com> <430DCD8D.3050000@valaraan.de> Message-ID: <430DD98D.6030305@neurogami.com> manveru wrote: > ... > and i have one question ... is this all about preventing vandalizing by > bots AND humans? > > for bots the job is done by some simple image, but what hinders humans > to access and vandalize? Good point. Use images to block bots. Use an editing delay to slow down humans. E.g. When editing a given page, store the IP address for x seconds (60? 10?), and block further editing of other pages until an editing hold for that IP address has expired. Then delete the stored IP address. Maybe use a cookie that expires after, say 60 seconds? Annoying to legitimate users, though I suspect most people are not trying to edit multiple pages one right after the other. James From alang at cronosys.com Thu Aug 25 11:01:37 2005 From: alang at cronosys.com (Alan Garrison) Date: Thu, 25 Aug 2005 11:01:37 -0400 Subject: [Nitro] vandalized homepage In-Reply-To: References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430DC102.5080207@ntecs.de> <4b6f054f05082506146936ea6@mail.gmail.com> Message-ID: <430DDD51.9010306@cronosys.com> What would be cool is to have a "revision request queue" for anyone who isn't authenticated (by whatever simple mechanism). I'd guess most wiki vandalizers wouldn't bother if they needed a basic user account to accept/reject revision requests. That way anyone could still contribute, but the work of non-auth'ed vandals wouldn't affect the site. George Moschovitis wrote: >> "What is 4 plus the number of legs a dog has?" :-) >> >> > >hehe :) > > > Or you could ask "My dog has got no nose. How does he smell?".... -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From transfire at gmail.com Thu Aug 25 11:02:37 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 11:02:37 -0400 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <430BF3B2.6020804@neurogami.com> References: <430BF3B2.6020804@neurogami.com> Message-ID: <4b6f054f05082508027f933caa@mail.gmail.com> On 8/24/05, James Britt wrote: > Has anyone tried using using rubyscript2exe on a Nitro application to > create a complete, standalone distributable application? > > > http://www.erikveen.dds.nl/rubyscript2exe/index.html Don't think anyone has. HAve you tried it? T. From james_b at neurogami.com Thu Aug 25 12:43:54 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 25 Aug 2005 09:43:54 -0700 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <4b6f054f05082508027f933caa@mail.gmail.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> Message-ID: <430DF54A.1090103@neurogami.com> TRANS wrote: > On 8/24/05, James Britt wrote: > >>Has anyone tried using using rubyscript2exe on a Nitro application to >>create a complete, standalone distributable application? >> >> >>http://www.erikveen.dds.nl/rubyscript2exe/index.html > > > > Don't think anyone has. HAve you tried it? > > T. > I've run the script to make the exe, but now I need a clean box to test it on :) I need to be sure that it works on a system with no Ruby. And, oddly enough, all four of my computers have Ruby installed. (Well, actually, I have a fifth computer, a C64 but it's in a box in the closet, so that doesn't count.) Looks like a job for VMware. Or maybe WINE? James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From transfire at gmail.com Thu Aug 25 13:11:33 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 13:11:33 -0400 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <430DF54A.1090103@neurogami.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> Message-ID: <4b6f054f0508251011154a7786@mail.gmail.com> On 8/25/05, James Britt wrote: > > I've run the script to make the exe, but now I need a clean box to test > it on :) > > I need to be sure that it works on a system with no Ruby. And, oddly > enough, all four of my computers have Ruby installed. (Well, actually, > I have a fifth computer, a C64 but it's in a box in the closet, so that > doesn't count.) C64! Best damn computer ever made! :-) > Looks like a job for VMware. Or maybe WINE? Or XEN. Let us know how it goes. T. From ak at navel.gr Thu Aug 25 13:24:42 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 25 Aug 2005 20:24:42 +0300 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <430DF54A.1090103@neurogami.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> Message-ID: <430DFEDA.7060903@navel.gr> James Britt wrote: > TRANS wrote: > >> On 8/24/05, James Britt wrote: >> >>> Has anyone tried using using rubyscript2exe on a Nitro application to >>> create a complete, standalone distributable application? >>> >>> >>> http://www.erikveen.dds.nl/rubyscript2exe/index.html >> >> >> >> >> Don't think anyone has. HAve you tried it? >> >> T. >> > > I've run the script to make the exe, but now I need a clean box to > test it on :) > > I need to be sure that it works on a system with no Ruby. And, oddly > enough, all four of my computers have Ruby installed. (Well, > actually, I have a fifth computer, a C64 but it's in a box in the > closet, so that doesn't count.) > > Looks like a job for VMware. Or maybe WINE? > > > > James > > i'm sure we can find a 'clean' windows box in our office - you could forward me the .exe to check it out! Tasos -- Navel, Greece ____________________________________ Did you joy today? www.JOY.GR !!! From ak at navel.gr Thu Aug 25 14:39:30 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 25 Aug 2005 21:39:30 +0300 Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082505437a47a84a@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> Message-ID: <430E1062.90605@navel.gr> TRANS wrote: >On 8/25/05, Martin Bernd Schmeil wrote: > > >>How about introducing authentification to the wiki? There are more >>attempts of vandalization than additions / updates.... >> >> > >What kind of validation do people prefer? > > - graphical text entry (what's this called again?) > - IP validation > - Memberships > - Other? > >T. > >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > why not try a combination, i.e.: 1. frequent users can register, 2. someone wishing to contribute should at least answer to a CAPTCHA or other kind or question 3. inform everyone that their contribution is logged (their ip, any other info we can get from their client's request) later we could add a moderation step if wewish, but i think it complicates things too much.... Tasos -- Navel, Greece http://www.navel.gr @@ +30 210 6898050 Navel does not accept liability for any errors, viruses or omissions in the contents of this message, which arise as a result of e-mail transmission. The full corporate policy is available on our web site. ____________________________________ Did you joy today? www.JOY.GR !!! From ulmo at valaraan.de Thu Aug 25 18:38:21 2005 From: ulmo at valaraan.de (manveru) Date: Fri, 26 Aug 2005 00:38:21 +0200 Subject: [Nitro] vandalized homepage In-Reply-To: <430E1062.90605@navel.gr> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> <430E1062.90605@navel.gr> Message-ID: <430E485D.5030707@valaraan.de> Anastasios Koutoumanos wrote: > TRANS wrote: > >> On 8/25/05, Martin Bernd Schmeil wrote: >> >> >>> How about introducing authentification to the wiki? There are more >>> attempts of vandalization than additions / updates.... >>> >> >> >> What kind of validation do people prefer? >> >> - graphical text entry (what's this called again?) >> - IP validation >> - Memberships >> - Other? >> >> T. >> >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> >> > why not try a combination, i.e.: > 1. frequent users can register, > 2. someone wishing to contribute should at least answer to a CAPTCHA > or other kind or question > 3. inform everyone that their contribution is logged (their ip, any > other info we can get from their client's request) > > later we could add a moderation step if wewish, but i think it > complicates things too much.... > > Tasos > i agree with you, that's a good 3-level-system level 0 guests, who can add entries, but have to answer that anti-bot thing - these entries are not going to be added immediantly someone with a higher level has to accept the modification. level 1 - the normal registered user, he is allowed to post while logged in under his name. They are also allowed to accept entries from level 0 - wich are afterwards under their resposibility and get their name mentioned... level 2 - moderator, can multi-delete entries by some criterias as timespan/author/IP..., administrate users, ban user-ids/ips... whatever i would love to have such a system :) MfG manveru From probertm at acm.org Thu Aug 25 19:03:22 2005 From: probertm at acm.org (Mark Probert) Date: Thu, 25 Aug 2005 16:03:22 -0700 Subject: [Nitro] Logger Message-ID: <1125011002.6863.6.camel@localhost.localdomain> Hi .. Following the recent thread in c.l.r, I did a quick modification of the Glue Logger class to get around the issue (I need my own Logger). Here is the diff (0.22.0 release): -----------------------< glue/logger.rb >----- 10c10 < class Logger --- > class GlueLogger < Logger 80c80 < @@global_logger = Logger.new(STDERR) --- > @@global_logger = GlueLogger.new(STDERR) 86,87c86,87 < @@global_logger = Logger.new(logger) < elsif logger.is_a?(Logger) --- > @@global_logger = GlueLogger.new(logger) > elsif logger.is_a?(GlueLogger) 150c150 < remove_const "Format" --- > # remove_const "Format" -----------------------< glue/logger.rb >----- This also means that there are also changes in the Og code. Specifically, a global replace of 'GlueLogger' for 'Logger' in the following files: og/manager.rb og/store.rb og/store/filesys.rb og/store/memory.rb og/store/psql.rb og/store/sqlite.rb og/store/kirby.rb og/store/mysql.rb og/store/sql.rb og/store/sqlserver.rb Given that these are trivial edits, I haven't given the diffs but I can on request. Thanks for the great tool! Regards, -- -mark. (probertm at acm dot org) From transfire at gmail.com Thu Aug 25 20:08:24 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 20:08:24 -0400 Subject: [Nitro] Logger In-Reply-To: <1125011002.6863.6.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> Message-ID: <4b6f054f05082517084efc7775@mail.gmail.com> Moin, Could someone explain what this logger is doing the sets it apart from the original? Thanks, T. From probertm at acm.org Thu Aug 25 21:23:55 2005 From: probertm at acm.org (Mark Probert) Date: Thu, 25 Aug 2005 18:23:55 -0700 Subject: [Nitro] Logger In-Reply-To: <4b6f054f05082517084efc7775@mail.gmail.com> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> Message-ID: <1125019435.6863.12.camel@localhost.localdomain> On Thu, 2005-08-25 at 20:08 -0400, TRANS wrote: > Moin, Could someone explain what this logger is doing the sets it > apart from the original? > It overrides the Logger class and changes the default format, and trace() methods. In addition, it turns Logger into a singleton, which kinds of hoses having your own logger(s) present. So, making it a GlueLogger < Logger gets around this. All of the Og and Glue classes can be happy with this new behaviour, and we can still have normal loggers elsewhere. The debate in c.l.r is about overriding standard class methods and behaviour. Extending is okay, IMO, modifying is another issue. In George's defence, I think that he took the code from someone else. Given the gift he has given us with Nitro and Og, this is a small price to pay ;-) Regards, -- -mark. (probertm at acm dot org) From transfire at gmail.com Thu Aug 25 22:24:10 2005 From: transfire at gmail.com (TRANS) Date: Thu, 25 Aug 2005 22:24:10 -0400 Subject: [Nitro] Logger In-Reply-To: <1125019435.6863.12.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> Message-ID: <4b6f054f050825192474dd3886@mail.gmail.com> Thanks! On 8/25/05, Mark Probert wrote: > On Thu, 2005-08-25 at 20:08 -0400, TRANS wrote: > > Moin, Could someone explain what this logger is doing the sets it > > apart from the original? > > > > It overrides the Logger class and changes the default format, and > trace() methods. In addition, it turns Logger into a singleton, which > kinds of hoses having your own logger(s) present. > > So, making it a GlueLogger < Logger gets around this. All of the Og and > Glue classes can be happy with this new behaviour, and we can still have > normal loggers elsewhere. > > The debate in c.l.r is about overriding standard class methods and > behaviour. Extending is okay, IMO, modifying is another issue. > > In George's defence, I think that he took the code from someone else. > Given the gift he has given us with Nitro and Og, this is a small price > to pay ;-) > > Regards, > > > -- > -mark. (probertm at acm dot org) > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- ( o _ ??? // trans. / \ transfire at gmail.com From james_b at neurogami.com Thu Aug 25 23:09:34 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 25 Aug 2005 20:09:34 -0700 Subject: [Nitro] Logger In-Reply-To: <1125019435.6863.12.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> Message-ID: <430E87EE.4040403@neurogami.com> Mark Probert wrote: ... > The debate in c.l.r is about overriding standard class methods and > behaviour. Extending is okay, IMO, modifying is another issue. > > In George's defence, I think that he took the code from someone else. > Given the gift he has given us with Nitro and Og, this is a small price > to pay ;-) On something of a side note, did anyone else find that thread weird? I can understand wanting to point out design or code flaws, and having a public discussion on differing opinions, but it seems perversely nasty to take free code, and, because it gave you a problem that the author almost certainly did not intend, publicly identify the code author and essentially rip him a new asshole. There are any number of ways to address such issues with a bit of tact, while still having a public discussion that doesn't point to a particular offender. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From probertm at acm.org Fri Aug 26 01:34:23 2005 From: probertm at acm.org (Mark Probert) Date: Thu, 25 Aug 2005 22:34:23 -0700 Subject: [Nitro] Logger In-Reply-To: <430E87EE.4040403@neurogami.com> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <430E87EE.4040403@neurogami.com> Message-ID: <1125034463.6863.17.camel@localhost.localdomain> On Thu, 2005-08-25 at 20:09 -0700, James Britt wrote: > There are any number of ways to address such issues with a bit of tact, > while still having a public discussion that doesn't point to a > particular offender. > This is true. I can understand the OP's upset at having to debug someone else's code. And we do the best we can. Read it like he can't really speak English in that post. I am sure that he doesn't mean to harm .. Regards, -- -mark. (probertm at acm dot org) From george.moschovitis at gmail.com Fri Aug 26 02:30:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 26 Aug 2005 09:30:07 +0300 Subject: [Nitro] Logger In-Reply-To: <430E87EE.4040403@neurogami.com> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <430E87EE.4040403@neurogami.com> Message-ID: Yeap, that was offending. I did post an answer to c.l.r (http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/3e0d03d839a45c6b) Due to the newsgroup-list bridge problems, this got somewhat lost. Perhaps it is better that way, flame wars are not really needed. But then again, posts like this (http://www.livejournal.com/users/djberg96/40192.html) are not needed either... oh well... George . On 8/26/05, James Britt wrote: > Mark Probert wrote: > ... > > > The debate in c.l.r is about overriding standard class methods and > > behaviour. Extending is okay, IMO, modifying is another issue. > > > > In George's defence, I think that he took the code from someone else. > > Given the gift he has given us with Nitro and Og, this is a small price > > to pay ;-) > > On something of a side note, did anyone else find that thread weird? I > can understand wanting to point out design or code flaws, and having a > public discussion on differing opinions, but it seems perversely nasty > to take free code, and, because it gave you a problem that the author > almost certainly did not intend, publicly identify the code author and > essentially rip him a new asshole. > > There are any number of ways to address such issues with a bit of tact, > while still having a public discussion that doesn't point to a > particular offender. > > > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Fri Aug 26 05:48:39 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 26 Aug 2005 12:48:39 +0300 (EEST) Subject: [Nitro] vandalized homepage In-Reply-To: <4b6f054f05082505437a47a84a@mail.gmail.com> References: <430D6179.1030606@bdebl.de> <4b6f054f05082505437a47a84a@mail.gmail.com> Message-ID: > What kind of validation do people prefer? > > - graphical text entry (what's this called again?) Graphical, not IP, we all connect from many pcs'... > - IP validation > - Memberships > - Other? > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Fri Aug 26 07:06:17 2005 From: transfire at gmail.com (TRANS) Date: Fri, 26 Aug 2005 07:06:17 -0400 Subject: [Nitro] iattr Message-ID: <4b6f054f05082604065fbeccae@mail.gmail.com> Hi, Since Rails has defined cattr_xxx methods as accessors to class variables, that name is not available to the more useful accessors for class instance variables. Not wanting to conflict with Rails' Active Support lib on the issue I'm leaning toward the use of iattr_xxx. Does that sit reasonably well with others? Note: I hanker not to include the mattr_xxx aliases for cattr_xxx. Please don't use those. How often, if ever, have you heard class varaibles (i.e. @@v) refered to as module variables? The whole alias business somtimes just gets a little overboard IMHO. Thoghts? -- ( o _ ??? // trans. / \ transfire at gmail.com From alang at cronosys.com Fri Aug 26 09:35:03 2005 From: alang at cronosys.com (Alan Garrison) Date: Fri, 26 Aug 2005 09:35:03 -0400 Subject: [Nitro] Logger In-Reply-To: References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <430E87EE.4040403@neurogami.com> Message-ID: <430F1A87.3060506@cronosys.com> George Moschovitis wrote: >Perhaps it is better that way, flame wars are not really needed. But >then again, posts like this >(http://www.livejournal.com/users/djberg96/40192.html) are not needed >either... > > Sure, just that you're taking someone who uses LiveJournal seriously... :P [mood | techie-emo] /humor -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From george.moschovitis at gmail.com Fri Aug 26 09:39:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 26 Aug 2005 16:39:48 +0300 Subject: [Nitro] Logger In-Reply-To: <1125019435.6863.12.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> Message-ID: The problem is that I DONT like to have GlueLogger all over the place... I prefer the solution posted in the ruby-talk mailing list. -g. On 8/26/05, Mark Probert wrote: > On Thu, 2005-08-25 at 20:08 -0400, TRANS wrote: > > Moin, Could someone explain what this logger is doing the sets it > > apart from the original? > > > > It overrides the Logger class and changes the default format, and > trace() methods. In addition, it turns Logger into a singleton, which > kinds of hoses having your own logger(s) present. > > So, making it a GlueLogger < Logger gets around this. All of the Og and > Glue classes can be happy with this new behaviour, and we can still have > normal loggers elsewhere. > > The debate in c.l.r is about overriding standard class methods and > behaviour. Extending is okay, IMO, modifying is another issue. > > In George's defence, I think that he took the code from someone else. > Given the gift he has given us with Nitro and Og, this is a small price > to pay ;-) > > Regards, > > > -- > -mark. (probertm at acm dot org) > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From transfire at gmail.com Fri Aug 26 10:31:15 2005 From: transfire at gmail.com (TRANS) Date: Fri, 26 Aug 2005 10:31:15 -0400 Subject: [Nitro] Logger In-Reply-To: References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> Message-ID: <4b6f054f050826073126b58908@mail.gmail.com> On 8/26/05, George Moschovitis wrote: > The problem is that I DONT like to have GlueLogger all over the place... > I prefer the solution posted in the ruby-talk mailing list. > What solution was that? T. From george.moschovitis at gmail.com Fri Aug 26 10:36:35 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 26 Aug 2005 17:36:35 +0300 Subject: [Nitro] Logger In-Reply-To: <4b6f054f050826073126b58908@mail.gmail.com> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <4b6f054f050826073126b58908@mail.gmail.com> Message-ID: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/153391 After a quick look I do not understand why this is better though. (And in fact I don't understand Zed's problem too). will have a look over this over the week end. -g. On 8/26/05, TRANS wrote: > On 8/26/05, George Moschovitis wrote: > > The problem is that I DONT like to have GlueLogger all over the place... > > I prefer the solution posted in the ruby-talk mailing list. > > > > What solution was that? > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From chris.farmiloe at farmiloe.com Fri Aug 26 12:36:07 2005 From: chris.farmiloe at farmiloe.com (Chris Farmiloe) Date: Fri, 26 Aug 2005 17:36:07 +0100 Subject: [Nitro] Possible improvement to setup_template_transformation pipeline In-Reply-To: <430DFEDA.7060903@navel.gr> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <430DFEDA.7060903@navel.gr> Message-ID: <4F3D7161-BEB0-421F-93BC-6AA2DB270FE9@farmiloe.com> Hi all: Problem: I have the following 'pipeline' Compiler.setup_template_transform do |template| template = Elements.transform(template) template = Template.transform(template) end if I use the render method "render_template" from a controller action, this pipeline will not get executed... leaving all my lovely and elements un-renderd Solution: To allow actions to correctly render templates other than their own using the pipeline, would it be a good idea to move the "pipeline" setup onto the Template object within glue? this should allow the templating engine to be more versitile on its own, and make the render_template work as I would expect it to? ie. Template.setup_template_transform {|t| #some stuff } Please tell me if there is a good reason for not doing this that I have neglected to see Or if this can be achieved some other way? ps: more love to the #nitro :-) chrisfarms. From deb at ysabel.org Fri Aug 26 17:08:28 2005 From: deb at ysabel.org (Ysabel) Date: Fri, 26 Aug 2005 15:08:28 -0600 Subject: [Nitro] Log of a Nitro Controller walkthrough Message-ID: <9B728BF0F3D45B17B1C3D303@[10.19.0.236]> Ended up talking about this on the IRC channel, trying to help manveru with something. He consented to having the log of that bit of our conversation put up on the wiki, and I thought it might be helpful to other folks. (Yes, I used nitro-auth as an example, since I had it handy.) http://nitrohq.com/view/Nitro_Controller_Walkthrough -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From deb at ysabel.org Fri Aug 26 19:42:13 2005 From: deb at ysabel.org (Ysabel) Date: Fri, 26 Aug 2005 17:42:13 -0600 Subject: [Nitro] Nitro-auth 0.2.0 and Nitro/Og 0.22.0 Message-ID: <90DEBFFE2F6E40C2995FFC3F@[10.19.0.236]> Given the current upcoming release of nitro 0.23, I'm not going to create a release of this unless someone desperately needs it. However, if you apply this patch to nitro-auth 0.2.0, it should work with Nitro/Og 0.22.0. diff -rN -u old-nitro-auth/lib/nitro/auth/model/user.rb new-nitro-auth/lib/nitro/auth/model/user.rb --- old-nitro-auth/lib/nitro/auth/model/user.rb 2005-08-26 17:38:08.178362800 -0600 +++ new-nitro-auth/lib/nitro/auth/model/user.rb 2005-08-26 16:32:56.000000000 -0600 @@ -91,7 +91,13 @@ # This is the canonical implementation # roles.include? Role.find_one(:where => "name = '#{role.to_s}'") # This is sort of a hack, but turns two queries into one. - not find_roles(:extra => "AND #{Role.table}.name = '#{role.to_s}'").empty? + # not find_roles(:extra => "AND #{Role.table}.name = '#{role.to_s}'").empty? + + # In either case, join tables on inherited classes don't + # resolve the way they should. This is a complete + # hack, but we'll live. + info = User.metadata[:join_tables].first + not self.class.find(:sql => "SELECT role.* from #{info[:table]} j,#{Role.table} role where j.#{info[:owner_key]} = #{oid} and j.#{info[:target_key]} = role.oid and role.name = '#{role.to_s}'").empty? end end This change is also available in the darcs repository at http://darcs.ysabel.org/nitro/nitro-auth if you want to just grab it there. Note that this patch will not work on non-SQL stores! -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From probertm at acm.org Sat Aug 27 01:38:02 2005 From: probertm at acm.org (Mark Probert) Date: Fri, 26 Aug 2005 22:38:02 -0700 Subject: [Nitro] Logger In-Reply-To: References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <4b6f054f050826073126b58908@mail.gmail.com> Message-ID: <1125121083.12212.8.camel@localhost.localdomain> Hi .. On Fri, 2005-08-26 at 17:36 +0300, George Moschovitis wrote: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/153391 > > After a quick look I do not understand why this is better though. (And > in fact I don't understand Zed's problem too). > I'll see if I can do it justice. Og is one part of my application, let's say a data collector is another. The connection info comes from the database via Og, into the collector, which fires off a threaded collection. The data comes back, is parsed, trimmed, reduced, and stored in the database. So, there is a logger for Og, a different one for the collector and a third for the parser and analyzer. Why? Cause different people are interested in different things, with the Loggers being logically at different levels. For example, if I have a communications problem collecting data, why have a whole bunch of database info gumming up the logs? Easier to have different logs than to have one and have to filter it all the time. The current design of the Glue logger a. makes it a singleton, so there is only one log possible b. changes the format, and I need the timestamp info for the comms threads Unless I am mistaken, which I could well be. A GlueLogger "fixes" both of these issues at minimum cost and no impact to third party libraries. Just my $0.02. Regards, -mark. From deb at ysabel.org Sat Aug 27 11:58:07 2005 From: deb at ysabel.org (Ysabel) Date: Sat, 27 Aug 2005 09:58:07 -0600 Subject: [Nitro] Logger In-Reply-To: <1125121083.12212.8.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <4b6f054f050826073126b58908@mail.gmail.com> <1125121083.12212.8.camel@localhost.localdomain> Message-ID: --On Friday, August 26, 2005 10:38 PM -0700 Mark Probert wrote: > Unless I am mistaken, which I could well be. A GlueLogger "fixes" both > of these issues at minimum cost and no impact to third party libraries. I would think that using log4r instead of tweaking Logger might well also solve it? -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From jeff.darklight at gmail.com Sat Aug 27 13:14:38 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Sat, 27 Aug 2005 10:14:38 -0700 Subject: [Nitro] Problems... Message-ID: Ok, I have Nitro & SQLite3 both setup as rubygems on my system. I'm trying to run the following through irb. --SCRIPT-- require 'rubygems' require 'sqlite3' require 'og' db = Og.setup( :store => :sqlite, :database => 'blah.db' ) class User property :name, String property :pass, String property :age, Fixnum has_many :comments, Comment end class Comment property :title, String property :body, String belongs_to :owner, User end a = User.new a.name = "joe blow" a.pass = "shhh" a.age = 13 b = Comment.new b.title = "Comment #1" b.body = "testing 1 2 3" a.comments << b --SCRIPT-- And at the comments << b line it blows up saying that there is no comments method for User. What am I doing wrong? j. -- "So long, and thanks for all the fish" Jeff Wood From probertm at acm.org Sat Aug 27 15:54:35 2005 From: probertm at acm.org (Mark Probert) Date: Sat, 27 Aug 2005 12:54:35 -0700 Subject: [Nitro] Logger In-Reply-To: References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <4b6f054f050826073126b58908@mail.gmail.com> <1125121083.12212.8.camel@localhost.localdomain> Message-ID: <1125172475.12212.33.camel@localhost.localdomain> Hi .. On Sat, 2005-08-27 at 09:58 -0600, Ysabel wrote: > I would think that using log4r instead of tweaking Logger might well also > solve it? > For sure. That is, of course, George's call. Given that there is already a requirement for a number of external libraries (RedCloth and Facets), adding Log4r isn't a big issue, IMO. Certainly, log4r solves the formatting issue. The singelton issue is a design level issue. Regards, -mark. From james_b at neurogami.com Sat Aug 27 18:31:18 2005 From: james_b at neurogami.com (James Britt) Date: Sat, 27 Aug 2005 15:31:18 -0700 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <430DFEDA.7060903@navel.gr> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <430DFEDA.7060903@navel.gr> Message-ID: <4310E9B6.9040605@neurogami.com> Anastasios Koutoumanos wrote: > James Britt wrote: ... >> I need to be sure that it works on a system with no Ruby. And, oddly >> enough, all four of my computers have Ruby installed. (Well, >> actually, I have a fifth computer, a C64 but it's in a box in the >> closet, so that doesn't count.) >> >> Looks like a job for VMware. Or maybe WINE? >> >> >> >> James >> >> > i'm sure we can find a 'clean' windows box in our office - you could > forward me the .exe to check it out! Thanks. I've set up a VMware instance with a bare-bones Win2K, and I'm happy to report some basic success. The app does, well, next to nothing, but the distributable exe does kick off WEBrick and allow one to load the default Nitro index.html page. Next: See if it actually loads and runs Nitro controllers and custom libs. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From james_b at neurogami.com Sat Aug 27 19:00:00 2005 From: james_b at neurogami.com (James Britt) Date: Sat, 27 Aug 2005 16:00:00 -0700 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <4310E9B6.9040605@neurogami.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <430DFEDA.7060903@navel.gr> <4310E9B6.9040605@neurogami.com> Message-ID: <4310F070.3040203@neurogami.com> James Britt wrote: ... > Thanks. I've set up a VMware instance with a bare-bones Win2K, and I'm > happy to report some basic success. > > The app does, well, next to nothing, but the distributable exe does kick > off WEBrick and allow one to load the default Nitro index.html page. > > Next: See if it actually loads and runs Nitro controllers and custom libs. Actually, in taking a second look, I found that my simple app already included a basic controller and some elementary URL mapping, and running it from the rubyscript2exe output successfully responded with some simple JSON. So I'm happy. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From transfire at gmail.com Sat Aug 27 23:01:48 2005 From: transfire at gmail.com (TRANS) Date: Sat, 27 Aug 2005 23:01:48 -0400 Subject: [Nitro] class instance attributes method names? Message-ID: <4b6f054f050827200130e234ed@mail.gmail.com> I have attr_x like methods for creating class instance attributes. Unfortuanetly Rails has set the precedence for using 'cattr' to mean accessors for class variable attributes, ie. @@v (despite their general uselessness), otherwise I would of course have used that name. So now I'm stuck with deciding another. Currently I'm using: 'iattr'. 'i' for instance. But that's a pretty bad misnomer if you think about it. Yet I don't much care for the obvious choice of 'ciattr'. Any opinions/alternatives? -- ( o _ ??? // trans. / \ transfire at gmail.com From george.moschovitis at gmail.com Sun Aug 28 02:39:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 28 Aug 2005 09:39:48 +0300 Subject: [Nitro] Problems... In-Reply-To: References: Message-ID: Hello, either define tour classes *before* Og.setup or call og.manage_classes after you define them. -g. On 8/27/05, Jeff Wood wrote: > Ok, > > I have Nitro & SQLite3 both setup as rubygems on my system. > > I'm trying to run the following through irb. > > --SCRIPT-- > require 'rubygems' > require 'sqlite3' > require 'og' > > db = Og.setup( :store => :sqlite, :database => 'blah.db' ) > > class User > property :name, String > property :pass, String > property :age, Fixnum > has_many :comments, Comment > end > > class Comment > property :title, String > property :body, String > belongs_to :owner, User > end > > a = User.new > a.name = "joe blow" > a.pass = "shhh" > a.age = 13 > > b = Comment.new > b.title = "Comment #1" > b.body = "testing 1 2 3" > > a.comments << b > --SCRIPT-- > > And at the comments << b line it blows up saying that there is no > comments method for User. > > What am I doing wrong? > > j. > > -- > "So long, and thanks for all the fish" > > Jeff Wood > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sun Aug 28 02:49:56 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 28 Aug 2005 09:49:56 +0300 Subject: [Nitro] Logger In-Reply-To: <1125172475.12212.33.camel@localhost.localdomain> References: <1125011002.6863.6.camel@localhost.localdomain> <4b6f054f05082517084efc7775@mail.gmail.com> <1125019435.6863.12.camel@localhost.localdomain> <4b6f054f050826073126b58908@mail.gmail.com> <1125121083.12212.8.camel@localhost.localdomain> <1125172475.12212.33.camel@localhost.localdomain> Message-ID: > Certainly, log4r solves the formatting issue. Maybe we can add support for log4r too. > The singelton issue is a > design level issue. The current logger is NOT a singleton, you just *can* use it as a signleton, but you can also instantiate loggers if you want. Only the formatting changes. So if we add a way to setup the format, everything works ok. (Ie we can setup the version used by Nitro differntly than the default). -g. > > Regards, > > -mark. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Sun Aug 28 02:58:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 28 Aug 2005 09:58:18 +0300 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <4310F070.3040203@neurogami.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <430DFEDA.7060903@navel.gr> <4310E9B6.9040605@neurogami.com> <4310F070.3040203@neurogami.com> Message-ID: Nice to hear, I am curious what your are planning to do :) -g. On 8/28/05, James Britt wrote: > James Britt wrote: > ... > > > Thanks. I've set up a VMware instance with a bare-bones Win2K, and I'm > > happy to report some basic success. > > > > The app does, well, next to nothing, but the distributable exe does kick > > off WEBrick and allow one to load the default Nitro index.html page. > > > > Next: See if it actually loads and runs Nitro controllers and custom libs. > > Actually, in taking a second look, I found that my simple app already > included a basic controller and some elementary URL mapping, and running > it from the rubyscript2exe output successfully responded with some > simple JSON. > > So I'm happy. > > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From jeff.darklight at gmail.com Sun Aug 28 10:33:29 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Sun, 28 Aug 2005 07:33:29 -0700 Subject: [Nitro] Problems... In-Reply-To: References: Message-ID: <4311CB39.7080705@gmail.com> George Moschovitis wrote: >Hello, > >either define tour classes *before* Og.setup or call og.manage_classes >after you define them. > >-g. > George, I did things the way you asked and got a bit farther ... Here's my script now... --SCRIPT-- require 'rubygems' require 'sqlite3' require 'og' class User property :name, String property :pass, String property :age, Fixnum has_many :comments, Comment def initialize( name, pass, age ) @name = name @pass = pass @age = age end end class Comment property :title, String property :body, String belongs_to User def initialize( title, body ) @title = title @body = body end end db = Og.setup( :store => :sqlite, :name => 'blah' ) a = User.new( "joe", "shhh", 13 ) b = Comment.new( "comment #1", "testing 1 2 3" ) a.comments << b a.save b.save c = User[ 1 ] puts c.name puts c.pass puts c.age puts "Comments Length : #{ c.comments.length }" c.comments.each { |curr| puts "#{ curr.title } -- #{ curr.body }" } --SCRIPT-- And here's the error I get: ================ SQLite3::SQLException ===================== c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/errors.rb:94:in `check' raise ( EXCEPTIONS[result] || SQLite3::Exception ), msg c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/statement.rb:70:in `initialize' Error.check( result, @db ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in `new' stmt = @statement_factory.new( self, sql ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in `prepare' stmt = @statement_factory.new( self, sql ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:274:in `query' result = prepare( sql ).execute( *bind_vars ) c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sqlite.rb:77:in `query' return @conn.query(sql) (eval):4:in `og_insert' - c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store.rb:121:in `save' obj.og_insert(self) c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:15:in `save' def save(options = nil) C:\Documents and Settings\jwood\TestRuby\ogtest.rb:37 b.save c:\ruby\lib\ruby\site_ruby\1.8/rubygems/custom_require.rb:21:in `require__' require__ path c:\ruby\lib\ruby\site_ruby\1.8/rubygems/custom_require.rb:21:in `require' require__ path ============================================= Exception: table ogcomment has no column named user_oid I guess I'm not as happy with all of the updates as some others might be ... I think I was playing with version 0.20 or 0.21 ... and all of this stuff used to work .. and I didn't used to need to call #save it just did it. It's not that I mind, it's just, well, seems things used to be simpler... I guess that's what happens when projects add features ... Anyways, if you can help, I do appreciate it. j. From james_b at neurogami.com Sun Aug 28 10:39:37 2005 From: james_b at neurogami.com (James Britt) Date: Sun, 28 Aug 2005 07:39:37 -0700 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <430DFEDA.7060903@navel.gr> <4310E9B6.9040605@neurogami.com> <4310F070.3040203@neurogami.com> Message-ID: <4311CCA9.2030808@neurogami.com> George Moschovitis wrote: > Nice to hear, I am curious what your are planning to do :) > > -g. With any luck I'll have a simple demo before too long. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From jeff.darklight at gmail.com Sun Aug 28 10:55:45 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Sun, 28 Aug 2005 07:55:45 -0700 Subject: [Nitro] Problems... In-Reply-To: References: Message-ID: <4311D071.8080004@gmail.com> George Moschovitis wrote: >Hello, > >either define tour classes *before* Og.setup or call og.manage_classes >after you define them. > >-g. > >On 8/27/05, Jeff Wood wrote: > > >>Ok, >> >>I have Nitro & SQLite3 both setup as rubygems on my system. >> >>I'm trying to run the following through irb. >> >>--SCRIPT-- >>require 'rubygems' >>require 'sqlite3' >>require 'og' >> >>db = Og.setup( :store => :sqlite, :database => 'blah.db' ) >> >>class User >> property :name, String >> property :pass, String >> property :age, Fixnum >> has_many :comments, Comment >>end >> >>class Comment >> property :title, String >> property :body, String >> belongs_to :owner, User >>end >> >>a = User.new >>a.name = "joe blow" >>a.pass = "shhh" >>a.age = 13 >> >>b = Comment.new >>b.title = "Comment #1" >>b.body = "testing 1 2 3" >> >>a.comments << b >>--SCRIPT-- >> >>And at the comments << b line it blows up saying that there is no >>comments method for User. >> >>What am I doing wrong? >> >>j. >> >>-- >>"So long, and thanks for all the fish" >> >>Jeff Wood >> >>_______________________________________________ >>Nitro-general mailing list >>Nitro-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/nitro-general >> >> >> > > > > I played a bit more with my script ... and it seems that the magical goodness of Og redefining tables doesn't work for sqlite ... so, when I blew away the sample database, it recreated things and it seems to work now. I think you should add some kind of an easy to read error message that the class definitions don't match up with the database model, and that the database model is not alterable ( as easily ) in sqlite Anyways, thanks for your help. Oh, also, I was trying to follow the example where you use User[ 'value from name field' ] and it doesn't seem to like that ... yet another incompatibility with sqlite? Thanks again. j. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050828/5865e06e/attachment.html From jeff.darklight at gmail.com Sun Aug 28 11:07:13 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Sun, 28 Aug 2005 08:07:13 -0700 Subject: [Nitro] Problems... In-Reply-To: <4311D071.8080004@gmail.com> References: <4311D071.8080004@gmail.com> Message-ID: <4311D321.6040503@gmail.com> Jeff Wood wrote: > I played a bit more with my script ... and it seems that the magical > goodness of Og redefining tables doesn't work for sqlite ... so, when > I blew away the sample database, it recreated things and it seems to > work now. > > I think you should add some kind of an easy to read error message that > the class definitions don't match up with the database model, and that > the database model is not alterable ( as easily ) in sqlite > > Anyways, thanks for your help. > > Oh, also, I was trying to follow the example where you use User[ > 'value from name field' ] and it doesn't seem to like that ... yet > another incompatibility with sqlite? > > Thanks again. > > j. > _______________________________________________ > >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > Figured I should post code... --SCRIPT-- require 'rubygems' require 'og' db = Og.setup( :store => :sqlite, :name => 'blah' ) class User property :name, String property :pass, String property :age, Fixnum has_many :comments, Comment def initialize( name, pass, age ) @name = name @pass = pass @age = age end end class Comment property :title, String property :body, String belongs_to User def initialize( title, body ) @title = title @body = body end end db.manage_classes( User, Comment ) a = User.create( "joe", "shhh", 13 ) b = Comment.create( "comment #2", "testing 4 5 6" ) a.comments << b puts a.name puts a.pass puts a.age puts "Comments Length : #{ a.comments.length }" a.comments.each { |curr| puts "#{ curr.title } -- #{ curr.body }" } c = User['joe'] puts c.name puts c.pass puts c.age puts "Comments Length : #{ c.comments.length }" c.comments.each { |curr| puts "#{ curr.title } -- #{ curr.body }" } --SCRIPT-- The blow up is at the c = User['joe'] line... the error is: ================ SQLite3::SQLException ===================== c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/errors.rb:94:in `check' raise ( EXCEPTIONS[result] || SQLite3::Exception ), msg c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/statement.rb:70:in `initialize' Error.check( result, @db ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in `new' stmt = @statement_factory.new( self, sql ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in `prepare' stmt = @statement_factory.new( self, sql ) c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:274:in `query' result = prepare( sql ).execute( *bind_vars ) c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sqlite.rb:77:in `query' return @conn.query(sql) c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/store/sql.rb:307:in `load' res = query "SELECT * FROM #{klass::OGTABLE} WHERE #{klass.pk_symbol}=#{pk}" c:/ruby/lib/ruby/gems/1.8/gems/og-0.22.0/lib/og/entity.rb:80:in `[]' ogmanager.store.load(pk, self) C:\Documents and Settings\jwood\TestRuby\ogtest.rb:45 c = User['joe'] c:\ruby\lib\ruby\site_ruby\1.8/rubygems/custom_require.rb:21:in `require__' require__ path c:\ruby\lib\ruby\site_ruby\1.8/rubygems/custom_require.rb:21:in `require' require__ path ============================================= Exception: no such column: joe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050828/bdb16601/attachment.html From kashia at vfemail.net Sun Aug 28 11:24:55 2005 From: kashia at vfemail.net (Kashia Buch) Date: Sun, 28 Aug 2005 17:24:55 +0200 Subject: [Nitro] ajax autocomplete example Message-ID: Hi I played around with the ajax example a bit and stumbled over the auto_complete function, which is not yet fully useful like this (imho). I thought, wouldn't it be better, if there was some kind of "search" mechanism built in, so you can type a few chars into the box, and then just get the corresponding items from the list. Well, I came to a solution, which is pretty much simple, but it's also crap. I wonder if there is a better way to do this. --- public/js/controls.js this.options.method = 'get'; (instead of post) --- src/controller.rb def country_auto_complete searchstring = get_ajax_value countries = %w{Greece England USA Germany Italy France Netherlands} countries.delete_if {|x| x !~ /#{searchstring}/i } build do ul { countries.each { |country| li country } } end end def get_ajax_value request = response.headers["REQUEST_URI"] /(.*)_auto_complete[^\?]*\?\1=([^&]*)/.match(request)[2] end --- public/index.xhtml

Auto complete example:

autocomplete="off", since Opera (8.02) doesn't seem to respect the el.autocomplete = "off" from javascript, and the additional name="country" to distinguish the GET value from other values and get it by that Regex. Well, while this approach certainly works quite well, as you can see, parsing the REQUEST_URI is pretty much ewwww. (I wouldn't even know how to do that stuff with POST...) What I would like to know, is there a more standard way to do this? If there isn't, here would be my idea for an api: def country_auto_complete(ajax_return_values) ... end Sadly I'm not good enough to code that myself, would love to hear your ideas. Kash -- Feel the love http://pinkjuice.com/pics/ruby.png From epiperak at softlab.ece.ntua.gr Sun Aug 28 21:26:34 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 29 Aug 2005 04:26:34 +0300 (EEST) Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <4b6f054f0508251011154a7786@mail.gmail.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <4b6f054f0508251011154a7786@mail.gmail.com> Message-ID: >> I've run the script to make the exe, but now I need a clean box to test >> it on :) >> >> I need to be sure that it works on a system with no Ruby. And, oddly >> enough, all four of my computers have Ruby installed. (Well, actually, >> I have a fifth computer, a C64 but it's in a box in the closet, so that >> doesn't count.) > > C64! Best damn computer ever made! :-) I will have to disagree. I have a ZX Spectrum (48K) with the rubber color keys. That was the best computer ever made... > >> Looks like a job for VMware. Or maybe WINE? > > Or XEN. > > Let us know how it goes. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Mon Aug 29 01:22:04 2005 From: transfire at gmail.com (TRANS) Date: Mon, 29 Aug 2005 01:22:04 -0400 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <4b6f054f0508251011154a7786@mail.gmail.com> Message-ID: <4b6f054f05082822226dccf2e1@mail.gmail.com> On 8/28/05, Emmanuel Piperakis wrote: > I will have to disagree. I have a ZX Spectrum (48K) with the rubber color > keys. That was the best computer ever made... :-) LOL. Well, maybe, but only if you're European. They didn't do as well in the States. Ah who r we kidn Amiga was the best. T. From george.moschovitis at gmail.com Mon Aug 29 02:58:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 29 Aug 2005 09:58:17 +0300 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: <4b6f054f05082822226dccf2e1@mail.gmail.com> References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082508027f933caa@mail.gmail.com> <430DF54A.1090103@neurogami.com> <4b6f054f0508251011154a7786@mail.gmail.com> <4b6f054f05082822226dccf2e1@mail.gmail.com> Message-ID: > Ah who r we kidn Amiga was the best. You never forget your first love, Atari ST was the best computer :-) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From jeff.darklight at gmail.com Mon Aug 29 19:12:57 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Mon, 29 Aug 2005 16:12:57 -0700 Subject: [Nitro] RE: Problems... Message-ID: I sent an updated email with new problems over the weekend, I've not seen any traffic on it ... does anybody have a moment to tell me what's up? I'm not near my home computer at the moment where I sent the original or I'd be reposting it ... Really, I'd love a response... Thanks in advance for any time you can spare to help me get things working properly with Og. j. -- "So long, and thanks for all the fish" Jeff Wood From epiperak at softlab.ece.ntua.gr Mon Aug 29 21:23:29 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 30 Aug 2005 04:23:29 +0300 (EEST) Subject: [Nitro] Og and Hash Message-ID: Hi, I have a question for the list: I want to make a relation between 2 classes, eg Unit and Tenant. Normally it would be something like this: class Unit has_many :tenants, Tenant end class Tenant belongs_to :unit, Unit end but I want to associate the 2 classes using a Date. Each tenant is related to a Unit with a specific Date. How can this be done? I thougt of Hashes but I am not sure how to combine the has_many, belongs_to directives with the Hash: class Unit has_many :tenants, Tenants property :leases, Hash(Date, :tenants) end The above code is of course wrong but it kind of explains what I want to do... Thanx Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Aug 29 22:57:52 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 30 Aug 2005 05:57:52 +0300 (EEST) Subject: [Nitro] Localization ? Message-ID: One more question: if I have a "property :name, String" with value, lets say @name = 'apple' can I use Localization, so that when I do in the .xhtml file something like

[@name]

it will print the name in different languages? What should I put in the yml language files in this case? Something like: conf/locales/en.yml apple: Apple conf/locales/jp.yml apple: Ringo Thanx in advance :-) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Tue Aug 30 02:47:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 30 Aug 2005 09:47:17 +0300 Subject: [Nitro] Problems... In-Reply-To: <4311D321.6040503@gmail.com> References: <4311D071.8080004@gmail.com> <4311D321.6040503@gmail.com> Message-ID: > Oh, also, I was trying to follow the example where you use User[ 'value > from name field' ] and it doesn't seem to like that ... yet another > incompatibility with sqlite? this is deprecated, use User.find_by_name(...) instead... -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Tue Aug 30 03:04:26 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 30 Aug 2005 10:04:26 +0300 Subject: [Nitro] Localization ? In-Reply-To: References: Message-ID: you can use [[@name]] in the uaml file tou put apple: Apple -g. On 8/30/05, Emmanuel Piperakis wrote: > One more question: > if I have a "property :name, String" with value, lets say @name = > 'apple' can I use Localization, so that when I do in the .xhtml file > something like

[@name]

it will print the name in different languages? > What should I put in the yml language files in this case? Something like: > conf/locales/en.yml > apple: Apple > conf/locales/jp.yml > apple: Ringo > > Thanx in advance :-) > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Tue Aug 30 03:34:31 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 30 Aug 2005 10:34:31 +0300 (EEST) Subject: [Nitro] Popups... Message-ID: Is there a specific way with Nitro/Ruby to do popups? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Tue Aug 30 03:40:30 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 30 Aug 2005 10:40:30 +0300 Subject: [Nitro] Popups... In-Reply-To: References: Message-ID: I 'll add a helper in the next version... stay tuned. -g. On 8/30/05, Emmanuel Piperakis wrote: > Is there a specific way with Nitro/Ruby to do popups? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Tue Aug 30 03:52:16 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 30 Aug 2005 10:52:16 +0300 (EEST) Subject: [Nitro] Popups... In-Reply-To: References: Message-ID: Add it to the 0.23.0 plz... !!! It is of vital importance! hehe... Thank you :-) > I 'll add a helper in the next version... stay tuned. > > -g. > > On 8/30/05, Emmanuel Piperakis wrote: >> Is there a specific way with Nitro/Ruby to do popups? >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From jeff.darklight at gmail.com Tue Aug 30 11:40:19 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Tue, 30 Aug 2005 08:40:19 -0700 Subject: [Nitro] Problems... In-Reply-To: References: <4311D071.8080004@gmail.com> <4311D321.6040503@gmail.com> Message-ID: <43147DE3.5030407@gmail.com> George Moschovitis wrote: >> Oh, also, I was trying to follow the example where you use User[ 'value >>from name field' ] and it doesn't seem to like that ... yet another >>incompatibility with sqlite? >> >> > >this is deprecated, use > >User.find_by_name(...) instead... > >-g. > > > Thanks for the response.... Man we need a fresh tutorial on Og. And we need to keep it up to date... I've been programming for years and this is really frustrating... Og is at a relatively high version number now ( almost 1 ) the API should be more solid than this. I know you're trying to make things the best they can be, but it's hard to gain traction when the project keeps pulling the rug out from under my feet. It also makes the project hard to sell to others. ( as far as trying to get other developers to use it ). j. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050830/8e383203/attachment.html From epiperak at softlab.ece.ntua.gr Tue Aug 30 21:29:05 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 04:29:05 +0300 (EEST) Subject: [Nitro] I have to bow! Message-ID: I was searching today and I found the Nitro::TableMixin !!!!!!! George you are amazing! One request: could you include a TableMixin version that has both Column Headers and Row Header? eg | Col_1 | Col_2 | Col_3 ------------------------------ Row_1 | Data | Data | Data Row_2 | Data | Data | Data If it can be easily done with this existing version, could you give an example? Thank you :-)) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Tue Aug 30 21:40:59 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 04:40:59 +0300 (EEST) Subject: [Nitro] One more request... Message-ID: could somebody give an example on the use of form_for of Nitro::FormMixin and especially explain what "an object with atrribute metadata" is? If this is a Ruby question could you pleeease point me to a url? Thanx again... Ps. I am getting really excited, because I slowly I find more and more ways to implement my non conventional app with Nitro! Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Tue Aug 30 21:57:45 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 04:57:45 +0300 (EEST) Subject: [Nitro] Dynamic Select Message-ID: Is there a way to make Dynamic Selects? eg, in pulldown selection choose option A and then pulldown options of a second menu are updated? Thanx Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From ulmo at valaraan.de Tue Aug 30 23:55:24 2005 From: ulmo at valaraan.de (manveru) Date: Wed, 31 Aug 2005 05:55:24 +0200 Subject: [Nitro] One more request... In-Reply-To: References: Message-ID: <43152A2C.2050404@valaraan.de> Emmanuel Piperakis wrote: > could somebody give an example on the use of form_for of > Nitro::FormMixin and especially explain what "an object with atrribute > metadata" is? If this is a Ruby question could you pleeease point me > to a url? > > Thanx again... > > Ps. I am getting really excited, because I slowly I find more and more > ways to implement my non conventional app with Nitro! > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > good you are asking that question :) i asked Ysabel the same question some days before and she said it is broken but should be fixed in 0.23 (wich is sometime this week i heard) i really wanted to use that, but ah... have to wait some days ^^ sorry that i can't provide you a quick fix or something, and i've got no clue about the 2 other questions you wrote to the list. though the list-update-thing could be done easily with a bit of javascript... but i think you want to know some nitro-way to do it :) so long... manveru From epiperak at softlab.ece.ntua.gr Wed Aug 31 01:07:26 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 08:07:26 +0300 (EEST) Subject: [Nitro] One more request... In-Reply-To: <43152A2C.2050404@valaraan.de> References: <43152A2C.2050404@valaraan.de> Message-ID: > though the list-update-thing could be done easily with a bit of javascript... > but i think you want to know some nitro-way to do it :) Indeed, I know how to do it with javascript. I hope there is a Nitro way, or that George provideth one ;-) > > so long... > manveru Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Wed Aug 31 02:48:59 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 09:48:59 +0300 Subject: [Nitro] Dynamic Select In-Reply-To: References: Message-ID: you have to use js or some ruby code to do this... well you have to write SOME code :) -g. On 8/31/05, Emmanuel Piperakis wrote: > Is there a way to make Dynamic Selects? eg, in pulldown selection choose > option A and then pulldown options of a second menu are updated? > > Thanx > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 31 02:50:03 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 09:50:03 +0300 Subject: [Nitro] One more request... In-Reply-To: <43152A2C.2050404@valaraan.de> References: <43152A2C.2050404@valaraan.de> Message-ID: The object->form/scaffold functionality of Nitro is greatly improved for 0.23.0 be patient... -g. On 8/31/05, manveru wrote: > Emmanuel Piperakis wrote: > > > could somebody give an example on the use of form_for of > > Nitro::FormMixin and especially explain what "an object with atrribute > > metadata" is? If this is a Ruby question could you pleeease point me > > to a url? > > > > Thanx again... > > > > Ps. I am getting really excited, because I slowly I find more and more > > ways to implement my non conventional app with Nitro! > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > > {To explore is Human, to Create is Devine, > > To teach is Primal, to Rule is Sin} > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > good you are asking that question :) > i asked Ysabel the same question some days before and she said it is > broken but should be fixed in 0.23 (wich is sometime this week i heard) > i really wanted to use that, but ah... have to wait some days ^^ > sorry that i can't provide you a quick fix or something, and i've got no > clue about the 2 other questions you wrote to the list. > though the list-update-thing could be done easily with a bit of > javascript... but i think you want to know some nitro-way to do it :) > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Wed Aug 31 05:30:18 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 12:30:18 +0300 (EEST) Subject: [Nitro] Dynamic Select In-Reply-To: References: Message-ID: > you have to use js or some ruby code to do this... > well you have to write SOME code :) No need to argue on that, I was just asking if there was a smarter/faster way... > > -g. > > On 8/31/05, Emmanuel Piperakis wrote: >> Is there a way to make Dynamic Selects? eg, in pulldown selection choose >> option A and then pulldown options of a second menu are updated? >> >> Thanx >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Wed Aug 31 05:31:43 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 31 Aug 2005 12:31:43 +0300 (EEST) Subject: [Nitro] One more request... In-Reply-To: References: <43152A2C.2050404@valaraan.de> Message-ID: > The object->form/scaffold functionality of Nitro is greatly improved for 0.23.0 > be patient... > Eagerly anticipating your next release... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From rainhead at gmail.com Wed Aug 31 05:38:44 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Wed, 31 Aug 2005 02:38:44 -0700 Subject: [Nitro] Can't set initialize for controller Message-ID: Good Morning, So, I'm just starting to write my first Nitro app, and am a little stumped by this. I have a default controller (Nitro.run Game). Everything's just peachy until I define initialize for that controller, which seems to be a normal thing to do. Nitro throws errors like this: ERROR: Error while handling '/'. ERROR: undefined method `session' for nil:NilClass /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb: 167:in `session' /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/flash.rb:82:in `flash' (eval):5:in `index_action' ... etc ideas? pointers? Thanks, Peter From george.moschovitis at gmail.com Wed Aug 31 05:42:51 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 12:42:51 +0300 Subject: [Nitro] Can't set initialize for controller In-Reply-To: References: Message-ID: Hello, You probably have to call super from the initialize method. -g. On 8/31/05, Peter Abrahamsen wrote: > Good Morning, > > So, I'm just starting to write my first Nitro app, and am a little > stumped by this. I have a default controller (Nitro.run Game). > Everything's just peachy until I define initialize for that > controller, which seems to be a normal thing to do. Nitro throws > errors like this: > > ERROR: Error while handling '/'. > ERROR: undefined method `session' for nil:NilClass > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/render.rb: > 167:in `session' > /usr/lib/ruby/gems/1.8/gems/nitro-0.22.0/lib/nitro/flash.rb:82:in > `flash' > (eval):5:in `index_action' > ... etc > > ideas? pointers? > > Thanks, Peter > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 31 11:49:14 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 18:49:14 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.23.0 Scaffolding reloaded, Taggable, Nano/Mega integration... Message-ID: Hello everyone, New versions of Nitro (Web Application Framework) and Og (Object Relational Mapping) were released: Homepage: http://www.nitrohq.com Download: http://rubyforge.org/projects/ nitro Mailing List: http://rubyforge.org/mailman/l istinfo/nitro-general The summer vacations are over and there is a brand new Nitro release. There is a preview of the new Scaffolder (also handles Og relations), support for Tagging (folksonomy), lots of small features and improvements and many bug fixes. Additionally, the code has been restructured to utilize the excellent Nano and Mega support libraries. Most notable additions: * Scaffolding reloaded. The scaffolding infrastructure is reimplemented to generate more flexible code. The automatically generated forms allow for visualization and editing of Og relations such as HasMany and BelongsTo. For example when rendering a BelongsTo relation all possible parents are presented with a select element. When rendering a HasMany relation a list of all children is presented. Moreover, an experimental admin component is provided. Just add the line: require 'part/admin' and surf http://www.mysite.com/admin To enter a simple administration screen. WARNING: This feature is considered a preview and will be improved in a future version. * Major cleanup in the Glue subproject. Some files are moved to the nano/mega project. Nano/Mega is now used throughout Nitro and really makes development so much easier. * Introduced Og Taggable mixin. It was never easier to add tagging to your application. class Article include Og::Taggable .. end article.tag('navel', 'gmosx', 'nitro') article.tags article.tag_names Article.find_with_tags('navel', 'gmosx') Article.find_with_any_tag('name', 'gmosx') t = Article::Tag.find_by_name('ruby') t.articles t.articles.count For an example usage of this Mixin, consult the Spark sources. * Added support for relative and absolute URLs in redirects and renders. This feature simplifies the creation of reusable components. * Support for assigning compound objects from the request. Here is an example: class Article property :title, String property :body, String end
article = request.assign('article') Alternatively you can use the article[title] article[body] notation. * Added simple Benchmarking mixin. * Added support for 'evolving' a single Og managed class. Useful when you are in development mode and change your schema. * Added support for session garbage collection. * Many many small bug fixes in Og and Nitro. Nitro provides everything you need to develop professional Web applications using Ruby and Javascript. Nitro redefines Rapid Application Development by providing a clean, yet efficient API, a layer of domain specific languages implemented on top of Ruby and the most powerful and elegant object relational mapping solution available everywhere. Nitro is Web 2.0 ready, featuring excellent support for AJAX, XML, Syndication while staying standards compliant. Nitro gives choice to the developer: Multiple paradigms are implemented, incorporating ideas from Rails, CherryPy, Catalyst, Wee, PHP, JSP and Microsoft.NET and more. The developer is free to choose the pattern that better fits his application. This kind of freedom makes Nitro applicable to a wide range of applications, spanning from big, scalable web sites with thousands of concurrent users to simple solutions for deployment on intranet desktops. have fun :) George Moschovitis -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 31 11:53:00 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 18:53:00 +0300 Subject: [Nitro] [ANN] Nitro Spark 0.5.0 Tagging support Message-ID: Hello everyone, I am proud to announce a new version of Spark. Spark is an advanced Wiki powered by Nitro and Og. The aim of this project is to provide a canonical example of using Nitro to build a Web application. An older version of Spark powers www.nitrohq.com Homepage: http://www.nitrohq.com Download: http://rubyforge.org/projects/ nitro The highlight of this release is Tagging support. Moreover, the code is updated to be compatible with the latest Nitro/Og release. have fun, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Aug 31 12:01:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 31 Aug 2005 19:01:17 +0300 Subject: [Nitro] Nitro 0.23.0 Message-ID: Dear devs, Nitro 0.23.0 was kind of rushed in order to support the release of a bigger nitro example. This release will follow tomorrow. However, I suggest updating to the latest version as it contains numerous bug fixes. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From ulmo at valaraan.de Wed Aug 31 13:25:13 2005 From: ulmo at valaraan.de (manveru) Date: Wed, 31 Aug 2005 19:25:13 +0200 Subject: [Nitro] Nitro 0.23.0 In-Reply-To: References: Message-ID: <4315E7F9.1020807@valaraan.de> George Moschovitis wrote: >Dear devs, > >Nitro 0.23.0 was kind of rushed in order to support the release of a >bigger nitro example. >This release will follow tomorrow. However, I suggest updating to the >latest version as it >contains numerous bug fixes. > >regards, >George. > > > so this is why nitrogen is broken? maybe it's some fault of my nano-installation, but i just did a 'gem update nitro' and said yes to every dependency what makes me wonder is 'nano/dir/recurse'... ####/snip/#### /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- nano/dir/recurse (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/bin/nitrogen:6 from /usr/bin/nitrogen:18 ####/snap/#### From citizen428 at gentoo.org Wed Aug 31 13:36:11 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Wed, 31 Aug 2005 19:36:11 +0200 Subject: [Nitro] Nitro 0.23.0 In-Reply-To: <4315E7F9.1020807@valaraan.de> References: <4315E7F9.1020807@valaraan.de> Message-ID: <20050831193611.4be36c5f@localhost> On Wed, 31 Aug 2005 19:25:13 +0200 manveru wrote: > maybe it's some fault of my nano-installation, but i just did a 'gem > update nitro' and said yes to every dependency > what makes me wonder is 'nano/dir/recurse'... Nah, it seems to be a bug in nano (one of the deps) and I've already reported it on Rubyforge. It's a real shame, because without this bug Nitro 0.23.0 would already be in the unstable tree. I had all ebuilds ready ca. 1 hour after the release... Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From transfire at gmail.com Wed Aug 31 14:37:11 2005 From: transfire at gmail.com (TRANS) Date: Wed, 31 Aug 2005 14:37:11 -0400 Subject: [Nitro] Nitro 0.23.0 In-Reply-To: <20050831193611.4be36c5f@localhost> References: <4315E7F9.1020807@valaraan.de> <20050831193611.4be36c5f@localhost> Message-ID: <4b6f054f0508311137241b3fd3@mail.gmail.com> On 8/31/05, Michael Kohl wrote: > On Wed, 31 Aug 2005 19:25:13 +0200 > manveru wrote: > > > maybe it's some fault of my nano-installation, but i just did a 'gem > > update nitro' and said yes to every dependency > > what makes me wonder is 'nano/dir/recurse'... > > Nah, it seems to be a bug in nano (one of the deps) and I've already > reported it on Rubyforge. It's a real shame, because without this bug > Nitro 0.23.0 would already be in the unstable tree. I had all ebuilds > ready ca. 1 hour after the release... The name of that method changed in Nano b/c it is a class method not an instance method (I had to draw some sort of distinction) To require it "in the raw" it should be: require 'nano/dir/%3A%3Arecurse' And that's probably how George will do it. But to be thurough, one could also use a built-in URI-escaping require: require 'nanoreq' # if not already loaded require_nano 'dir/::recurse' I think George is off for the day, so he'll fix tomorrow. In the mean time it shouldn't be too hard to find and fix manually. T. From citizen428 at gentoo.org Wed Aug 31 14:44:21 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Wed, 31 Aug 2005 20:44:21 +0200 Subject: [Nitro] Nitro 0.23.0 In-Reply-To: <4b6f054f0508311137241b3fd3@mail.gmail.com> References: <4315E7F9.1020807@valaraan.de> <20050831193611.4be36c5f@localhost> <4b6f054f0508311137241b3fd3@mail.gmail.com> Message-ID: <20050831204421.6c1dec9e@localhost> On Wed, 31 Aug 2005 14:37:11 -0400 TRANS wrote: > The name of that method changed in Nano b/c it is a class method not > an instance method Stupid me, now that I look at the hex codes, I see that they are :!?, viz. characters which aren't all that strange in Ruby method names... Thanks for pointing this out, it makes a lot more sense now. :) Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From jeff.darklight at gmail.com Wed Aug 31 16:49:59 2005 From: jeff.darklight at gmail.com (Jeff Wood) Date: Wed, 31 Aug 2005 13:49:59 -0700 Subject: [Nitro] Nano & Mega Message-ID: So, I remember seeing some errors in the mailing list about nano &| mega having problems with nitro... Do they work? or What's the issue? j. -- "So long, and thanks for all the fish" Jeff Wood -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050831/80dc9269/attachment.html From julian at coretech.net.au Wed Aug 31 20:03:54 2005 From: julian at coretech.net.au (Julian Leviston) Date: Thu, 1 Sep 2005 10:03:54 +1000 Subject: [Nitro] Dynamic Select In-Reply-To: References: Message-ID: No, it's going to be javascript. On 31/08/2005, at 4:48 PM, George Moschovitis wrote: > you have to use js or some ruby code to do this... > well you have to write SOME code :) > > -g. > > On 8/31/05, Emmanuel Piperakis wrote: > >> Is there a way to make Dynamic Selects? eg, in pulldown selection >> choose >> option A and then pulldown options of a second menu are updated? >> >> Thanx >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From transfire at gmail.com Wed Aug 31 21:28:50 2005 From: transfire at gmail.com (TRANS) Date: Wed, 31 Aug 2005 21:28:50 -0400 Subject: [Nitro] Nano & Mega In-Reply-To: References: Message-ID: <4b6f054f050831182819d6978e@mail.gmail.com> On 8/31/05, Jeff Wood wrote: > So, I remember seeing some errors in the mailing list about nano &| mega > having problems with nitro... > > Do they work? or What's the issue? One bug in Nano that was trouble for windows users, but it has been fixed. There was also one in the new realease of Nitro which will ceratinly be fixed by tomorrow afternoon as well. T.