WE::DB::Content - the content database for the web.editor
$content_db = new WE::DB::Content($root, $content_db_directory);
The content database contains the real contents (HTML, text, images) of the objects in the object database.
The Content database is usually created in the WE::DB object.
WE::DB
Initializes the content database. This means that the directory holding the content files is created.
Store the $content (which is a string) for object with id $objid. Dies on failure. Existing content is not overwritten in case of errors.
Get the content for object with id $objid. The content is returned as a string.
Remove the content for object with id $objid.
Copy the content from $from_objid to $to_objid. This may be implemented efficiently using OS copy. Dies on failure.
Return the absolute filename for the object with id $objid (or supply the WE::Obj). Usually, the content should not be accessed directly. But we are Perl, so it is possible nevertheless.
Return the extension of the supplied WE::Obj object.
WE::Obj
Return the MIME type (e.g. text/plain) of the supplied file.
text/plain
Delete all database contents
Search the term in the content database and return a list of object ids. Further options are:
Id of the scope for the search.
Restrict search to the specified language. Otherwise all languages are used. NYI.
True, if the search should be case sensitive.
True, if the search term is a regular expression.
Search $term (treated as a regular expression) in the content database recusively starting from the WE::Obj object $obj and return a list of object ids. If $obj is a non-folder object, then only this object is searched.
$term
$obj
There is no locking implemented in the Content database. It is assumed that the Content database is usually accessed through WE::DB::Obj methods, where locking is implemented.
Slaven Rezic - eserte@users.sourceforge.net
WE::DB::Obj
To install WE::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WE::DB
CPAN shell
perl -MCPAN -e shell install WE::DB
For more information on module installation, please visit the detailed CPAN module installation guide.