Submitting LTPDA objects to a repository


Any of the following user objects can be submitted to an LTPDA repository:

There are three different methods which submit/update object(s) to the repository

The submission process

When an object is submitted, the following steps are taken:

  1. The userid of the user connecting is retrieved from the Users table of the repository
  2. For each object to be submitted:
    1. The object to be submitted is checked to be one of the types listed above
    2. The name, created, and version fields are read from the object
    3. The object is converted to an XML text string
    4. An MD5 hash sum is computed for the XML string
    5. The XML string and the hash code are inserted in to the objs table
    6. The automatically assigned ID of the object is retrieved from the objs table
    7. Tries to create a binary representation of the object. If this is possible and it is possible to store for this object type a binary, then insert the binary
    8. Various pieces of meta-data (object name, object type, created time, client IP address, etc.) are submitted to the objmeta table
    9. Additional meta-data is entered into the table matching the object class (ao, tsdata, etc.)
    10. An 'in' entry is made in the transaction table recording the user ID and the object ID
  3. A entry is then made in the collections table, even if this is a single object submission
  4. The object IDs and the collection ID are returned to the user


Submitting objects

Objects can be submitted using the command submit. This command takes at least two inputs:

objectThe object to submit
sinfoAn information structure (see below)

The information structure should have the following fields:
      'conn'                   - database connection object
      'experiment_title'       - a title for the submission (Mandatory, >4 characters)
      'experiment_description' - a description of this submission (Mandatory, >10 characters)
      'analysis_description'   - a description of the analysis performed  (Mandatory, >10 characters));
      'quantity'               - the physical quantity represented by the data);
      'keywords'               - a comma-delimited list of keywords);
      'reference_ids'          - a string containing any reference object id numbers
      'additional_comments'    - any additional comments
      'additional_authors'     - any additional author names
    

The following example script connects to a repository and submits an AO:

      % Connect to a repository
      conn = utils.mysql.connect('130.75.117.67', 'ltpda_test');

      % Load the AO
      a = ao('result.xml');

      % Build an information structure
      sinfo.conn                   = conn;
      sinfo.experiment_title       = 'Interferometer noise';
      sinfo.experiment_description = 'Spectral estimation of interferometer output signal';
      sinfo.analysis_description   = 'Spectrum of the recorded signal';
      sinfo.quantity               = 'photodiode output';
      sinfo.keywords               = 'interferometer, noise, spectrum';
      sinfo.reference_ids          = '';
      sinfo.additional_comments    = 'none';
      sinfo.additional_authors     = 'no one';

      % Submit the AO
      [ids, cid] = submit(a, sinfo);

      % Close the connection
      close(conn);
    
The ID assigned to the submitted object is contained in the first output of the submit function:
      % Inspect the object ID
      disp(ids)
      212
    

Submitting collections

Collections of LTPDA objects can also be submitted. Here a collection is defined as a group of objects submitted at the same time. In this way, a single information structure describing the collection is assigned to all the objects. The collection is just a virtual object; it is defined by a list of object IDs in the database. The following example script connects to a repository and submits three AOs:

    % Connect to a repository
    conn = utils.mysql.connect('130.75.117.67', 'ltpda_test');

    % Create objects to submit
    o1 = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 10, 'fs', 100));
    o2 = pzmodel(1, 10, 100);
    o3 = plist('b', 2, 'c', 'asd');

    % Create an information structure
    sinfo.conn                   = conn;
    sinfo.experiment_title       = 'submit multiple objects';
    sinfo.experiment_description = 'this is just a test of the whole thing';
    sinfo.analysis_description   = 'no analysis this time';
    sinfo.quantity               = '';
    sinfo.keywords               = '';
    sinfo.reference_ids          = '';
    sinfo.additional_comments    = 'none';
    sinfo.additional_authors     = 'no one';

    % Submit the objects
    [ids, cid] = submit(o1, o2, o3, sinfo)

    % Close connection
    close(conn);

    % END
  

