Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/repo_submit_content.html @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 <p> | |
2 Any of the <it>user</it> objects can be submitted to an LTPDA repository | |
3 </p> | |
4 | |
5 <p> | |
6 There are three different methods which submit/update object(s) to the repository: | |
7 <ul> | |
8 <li><h3>submit</h3> | |
9 Submits the given collection of objects to an LTPDA Repository. If multiple objects | |
10 are submitted together, a corresponding collection entry will be made. The objects | |
11 are stored as a XML representation <b>and</b> if possible a binary representation | |
12 (see bsubmit).</li> | |
13 <li><h3>bsubmit</h3> | |
14 Submits the given collection of objects to an LTPDA Repository. If multiple objects | |
15 are submitted together, a corresponding collection entry will be made. The objects | |
16 are stored <b>only</b> as a binary representation.<br /> | |
17 In order to retrieve this object by calling a constructor it is necessary to | |
18 set the key <tt>'BINARY'</tt> to 'yes' because the XML representation doesn't exist. | |
19 For example the AO constructor | |
20 <a href="matlab:web(ao.getInfo('ao', 'from repository').tohtml, '-helpbrowser')">'From Repository'</a> | |
21 </li> | |
22 <li><h3>update</h3> | |
23 Updates the specified object with a new object. | |
24 </li> | |
25 </ul> | |
26 </p> | |
27 | |
28 <h2>The submission process</h2> | |
29 | |
30 <p> | |
31 When an object is submitted, the following steps are taken:<br /> | |
32 <ol> | |
33 <li>The <tt>userid</tt> of the user connecting is retrieved from the <it>Users</it> table of the repository</li> | |
34 <li>For each object to be submitted: | |
35 <ol> | |
36 <li>The object to be submitted is checked to be one of the types listed above</li> | |
37 <li>The <tt>name</tt>, <tt>created</tt>, and <tt>version</tt> fields are read from the object</li> | |
38 <li>The object is converted to an XML text string</li> | |
39 <li>An MD5 hash sum is computed for the XML string</li> | |
40 <li>The XML string and the hash code are inserted in to the <tt>objs</tt> table</li> | |
41 <li>The automatically assigned ID of the object is retrieved from the <tt>objs</tt> table</li> | |
42 <li>An attempt is made to create a binary representation of the object (.MAT). If this is possible, the binary data is inserted in the <tt>bobjs</tt> table.</li> | |
43 <li>Various pieces of meta-data (object name, object type, created time, client IP address, <i>etc.</i>) are submitted to the <tt>objmeta</tt> table</li> | |
44 <li>Additional meta-data is entered into the table matching the object class (<tt>ao</tt>, <tt>tsdata</tt>, <i>etc.</i>)</li> | |
45 <li>An 'in' entry is made in the <tt>transaction</tt> table recording the user ID and the object ID</li> | |
46 </ol> | |
47 </li> | |
48 <li>A entry is then made in the <tt>collections</tt> table, even if this is a single object submission</li> | |
49 <li>The object IDs and the collection ID are returned to the user</li> | |
50 </ol> | |
51 </p> | |
52 | |
53 <br /> | |
54 <h2>Submitting objects</h2> | |
55 | |
56 <p> | |
57 Objects can be submitted using the command <tt>submit</tt>. This command takes at least two inputs: | |
58 <table border="1" cellpadding="2" width="30%" bgcolor="#DDDDDD"> | |
59 <tr valign="top"> | |
60 <td><tt>object</tt></td><td>The object(s) to submit</td> | |
61 </tr> | |
62 <tr valign="top"> | |
63 <td><tt>pl</tt></td><td>A plist containing various pieces of information (see below)</td> | |
64 </tr> | |
65 </table> | |
66 </p> | |
67 <p> | |
68 The <tt>plist</tt> details can be found at: <a href="matlab:web(ltpda_uo.getInfo('submit').tohtml, '-helpbrowser')">Parameter Sets</a> | |
69 </p> | |
70 <p> | |
71 The following example script connects to a repository and submits an AO: | |
72 <div class="fragment"><pre> | |
73 | |
74 <span class="comment">% Connect to a repository</span> | |
75 conn = utils.jmysql.connect(<span class="string">'localhost'</span>, <span class="string">'ltpda_test'</span>); | |
76 | |
77 <span class="comment">% Load the AO</span> | |
78 a = ao(<span class="string">'result.xml'</span>); | |
79 | |
80 <span class="comment">% Build an information plist</span> | |
81 pl = plist; | |
82 pl.append(<span class="string">'conn'</span>, conn); | |
83 pl.append(<span class="string">'experiment title'</span>, <span class="string">'Interferometer noise'</span>); | |
84 pl.append(<span class="string">'experiment description'</span>, <span class="string">'Spectral estimation of interferometer output signal'</span>); | |
85 pl.append(<span class="string">'analysis description'</span>, <span class="string">'Spectrum of the recorded signal'</span>); | |
86 pl.append(<span class="string">'quantity'</span>, <span class="string">'photodiode output'</span>); | |
87 pl.append(<span class="string">'keywords'</span>, <span class="string">'interferometer, noise, spectrum'</span>); | |
88 pl.append(<span class="string">'reference ids'</span>, <span class="string">''</span>); | |
89 pl.append(<span class="string">'additional comments'</span>, <span class="string">'none'</span>); | |
90 pl.append(<span class="string">'additional authors'</span>, <span class="string">'no one'</span>); | |
91 | |
92 <span class="comment">% Submit the AO</span> | |
93 [ids, cid] = submit(a, pl); | |
94 | |
95 <span class="comment">% Close the connection</span> | |
96 conn.closeConnection | |
97 </pre></div> | |
98 The ID assigned to the submitted object is contained in the first output of the <tt>submit</tt> function: | |
99 <div class="fragment"><pre> | |
100 <span class="comment">% Inspect the object ID</span> | |
101 disp(ids) | |
102 212 | |
103 </pre></div> | |
104 If the <tt>plist</tt> contains sufficient information, it is possible to overide the appearance of the | |
105 'submission' dialog by giving the key/value pair: 'no dialog', <tt>true</tt>. | |
106 </p> | |
107 | |
108 <h2>Submitting collections</h2> | |
109 <p> | |
110 Collections of LTPDA objects can also be submitted. Here a collection is defined as a group of objects | |
111 submitted at the same time. In this way, a single information structure describing the collection is | |
112 assigned to all the objects. The collection is just a virtual object; it is defined by a list of object IDs in the database. | |
113 </p> | |
114 |