You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(35) |
Nov
(38) |
Dec
(112) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(24) |
Mar
(47) |
Apr
(18) |
May
(28) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(14) |
Oct
(5) |
Nov
(26) |
Dec
(31) |
2003 |
Jan
(8) |
Feb
(14) |
Mar
(38) |
Apr
(34) |
May
(33) |
Jun
(32) |
Jul
(24) |
Aug
(9) |
Sep
|
Oct
(20) |
Nov
(43) |
Dec
(22) |
2004 |
Jan
(23) |
Feb
(25) |
Mar
(15) |
Apr
(3) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(15) |
Nov
(3) |
Dec
(5) |
2005 |
Jan
|
Feb
|
Mar
(16) |
Apr
(24) |
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(3) |
Dec
(2) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Teemu A. <te...@io...> - 2004-02-13 23:41:27
|
> - We're using Locale::Maketext for everything > - Every package can define a set of message files (normally in msg/); I used to work for a project that had 20 translations. We first used opaque IDs for identifying the strings. We soon noticed it was hard to translate, because once you translated the string from english to some other language, you don't see the original english string anywhere unless you put it in comments or look for it in the orginial english translation file. My question for opaque IDs is: how do you easily improve a translation if the keys are not based on the base language (comparing original to current, making modifications...)? Another thing was the self-documenting aspects of having the base language key in the code. Consider for example: $lh->maketext( 'Hello [_1], today is [_2]', $username, $date ); vs: $lh->maketext( 'desktop.welcome', $username, $date ); If you are first time reading the code, it's not always obvious what that peace of code will actually produce unless you search the translation file at the same time. Now another point: It is very common that some projects just never have 100% complete translations and it is common that translation files lacking latest improvements have some required keys missing. In that case I would suggest the logic: 1. look for requested key from the requested translation (e.g. spanish) 2. If not found, look for requested key from the default translation (english) 3. If not found, produce error This way you can still use 100% translations that are made for some older versions, although some strings might appear in english. If you consider using base language as keys, consider working around the global key problem (if I understood correctly, the keys have to be unique, even over package boundaries). For example, Maketext objects could be initialized for each package, so that the key name-space is unique for every package. Very useful, in my opinion.. you never know what strings or keys some other project will use. > these use a slightly modified Java message bundle syntax (easy to > write!) In my opinion you should use gettext (PO files), because there are easy translation project management tools available for programs using gettext. I for example find Kbabel brilliant for that job: http://i18n.kde.org/tools/kbabel/ This tool for example hides the syntax details (editing hand results very often in syntax errors, even if the file is easy to edit), resulting in perfectly formatted files. This tool also tells you statistics of each translation: how many strings translated, how many % translated, how many fuzzy strings you have (.po format has this nice # ,fuzzy thing, which enables you to mark certain translation as "being under consideration".. imagine translating from english to chinese.. the translation is not always obvious). Also, easy navigation like "next untranslated string" helps a lot when you get into a mood of translating, when you don't have to look for untranslated or fuzzy translations by eye. Built-in spell checking (!) and dictionary-helper also helps maintaining basic quality of the translation. Syntax highlight etc.. Also, many translators are not techies. Even a simple file could be hard to modify by hand and remember all the syntax. Believe me, the small learning curve could affect their willing to try the translation process at all. There are also a plenty of graphical translation tools available for Windows and Unix that support the gettext system. > I'm in the middle of creating english localization files all the > packages shipped with OI2. Talk about a boring job... :-) Another point why to use base language strings as keys here: you could easily write a script that goes through your script, extracts strings from commands like $lh->maketext( 'Hello [_1], today is [_2]', $username, $weekday ) and generate a translation file for you. This way you could just improve the english translation in your code and then generate an up to date version of the translation file. In your FAQ you state: "if you change the key in the base language even for punctuation you'll need to change all of them" I solved this problem by writing a script that compared old and new strings and replaced them in the translation files. No more doing it by hand. I also wrote a script that compared each foreign translation to the base translation and added missing translation keys from base translation to foreign translation files and also produced a warning if foreign translation files contained keys not present in base translation (very common if you typo things or remove old keys form base translation). Also, gnu gettext utils also contain some really useful tools for development like msgfmt. It is helpful for checking translation file syntax, produce some statistics etc. msgcmp compares two .po files finding differencies like missing msgid strings. Hope this helps, Teemu Arina Ionstream Oy / Dicole Komeetankuja 4 A 02210 Espoo FINLAND Tel: +358-(0)50 - 555 7636 http://www.mimerdesk.org http://www.dicole.fi/en |
From: Chris W. <ch...@cw...> - 2004-02-13 22:17:08
|
On Feb 13, 2004, at 2:15 PM, Teemu Arina wrote: > ... > For Chris, I would like to hear more about the final details how > internationalization is going to be implemented in the next release, > before I > start to work on my own =) I just posted updated docs to the SF site. http://openinteract.sourceforge.net/docs/oi2-snapshot/ In particular you want to read: http://openinteract.sourceforge.net/docs/oi2-snapshot/OpenInteract2/ Manual/I18N.shtml The thirty-second version: - We're using Locale::Maketext for everything - Every package can define a set of message files (normally in msg/); these use a slightly modified Java message bundle syntax (easy to write!) - All message files for all languages get read in at server startup and classes for Locale::Maketext generated from them - On every request OI determines what language you're using (customizable, of course) I don't have the template interaction there yet -- basically, TT2 will have two global functions in your template namespace: # Grab a message from the correct message bundle using # $message_key and interpolating any arguments as # necessary MSG( $message_key, [ arg1, arg2, ... ] ) # Return a Locale::Maketext handle LH() Programmatically you grab a Locale::Maketext handle from the request object: my $lh = CTX->request->language_handle; Let me know if you have any ideas/features/improvements in this area. I've tried to make it as easy as possible to ship localized applications by allowing the packages to define their own messages. And retrieving the messages is I think also pretty simple. I'm in the middle of creating english localization files all the packages shipped with OI2. Talk about a boring job... :-) Later, Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Teemu A. <te...@io...> - 2004-02-13 19:25:42
|
> serious: I really believe that OI is currently the best plattform for > developing web applications with Perl. I agree. I tried several platforms (for example, Mason) after moving to OI. I personally like the quality of the code and available documentation produced for OI in top of the basic features that do everything smoothly what I need for a web application server. I also checked Zope out but I didn't like the ammount of features they have put into it, resulting in a quite of a learning curve to know how to do things the correct way. I also find OI very lightweight and SPOPS very effective in performance. I call it "Zope without the bloat" =) The only lack in OI I find is easy creation of content without the need to create templates (I call them Fields) and also the possibility to build Validators (basic user input validation for the fields. For example a number based field for age should only contain numbers) and Constructors (converting abstract Field types to something like HTML based fields or something else). In plone they have Archetypes (formerly CMFTyles) for such and in some other languages like Java I think they call them FieldEditors. Earlier on this list I told I'm working on such an higher level platform based on OI and the alpha sources are already available and it sure reduces the development time of web applications. Based on my efforts I have worked this week on a File Manager that features tree view, icon view and detailed view of files with meta-data. Some nice features include cut/copy/paste files and downloading selected files and directories as Zip or Tar/gz and also uncompressing such files in the server side. For Chris, I would like to hear more about the final details how internationalization is going to be implemented in the next release, before I start to work on my own =) -- Best regards, Teemu Arina Ionstream Oy / Dicole Komeetankuja 4 A 02210 Espoo FINLAND Tel: +358-(0)50 - 555 7636 http://www.mimerdesk.org http://www.dicole.fi/en |
From: Chris W. <ch...@cw...> - 2004-02-13 18:46:10
|
On Feb 13, 2004, at 12:03 PM, Jim Howard wrote: >> But some of my colleagues are a bit apprehensive about there >> not being any updates since september... Is there a reason >> to be nervous? Are there any new (1.x or 2.x) releases in the >> pipeline? > > I have to admit I was a bit nervous when openinteract.org/com went > away, as > we have been using OI in production for almost 2 or 3 years now. Sorry about that. The company where it's hosted is having some problems maintaining it. That has *zero* effect on the state of OI, but I realize that appearances are very important. I hope to get all the OI stuff onto one of my own servers in the next few months -- I have someone who will do the hosting for me, but I need to buy a rackmount server and get it loaded up. The "buy" part of that statement is the only holdup now :-) > We're very much looking forward to OI2 which we will celebrate with a > big > refactoring of our own code and new server hardware. It would be great if when you're doing that you keep track of what tripped you up (or worked really well!) so we can feed that back into the docs. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Jim H. <ja...@tr...> - 2004-02-13 17:05:58
|
> But some of my colleagues are a bit apprehensive about there > not being any updates since september... Is there a reason > to be nervous? Are there any new (1.x or 2.x) releases in the pipeline? I have to admit I was a bit nervous when openinteract.org/com went away, as we have been using OI in production for almost 2 or 3 years now. But then I subscribed to the commits mailing list and indeed saw Good Mr. Winters committing code just last night. We're very much looking forward to OI2 which we will celebrate with a big refactoring of our own code and new server hardware. -Jim |
From: Andreas N. <an...@kl...> - 2004-02-13 16:16:21
|
On Fri, 2004-02-13 at 14:35, Salve Nilsen wrote: > Hi! > > We're considering on using OpenInteract as a CMS at my workplace, mostly > because of SPOPS and the plugin architecture (and the fact that OI is > quite cool :) - sounds familiar > > But some of my colleagues are a bit apprehensive about there not being > any updates since september... Is there a reason to be nervous? Are > there any new (1.x or 2.x) releases in the pipeline? 1.x is only being maintained to fix bugs, but will probably not get any new featurs. You still can expect help from the mailing lists. Our company ( arvato direct services ) chose OI 1 two years ago as out platform of choice for our intranet applications, currently running with about 1000 clients, and also some end user internet sites. We still invest heavily into that architecture in the near future ( software for call centers, workflow systems, etc.). >From that experience I can tell you, that OI 1 is a production class system already and I currently do not know of any bugs. 2.x is still being actively developed, but in the end of last year we distracted Chris Winters mind a bit towards a new area, which he put quite some effort in. I expect him too release the first live signs of that project soon, which will of course integrate nicely with OI. ( Hint: it will be all about Workflows in Perl... ) To my knowledge, Chris is currently extremely busy in his day job, leaving not as much time for OI. Having met him in person though, I would always bet on him going on with OI 2 soon. Also, OI 2 is already running smooth. If you think about production usage, though - you got to go for OI 1 now. If you wrap your application logic around SPOPS, then it should not be too hard to port you app later to OI 2.x . > > Any lifesign would be very much appreciated. :) ping ;-) serious: I really believe that OI is currently the best plattform for developing web applications with Perl. Do you have any specific questions yet ? later, Andreas |
From: Chris W. <ch...@cw...> - 2004-02-13 15:55:22
|
On Feb 13, 2004, at 8:35 AM, Salve Nilsen wrote: > We're considering on using OpenInteract as a CMS at my workplace, > mostly because of SPOPS and the plugin architecture (and the fact that > OI is quite cool :) > > But some of my colleagues are a bit apprehensive about there not being > any updates since september... Is there a reason to be nervous? Are > there any new (1.x or 2.x) releases in the pipeline? > > Any lifesign would be very much appreciated. :) The 1.x branch is fairly stable and will generally only get bugfixes from now on. The 2.x branch is under active development (with periodic pauses) and the next beta/release-candidate should be out in a week or two. (Honest!) It includes quite a few changes from the previous beta, including internationalization support plus lots of stuff under the hood. If you're just starting out with a project I strongly recommend using 2.0. It has much better documentation and architecture than 1.x. It also runs under more environments, not just Apache 1.x. More soon.... Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Salve N. <sal...@me...> - 2004-02-13 13:37:15
|
Hi! We're considering on using OpenInteract as a CMS at my workplace, mostly because of SPOPS and the plugin architecture (and the fact that OI is quite cool :) But some of my colleagues are a bit apprehensive about there not being any updates since september... Is there a reason to be nervous? Are there any new (1.x or 2.x) releases in the pipeline? Any lifesign would be very much appreciated. :) kind regards, - Salve J. Nilsen -- Salve J. Nilsen <sa...@me...>, Systems Developer met.no, IT-department, Section Development |
From: Chris M. <Chr...@te...> - 2004-02-06 14:52:30
|
=20 I got it all figured out. I knew what I wanted to do, I just didn't = know where to do it. I ended up stuffing the apache->params into the = template as usual in Page.pm -> show_displayable_page =20 Thanks for the tip! ;-) -----Original Message----- From: And...@Be... [mailto:And...@Be...] Sent: Friday, February 06, 2004 3:09 AM To: Chris McDaniel; ope...@li... Subject: AW: [Openinteract-help] quick template/url params question Hi Chris, =20 if I remember right, then you should be able to do the following: =20 - edit the page object and enable template processing ( base_page = package ) - look at the documentation of the OI module for the template toolkit, = which use can include in the template - with this you should be able to get to the $R object somehow =20 hope that starts ya... =20 Andreas -----Urspr=FCngliche Nachricht----- Von: Chris McDaniel [mailto:Chr...@te...]=20 Gesendet: Freitag, 6. Februar 2004 07:29 An: ope...@li... Betreff: [Openinteract-help] quick template/url params question Hello,=20 If you have a page on the filesystem (foo.html say) and type in the URL = bar www.host.com/foo.html?var1=3Dtest is there any way to access "var1" = from the URL string with the templating language? Thanks,=20 Chris McDaniel=20 |
From: <And...@Be...> - 2004-02-06 08:11:34
|
Hi Chris, =20 if I remember right, then you should be able to do the following: =20 - edit the page object and enable template processing ( base_page = package ) - look at the documentation of the OI module for the template toolkit, = which use can include in the template - with this you should be able to get to the $R object somehow =20 hope that starts ya... =20 Andreas -----Urspr=FCngliche Nachricht----- Von: Chris McDaniel [mailto:Chr...@te...]=20 Gesendet: Freitag, 6. Februar 2004 07:29 An: ope...@li... Betreff: [Openinteract-help] quick template/url params question Hello,=20 If you have a page on the filesystem (foo.html say) and type in the URL = bar www.host.com/foo.html?var1=3Dtest is there any way to access "var1" = from the URL string with the templating language? Thanks,=20 Chris McDaniel=20 |
From: Chris M. <Chr...@te...> - 2004-02-06 06:29:17
|
Hello, If you have a page on the filesystem (foo.html say) and type in the URL = bar www.host.com/foo.html?var1=3Dtest is there any way to access "var1" = from the URL string with the templating language? Thanks,=20 Chris McDaniel |
From: Chris W. <ch...@cw...> - 2004-01-22 22:34:07
|
On Jan 22, 2004, at 5:19 PM, Vsevolod (Simon) Ilyushchenko wrote: > A minor annoyance - the generated mutator methods do not assign the > undef value to attributes. Sometimes it's a desired behavior. It would > be cool if this could be turned on or off via a configuration option. I actually did think of this one -- in the docs for SPOPS.pm is the following: ---------- You should use the hash interface to get and set values in your object -- it is easier. However, SPOPS will also create an accessor/mutator/clearing-mutator for you on demand -- just call a method with the same name as one of your properties and two methods ('${fieldname}' and '${fieldname}_clear') will be created. Similar to other libraries in Perl (e.g., L<Class::Accessor|Class::Accessor>) the accessor and mutator share a method, with the mutator only being used if you pass a defined value as the second argument: ... # This won't do what you want (clear the field value)... $object->fieldname( undef ); # ... but this will $object->fieldname_clear; ---------- So you should be able to call $object->foo_clear and assign 'foo' undef. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Vsevolod (S. I. <si...@cs...> - 2004-01-22 22:19:52
|
Chris, A minor annoyance - the generated mutator methods do not assign the=20 undef value to attributes. Sometimes it's a desired behavior. It would=20 be cool if this could be turned on or off via a configuration option. BTW, my issue with upper case in field names only shows up when I use=20 the function call interface, not the hash interface. Thanks, Simon --=20 Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com The unknown is honoured, the known is neglected - until all is known. The C=FA Chulaind myth |
From: Stathy G T. <sto...@tu...> - 2004-01-12 17:23:52
|
>Dicole is going to be the total rewrite (sequel) of MimerDesk >(www.mimerdesk.org), a groupware I created during the years. This time I'm >going to make the sources a little bit more maintainable. This is very interesting as I am working on much the same thing (custom groupware apps). I look forward to peeking at what you have done with OpenInteract and your groupware application. Thanks for the info, |
From: Teemu A. <te...@io...> - 2004-01-12 03:18:09
|
Hello, for a while we have been developing a nice object oriented toolkit for making application development on OpenInteract easy. The main idea is that when creating applications, you don't have to creaty _any_ templates for your project. Dicole core just provides generic templates for different content and an object oriented interface to hide all dirty template parameter details. That way you may build sites completely out of widgets. Site layout is controlled completely through CSS and the page sources are based on XHTML. I have extended the toolkit with a system called Dicole::Generictool. Most applications that work with some sort of data objects usually are satisfactory when they provide at least functionality to add, list, remove, show and edit objects. Generictool addresses just those, adds a couple of nice features and makes everything easy to extend. For example, here is sample code of my current "list" handler method that features browsing, sorting, searching and listing of objects and some fields: sub list { my ( $class, $p ) = @_; my ( $R, $tool, $gentool ) = $class->_common_init( params => $p ); $tool->Path->add( name => 'List users' ); # Modify tool object to contain our form in a single legend box $tool->Container->box_at( 0, 0 )->set_name( 'List of users' ); $tool->Container->box_at( 0, 0 )->add_content( $gentool->get_list( 'list' ) ); return $R->template->handler( $tool->get_template_handler_structure ); } Not too many lines of code =). _common_init basically only defines the object fields with some added meta-data. Generictool also takes care of input validation. Here is my add method, for example: sub add { my ( $class, $p ) = @_; my ( $R, $tool, $gentool ) = $class->_common_init( params => $p ); $tool->Path->add( name => 'Add new user' ); if ( $R->apache->param( 'save' ) ) { ( $p->{return_code}, $p->{return} ) = $gentool->validate_input( $gentool->visible_fields('add'), { clear_output => 1 } ); if ( $p->{return_code} ) { $p->{return} = "User has been saved."; } else { $p->{return} = sprintf( "Failed adding user: %s", $p->{return} ); } $tool->set_return( $p->{return_code}, $p->{return} ); } # Modify tool object to contain our form in a single legend box $tool->Container->box_at( 0, 0 )->set_name( 'New user details' ); $tool->Container->box_at( 0, 0 )->add_content( $gentool->get_add( 'add' ) ); return $R->template->handler( $tool->get_template_handler_structure ); } No single template needed for that handler, either. Dicole is going to be the total rewrite (sequel) of MimerDesk (www.mimerdesk.org), a groupware I created during the years. This time I'm going to make the sources a little bit more maintainable. I try to keep the documentation if the source code complete so using it shouldn't be a problem in anyone is interested to try it so early in the development. Links: The current unstable CVS is browsable here: http://www.mimerdesk.org/cgi-bin/cvsweb.cgi/dicole/ Dicole documentation (draft, partly incomplete): http://inf.dicole.fi/dicole_docs/ Generictool documentation: http://inf.dicole.fi/dicole_docs/Dicole/Generictool.html Example handler code: http://www.mimerdesk.org/cgi-bin/cvsweb.cgi/dicole/pkg/user_manager/OpenInteract/Handler/UserManager.pm?rev=1.50&content-type=text/x-cvsweb-markup Example application for trying the results out (Mozilla recommended): http://dev1.dicole.fi/Usermanager/ Latest CVS checkout: cvs -d :pserver:ano...@mi...:/opt/cvs login Login with blank password (Just press enter). cvs -d :pserver:ano...@mi...:/opt/cvs checkout dicole -- Sincerely, Teemu Arina mimerdesk.org |
From: Vsevolod (S. I. <si...@cs...> - 2004-01-07 18:49:46
|
Chris, When an object is retrieved from cache, SPOPS->new is called with the $p parameter being the actual object. Then a new object is created by copying the data. (In normal cases $p is just a hashref, not an SPOPS object.) However, on line 138 $p->{default_values} is called. When $p is a hashref, it's okay. When $p is an SPOPS object with strict field checking turned on, it generates a warning. Simon -- Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com America's business leaders simply don't want to think about complex technology issues - they want to think about golf. Microsoft promises them that. Andrew Grygus, www.aaxnet.com |
From: Chris W. <ch...@cw...> - 2004-01-07 01:38:02
|
On Jan 6, 2004, at 2:55 PM, Vsevolod (Simon) Ilyushchenko wrote: >> Ugh, that blows. I'm going to introduce a initialize_custom() method >> to SPOPS.pm which you can override to do whatever you want. This is a >> very useful feature and I can't believe it's not there already. > > Cool - should be useful. This is in CVS now -- if you're interested LMK and I'll make a dist available. >> You still need to initialize your SPOPS classes before trying to use >> 'Job'. See the tarball above for my example. > > OH!!! You are doing this OUTSIDE of the classes! Thanks, got it! > > But... this violates encapsuliation... though I see how you have to go > outside of the box to define the circular relationships... Yeah... what you're doing is defining an object and inheriting all the persistent behavior. Even though the class with the persistent behavior isn't defined until you create it using SPOPS::Initialize. (Perl lets you do this.) The previous normal practice for SPOPS was to define a class with your custom behavior and bring it in using the 'code_class' configuration key. This is such an ugly hack I shouldn't even discuss it :-) > BTW, do I understand correctly that links_to objects are loaded in a > lazy manner, that is, they are not fetched until the method to access > them is explicitly invoked? Correct. I have a strong aversion to systems that load dependencies automatically because you wind up fetching a huge graph when you want a simple object. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Vsevolod (S. I. <si...@cs...> - 2004-01-07 00:21:30
|
Chris, I have tried to use caching, because otherwise the linked_to attributes are retrieved anew every time, making any kind of change to them non-permanent. However, it does not work. I was only able to get it to work by overriding use_cache() and returning 1 in my SPOPS superclass. Here's what happens: The first time a DB call happens, SPOPS tries to get the data from the global cache. Irregardless of whether it was found or not, skip_cache is incremented: DBI.pm <pre> sub fetch { .. if ( ref $p->{data} eq 'HASH' ) { $obj = $class->new({ %{ $p->{data} }, skip_default_values => 1 }); } else { $obj = $class->get_cached_object({ %{ $p }, id => $id }); $p->{skip_cache}++; # Set so we don't re-cache it later } .. $obj->_fetch_post_process($p, $level); } </pre> Note that the last thing in the fetch() function is a call to _fetch_post_process in SPOPS.pm: <pre> sub _fetch_post_process { my ( $self, $p, $level ) = @_; # Create an entry for this object in the cache unless either the # class or this call to fetch() doesn't want us to. $self->set_cached_object( $p ); </pre> _fetch_post_process calls set_cached_object() in SPOPS.pm. Note that this will fail if use_cache() returns 1; <pre> sub set_cached_object { my ( $self, $p ) = @_; return undef unless ( ref $self ); return undef unless ( $self->id ); return undef unless ( $self->use_cache( $p ) ); return $self->global_cache->set({ data => $self }); } </pre> Finally, use_cache() is: <pre> sub use_cache { return undef unless ( $USE_CACHE ); my ( $class, $p ) = @_; return undef if ( $p->{skip_cache} ); return undef if ( $class->no_cache ); return undef unless ( $class->global_cache ); return 1; } </pre> We check $p->{skip_cache}, which was set to 1 after an unsuccessful call to get(), return undef from use_cache()... and never call cache::set()! I think the fix is simple - you should increment skip_cache after get() in fetch() only if ( ref $obj eq $class ) You use the same check literally one line below in determining whether or not to access the database. Simon -- Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com America's business leaders simply don't want to think about complex technology issues - they want to think about golf. Microsoft promises them that. Andrew Grygus, www.aaxnet.com |
From: Chris W. <ch...@cw...> - 2004-01-06 18:27:22
|
On Jan 6, 2004, at 11:32 AM, Vsevolod (Simon) Ilyushchenko wrote: >> Okay, I've got a test script + classes that has this setup with >> strict field checking and field autodiscovery. > > Sorry, no script was attached. :( Dratted mailing list managers! Try: http://www.cwinters.com/raw/book_sample.tar.gz >>> 1. My classes have a superclass. Let's call it MyObject. So I >>> inherit MyBooks from SPOPS_Books and MyObject. I have to >>> double-dispatch the new() method, but I can live with it. >> This might be a problem. How are you dispatching new()? > > Nothing fancy - in MyObject: > sub new > { > my ($proto) = shift; > my %args = %{$_[0]}; > > my $self = $proto->SUPER::new(@_); > $self->_new(\%args); > > return $self; > } > > MyObject inherits from ProtoObject, which is a parent also to > non-SPOPS classes. In ProtoObject, _new() calls $self->new(), and > everybody's happy. Since only one ugly method was introduced, this is > not a big deal. Ugh, that blows. I'm going to introduce a initialize_custom() method to SPOPS.pm which you can override to do whatever you want. This is a very useful feature and I can't believe it's not there already. > Thanks - that helped my script to compile! However, when I added > another line: > Job->fetch(1) > I got this: > > Can't locate package SPOPS_Job for @Job::ISA at script.pl line 5. > Can't locate package SPOPS_Job for @Job::ISA at script.pl line 6. > Can't locate package SPOPS_Job for @Job::ISA at script.pl line 6. > Can't locate object method "fetch" via package "Job" at script.pl line > 6. You still need to initialize your SPOPS classes before trying to use 'Job'. See the tarball above for my example. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Vsevolod (S. I. <si...@cs...> - 2004-01-06 16:33:03
|
> > Okay, I've got a test script + classes that has this setup with strict > field checking and field autodiscovery. Sorry, no script was attached. :( > >> 1. My classes have a superclass. Let's call it MyObject. So I inherit >> MyBooks from SPOPS_Books and MyObject. I have to double-dispatch the >> new() method, but I can live with it. > > This might be a problem. How are you dispatching new()? Nothing fancy - in MyObject: sub new { my ($proto) = shift; my %args = %{$_[0]}; my $self = $proto->SUPER::new(@_); $self->_new(\%args); return $self; } MyObject inherits from ProtoObject, which is a parent also to non-SPOPS classes. In ProtoObject, _new() calls $self->new(), and everybody's happy. Since only one ugly method was introduced, this is not a big deal. > As an aside: you can also use the kludge of storing it in a field named > 'tmp_foo' -- anything that starts with 'tmp_' is ignored by the tie > implementation. (Did I mention that I hate tie? :-) Okay, I'll try to work with this. > One thing I noticed is that you have a 'require SPOPS_Job' in Job and a > corresponding one for Task. Get rid of that, you don't need it and might > be causing the problem: Thanks - that helped my script to compile! However, when I added another line: Job->fetch(1) I got this: Can't locate package SPOPS_Job for @Job::ISA at script.pl line 5. Can't locate package SPOPS_Job for @Job::ISA at script.pl line 6. Can't locate package SPOPS_Job for @Job::ISA at script.pl line 6. Can't locate object method "fetch" via package "Job" at script.pl line 6. Simon -- Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com America's business leaders simply don't want to think about complex technology issues - they want to think about golf. Microsoft promises them that. Andrew Grygus, www.aaxnet.com |
From: Chris W. <ch...@cw...> - 2004-01-06 00:53:56
|
On Jan 5, 2004, at 5:52 PM, Vsevolod (Simon) Ilyushchenko wrote: > At the risk of being a pain, I'll repost my two previous questions > about links_to: I have a current project which is stalled because of > them. Hope I'll be able to help. > This refers to the solution that you suggested when I do this: > > SPOPS class: SPOPS_Books > Your class: MyBooks isa SPOPS_Books > SPOPS class: SPOPS_Publisher > Your class: MyPublisher isa SPOPS_Publisher > > Then declare in your publisher configuration: > > links_to => { MyBooks => 'link_table' } Okay, I've got a test script + classes that has this setup with strict field checking and field autodiscovery. It all works ok with: Book isa Book_Persist Book linksto Publisher Publisher isa Publisher_Persist Publisher linksto Book Files are attached in book_sample.tar.gz > 1. My classes have a superclass. Let's call it MyObject. So I inherit > MyBooks from SPOPS_Books and MyObject. I have to double-dispatch the > new() method, but I can live with it. This might be a problem. How are you dispatching new()? > Obviously, I can turn strict fields checking off, but I'd like to > retain that. The alternative is to somehow keep autodiscovery, but add > in the config hash of SPOPS_Books additional fields which correspond > to "instance variables" of MyObject. I am not sure how to do it, but > even if I could, it's messy because I'll have to repeat it in every > SPOPS_* class. This can be made a little less messy if I do not > inherit from MyObject, but store a reference to it, but this one > reference still has to be mentioned in SPOPS config. As an aside: you can also use the kludge of storing it in a field named 'tmp_foo' -- anything that starts with 'tmp_' is ignored by the tie implementation. (Did I mention that I hate tie? :-) > 2. I am trying to use objects that refer to each other, and I use > links_to in both configuration. (I call them Job and Task, but they > are similar in their relationship to Publisher and Book). > > I attach the four class files and the script that tries to use them. > I inherit Job from SPOPS_Job and Task from SPOPS_Task. The SPOPS > configuration refers to Common.pm, which would be different in your > case. One thing I noticed is that you have a 'require SPOPS_Job' in Job and a corresponding one for Task. Get rid of that, you don't need it and might be causing the problem: > The error message is: > Cannot run behavior in [links_to] [SPOPS_Job]: Failed to retrieve > configuration from Compilation failed in require at Job.pm line 5. Let me know about the 'new()' dispatch and whether the sample works for you and if it's different than your setup in any way other than the common inherited class. (It uses SQLite like before) Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Vsevolod (S. I. <si...@cs...> - 2004-01-05 22:53:01
|
Chris, At the risk of being a pain, I'll repost my two previous questions about links_to: I have a current project which is stalled because of them. This refers to the solution that you suggested when I do this: SPOPS class: SPOPS_Books Your class: MyBooks isa SPOPS_Books SPOPS class: SPOPS_Publisher Your class: MyPublisher isa SPOPS_Publisher Then declare in your publisher configuration: links_to => { MyBooks => 'link_table' } 1. My classes have a superclass. Let's call it MyObject. So I inherit MyBooks from SPOPS_Books and MyObject. I have to double-dispatch the new() method, but I can live with it. However, I use strict field checking and field autodiscovery. When I begin to store attributes in MyObject via the regular Perl getter/setter methods which use $self as a hashref, I start to get SPOPS errors about accessing fields that are not present. Obviously, I can turn strict fields checking off, but I'd like to retain that. The alternative is to somehow keep autodiscovery, but add in the config hash of SPOPS_Books additional fields which correspond to "instance variables" of MyObject. I am not sure how to do it, but even if I could, it's messy because I'll have to repeat it in every SPOPS_* class. This can be made a little less messy if I do not inherit from MyObject, but store a reference to it, but this one reference still has to be mentioned in SPOPS config. 2. I am trying to use objects that refer to each other, and I use links_to in both configuration. (I call them Job and Task, but they are similar in their relationship to Publisher and Book). I attach the four class files and the script that tries to use them. I inherit Job from SPOPS_Job and Task from SPOPS_Task. The SPOPS configuration refers to Common.pm, which would be different in your case. There are four possible configurations: SPOPS_Job links to SPOPS_Task, SPOPS_Task links to SPOPS_Job SPOPS_Job links to Task, SPOPS_Task links to SPOPS_Job SPOPS_Job links to SPOPS_Task, SPOPS_Task links to Job SPOPS_Job links to Task, SPOPS_Task links to Job The first three work, but the last one, which is of greater interest, does not. Could you please look at this and tell me if I am doing anything wrong? The error message is: Cannot run behavior in [links_to] [SPOPS_Job]: Failed to retrieve configuration from Compilation failed in require at Job.pm line 5. The tables that the config files refer to are created thusly: CREATE TABLE `Job` (`job_id` int(11)); CREATE TABLE `Task` (`task_id` int(11)); CREATE TABLE `JobToTask` (`id` int(11), `job_id` int(11), `task_id` int(11)); Thanks, Simon -- Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com America's business leaders simply don't want to think about complex technology issues - they want to think about golf. Microsoft promises them that. Andrew Grygus, www.aaxnet.com |
From: Chris W. <ch...@cw...> - 2004-01-05 16:30:40
|
On Jan 5, 2004, at 10:26 AM, Stefano di Sandro wrote: > Hello Chris and everyone, > and Happy new year! Same to you! > May be I'm boring... or I've missed something... > but www.openinteract.org/com seems to be down > > Is there an obfuscated reason ? The company that maintains the site and domains may be having some problems with them. IIRC they're running on *ancient* versions of OI (1.07 or so) and have been stable for a long time. (I suspect OI was upgraded on the machine, but we'll see.) I'd really like to consolidate these and the SF site under one domain/box but I'm waiting for some $$ to pickup a rackmount server and relying on the generosity of some folks for bandwidth. Might be a few months... I'll see about helping them get the oi.org/com sites back online though. Thanks for the note. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Chris W. <ch...@cw...> - 2004-01-05 16:02:18
|
On Jan 5, 2004, at 10:43 AM, Igor Sutton Lopes wrote: > I'm having a trouble obtaining the object's id after saving it. > According > documentation you should use something like: > > my $obj = eval { $empresa->save }; > > $id_empresa = $obj->id_empresa; > > But it is always returning undef. > > I'm using SPOPS (the last version from CPAN) and Perl 5.8.0. Try: my $new_id = $obj->id; Also, if you're using auto-incrementing fields this may mean you're not using the right SPOPS DBI implementation. In your configuration you must have the right implementation for the driver (e.g., 'SPOPS::DBI::MySQL') as well as the field 'increment_field' set to a true value, like in this example: my %conf = ( object => { class => 'My::Object', isa => [ qw/ SPOPS::DBI::MySQL SPOPS::DBI / ], field => [ qw/ id_empressa foo bar / ], id_field => 'id_empressa', increment_field => 'yes', base_table => 'empressa' }, ); And if you're using Oracle/Postgres you need to specify a sequence name as well. Good luck! Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Stefano di S. <st...@an...> - 2004-01-05 15:27:23
|
Hello Chris and everyone, and Happy new year! May be I'm boring... or I've missed something... but www.openinteract.org/com seems to be down. Is there an obfuscated reason ? Bye, Stefano |