DB handler commands & API commands
Wanjuan Yang
May 4, 2007
NewDb
DbOpen
DbNewRecord
DbDeleteRecord
DbSetData
Updatetime
DbGetData
DbItemExists
DbSelectRecords
ListJobs
DbReturnRecord
ListProjects
GetNProjects
ImportProject
DeleteProject
AddDefDirRef
DeleDefDirRef
GetProjectDir
ListDefDirs
GetDefDir
GetNJOB
GetNextJobList
GetAllLinks
GetLinks
DbGetListofRecords
GetAllChildren
GetAllParents
GetChildren
GetParents
GetAllParentsChildren
GetNotebook
DbClose
Commands for accessing to SQLite backend
DbRegister username pid [ broadcast_flag ]
|
Summary: Client registers with the handler. This is the first
request that a client should send to db handler before sending any other requests.
|
Arguments |
username | user name of the system |
pid | process Id |
broadcast_flag | True if client wishes handler to send
broadcast message to it. False otherwise. |
Corresponding API commands |
Tcl | DbHandlerConnect |
Python | DbRegister username pid broadcast |
DbRequestStatus
|
Summary: Get the status of the handler
|
Arguments |
None |
Corresponding API commands |
Tcl | CheckServerStatus |
Python | CheckServerStatus |
DbSupported dbtype
|
Summary: Check if handler supports the given db backend.
|
Arguments |
dbtype | database backend, e.g def, SQLite |
Corresponding API commands |
Tcl | DbSupported db |
Python | DbSuppoted db |
DbDisconnect
|
Summary: Disconnect to the handler. Handler sends 'True' to client for this request.
|
Arguments |
None |
Corresponding API commands |
Tcl | DbHandlerDisconnect |
Python | HandlerDisconnect |
ShutDown
|
Summary: Shutdown the handler. Handler doesn't send any
response to client for this request.
|
Arguments |
None |
Corresponding API commands |
Tcl | DbShutdown |
Python | ShutDown |
NewDb project dir
|
Summary: Create a new project in def backend.
|
Arguments |
project | the name of the project |
dir | directory of the project |
Corresponding API commands |
Tcl | CreateDatabase project db messageVar args |
Python | CreateDatabase project dir |
DbOpen project [ -grablock/-readonly ]
|
Summary: Create a new project in def backend.
|
Arguments |
project | the name of the project |
-grablock | Optional. If the database is locked, with
this option, the lock will be overwritten. |
-readonly | Optional. If the database is locked, with
this option, the database is readonly. |
Corresponding API commands |
Tcl | OpenDatabase project args |
Python | OpenDatabase project grablock readonly |
DbNewRecord project
|
Summary: Create a job in database.
|
Arguments |
project | the name of the project |
Corresponding API commands |
Tcl | NewRecord project |
Python | NewRecord project |
DbDeleteRecord project jobid
|
Summary: Delete a job in database.
|
Arguments |
project | the name of the project |
jobid | the id of the job to be deleted. |
Corresponding API commands |
Tcl | DeleteRecord project jobid |
Python | DeleteRecord project jobid |
DbSetData project jobid
item value [ item2 value2 [...] ]
|
Summary: Set the value(s) of one or more data item(s) for a job in project.
|
Arguments |
project | the name of the project |
jobid | the id of the job to be set data. |
item | item name of the job. |
value | value of the item. |
Corresponding API commands |
Tcl | SetData project jobid args |
Python | SetData project jobid args |
DbGetData project jobid
item
|
Summary: Retrieve the values of one or more data item(s) from a job in a project.
|
Arguments |
project | the name of the project |
jobid | the id of the job. |
item | item name of the job. |
Corresponding API commands |
Tcl | GetData project jobid args |
Python | GetData project jobid items |
Updatetime project jobid
|
Summary: Update the time of a job.
|
Arguments |
project | the name of the project |
jobid | the id of the job. |
Corresponding API commands |
Tcl | Updatetimeproject jobid |
Python | Updatetime project jobid |
DbItemExists project jobid item
|
Summary: Check that item exists for a job.
|
Arguments |
project | the name of the project |
jobid | the id of the job. |
item | the item name of the job. |
Corresponding API commands |
Tcl | ItemExists project jobid item |
Python | ItemExists project jobid item |
DbSelectRecords project item pattern
|
Summary: Retrieve a list of jobs based on some selection criterion.
|
Arguments |
project | the name of the project |
item | the item name of the job. |
pattern | regular expression pattern. |
Corresponding API commands |
Tcl | SelectJobs project item pattern |
Python | SelectJobs project item pattern |
ListJobs project
|
Summary: List all the job ids of a project.
|
Arguments |
project | the name of the project. |
Corresponding API commands |
Tcl | ListJobs project |
Python | ListJobs project |
DbReturnRecord project joblist
itemlist format
|
Summary: Given a list of job ids, return a list of descriptions
which are generated from the suppied lists of data items in itemlist
and format.
|
Arguments |
project | the name of the project |
joblist | a list of job ids to be retrived description. |
itemlist | a list of items to be retrived. |
format | the format in which to display the result - this is
a list of integers (one integer per item specified in
the itemlist) that specifies the field width (number
of characters) to allocate to the corresponding
datat item. |
Corresponding API commands |
Tcl | GetDescription project joblist db_display db_display_format |
Python | GetDescription project joblist db_display db_display_format |
ListProjects
|
Summary: List all the project names which are recorded in directories.def.
|
Arguments |
None |
Corresponding API commands |
Tcl | ListProjects |
Python | ListProjects |
GetNProject
|
Summary: Get the total number of projects.
|
Arguments |
None |
Corresponding API commands |
Tcl | GetNProjects |
Python | GetNProjects |
ImportProject alias path
|
Summary: Add a reference of a project (alias and path) in the
directories.def file.
|
Arguments |
alias | The alias of the project. |
path | The directory of the project. |
Corresponding API commands |
Tcl | ImportProject alias path |
Python | ImportProject alias path |
DeleteProject project
|
Summary: Delete the reference of a project in directories.def.
|
Arguments |
project | The name of the project. |
Corresponding API commands |
Tcl | DeleteProject project |
Python | DeleteProject project |
AddDefDirRef dir_def path
|
Summary: Add a reference of a default directory in the
directories.def file.
|
Arguments |
dir_def | The default directory name. |
path | The path of the default directory. |
Corresponding API commands |
Tcl | AddDefDirRef def_dir path |
Python | AddDefDirRef def_dir path |
DeleDefDirRef dir_def
|
Summary: Delete the reference of a default directory in directories.def.
|
Arguments |
def_dir | The name of the default directory. |
Corresponding API commands |
Tcl | DeleDefDirRef def_dir |
Python | DeleDefDirRef def_dir |
GetProjectDir project
|
Summary: Get the directory name of the project.
|
Arguments |
project | The name of the project. |
Corresponding API commands |
Tcl | GetProjectDir project |
Python | GetProjectDir project |
ListDefDirs
|
Summary: Return a list of the user's default directories.
|
Arguments |
None |
Corresponding API commands |
Tcl | ListDefDirs |
Python | ListDefDirs |
GetDefDir def_dir
|
Summary: Return the directory corresponding to a def dir name.
|
Arguments |
def_dir | default directory name. |
Corresponding API commands |
Tcl | GetDefDir def_dir |
Python | GetDefDir def_dir |
GetNJOB project
|
Summary: Return the last number of job in project.
|
Arguments |
project | The name of the project. |
Corresponding API commands |
Tcl | GetNJOB project |
Python | GetNJOB project |
GetNextJobList project jobid
|
Summary: Return a list of job ids which are related to the given job.
|
Arguments |
project | The name of the project. |
jobid | The id of the job. |
Corresponding API commands |
Tcl | GetNextJobList project jobid |
Python | GetNextJobList project jobid |
GetAllLinks project
|
Summary: Returns a list of job pairs. Each pair of jobs
indicates these two jobs are related to each other.
|
Arguments |
project | The name of the project. |
Corresponding API commands |
Tcl | GetAllLinks project |
Python | GetAllLinks project |
GetLinks project joblist
|
Summary: Given the job list, for each job id in the job list, return a list of job pairs. Each pair of jobs
indicates these two jobs are related to each other.
|
Arguments |
project | The name of the project. |
joblist | A list of job ids. |
Corresponding API commands |
Tcl | GetLinks project joblist |
Python | GetLinks project joblist |
DbGetListofRecords project joblist itemlist
|
Summary: Get a list of jobs' item value.
|
Arguments |
project | The name of the project. |
joblist | A list of job ids. |
itemlist | A list of item names. |
Corresponding API commands |
Tcl | GetListofRecords project joblist itemlist |
Python | GetListofRecords project joblist itemlist |
GetAllChildren project jobid
|
Summary: For a particular project, given a job id, get all the jobs
which are children(all levels) of this job.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetAllChildren project jobid |
Python | GetAllChildren project jobid |
GetAllParents project jobid
|
Summary: For a particular project, given a job id, get all the jobs
which are parent (all levels) of this job.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetAllParents project jobid |
Python | GetAllParents project jobid |
GetChildren project jobid
|
Summary: For a particular project, given a job id, get all the jobs
which are children of this job.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetChildren project jobid |
Python | GetChildren project jobid |
GetParents project jobid
|
Summary: For a particular project, given a job id, get all the jobs
which are parent of this job.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetParents project jobid |
Python | GetParents project jobid |
GetAllParentsChildren project jobid
|
Summary: For a particular project, given a job id, get all the jobs
which are parent of this job.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetAllParentsChildren project jobid |
Python | GetAllParentsChildren project jobid |
GetNotebook project jobid
|
Summary: Return full path notebook name.
|
Arguments |
project | The name of the project. |
jobid | job id |
Corresponding API commands |
Tcl | GetNotebook project jobid |
Python | GetNotebook project jobid |
DbClose project
|
Summary: Close a project.
|
Arguments |
project | the name of the project |
Corresponding API commands |
Tcl | CloseDatabase project |
Python | CloseDatabase project |
NewDB_sql dbname dir
|
Summary: Create a new database in SQLite.
|
Arguments |
dbname | the name of the database |
dir | the directory of the database |
Corresponding API commands |
Tcl | ? |
Python | NewDB dbname dir |
OpenDB_sql dbname dir
|
Summary: Open an existing database in SQLite.
|
Arguments |
dbname | the name of the database |
dir | the directory of the database |
Corresponding API commands |
Tcl | OpenDBsql dbname dir |
Python | OpenDB dbname dir |
GetJobData_sql jobid item [ item2 ...]
|
Summary: Return the value(s) of one or more items in a job.
|
Arguments |
jobid | the id of job. |
item | item name of the job. Could specify one or more item names. |
Corresponding API commands |
Tcl | GetJobDatasql jobid args |
Python | getData jobid item |
GetProjectId projectname
|
Summary: Given a project name, return project id.
|
Arguments |
projectname | the name of the project. |
Corresponding API commands |
Tcl | None |
Python | getProjectId projectname |
GetData table id attribute [
attribute1 ...]
|
Summary: Given a table name and id of the record and attribute(s),,
return the value of the attribute(s).
|
Arguments |
table | the table name. |
id | the id of the record |
attribute | attribute of the table, could specify one or more
attributes. |
Corresponding API commands |
Tcl | None |
Python | GetData(in db class) table id attribute |
GetProjectList
|
Summary: Return a list of projects in the database.
|
Arguments |
None |
Corresponding API commands |
Tcl | None |
Python | GetProjectList |
GetJobList project
|
Summary: Return a list of job records for a given proejct.
|
Arguments |
project | the name of project. |
Corresponding API commands |
Tcl | None |
Python | GetJobList projectname |
GetRowofTable table
|
Summary: Return a row of a table..
|
Arguments |
id | the id of record. |
Corresponding API commands |
Tcl | None |
Python | GetRowofTable table rid |
NewProject_sql projectname
|
Summary: Create a new project.
|
Arguments |
projectname | the project name |
Corresponding API commands |
Tcl | NewProjectsql projectname |
Python | newProject projectname |
NewJob_sql projectname
|
Summary: Create a new job in a project.
|
Arguments |
projectname | the project name |
Corresponding API commands |
Tcl | NewJobsql projectname |
Python | newJob projectname |
NewRecord table
|
Summary: Create a new record in table.
|
Arguments |
table | the table name |
Corresponding API commands |
Tcl | None |
Python | NewRecord(in db class) table |
SetJobData_sql jobid item value
[item1 value1 ... ]
|
Summary: Set item/attribute value for a given job.
|
Arguments |
jobid | the job id |
item | the item/attribute of job. Could set one or more
item/value at a time. |
value | the value of the item |
Corresponding API commands |
Tcl | None |
Python | setData(in job class) jobid item value |
SetData table recordid attribute
value [ attribute1 value1 ...]
|
Summary: Set one or more item/attribute value for a table record.
|
Arguments |
table | the table name |
recordid | record id. |
attribute | the attribute of the item, could set one or
more pairs of attribute/value. |
value | the value of the attribute |
Corresponding API commands |
Tcl | None |
Python | SetData(in db class) table id attribute value |
CloseDB_sql
|
Summary: Close database in SQLite.
|
Arguments |
None |
Corresponding API commands |
Tcl | CloseDBsql |
Python | CloseDB(in job class) |
Last Update: $Date: 2008/08/12 10:48:16 $