NAME

OpenInteract::SPOPS - Define common behaviors for all SPOPS objects in the OpenInteract Framework

SYNOPSIS

# In configuration file
'myobj' => {
   'isa'   => [ qw/ ... Interact::SPOPS ... / ],
}

DESCRIPTION

Here we provide some common operations within OpenInteract that are not implmented within the data abstraction layer itself. One of the reasons for that is that we want to continue using both separately, so we cannot embed ideas like a configuration object or a particular cache implementation within SPOPS. Think of this class as a bridge between the two.

METHODS

log_action( $action, $id )

Wrapper for the log_action_enter method below, decides whether it gets called. (Wrapper exists so subclasses can call log_action_enter directly and not deal with this step.)

Returns undef on failure, true value on success.

log_action_enter( $action, $id )

Makes an entry into the 'object_track' table, which logs all object creations, updates and deletions. We do not note the content that changes, but we do note who did the action and when it was done.

Returns undef on failure, true value on success.

fetch_creator()

Retrieve an arrayref of all user objects who have 'creator' rights to a particular object.

is_creator( $uid )

Return 1 if the object was created by $uid, undef if not.

fetch_updates()

Return an arrayref of arrayrefs, formatted:

[ uid of updater, date of update ]

notify()

Either call from an object or from a class passing an arrayref of objects to send to a user. Calls the as_string() method of the object, which (if you look in the SPOPS docs), defaults to being a simple property -> value listing. You can override this with information in your class configuration which specifies the fields you want to use in the listing along with associated labels.

html_encode( $text )

Returns: escaped version of $text (e.g., the character '"' will be replaced by ")

html_decode( $text )

Returns: unescaped version of $text (e.g., the entity " will be replaced by the character '"')

It may seem silly to have these html_ methods which currently just call the method of an external module, but we might wish to do more in the future (for example, screen out javascript>. This way, we have a central place to change it.

NOTES

TO DO

BUGS

COPYRIGHT

Copyright (c) 2001 intes.net, inc.. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>