|
From: Chris W. <la...@us...> - 2001-10-22 05:41:00
|
Update of /cvsroot/openinteract/SPOPS/doc/Manual In directory usw-pr-cvs1:/tmp/cvs-serv519/doc/Manual Modified Files: Configuration.pod Log Message: added configuration information for 'default_values' Index: Configuration.pod =================================================================== RCS file: /cvsroot/openinteract/SPOPS/doc/Manual/Configuration.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Configuration.pod 2001/10/12 19:39:07 1.6 --- Configuration.pod 2001/10/22 05:40:57 1.7 *************** *** 43,56 **** The name of the class SPOPS will build. ! B<code_class> (\@) An arrayref of class names that will be read in as additional behaviors to the SPOPS-generated class. ! B<field> (\@) An arrayref of fieldnames used in this object. ! B<strict_field> (bool) A flag indicating whether to use strict field checking. --- 43,56 ---- The name of the class SPOPS will build. ! B<code_class> (\@) (optional) An arrayref of class names that will be read in as additional behaviors to the SPOPS-generated class. ! B<field> (\@) (optional if setting dynamically) An arrayref of fieldnames used in this object. ! B<strict_field> (bool) (optional) A flag indicating whether to use strict field checking. *************** *** 63,67 **** they're also used in the normal ISA fashion as class ancestors. ! B<rules_from> (\@) An arrayref of classes to read class factory behaviors and object --- 63,67 ---- they're also used in the normal ISA fashion as class ancestors. ! B<rules_from> (\@) (optional) An arrayref of classes to read class factory behaviors and object *************** *** 75,79 **** object. Currently, multi-field primary keys are not supported. ! B<column_group> (\%) Used by the lazy loading process to determine the group-to-fieldname --- 75,79 ---- object. Currently, multi-field primary keys are not supported. ! B<column_group> (\%) (optional) Used by the lazy loading process to determine the group-to-fieldname *************** *** 81,85 **** information on lazy loading. ! B<field_map> (\%) A hashref of field-to-field relationships so you can make an object --- 81,85 ---- information on lazy loading. ! B<field_map> (\%) (optional) A hashref of field-to-field relationships so you can make an object *************** *** 90,123 **** field mapping. ! B<multivalue> (\@) List all fieldnames that can hold multiple values. Currently the only native support for this is in L<SPOPS::LDAP|SPOPS::LDAP>, but you can also use it along with some object rules to fake relationships. ! B<no_insert> (\@) List of fields not to use when creating a new object in the datastore. ! B<no_update> (\@) List of fields not to update when saving a previously saved object. ! B<skip_undef> (\@) You can elect not to include a field that's undefined when saving or updating an object by including it in this list. ! B<creation_security> (\%) If you're using security, specify here what security the object will have when it's first created. ! B<no_security> (bool) If true, the object won't use security even if L<SPOPS::Secure|SPOPS::Secure> is in the C<isa>. ! B<no_cache> (bool) If true, the object won't be cached even if the application specifies --- 90,137 ---- field mapping. ! B<default_values> (\%) (optional) + Hashref of field names and default values for the fields when the + object is initialized with C<new()>. + + One problem with setting default values in your object configuration + B<and> in your database is that the two may become unsynchronized, + resulting in many pulled hairs when debugging. + + To get around the synchronization issue, you can set this dynamically + using various methods with + L<SPOPS::ClassFactory|SPOPS::ClassFactory>. (A sample, + C<My::DBI::FindDefaults>, is shipped with SPOPS.) + + B<multivalue> (\@) (optional) + List all fieldnames that can hold multiple values. Currently the only native support for this is in L<SPOPS::LDAP|SPOPS::LDAP>, but you can also use it along with some object rules to fake relationships. ! B<no_insert> (\@) (optional) List of fields not to use when creating a new object in the datastore. ! B<no_update> (\@) (optional) List of fields not to update when saving a previously saved object. ! B<skip_undef> (\@) (optional) You can elect not to include a field that's undefined when saving or updating an object by including it in this list. ! B<creation_security> (\%) (required if you're using security) If you're using security, specify here what security the object will have when it's first created. ! B<no_security> (bool) (optional) If true, the object won't use security even if L<SPOPS::Secure|SPOPS::Secure> is in the C<isa>. ! B<no_cache> (bool) (optional) If true, the object won't be cached even if the application specifies *************** *** 143,147 **** query information to it. ! B<as_string_order> (\@) Ordered list of object fields to use when the C<as_string()> method is --- 157,161 ---- query information to it. ! B<as_string_order> (\@) (optional) Ordered list of object fields to use when the C<as_string()> method is *************** *** 149,158 **** listed in the C<field> configuration key. ! B<as_string_label> (\%) Hashref of object field-to-label mappings used when the C<as_string()> method is called. ! B<has_a> (\%) Metadata for SPOPS to use when building a relationship from one object --- 163,172 ---- listed in the C<field> configuration key. ! B<as_string_label> (\%) (optional) Hashref of object field-to-label mappings used when the C<as_string()> method is called. ! B<has_a> (\%) (optional) Metadata for SPOPS to use when building a relationship from one object *************** *** 164,168 **** more information. ! B<fetch_by> (\@) A list of fields that tell SPOPS you want to create special methods --- 178,182 ---- more information. ! B<fetch_by> (\@) (optional) A list of fields that tell SPOPS you want to create special methods *************** *** 187,191 **** L<SPOPS::DBI|SPOPS::DBI> in it. ! B<base_table> ($) Table name for data to be stored. This may be modified during the --- 201,205 ---- L<SPOPS::DBI|SPOPS::DBI> in it. ! B<base_table> ($) Table name for data to be stored. This may be modified during the *************** *** 194,198 **** C<table_name()> class method. ! B<sql_defaults> (\@) List of fields that have defaults defined in the SQL table. For --- 208,212 ---- C<table_name()> class method. ! B<sql_defaults> (\@) (optional) List of fields that have defaults defined in the SQL table. For *************** *** 205,210 **** object to ensure that the data in the object and the data in the database are synced. ! ! B<field_alter> (\%) Allows you to define different formatting behaviors for retrieving --- 219,223 ---- object to ensure that the data in the object and the data in the database are synced. ! B<field_alter> (\%) (optional) Allows you to define different formatting behaviors for retrieving *************** *** 228,232 **** =head2 General Relationship Fields ! B<links_to> (\%) The 'links_to' field allows you to specify a SPOPS alias and specify --- 241,245 ---- =head2 General Relationship Fields ! B<links_to> (\%) (optional) The 'links_to' field allows you to specify a SPOPS alias and specify |