Fixed syntactic errors in Onis::Plugins::Core, Onis::Data::Persistent::None, Onis...
[onis.git] / lib / Onis / Data / Persistent.pm
index 73df88f..8c08f28 100644 (file)
@@ -18,9 +18,6 @@ internal data for longer than one run..
 
 use Onis::Config qw#get_config get_checksum#;
 
-@Onis::Data::Persistent::EXPORT_OK = qw##;
-@Onis::Data::Persistent::ISA = ('Exporter');
-
 our $StoreModule = 'None';
 
 =head1 CONFIGURATION OPTIONS
@@ -59,12 +56,15 @@ if (get_config ('storage_module'))
        if ($@)
        {
                print STDERR $/, __FILE__, ": Could not load storage module ``$StoreModule''. Are you sure it exists?";
+               print STDERR $/, __FILE__, ": Error while loading was: $@";
                exit (1);
        }
 
        unshift (@Onis::Data::Persistent::ISA, $mod_name);
 }
 
+return (1);
+
 =head1 INTERFACE
 
 The child-modules have to provide the following interface:
@@ -81,17 +81,24 @@ world - a table. The name must be unique for each calling method's namespace.
 
 Since this is a constructor it returns an object. The object "knows" the folling methods:
 
-=item B<$data-E<gt>put> (I<$name>, I<$key>, I<@fields>)
+=item B<$data-E<gt>get> (I<$key>) 
+
+Returns the data associated with the given I<$key> pair or an empty list if no
+data has been stored under this tupel before..
+
+=item B<$data-E<gt>put> (I<$key>, I<@fields>)
 
 Stores the given values in the data structure. How this is done is described
 below in L<another paragraph>. Doesn't return anything. The number of entries
 in I<@fields> has to match the number of entries in I<@field_names> when
 creating the object using B<new>.
 
-=item B<$data-E<gt>get> (I<$name>, I<$key>) 
+=item B<$data-E<gt>keys> ([I<$field>, ...])
 
-Returns the data associated with the given I<$name>/I<$key> pair or an empty
-list if no data has been stored under this tupel before..
+Returns a list of all the keys defined for this object. If one field is given
+the list will be sorted by that field's values, if more fields are given the
+list is sorted with the first field taking precedence over the others. If no
+field is supplied the order is undefined.
 
 =back
 
@@ -122,16 +129,9 @@ Backend modules will probably read the entire data at startup and save
 everything at the end. Another strategy might be reading (at least trying to)
 an entry when it's first tried to B<get>..
 
-Another problem might be if/when a module needs a list of keys. I think almost
-all plugins need this.. I'll probably add a B<keys> method to which you can
-tell which field to use for sorting.. That might make it a lot easier for
-database-backends..
-
 =head1 AUTHOR
 
 Florian octo Forster, L<octo@verplant.org>. Any comments welcome as long as I
 haven't started implementing this ;)
 
 =cut
-
-exit (0);