If the verbosity level you set up on your LTPDA Toolbox preferences GUI is at lest 'PROC1', running this script yields an outut similar to the following:

    ** Connecting to 130.75.117.67 as john.doe...
    ** Connection status:
    DatabaseProductName: 'MySQL'
    DatabaseProductVersion: '5.0.45'
    JDBCDriverName: 'MySQL-AB JDBC Driver'
    JDBCDriverVersion: [1x56 char]
    MaxDatabaseConnections: 0
    CurrentUserName: 'hewitson@pixfirewall.aei.uni-hannover.de'
    DatabaseURL: 'jdbc:mysql://130.75.117.67/ltpda_test'
    AutoCommitTransactions: 'True'

    M: running ao/ao
    M:   constructing from plist
    M: running ltpda_uo/submit
    M:   sinfo structure is valid.
    M:   submitting objects to repository.
    M:   got user id 1 for user: john.doe
    M:   submitting object: ao / sine wave
    M: running ltpda_uoh/created
    M: running ltpda_uoh/created
    M:   uploading XML data...
    M:  done.
    M:   submitted object ao with id 234
    M:   running query: insert into bobjs (obj_id, mat) values (?,?)
    M:   running query INSERT INTO objmeta SET obj_id=234,obj_type='ao',name='sine wave',created='2009-07-30 04:02:28',version='$Id: repo_submit_content.html,v 1.9 2009/08/03 12:29:51 mauro Exp $',ip='193.205.193.171',hostname='mauro-huellers-macbook.local',os='MACI',submitted='2009-07-30 06:02:39',experiment_title='submit multiple objects',experiment_desc='this is just a test of the whole thing',reference_ids='',additional_comments='none',additional_authors='no one',keywords='',quantity='',analysis_desc='no analysis this time';
    M:   made meta-data entry
    M:   running query INSERT INTO tsdata SET xunits=' [s] ',yunits=' [] ',fs=100,nsecs=10,t0='1970-01-01 00:00:00';
    M:   running query INSERT INTO ao SET obj_id=234,data_type='tsdata',data_id=70,description='',mfilename='',mdlfilename='';
    M:   running query INSERT INTO transactions SET obj_id=234,user_id=1,transdate='2009-07-30 04:02:28',direction='in';
    M:   updated transactions table
    M:   submitting object: pzmodel / None
    M: running ltpda_uoh/created
    M: running ltpda_uoh/created
    M:   uploading XML data...
    M:  done.
    M:   submitted object pzmodel with id 235
    M:   running query: insert into bobjs (obj_id, mat) values (?,?)
    M:   running query INSERT INTO objmeta SET obj_id=235,obj_type='pzmodel',name='None',created='2009-07-30 04:02:28',version='$Id: repo_submit_content.html,v 1.9 2009/08/03 12:29:51 mauro Exp $',ip='193.205.193.171',hostname='mauro-huellers-macbook.local',os='MACI',submitted='2009-07-30 06:02:42',experiment_title='submit multiple objects',experiment_desc='this is just a test of the whole thing',reference_ids='',additional_comments='none',additional_authors='no one',keywords='',quantity='',analysis_desc='no analysis this time';
    M:   made meta-data entry
    M:   running query INSERT INTO transactions SET obj_id=235,user_id=1,transdate='2009-07-30 04:02:28',direction='in';
    M:   updated transactions table
    M:   submitting object: plist / none
    M:   uploading XML data...
    M:  done.
    M:   submitted object plist with id 236
    M:   running query: insert into bobjs (obj_id, mat) values (?,?)
    M:   running query INSERT INTO objmeta SET obj_id=236,obj_type='plist',name='none',created='2009-07-30 04:02:28',version='$Id: repo_submit_content.html,v 1.9 2009/08/03 12:29:51 mauro Exp $',ip='193.205.193.171',hostname='mauro-huellers-macbook.local',os='MACI',submitted='2009-07-30 06:02:43',experiment_title='submit multiple objects',experiment_desc='this is just a test of the whole thing',reference_ids='',additional_comments='none',additional_authors='no one',keywords='',quantity='',analysis_desc='no analysis this time';
    M:   made meta-data entry
    M:   running query INSERT INTO transactions SET obj_id=236,user_id=1,transdate='2009-07-30 04:02:28',direction='in';
    M:   updated transactions table
    M:   running query INSERT INTO collections SET nobjs=3,obj_ids='234,235,236';
    M:   made collection entry
    M:   submission complete.
  




©LTP Team