NAME
WE::Obj - base object class for the web editor framework
SYNOPSIS
This is an abstract class.
DESCRIPTION
For member attributes there are accessors defined. To get the value of a member named Id, use:
$object->Id;
To set the value of a member use:
$object->Id($new_value);
Below is a list of member attributes which can be defined for each object. The semantics apply to the WE::DB::Obj database.
- Id
-
The identifier for this object. Normally, this identifier is numeric (but it does not have to). The normal user should not change the Id.
- Title
-
The title for this object. This is usually a normal string. If you want to set language-dependent titles, then look at WE::Util::LangString.
- Basename
-
An optional basename for this object. For backends using a pathname-like scheme, this can be used to construct the basename. See Net::FTPServer::WE_DB::Server.
- Name
-
An optional name for this object. This name should be unique in the database and will be used for name-based queries.
- Keywords
-
Optional keywords for this object. This is usually a normal string. If you want to set language-dependent keywords, then look at WE::Util::LangString.
- TimeCreated
-
The time of the creation of the object. This attribute is set automatically and should not be changed. The returned value is an ISO date. See WE::Util::Date for conversion functions for ISO dates.
- TimeModified
-
The time of the last modification of the object. Both attribute modification and content modification are taken into account. Like in
TimeCreated
, the returned value is an ISO date. - Owner
-
This is the owner of the object. The owner is set automatically when creating the object (see "CurrentUser" in WE::DB). See "NOTES" below for more information.
- DocAuthor
-
This is the original author of the object. This should be set only if the original author differs from the technical Owner of the object.
- Rights
-
For now, the value for the Rights member is a freely definable. Its value is not used nor it is inherited to other objects.
- TimeOpen
-
This member can be set to an ISO date to indicate the start of publication for the object.
- TimeExpire
-
This member can be set to an ISO date to indicate the end of publication for the object.
- Version_Owner
-
This member is only set for versions and for checked out objects. It holds the user who made this version. This member is set automatically.
- Version_Time
-
This member is only set for versions and for checked out objects. It holds the time when this version is made. This member is set automatically.
- Version_Comment
-
This member is only set for versions and for checked out objects. It holds the (optional) log message (or comment) for this version.
- Version_Number
-
This member is only set for versions and for checked out objects. It holds the version number for this version. Normally version numbers begin at "1.0" and are incremented by 0.1 (that is, the next would be "1.1", "1.2" and so on), but version numbers are not necessarily numbers.
- Version_Parent
-
This member is only set for versions and for checked out objects. It holds the Id of the original object belonging to this version.
- Release_State
-
The following values are possible:
- released
-
The object is released.
- inactive
-
The object should never be released.
- modified
-
The object was modified since the last release or it was never released.
- Release_*
-
The attributes Release_Author, Release_Flow, Release_Publishers, Release_ReviewedBy, and Release_TargetFolder are defined, but there is not functionality for these.
- LockedBy
-
Holds the user who is locking this object.
- LockType
-
The LockType may be PermanentLock or SessionLock. A permanent lock is valid over sessions. A session lock is only valid for the session of the locking user. If the locking user logs out (or the system can determine by some other means that the user is not logged in --- see WE::DB::OnlineUser), then the lock is not valid anymore.
- Dirty
-
Indicates that the object is changed after the last check in. This is the combination of DirtyAttributes and DirtyContent.
- DirtyAttributes
-
Indicates that the attributes of the object changed after the last check in.
- DirtyContent
-
Indicates that the content of the object changed after the last check in.
Other custom attributes may be set by accessing the object as a hash:
$object->{My_Attribute} = ["my value1", "my value2"];
As you can see, the value may also be a complex perl data structure. It is a good idea to use a prefix (like "My_" in the sample above) to minimize the chance of name clashes.
For other standard attributes, look at the documentation of the sub classes of WE::Obj.
METHODS
- instantiable
-
Return true if the object is instantiable (e.g. only folders and documents).
- insertable_types
-
Return an array reference of class names which are insertable into this object. Applies only for folder-like objects.
- use_classes(@classes)
-
Load into perl all given classes.
:all
means: load all known classes. - object_is_insertable($obj)
-
Return true if the given object is insertable.
- clone
-
Clone the given object.
- is_doc, is_folder, is_site
-
Return true if the object is a document, folder or site.
- is_sequence
-
Return true if the object is a sequence. Remember that a Sequence is always a FolderObj, so the return value of
is_folder
will also be true. - field_is_date($fieldname)
-
Return true if the given field should be treated as a date/time field.
- field_is_user($fieldname)
-
Return true if the given field should be treated as a username field.
- field_is_user($fieldname)
-
Return true if the given field should not be edited (e.g. Id field).
- is_time_restricted($now)
-
Return true if the object is restricted via
TimeOpen
andTimeExpire
. To adjust the current time, set$now
to a unix epoch time in seconds.
NOTES
The "Owner" is normally the Username of the owner, but depending on database needs the engine may interpret this value as the user Id.
AUTHOR
Slaven Rezic - slaven@rezic.de