To administer the database with remote control, DataStore use some special
XML blocks ( otherwise modified SEP store and fetch command ) in each
administer program.
Have a lot of methods for :
- change the user access rights for documents and subtrees
- change the document owner
- administer the user groups
- administer the subtrees where you can store documents
- administer the users
$ds = DSClient.create()
#login to XMLDB named database with username and passwd
if $ds.login("XMLDB", "username", "passwd") then [
#create test2 subtree on root subtree and list the root subtree
$resp = $ds.makeSubtree("test2")
if $resp.hasAdditional then [
if $resp.hasInfo then [
print $resp/additional/info.toXML
] else [
if $resp.hasWarning then [
print $resp/additional/warning.toXML
]
]
]
if $resp.hasError then [
print $resp/error.toXML
]
if $resp.hasBlock then [
print $resp/block.toXML
]
$resp = $ds.list("/")
if $resp.hasAdditional then [
if $resp.hasInfo then [
print $resp/additional/info.toXML
] else [
if $resp.hasWarning then [
print $resp/additional/warning.toXML
]
]
]
if $resp.hasError then [
print $resp/error.toXML
]
if $resp.hasBlock then [
print $resp/block.toXML
]
#remove test2 subtree recursively and list the root subtree
$resp = $ds.removeSubtree("test2",true)
if $resp.hasAdditional then [
if $resp.hasInfo then [
print $resp/additional/info.toXML
] else [
if $resp.hasWarning then [
print $resp/additional/warning.toXML
]
]
]
if $resp.hasError then [
print $resp/error.toXML
]
if $resp.hasBlock then [
print $resp/block.toXML
]
#search the documents in the test subtree that contains the specified value
#in the specified path
$resp = $ds.fetch("test","person/name@first","Antal")
if $resp.hasAdditional then [
if $resp.hasInfo then [
print $resp/additional/info.toXML
] else [
if $resp.hasWarning then [
print $resp/additional/warning.toXML
]
]
]
if $resp.hasError then [
print $resp/error.toXML
]
if $resp.hasBlock then [
print $resp/block.toXML
]
] else [
print "Connection failed !!!"
]
DSResponse | addGroup (String $group) |
DSResponse | addUser (String $username, String $password, String $home, String $group, String $groups) |
DSResponse | blockUser (String $username) |
DSResponse | changeStoreType (String $subtree, String $mode, Logical $recursive) |
DSResponse | setNamingFlag (String $subtree, String $naming, Logical $recursive) |
DSResponse | chmod (String $mode, String $subtree, Logical $recursive) |
DSResponse | chown (String $owner, String $subtree, Logical $recursive) |
DSResponse | copy (String $src, String $dest, Logical $recursive) |
DSResponse | delGroup (String $gname) |
DSResponse | delUser (String $name) |
DSResponse | fetch (String $subtree, String $path, String $value) |
DSResponse | list (String $subtree) |
DSResponse | listGroup (String $group, String $user) |
DSResponse | listUser (String $name) |
Logical | login (String $dbName) |
Logical | login (String $dbName, String $userName, String $password) |
Logical | logout |
DSResponse | makeSubtree (String $subtree) |
DSResponse | modGroup (String $oldName, String $newName) |
DSResponse | modUser (String $oldName, String $newName, String $password, String $home, String $group, String $groups) |
DSResponse | move (String $src, String $dest) |
DSResponse | removeSubtree (String $subtree, Logical $force) |
DSResponse | store (String $action, String $path, String $block) |
DSResponse | unblockUser (String $userName) |
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML |
|
Parameters: |
$host : | The host name to be connected. |
|
Constructs a new DSClient with the given host name on the default port.
Parameters: |
$host : | The host name to be connected. |
$port : | The port to be connected. |
|
Constructs a new DSClient with the given host name and port.
Constructs a new DSClient with the default host name on the default
port.
Parameters: |
$group : | The group name to add. |
|
Exceptions: |
executeFailed :
(Error) | Unable to execute the SEP command. |
Adds the specified group to the specified database.
Parameters: |
$username : | The user's name. |
$password : | The user's password. |
$home : | The user's home directory. |
$group : |
The group name of the user's initial login group. If the group name not
exist, then a new group will be created with the given name.
|
$groups : |
A list of supplementary groups which the user is also a member of. each
group is separated from the next by a comma, with no intervening
whitespace.
|
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Adds the specified user to the specified database.
Parameters: |
$username : | The user's name to block. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Blocks the specified user. After this command the user can't log in
until he is not unblocked.
Parameters: |
$subtree : | The subtree which mode will be changed. |
$mode : | The store mode. (strict/flexible/free/free_tag) |
$recursive : | If true change recursivelly. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Change subtree store mode.
Parameters: |
$subtree : | The subtree which naming flag will be changed. |
$naming : | The naming flag. (auto/manual) |
$recursive : | If true change recursivelly. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Set subtree naming flag.
Parameters: |
$mode : | The permission mode. |
$subtree : | The subtree which mode will be changed. |
$recursive : | If true change recursivelly. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Change acces permissions for subtrees and documents.
Parameters: |
$owner : | The owner of document. |
$subtree : | The subtree which owner will be changed. |
$recursive : | If true change recursivelly. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Change owner
Parameters: |
$src : | The subtree which will be copied. |
$dest : | The target subtree name. |
$recursive : | If true copy subtrees recursivelly. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Copy the subtree given as $src to the target subtree given as $dest.
Parameters: |
$gname : | The group name which you want to delete. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Deletes the specified group.
Parameters: |
$name : | The user name which you want to delete. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Deletes the specified user.
Parameters: |
$subtree : | The subtree where the value will be searched. |
$path : |
Relative path in the XML document to the searched value. If the path is
not specified then the value will be searched in the whole document.
|
$value : |
The value to be searched. If the value is missing then you can't specify
a path. In this case all documents in the given subtree will be returned
recursively.
|
|
Exceptions: |
executeFailed :
(Error) | Unable to execute the SEP command. |
Returns the XML document if in the subtree was specified the path to the
document else returns the document names where the specified value was
found.
Parameters: |
$subtree : | The subtree name to be listed. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Lists the specified subtree.
Parameters: |
$group : | The group name to list. |
$user : | The user's groups to list. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
If the group name is given then returns all users in that group, else if
the user name is given then returns the group names in which the user is
in, if both is missing then returns all groups name.
Parameters: |
$name : | The user's name which data will be listed. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Lists the specified user's data or if there is no username specified
then list all users name.
Parameters: |
$dbName : | The database name to connenct. |
|
Exceptions: |
loginFailed :
(Error) | If unable to login to the DataStore server. |
Connects to the specified database.
Parameters: |
$dbName : | The database name to connenct. |
$userName : | The user name. |
$password : | The user's password. |
|
Exceptions: |
loginFailed :
(Error) | If unable to login to the DataStore server. |
Connects to the specified database with the given user name and
password.
Exceptions: |
logouFailed :
(Error) | If unable to logout from the DataStore server. |
Disconnects from DataStore server.
Parameters: |
$subtree : | The absolute path to the subtree with the subtree name to create. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Creates a new subtree with the given path and name.
Parameters: |
$oldName : | The group name to change. |
$newName : | The new name of the group. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Modifies a group name from the oldName to the newName.
Parameters: |
$oldName : | The user name whom data will be modified. |
$newName : |
The new user name if you want to change it, if not leave this empty.
|
$password : |
The new password for the user if you want to change it, if not leave
this empty.
|
$home : |
The new home for the user if you want to change it, if not leave this
empty.
|
$group : |
The new group for the user if you want to change it, if not leave this
empty.
|
$groups : |
The new groups for the user if you want to change it, if not leave this
empty.
|
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Modify existing user dates.
Parameters: |
$src : | The subtree which will be moved. |
$dest : | The target subtree name. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Moves the subtree given as $src to the target subtree given as $dest.
Parameters: |
$subtree : | The subtree name which will be removed. |
$force : | If true removes the nonempty subtrees too. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Removes the specified subtree.
Parameters: |
$action : | The store action, can be write, update or delete. |
$path : |
If the action is update or delete this must be contain the document name
and subtree, else only the subtree.
|
$block : |
If the action is write or update this will be the document which will be
stored or with which will be overwrite the specified subtree in the
$path. If the action is delete leave this empty.
|
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Executes the specified action to the given $path.
Parameters: |
$userName : | The user's name to unblock. |
|
Exceptions: |
executeFailed :
(Error) | If unable to execute the SEP command. |
Unblocks the specified user. After this command the user can log in
again.