Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uo/bsubmit.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 % BSUBMIT Submits the given collection of objects in binary form to an LTPDA repository | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: Submits the given objects in binary form only to an LTPDA | |
5 % repository. If multiple objects are submitted together a corresponding | |
6 % collection entry will be made. | |
7 % | |
8 % If not explicitly disabled the user will be prompt for entering submission | |
9 % metadata and for chosing the database where to submit the objects. | |
10 % | |
11 % CALL: [IDS, CID] = bsubmit(O1, PL) | |
12 % [IDS, CID] = bsubmit(O1, O2, PL) | |
13 % | |
14 % INPUTS: O1, O2, ... - objects to be submitted | |
15 % PL - plist whih submission and repository informations | |
16 % | |
17 % OUTPUTS: IDS - IDs assigned to the submitted objects | |
18 % CID - ID of the collection entry | |
19 % | |
20 % <a href="matlab:utils.helper.displayMethodInfo('ltpda_uo', 'bsubmit')">Parameters Description</a> | |
21 % | |
22 % | |
23 % METADATA: | |
24 % | |
25 % 'experiment title' - title for the submission (required >4 characters) | |
26 % 'experiment description' - description of this submission (required >10 characters) | |
27 % 'analysis description' - description of the analysis performed (required >10 characters) | |
28 % 'quantity' - the physical quantity represented by the data | |
29 % 'keywords' - comma-delimited list of keywords | |
30 % 'reference ids' - comma-delimited list object IDs | |
31 % 'additional comments' - additional comments | |
32 % 'additional authors' - additional author names | |
33 % | |
34 % VERSION: $Id: bsubmit.m,v 1.22 2011/11/07 18:55:59 mauro Exp $ | |
35 % | |
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
37 | |
38 function varargout = bsubmit(varargin) | |
39 | |
40 %%% Check if this is a call for parameters | |
41 if utils.helper.isinfocall(varargin{:}) | |
42 varargout{1} = getInfo(varargin{3}); | |
43 return | |
44 end | |
45 | |
46 import utils.const.* | |
47 utils.helper.msg(msg.PROC3, 'running %s/%s', mfilename('class'), mfilename); | |
48 | |
49 % just call submit with the right outputs | |
50 if nargout == 1 | |
51 varargout{1} = submit(plist('binary', true), varargin{:}); | |
52 else | |
53 [varargout{1}, varargout{2}] = submit(plist('binary', true), varargin{:}); | |
54 end | |
55 end | |
56 | |
57 | |
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
59 % | |
60 function ii = getInfo(varargin) | |
61 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
62 sets = {}; | |
63 pl = []; | |
64 else | |
65 sets = {'Default'}; | |
66 pl = getDefaultPlist(); | |
67 end | |
68 % Build info object | |
69 ii = minfo(mfilename, 'ltpda_uo', 'ltpda', utils.const.categories.internal, '$Id: bsubmit.m,v 1.22 2011/11/07 18:55:59 mauro Exp $', sets, pl); | |
70 ii.setModifier(false); | |
71 end | |
72 | |
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
74 % | |
75 function plout = getDefaultPlist() | |
76 persistent pl; | |
77 if ~exist('pl', 'var') || isempty(pl) | |
78 pl = buildplist(); | |
79 end | |
80 plout = pl; | |
81 end | |
82 | |
83 function plo = buildplist() | |
84 plo = plist.TO_REPOSITORY_PLIST; | |
85 | |
86 p = param({'sinfo filename', 'Path to an XML file containing submission metadata'}, paramValue.EMPTY_STRING); | |
87 plo.append(p); | |
88 | |
89 end | |
90 |