Document::Object
my $doc = new Document::Object;
$doc->state($state);
my $cid = $doc->comment( undef, { author => "Me", subject => "My Subject", text => "Comment to be appended" } ); my @comments = $doc->comment(); my $comment = $doc->comment(42);
my $text = $doc->diff($revA, $revB);
my $wid = $doc->watcher( undef, { name => "Me", email => "myself@mydomain.com" } );
This class encapsulates information about a generic document and operations for altering its properties. A document is assumed to be a collection of one or more files, with metadata.
Creates a new document object. Accepts the following arguments in %args:
repository - a valid Document::Repository object doc_id - the integer document ID this object represents
Returns the most recent error message as a string. Returns undef or a blank string if no error has been logged.
Gets or adds comments in change log. Returns undef on error.
Retrieves the contents of a file in the document from the document repository, or, if $content is defined, stores the content into the file.
Returns undef on error and logs an error message that can be retrieved via get_error().
Gets or sets the state of the document. The following states are valid:
new open accepted rejected broken retired
If a state not in this list is used, the function will return undef and log an error.
If called with no argument, returns the current state.
Returns a hash of all properties for the document.
Updates general properties about the document. Accepts a hash of key/value pairs corresponding to properties to set. Only properties provided as arguments will be updated; other properties will be left unchanged.
Retrieves the value of one property of the document.
Returns an array of the keywords for this document.
Replaces the keywords for the document with those specified.
Adds the given keywords to the document. This does not remove any existing keywords, but it does check to make sure we're not adding any that are already included. All added keywords are changed to lowercase, have any ';' characters changed into ',' and leading and trailing space is trimmed off.
Deletes the given keywords from the document. This operates in a case insensitive manner.
Gets or sets the comment information for a given comment ID $cid, or adds a new $comment if $cid is not defined, or returns all of the comments as an array if neither parameter is specified.
To install Document::Manager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Document::Manager
CPAN shell
perl -MCPAN -e shell install Document::Manager
For more information on module installation, please visit the detailed CPAN module installation guide.