Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/repo_submit.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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> | |
3 | |
4 <html lang="en"> | |
5 <head> | |
6 <meta name="generator" content= | |
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org"> | |
8 <meta http-equiv="Content-Type" content= | |
9 "text/html; charset=us-ascii"> | |
10 | |
11 <title>Submitting LTPDA objects to a repository (LTPDA Toolbox)</title> | |
12 <link rel="stylesheet" href="docstyle.css" type="text/css"> | |
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2"> | |
14 <meta name="description" content= | |
15 "Presents an overview of the features, system requirements, and starting the toolbox."> | |
16 </head> | |
17 | |
18 <body> | |
19 <a name="top_of_page" id="top_of_page"></a> | |
20 | |
21 <p style="font-size:1px;"> </p> | |
22 | |
23 <table class="nav" summary="Navigation aid" border="0" width= | |
24 "100%" cellpadding="0" cellspacing="0"> | |
25 <tr> | |
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td> | |
27 | |
28 <td valign="baseline" align="right"><a href= | |
29 "repo_connect.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Connecting to an LTPDA Repository"></a> <a href= | |
31 "repo_explore.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Exploring an LTPDA Repository"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Submitting LTPDA objects to a repository</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 <p> | |
41 Any of the <it>user</it> objects can be submitted to an LTPDA repository | |
42 </p> | |
43 | |
44 <p> | |
45 There are three different methods which submit/update object(s) to the repository: | |
46 <ul> | |
47 <li><h3>submit</h3> | |
48 Submits the given collection of objects to an LTPDA Repository. If multiple objects | |
49 are submitted together, a corresponding collection entry will be made. The objects | |
50 are stored as a XML representation <b>and</b> if possible a binary representation | |
51 (see bsubmit).</li> | |
52 <li><h3>bsubmit</h3> | |
53 Submits the given collection of objects to an LTPDA Repository. If multiple objects | |
54 are submitted together, a corresponding collection entry will be made. The objects | |
55 are stored <b>only</b> as a binary representation.<br /> | |
56 In order to retrieve this object by calling a constructor it is necessary to | |
57 set the key <tt>'BINARY'</tt> to 'yes' because the XML representation doesn't exist. | |
58 For example the AO constructor | |
59 <a href="matlab:web(ao.getInfo('ao', 'from repository').tohtml, '-helpbrowser')">'From Repository'</a> | |
60 </li> | |
61 <li><h3>update</h3> | |
62 Updates the specified object with a new object. | |
63 </li> | |
64 </ul> | |
65 </p> | |
66 | |
67 <h2>The submission process</h2> | |
68 | |
69 <p> | |
70 When an object is submitted, the following steps are taken:<br /> | |
71 <ol> | |
72 <li>The <tt>userid</tt> of the user connecting is retrieved from the <it>Users</it> table of the repository</li> | |
73 <li>For each object to be submitted: | |
74 <ol> | |
75 <li>The object to be submitted is checked to be one of the types listed above</li> | |
76 <li>The <tt>name</tt>, <tt>created</tt>, and <tt>version</tt> fields are read from the object</li> | |
77 <li>The object is converted to an XML text string</li> | |
78 <li>An MD5 hash sum is computed for the XML string</li> | |
79 <li>The XML string and the hash code are inserted in to the <tt>objs</tt> table</li> | |
80 <li>The automatically assigned ID of the object is retrieved from the <tt>objs</tt> table</li> | |
81 <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> | |
82 <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> | |
83 <li>Additional meta-data is entered into the table matching the object class (<tt>ao</tt>, <tt>tsdata</tt>, <i>etc.</i>)</li> | |
84 <li>An 'in' entry is made in the <tt>transaction</tt> table recording the user ID and the object ID</li> | |
85 </ol> | |
86 </li> | |
87 <li>A entry is then made in the <tt>collections</tt> table, even if this is a single object submission</li> | |
88 <li>The object IDs and the collection ID are returned to the user</li> | |
89 </ol> | |
90 </p> | |
91 | |
92 <br /> | |
93 <h2>Submitting objects</h2> | |
94 | |
95 <p> | |
96 Objects can be submitted using the command <tt>submit</tt>. This command takes at least two inputs: | |
97 <table border="1" cellpadding="2" width="30%" bgcolor="#DDDDDD"> | |
98 <tr valign="top"> | |
99 <td><tt>object</tt></td><td>The object(s) to submit</td> | |
100 </tr> | |
101 <tr valign="top"> | |
102 <td><tt>pl</tt></td><td>A plist containing various pieces of information (see below)</td> | |
103 </tr> | |
104 </table> | |
105 </p> | |
106 <p> | |
107 The <tt>plist</tt> details can be found at: <a href="matlab:web(ltpda_uo.getInfo('submit').tohtml, '-helpbrowser')">Parameter Sets</a> | |
108 </p> | |
109 <p> | |
110 The following example script connects to a repository and submits an AO: | |
111 <div class="fragment"><pre> | |
112 | |
113 <span class="comment">% Connect to a repository</span> | |
114 conn = utils.jmysql.connect(<span class="string">'localhost'</span>, <span class="string">'ltpda_test'</span>); | |
115 | |
116 <span class="comment">% Load the AO</span> | |
117 a = ao(<span class="string">'result.xml'</span>); | |
118 | |
119 <span class="comment">% Build an information plist</span> | |
120 pl = plist; | |
121 pl.append(<span class="string">'conn'</span>, conn); | |
122 pl.append(<span class="string">'experiment title'</span>, <span class="string">'Interferometer noise'</span>); | |
123 pl.append(<span class="string">'experiment description'</span>, <span class="string">'Spectral estimation of interferometer output signal'</span>); | |
124 pl.append(<span class="string">'analysis description'</span>, <span class="string">'Spectrum of the recorded signal'</span>); | |
125 pl.append(<span class="string">'quantity'</span>, <span class="string">'photodiode output'</span>); | |
126 pl.append(<span class="string">'keywords'</span>, <span class="string">'interferometer, noise, spectrum'</span>); | |
127 pl.append(<span class="string">'reference ids'</span>, <span class="string">''</span>); | |
128 pl.append(<span class="string">'additional comments'</span>, <span class="string">'none'</span>); | |
129 pl.append(<span class="string">'additional authors'</span>, <span class="string">'no one'</span>); | |
130 | |
131 <span class="comment">% Submit the AO</span> | |
132 [ids, cid] = submit(a, pl); | |
133 | |
134 <span class="comment">% Close the connection</span> | |
135 conn.closeConnection | |
136 </pre></div> | |
137 The ID assigned to the submitted object is contained in the first output of the <tt>submit</tt> function: | |
138 <div class="fragment"><pre> | |
139 <span class="comment">% Inspect the object ID</span> | |
140 disp(ids) | |
141 212 | |
142 </pre></div> | |
143 If the <tt>plist</tt> contains sufficient information, it is possible to overide the appearance of the | |
144 'submission' dialog by giving the key/value pair: 'no dialog', <tt>true</tt>. | |
145 </p> | |
146 | |
147 <h2>Submitting collections</h2> | |
148 <p> | |
149 Collections of LTPDA objects can also be submitted. Here a collection is defined as a group of objects | |
150 submitted at the same time. In this way, a single information structure describing the collection is | |
151 assigned to all the objects. The collection is just a virtual object; it is defined by a list of object IDs in the database. | |
152 </p> | |
153 | |
154 | |
155 </p> | |
156 | |
157 <br> | |
158 <br> | |
159 <table class="nav" summary="Navigation aid" border="0" width= | |
160 "100%" cellpadding="0" cellspacing="0"> | |
161 <tr valign="top"> | |
162 <td align="left" width="20"><a href="repo_connect.html"><img src= | |
163 "b_prev.gif" border="0" align="bottom" alt= | |
164 "Connecting to an LTPDA Repository"></a> </td> | |
165 | |
166 <td align="left">Connecting to an LTPDA Repository</td> | |
167 | |
168 <td> </td> | |
169 | |
170 <td align="right">Exploring an LTPDA Repository</td> | |
171 | |
172 <td align="right" width="20"><a href= | |
173 "repo_explore.html"><img src="b_next.gif" border="0" align= | |
174 "bottom" alt="Exploring an LTPDA Repository"></a></td> | |
175 </tr> | |
176 </table><br> | |
177 | |
178 <p class="copy">©LTP Team</p> | |
179 </body> | |
180 </html> |