Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@helper/isSubmissionPlist.m @ 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 % ISSUBMISSIONPLIST Checks if the input plist is a submission plist. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: ISSUBMISSIONPLIST Checks if the input plist is a submission | |
5 % plist. This means that this method checks that the input | |
6 % plist have only some of the following keys: | |
7 % 'hostname' | |
8 % 'database' | |
9 % 'username' | |
10 % 'password' | |
11 % 'experiment title' | |
12 % 'experiment description' | |
13 % 'analysis description' | |
14 % 'quantity' | |
15 % 'keywords' | |
16 % 'reference ids' | |
17 % 'additional comments' | |
18 % 'additional authors' | |
19 % 'binary' | |
20 % 'no dialog' | |
21 % | |
22 % CALL: res = isSubmissionPlist(pl) | |
23 % | |
24 % VERSION: $Id: isSubmissionPlist.m,v 1.6 2010/05/03 19:21:52 ingo Exp $ | |
25 % | |
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
27 | |
28 function res = isSubmissionPlist(pl) | |
29 | |
30 fields = {... | |
31 'hostname', ... | |
32 'database', ... | |
33 'username', ... | |
34 'password', ... | |
35 'conn', ... | |
36 'experiment title', ... | |
37 'experiment_title', ... | |
38 'experiment description', ... | |
39 'experiment_description', ... | |
40 'analysis description', ... | |
41 'analysis_description', ... | |
42 'quantity', ... | |
43 'keywords', ... | |
44 'reference ids', ... | |
45 'reference_ids', ... | |
46 'additional comments', ... | |
47 'additional_comments', ... | |
48 'additional authors', ... | |
49 'additional_authors', ... | |
50 'binary', ... | |
51 'sinfo filename', ... | |
52 'sinfo_filename', ... | |
53 'no dialog', ... | |
54 'use selector'}; | |
55 | |
56 if pl.nparams >= 1 | |
57 keys = lower({pl.params(:).key}); | |
58 | |
59 res = utils.helper.ismember(keys, fields); | |
60 | |
61 if all(res) | |
62 res = true; | |
63 else | |
64 res = false; | |
65 end | |
66 | |
67 else | |
68 res = false; | |
69 end | |
70 | |
71 end |