Mercurial > hg > ltpda
annotate m-toolbox/classes/+utils/@jmysql/getsinfo.m @ 50:7d2e2e065cf1 database-connection-manager
Update unit tests
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:24:37 +0100 |
parents | 91f21a0aab35 |
children |
rev | line source |
---|---|
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
1 function sinfo = getsinfo(conn, varargin) |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
2 % GETSINFO Retrieved objects submission info from the repository. |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
3 % |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
4 % CALL: |
0 | 5 % |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
6 % sinfo = getsinfo(conn, id, id) |
0 | 7 % |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
8 % INPUTS: |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
9 % |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
10 % id - object ID |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
11 % conn - repository connection implementing java.sql.Connection |
0 | 12 % |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
13 % OUTPUTS: |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
14 % |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
15 % sinfo - array of sinfo structures containing fields |
0 | 16 % |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
17 % - name |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
18 % - experiment_title |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
19 % - experiment_desc |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
20 % - analysis_desc |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
21 % - quantity |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
22 % - additional_authors |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
23 % - additional_comments |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
24 % - keywords |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
25 % - reference_ids |
0 | 26 % |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
27 % VERSION: $Id: getsinfo.m,v 1.2 2011/03/29 13:40:16 hewitson Exp $ |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
28 |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
29 if ~isa(conn, 'java.sql.Connection') |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
30 error('### first argument should be a java.sql.Connection object'); |
0 | 31 end |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
32 |
0 | 33 sinfo = []; |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
34 for kk = 1:length(varargin) |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
35 |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
36 q = ['SELECT name, experiment_title, experiment_desc, analysis_desc, ' ... |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
37 'quantity, additional_authors, additional_comments, keywords, ' ... |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
38 'reference_ids FROM objmeta WHERE obj_id = ?']; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
39 |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
40 info = utils.mysql.execute(conn, q, varargin{kk}); |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
41 |
0 | 42 s.conn = conn; |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
43 s.name = info{1}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
44 s.experiment_title = info{2}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
45 s.experiment_description = info{3}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
46 s.analysis_description = info{4}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
47 s.quantity = info{5}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
48 s.additional_authors = info{6}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
49 s.additional_comments = info{7}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
50 s.keywords = info{8}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
51 s.reference_ids = info{9}; |
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
52 |
0 | 53 sinfo = [sinfo s]; |
54 end | |
16
91f21a0aab35
Update utils.jquery
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
0
diff
changeset
|
55 |
0 | 56 end |