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