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_flagTrue if client wishes handler to send broadcast message to it. False otherwise.
    Corresponding API commands
    TclDbHandlerConnect
    PythonDbRegister username pid broadcast

    DbRequestStatus

    Summary: Get the status of the handler

    Arguments None
    Corresponding API commands
    TclCheckServerStatus
    PythonCheckServerStatus

    DbSupported dbtype

    Summary: Check if handler supports the given db backend.

    Arguments dbtypedatabase backend, e.g def, SQLite
    Corresponding API commands
    TclDbSupported db
    PythonDbSuppoted db

    DbDisconnect

    Summary: Disconnect to the handler. Handler sends 'True' to client for this request.

    Arguments None
    Corresponding API commands
    TclDbHandlerDisconnect
    PythonHandlerDisconnect

    ShutDown

    Summary: Shutdown the handler. Handler doesn't send any response to client for this request.

    Arguments None
    Corresponding API commands
    TclDbShutdown
    PythonShutDown

    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
    TclCreateDatabase project db messageVar args
    PythonCreateDatabase 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
    TclOpenDatabase project args
    PythonOpenDatabase project grablock readonly

    DbNewRecord project

    Summary: Create a job in database.

    Arguments project the name of the project
    Corresponding API commands
    TclNewRecord project
    PythonNewRecord 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
    TclDeleteRecord project jobid
    PythonDeleteRecord 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
    TclSetData project jobid args
    PythonSetData 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
    TclGetData project jobid args
    PythonGetData 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
    TclUpdatetimeproject jobid
    PythonUpdatetime 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
    TclItemExists project jobid item
    PythonItemExists 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
    TclSelectJobs project item pattern
    PythonSelectJobs project item pattern

    ListJobs project

    Summary: List all the job ids of a project.

    Arguments project the name of the project.
    Corresponding API commands
    TclListJobs project
    PythonListJobs 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
    TclGetDescription project joblist db_display db_display_format
    PythonGetDescription 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
    TclListProjects
    PythonListProjects

    GetNProject

    Summary: Get the total number of projects.

    Arguments None
    Corresponding API commands
    TclGetNProjects
    PythonGetNProjects

    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
    TclImportProject alias path
    PythonImportProject alias path

    DeleteProject project

    Summary: Delete the reference of a project in directories.def.

    Arguments
    project The name of the project.
    Corresponding API commands
    TclDeleteProject project
    PythonDeleteProject 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
    TclAddDefDirRef def_dir path
    PythonAddDefDirRef 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
    TclDeleDefDirRef def_dir
    PythonDeleDefDirRef def_dir

    GetProjectDir project

    Summary: Get the directory name of the project.

    Arguments
    project The name of the project.
    Corresponding API commands
    TclGetProjectDir project
    PythonGetProjectDir project

    ListDefDirs

    Summary: Return a list of the user's default directories.

    Arguments
    None
    Corresponding API commands
    TclListDefDirs
    PythonListDefDirs

    GetDefDir def_dir

    Summary: Return the directory corresponding to a def dir name.

    Arguments
    def_dirdefault directory name.
    Corresponding API commands
    TclGetDefDir def_dir
    PythonGetDefDir def_dir

    GetNJOB project

    Summary: Return the last number of job in project.

    Arguments
    projectThe name of the project.
    Corresponding API commands
    TclGetNJOB project
    PythonGetNJOB project

    GetNextJobList project jobid

    Summary: Return a list of job ids which are related to the given job.

    Arguments
    projectThe name of the project.
    jobidThe id of the job.
    Corresponding API commands
    TclGetNextJobList project jobid
    PythonGetNextJobList 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
    projectThe name of the project.
    Corresponding API commands
    TclGetAllLinks project
    PythonGetAllLinks 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
    projectThe name of the project.
    joblistA list of job ids.
    Corresponding API commands
    TclGetLinks project joblist
    PythonGetLinks project joblist

    DbGetListofRecords project joblist itemlist

    Summary: Get a list of jobs' item value.

    Arguments
    projectThe name of the project.
    joblistA list of job ids.
    itemlistA list of item names.
    Corresponding API commands
    TclGetListofRecords project joblist itemlist
    PythonGetListofRecords 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
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetAllChildren project jobid
    PythonGetAllChildren 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
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetAllParents project jobid
    PythonGetAllParents 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
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetChildren project jobid
    PythonGetChildren 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
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetParents project jobid
    PythonGetParents 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
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetAllParentsChildren project jobid
    PythonGetAllParentsChildren project jobid

    GetNotebook project jobid

    Summary: Return full path notebook name.

    Arguments
    projectThe name of the project.
    jobidjob id
    Corresponding API commands
    TclGetNotebook project jobid
    PythonGetNotebook project jobid

    DbClose project

    Summary: Close a project.

    Arguments project the name of the project
    Corresponding API commands
    TclCloseDatabase project
    PythonCloseDatabase 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?
    PythonNewDB 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
    TclOpenDBsql dbname dir
    PythonOpenDB 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
    TclGetJobDatasql jobid args
    PythongetData jobid item

    GetProjectId projectname

    Summary: Given a project name, return project id.

    Arguments projectname the name of the project.
    Corresponding API commands
    TclNone
    PythongetProjectId 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
    TclNone
    PythonGetData(in db class) table id attribute

    GetProjectList

    Summary: Return a list of projects in the database.

    Arguments None
    Corresponding API commands
    TclNone
    PythonGetProjectList

    GetJobList project

    Summary: Return a list of job records for a given proejct.

    Arguments project the name of project.
    Corresponding API commands
    TclNone
    PythonGetJobList projectname

    GetRowofTable table

    Summary: Return a row of a table..

    Arguments id the id of record.
    Corresponding API commands
    TclNone
    PythonGetRowofTable table rid

    NewProject_sql projectname

    Summary: Create a new project.

    Arguments projectname the project name
    Corresponding API commands
    TclNewProjectsql projectname
    PythonnewProject projectname

    NewJob_sql projectname

    Summary: Create a new job in a project.

    Arguments projectname the project name
    Corresponding API commands
    TclNewJobsql projectname
    PythonnewJob projectname

    NewRecord table

    Summary: Create a new record in table.

    Arguments table the table name
    Corresponding API commands
    TclNone
    PythonNewRecord(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
    TclNone
    PythonsetData(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
    TclNone
    PythonSetData(in db class) table id attribute value

    CloseDB_sql

    Summary: Close database in SQLite.

    Arguments None
    Corresponding API commands
    TclCloseDBsql
    PythonCloseDB(in job class)

    Last Update: $Date: 2008/08/12 10:48:16 $