Overview   Package   Tree   Index 
Tv2 documentation
PREV  NEXT FRAMES  NO FRAME 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

tv2-engine
Class tv2Document


class tv2Document

tv2Xdb document class

Authors:
Emilis Dambauskas (emilis@gildija.lt)
Version:
$Id: tv2Document.class.php,v 1.5 2003/07/10 05:09:07 lunaticlt Exp $
Copyright:
2002–2003 Emilis Dambauskas under Artistic license

Field Summary
integer$ctime
document modify (change) time
array$fields
document field array (numerically indexed)
array$fv
document field values array (indexed by field name)
integer$id
document id
string$ident
document ident
string$name
document name
string$path
document path
private array$permissions
document permissions
string$type
document type
private object$xdb
tv2Xdb object

Constructor Summary
void tv2Document([boolean $empty])
Connects to tv2Xdb

Method Summary
void addFIeld(string $name, [string $value], [string $type])
Adds new field to the document
boolean addPermission(string $ug, string $name, string $permission)
add new permission for the document
boolean changeContext([string $context])
Experimental.
boolean changeField(string $oldname, string $newname, [string $value], [string $type])
Changes field name type and value.
boolean changePermission(string $ug, string $name, string $permission)
Replace a permission for a document
boolean changeType(string $type)
Changes document type
boolean changeVersion(string $lang, string $statuts)
Experimental.
boolean create(string $ident, string $type)
create a new document
private boolean error(string $msg)
Sends an error to the errors object and returns FALSE
boolean move(string $ident, [boolean $overwrite])
Moves document in the tv2Xdb tree
boolean open(mixed $id, [array $vinfo])
Opens an existing document from the tv2Xdb
boolean remove()
Deletes a document from tv2Xdb
boolean removeField(string $name)
Deletes a field in a document
void removeFields()
Deletes all fields in a document
void removeFieldValues()
Empties document fields
boolean removePermission(string $ug, string $name)
Removes permissions for user or group on the document
void removePermissions()
Remove all permissions on the document
boolean removeVersion()
Experimental.
boolean save()
Saves a document in the tv2Xdb
boolean setVersion(string $lang, string $statuts)
Experimental.
boolean startVersioning(string $context, string $lang, string $status)
Experimental.
boolean stopVersioning()
Experimental.


Field Detail

ctime

integer $ctime

document modify (change) time


fields

array $fields

document field array (numerically indexed)


fv

array $fv

document field values array (indexed by field name)


id

integer $id

document id


ident

string $ident

document ident


name

string $name

document name


path

string $path

document path


permissions

private array $permissions

document permissions


type

string $type

document type


xdb

private object $xdb

tv2Xdb object


Constructor Detail

tv2Document()

void tv2Document([boolean $empty])

Connects to tv2Xdb

Parameters:
empty - if set to TRUE tv2Xdb will not be connected.
Uses the global variables:
$xdb

Method Detail

addFIeld()

void addFIeld(string $name, [string $value], [string $type])

Adds new field to the document

Parameters:
name - field name
value - field value
type - field type

addPermission()

boolean addPermission(string $ug, string $name, string $permission)

add new permission for the document

Parameters:
ug - user 'u' or group 'g'?
name - user/group name
permission - o/w/r/x/d
Returns:
TRUE on success, FALSE on failure

changeContext()

boolean changeContext([string $context])

Experimental. Changes context in which versions status has meaning

Parameters:
context - context name
Returns:
always TRUE

changeField()

boolean changeField(string $oldname, string $newname, [string $value], [string $type])

Changes field name type and value. If the field does not exist adds a new field.

Parameters:
oldname - field name
newname - new name for the field (use same as oldname if you don't want to change it)
value - new value for the field (pass NULL if you don't want to change it)
type - new type for the field (pass NULL if you don't want to change it)
Returns:
TRUE on success, FALSE on failure

changePermission()

boolean changePermission(string $ug, string $name, string $permission)

Replace a permission for a document

Parameters:
ug - user 'u' or group 'g'?
name - user/group name
permission - o/w/r/x/d
Returns:
TRUE on success, FALSE on failure

changeType()

boolean changeType(string $type)

Changes document type

Parameters:
type - new type for the document
Returns:
always TRUE

changeVersion()

boolean changeVersion(string $lang, string $statuts)

Experimental. Changes version of the document

Parameters:
lang - document language
statuts - document status
Returns:
always TRUE

create()

boolean create(string $ident, string $type)

create a new document

Parameters:
ident - document ident
type - document type
Returns:
TRUE on success, FALSE on failure

error()

private boolean error(string $msg)

Sends an error to the errors object and returns FALSE

Parameters:
msg - error message
Returns:
always FALSE
Uses the global variables:
errors

move()

boolean move(string $ident, [boolean $overwrite])

Moves document in the tv2Xdb tree

Parameters:
ident - target ident
overwrite - Should we overwrite if doc exists at new location? (default: FALSE)
Returns:
TRUE on success, FALSE on failure

open()

boolean open(mixed $id, [array $vinfo])

Opens an existing document from the tv2Xdb

Parameters:
id - document id/ident
vinfo - version info (do not use: still experimental)
Returns:
TRUE on success, FALSE on failure

remove()

boolean remove()

Deletes a document from tv2Xdb

Returns:
TRUE on success, FALSE on failure

removeField()

boolean removeField(string $name)

Deletes a field in a document

Parameters:
name - field name
Returns:
TRUE on success, FALSE on failure

removeFields()

void removeFields()

Deletes all fields in a document


removeFieldValues()

void removeFieldValues()

Empties document fields


removePermission()

boolean removePermission(string $ug, string $name)

Removes permissions for user or group on the document

Parameters:
ug - user 'u' or group 'g'?
name - user/group name
Returns:
TRUE on success, FALSE on failure

removePermissions()

void removePermissions()

Remove all permissions on the document


removeVersion()

boolean removeVersion()

Experimental. Removes a version of the document.

Returns:
TRUE on success, FALSE on failure

save()

boolean save()

Saves a document in the tv2Xdb

Returns:
TRUE on success, FALSE on failure

setVersion()

boolean setVersion(string $lang, string $statuts)

Experimental. Sets version of the document

Parameters:
lang - document language
statuts - document status
Returns:
always TRUE

startVersioning()

boolean startVersioning(string $context, string $lang, string $status)

Experimental. Start version control for the document.

Parameters:
context - context
lang - language
status - status
Returns:
always TRUE

stopVersioning()

boolean stopVersioning()

Experimental. Stop version control for the document.

Returns:
TRUE on success, FALSE on failure

 Overview   Package   Tree   Index 
Tv2 documentation
PREV  NEXT FRAMES  NO FRAME 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug

This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)