From: <an...@io...> - 2004-12-11 00:42:31
|
Hi Coder! I think OI2 uses SPOPS instead of Class::DBI as object persistence and database mapping. Chris might have added some config options and other code to ease the transition to Class::DBI, but I'm not sure if such a conversion has ever been done / tested to work. My suggestion would be to go for SPOPS. It has a decent documentation but some difficulties might arise from the fact that OI2 uses ini files to generate the SPOPS object configuration instead of plain perl which OI1 uses. Most of the examples in SPOPS documentation are from OI1 era and thus the syntax is presented just as perl hashes. In OI1 the SPOPS object configuration was set in packages conf/spops.perl (a perl syntax config) and nowadays it is in conf/spops.ini (an ini syntax config). OI2 has some helper scripts to convert the old .perl files to the .ini syntax but the ini syntax should not be very hard to figure out when you know what you want to express. First you should probably read the SPOPS documentation, especially the configuration part ( http://spops.sourceforge.net/doc/SPOPS/Manual/Configuration.shtml ) or OI1 Developer's guide ( http://www.openinteract.org/docs/developer.shtml ) to get an idea how to build has_a (for the parent) and links_to (for the children) relations and then read the light OI2 documentation to get the idea on how to express these thing in .ini files. The has_many relation you might be familiar with from Class::DBI does not yet exist in SPOPS. I believe it is being worked on ( on testing phase with lots of arm wrestling on some details =) ) at the moment, but you can manage quite well without it since links_to can be used to achieve the same result. As you might notice OI2 has not yet reached stable status and does not even carry 2.0 version number so things like throughout documentation are still a bit lacking. The code itself is in my experience quite stable and we are using it in production environment (*eeeks*) but it surely has quite a learning curve especially with some parts lackin documentation. Good luck! - Antti Coder wrote amont other things: > Each object can tell you what it's children are and each child it's parent when > queried using the correct method. > > These are the main functions I am having probelms translating into 'OI2 speak'. > > Can anyone shed some light? I have looked through the archives, but have to > admit am a little more confused. The OI2 Tutorial is good, but uses only a one > table, and the Advanced Tutorial does not appear to have been written as yet. > > I have seen reference to the fact that Class::DBI could be incorporated, but no > concrete examples of how. > > This is the last stumbling block for me before I migrate my apps to OI2, so your > assistance is much appreciated. > > Ticha |