NAME

WE_Singlesite::Root - a simple implementation for a site

SYNOPSIS

$root = new WE_Singlesite::Root -rootdir => $root_directory_for_database;

DESCRIPTION

A simple instantiation for WE::DB.

ADDITIONAL MEMBERS

RootDir

The root directory for all databases.

OVERRIDEABLE METHODS

To change the default classes for the subdatabases, override the following methods to return another class string:

ObjDBClass

By default WE::DB::Obj

UserDBClass

By default WE::DB::User

ContentDBClass

By default WE::DB::Content

OnlineUserDBClass

By default WE::DB::OnlineUser

NameDBClass

By default WE::DB::Name

To change the default file names for the subdatabases, override the following methods to return another filename (just the basename):

ObjDBFile

By default objdb.db

UserDBFile

By default userdb.db

ContentDBFile

By default content

OnlineUserDBFile

By default onlinedb.db

NameDBFile

By default name.db

To change other aspects of the subdatabases, change the following methods (WARNING: The semantics of the following two may change!!!):

SerializerClass

By default Data::Dumper

DBClass

By default DB_File

METHODS

is_allowed($action, $object_id)

Return a true value if the current user is allowed to do $action on object $object_id.

Currently are these actions defined:

release

The user is allowed to release a document ("freigeben").

publish

The user is allowed to publish a site.

change-folder

The user is allowed to do folder manipulation, that is, he is allowed to add or delete folders.

change-doc

The user is allowed to do document manipulation, that is, he is allowed to add, edit or delete documents.

If there is no current user, then always a false value is returned.

release_page($obj, %args)

Release the page with object $obj. Pass the object, not the id. If the value of the -useversioning argument is true, then do a check-in of the released objects (see also useversioning in WEprojectinfo). The arguments Title, VisibleToMenu and Rights are used, if defined, to set the respective object members.

HISTORY

Historically this module preloaded the standard ObjDB, UserDB, ContentDB, OnlineUserDB and NameDB classes with WE::DB->use_databases. Since about 2005-01-23 this modules are only preloaded if actually needed (that is, on construction time). This means that some inherited modules which depend on this preloading should do the preloading itself now.

CAVEATS

See incompatible change in "HISTORY".

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO

WE::DB.