- SEE ALSO
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
Initializes the content database. This means that the directory holding the content files is created.
- store($objid, $content)
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($from_objid, $to_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
Return the MIME type (e.g.
text/plain) of the supplied file.
Delete all database contents
- search_fulltext($term, %args)
Search the term in the content database and return a list of object ids. Further options are:
- search_fulltext_in_object($obj, $term)
$term(treated as a regular expression) in the content database recusively starting from the WE::Obj object
$objand return a list of object ids. If
$objis a non-folder object, then only this object is searched.
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 - email@example.com