Changes for version 0.39 - 2001-02-25
- SPOPS.pm, SPOPS/Tie.pm, SPOPS/DBI.pm: Created a 'saved' flag within the tied hash so that we always know whether a record has been retrieved from a data store or not.
- SPOPS/DBI.pm: Prompted by Christian Lemburg <clemburg@aixonix.de>: modify check_action_security() to see whether the action is an add or not, and if so pass back SEC_LEVEL_WRITE since SPOPS relies on your application to ensure that a user can create an object. (Should SPOPS implement this? Let us know on the openinteract-dev mailing list at http://lists.sourceforge.net/lists/listinfo/openinteract-dev) Also added documentation to the save() method.
- SPOPS/DBI.pm, SPOPS/Key/Random.pm, SPOPS/Key/DBI/*.pm: Modified how the pre_fetch_id() and post_fetch_id() methods are called -- instead of passing a db handle/statement handle as the arguments, instead put everything in a hashref and read from that. (Prompted by the fact that SPOPS/Key/Random.pm was trying to use a DBI database handle as the width for the random code to generate. Ouch!)
- SPOPS/Configure.pm: Thanks to questions and notes from Leon Brocard <acme@astray.com>, we added documentation for the 'has_a' configuration item for an SPOPS object as well as gave developers the ability to define a custom alias for the returned object alias. For instance, you can do something like:
- user => { field => [ 'user_id', 'group_id', 'email' ], id_field => 'user_id', class => 'My::User', has_a => { 'My::Group' => [ { group_id => 'zanybrainy' } ] ..., },
- and call the 'zanybrainy' method of a C<My::User> object to get back the associated C<My::Group> object. (This is a silly example but it means we don't have to rely solely on the clunky automatic naming anymore.)
- SPOPS/DBI/MySQL.pm: post_fetch_id() now first checks to see if the 'increment_field' of the class configuration is set to a true value and if so retrieves the value from the handle.
- **THIS REQUIRES A CHANGE!!**
- From now on to use AUTO_INCREMENT fields in MySQL and SPOPS, you must set:
- 'increment_field' => 1
- in the SPOPS configuration file for that class.
- SPOPS/DBI/Sybase.pm: post_fetch_id() now first checks to see if the 'syb_identity' field of the class configuration is set to a true value and if so retrieves the value from the handle. This is no retrofit issue at all since we already required this.
- SPOPS/DBI.pm: _save_insert() now retrieves a db handle and passes it to both the pre_fetch_id() and post_fetch_id() methods as well as the appropriate (insert/update) SQLInterface method.
- SPOPS.pm: added 'Storable' to the ISA list of SPOPS, which means that every SPOPS object can now call store(), retrieve() and nstore() get serialized in a network-transportable format. Cool. Implications of this have yet to shake out, however.
- **POSSIBLE INTERFACE CONFLICT!!**
- If you are using a routine with any of the following names:
- store() retrieve() nstore()
- then you will not be able to use the methods from Storable. If you don't plan to use Storable then this is no big deal, but if you do then you'll have to rename your class methods.
- SPOPS/Tie.pm: Functionality for doing field consistency checking is now in the new SPOPS/Tie/StrictField.pm, which allows you to create an SPOPS object without field restrictions and serialize it to a datasource. This might not seem useful at first -- why not just serialize a hashref? -- but we can treat all these objects the same which will (trust me) be important to you at some time or other. You also get builtin serialization and other fun stuff for free.
- SPOPS/Key/Random.pm, SPOPS/Key/DBI/Pool.pm, SPOPS/Key/DBI/Identity.pm, SPOPS/Key/DBI/HandleField.pm: Moved all key-generation functions to the SPOPS::Key hierarchy. The Identity.pm and HandleField.pm came out of SPOPS/DBI/Sybase.pm and SPOPS/DBI/MySQL.pm, respectively, and Pool.pm is a rewritten SPOPS/DBI/Keypool.pm. SPOPS/DBI/RandomCode.pm was just renamed to Random.pm. (Hope that makes sense!) This might cause a little pain but we'll see if we can keep backward compatibility.
- SPOPS.pm, SPOPS/DBI.pm, t/dbi.t: Applied patches from Rick Myers <rik@sumthin.nu> to eliminate warnings regarding undefined items under -w.
- SPOPS/GDBM.pm, t/gdbm.t: Applied patches from Rick Myers <rik@sumthin.nu> to properly deal with GDBM_WRCREAT permissions on new GDBM databases.
Modules
Simple Perl Object Persistence with Security
read in configuration information for collections and create/configure
Define additional configuration methods
Install variables, subroutines and process inherited rulesets per class
Implement SPOPS class, serializing into a DBI database
MySQL-specific code for DBI collections
Creates a random code for the ID field
Sybase-specific routines for the SPOPS::DBI
Centralized error messages from all SPOPS objects.
Store SPOPS objects in a GDBM database
Implement as objects files containing perl hashrefs dumped to text
Implement a security object and basic operations
Create and manipulate users.
Retrieve IDENTITY values from a supported DBI database
Retrieves ID field information from a pool
Creates a random alphanumeric code for the ID field
Generic routines for DBI database interaction
Implement security across one or more classes of SPOPS objects
Define hierarchical security
Simple class implementing tied hash with some goodies
Enable field checking for SPOPS objects
Utility methods for SPOPS objects
Provides
in SPOPS/Key/DBI/HandleField.pm
in SPOPS/HashFile.pm