Table of Contents
The principle of the datastore is to store and get data. The datastore has
a subtree hierarchy like directories in operating systems. In each subtree you
can put data or other subtrees. The users must have some rights to access those
subtrees or documents.
For datastore, you have some client programs. With those programs you can:
- change the user acces rights for documents and subtrees
- change the document owner
- administer the user groups
- put and get data (XML, HTML, email, ...) in datastore
- administer the subtrees where you can store documents
- administer the users
Each client utility has the following common options for connecting to a server database
Usage: program_file <options> <...>
Options for SEPDB connection :
-?, --help # this help.
-h, --host <host> # specifies the host name.
if missing will use localhost;
-p, --port <port> # specifies the port number.
if missing will use 10288;
-d, --dbname <database> # specifies SEP database name for your
connection.
database name is required;
-u, --user <username> # specifies the username for SEPDB connection.
if missing will use guest;
-P, --passwd <password> # specifies the password for SEPDB connection.
if missing will use guest;
-s, --security <security> # specifies the security type for
SEPDB connection.
The secutity type must be : jsse or ptls.
If missing the connection is opened without
security;
|
|
Where the program_file will be a name of a client utility. The
<command options> will be commented separatelly for each program.
The change mode utility can start with the smchmod.sh or
smchmod.bat. This program helps you to change the
acces permissions for subtrees and documents.
Usage: smchmod.(sh/bat) <options> <command options>
Command options :
-R, --recursive # change permissions in specified subtree
recursively;
-v, --verbose # output a diagnostic for every file processed;
[ugoa][[+-=][rw]][,..] # is format of a symbolic mode. If you want to
use multiple symbolic operations, then you
can separated by commas.
Combination of the letters 'ugoa' controls
which users' access to the document will be
changed :
- the user who owns it (u),
- other users in the document's group (g),
- other users not in the file's group (o),
- all users (a).
If none of these are given, the effect is 'a'.
The operator '+' add selected permissions
to the existing permissions for each document;
'-' causes them to be removed; and '=' causes
them to be the only permissions that the each
dococuments has.
The letters 'rw' select new permissions for
the affected users: read (r), write (w);
<subtree> # the subtree (and document id), for changes.
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smchmod.sh -u root -P rootPWD -d XMLDB u+rw users/crow/xml/1
# add read, write permissions to user for document '1' in subtree
'users/crow/xml';
smchmod.sh -u root -P rootPWD -d XMLDB +r-w users/crow
# add read and remove write permission to all users for
subtree 'users/crow';
smchmod.bat -u root -P rootPWD -R -d XMLDB ug+r users/crow
# add read permission to user and group for all documents
in subtree 'users/crow' recursively;
|
|
The change owner utility can start with the smchown.sh or
smchown.bat. This program helps you to set or change the
owner of subtrees and documents.
Usage: smchown.(sh/bat) <options> <command options>
Command options :
-R, --recursive # change owner in specified subtree recursively;
-v, --verbose # output a diagnostic for every file processed;
[user][.[group]] # changes the user and/or group ownership of
each given document.
If only user name is given, that user is
made the owner of each given document, and
the documents' group is not changed.
If the user name is followed by a dot and
a group name, with no space between them,
the group ownership of the documents is
changed as well.
If a dot but no group name follows the user
name, that user is made the owner of the
documents and the group of the documents is
changed to that user's group.
If the dot and group are given, but the user
name is omited, only the group of the
documents is changed;
<subtree> # the subtree (and document id), for changes.
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smchown.sh -u root -P rootPWD -d XMLDB crow users/crow/xml/1
# set user name 'crow' for document '1' in subtree
'users/crow/xml'.
smchown.sh -u root -P rootPWD -d XMLDB crow.devel users/crow
# set username 'crow' and group name 'devel' for
subtree 'users/crow'.
smchown.bat -u root -P rootPWD -R -d XMLDB crow. users/crow
# set username 'crow' and group name 'crow' for all documents
in subtree 'users/crow' recursively.
smchown.bat -u root -P rootPWD -d XMLDB .crow users/crow
# change group name 'crow' for subtree 'users/crow'.
|
|
The utility can start with the smgroup.sh or
smgroup.bat. This program helps you to add, modify and remove database
user groups.
Usage: smgroup.(sh/bat) <options> <commands> <command options>
Commands :
-add # create new group in specified SEP database.
Options for 'add':
<groupname> # group name that will be added to SEPDB.
groupname is required;
-mod # modify a group in specified SEP database.
Options for 'mod':
<groupname> # the name of the group will be changed from
'groupname' to 'name'.
group name is required;
--name <newgroupname> # new group name.
newgroupname is required;
-del # delete a group from specified SEP database.
Options for 'del':
<groupname> # the group name that will be removed.
groupname is required;
You can't remove the group until have users.
-list # list existing groups in SEP DB, or user groups
or group users.
Options for 'list':
[<groupname>] # list users for specified group;
[--uname <username>] # list groups for specified user;
If parameter missing, list all groups
from SEPDB.
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smgroup.sh -add -u root -P rootPWD -d XMLDB crow
# create group with specified group name 'crow'.
smgroup.sh -mod -u root -P rootPWD -d XMLDB --name csabi crow
# change group name 'crow' to 'csabi'.
smgroup.sh -del -u root -P rootPWD -d XMLDB crow
# delete group 'crow' form specified XMLDB SEP database.
smgroup.bat -list -d XMLDB
# list all group from XMLDB SEP database.
smgroup.bat -list -d XMLDB --uname crow
# list groups of user 'crow'.
|
|
This utility can start with the smquery.sh or
smquery.bat. With this program you can store data to database or you can
query data from databases. You need to use the simple store and fetch SEP commands
for data manipulation. You can use the standard consol to enter this commands
or you can use the already stored commands from file.
Usage: smquery.(sh/bat) <options> <sepfile> <commands> <command options>
Sepfile:
-f, --sepfile <file> # specifies file with SEP commands.
if missing will use consol or commands;
Commands:
-fetch # querying data from SEPDB.
Options for 'fetch':
--subtree <subtree> # querying data from specified subtree;
[--path <e/e@a>] # elements separated by '/' and one attribute
separated by '@';
[--value <value>] # querying value;
-store # administrate data in SEPDB.
Options for 'store':
--action <write|
delete|update> # make storing action;
--block <blockname> # specifying name of block;
[--file <filename>] # file with block to store;
If no file, you need use the consol.
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smquery.sh -u root -P rootPWD -d XMLDB filename
# using file with predefined SEP commands.
smquery.sh -d XMLDB -fetch --subtree users/email --path TO@name --value John
# querying from subtree 'users/email' where element 'TO' have an
attribute 'name', and its equal 'John'.
smquery.bat -u root -P rootPWD -d XMLDB -store --action write
--block users/email --file filename
# writing block on the location users/email where the block having
in the file.
If no file mentioned you must enter the block from consol.
|
|
This utility can start with the smtree.sh or smtree.bat.
With this program you can create, delete, copy, move and list database trees.
Usage: smtree.(sh/bat) <options> <commands> <command options>
Commands :
-create # create new subtree in the 'root directory'.
Options for 'create':
<subtree> # subtree name that will be created in SEPDB.
subtree name is required;
-remove # remove empty subtree.
Options for 'remove':
<subtree> # the name of the subtree that will be removed.
subtree name is required;
[-f, --force] # you can be remove a not empty subtrees;
-list # list subtree contents from SEP database.
Options for 'list':
<subtree> # name of the subtree that contents will be
listed.
subtree name is required;
[-l, --long] # if is specified use a long listing format;
[-t, --tree] # if is specified list tree entries instead
contents;
-copy # copy subtrees and documents without overwriting.
Options for 'copy':
<source> # source subtree or document that will be copied
source name is required;
<destination> # is destination subtree where documents
will be copied.
destination subtree name is required;
[-R, --recursive] # if is specified copy subtrees recursively;
[-v, --verbose] # if is specified explain what is being done;
-move (rename) # move (rename) subtrees and documents without
overwriting.
Options for 'move':
<source> # source subtree or document that will be moved.
source name is required;
<destination> # is destination subtree where documents will
be moved.
[-v, --verbose] # if is specified explain what is being done;
-chtype # change store type for specified subtree.
Options for 'chtype':
<storeType> # is new subtrees store type, which can be:
- flexible, strict, free or free_tag;
<subtree> # this name is name of subtree, which store
types will be changed;
-naming # set naming flag for specified subtree.
Options for 'naming':
<naming> # is new subtrees naming flag, which can be:
- auto or manual;
<subtree> # this name is name of subtree, which naming
type will be seted;
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smtree.sh -create -u root -P rootPWD -d XMLDB home/crow
# create 'home/crow' subtrees in the 'root directory'.
smtree.sh -remove -u root -P rootPWD -d XMLDB crow
# remove 'crow' subtree from root directory if subtree is empty.
smtree.bat -list -u root -P rootPWD -d XMLDB home/crow
# list subtrees and documents for subtree 'home/crow'.
smtree.bat -copy -u root -P rootPWD -d XMLDB home/crow user/crow
# copy documents from subtree 'home/crow' to subtree 'user/crow'.
Source and destination subtrees may be exists.
smtree.bat -chtype -u root -P rootPWD -d XMLDB flexible user/crow
# change store type in 'flexible' mode for subtree 'user/crow'.
smtree.bat -naming -u root -P rootPWD -d XMLDB auto user/crow
# set naming flag to 'auto' for subtree 'user/crow'.
|
|
This utility can start with the smuser.sh or smuser.bat.
This program helps you to add, modify, remove and list the datastore users.
Usage: smuser.(sh/bat) <options> <commands> <command options>
Commands :
-add # create new user in specified SEP database.
Options for 'add':
<username> # user name that will be added to SEPDB.
username is required;
[--pwd <password>] # the password for user being to added;
[--home <homedir>] # home directory for user being added;
[--group <initial_group>]# inital group , if missing the group
having same name as the user being added;
[--groups <group_list>] # the list of supplementary groups which the
user is also a member of.
Each group is separated from next by a
comma, with no intervening whitespace;
-mod # modify user account in specified SEP database.
Options for 'mod':
<username> # the name of the user will be changed from
'username' to 'loginname'.
username is required;
[--lname <loginname>] # new user name;
[--pwd <password>] # new password for user;
[--home <homedir>] # new home directory for user;
The contents of current home directory will
be moved to the new home directory;
[--group <initial_group>] # inital group , if missing the group
having same name as the new user
[--groups <group_list>] # the list of supplementary groups which the
user is also a member of.
Each group is separated from next by a comma,
with no intervening whitespace.
If the user is currently a member of a group
which is not listed, the user will be removed
from the group;
-del # delete user from specified SEP database.
-list # list users or user data from specified SEP
database.
-block # block specified user in SEP database.
-ublock # unblock blocked user in SEP database.
Options for 'del, list, block, unblock':
<username> # the username that will be removed, blocked.
unlocked in SEPDB or to wish to do data.
about user.
username is required for del, block and
unblock options;
|
|
The following examples for SEP database connection, using host:localhost,
port:10288, username:root and the <root_password>.
smuser.sh -add -u root -P rootPWD -d XMLDB --pwd worc crow
# create user with specified username 'crow' and password 'worc'.
smuser.sh -mod -u root -P rootPWD -d XMLDB --pwd crow crow
# change password for 'crow' user in 'crow'.
smuser.bat -del -u root -P rootPWD -d XMLDB crow
# delete user 'crow' form specified SEP database.
smuser.bat -list -u root -P rootPWD -d XMLDB
# list all users registred into SEP database.
smuser.bat -block -u root -P rootPWD -d XMLDB crow
# block 'crow' user, user cant be logined so long as you not use
unblock command.
|
|