comparison m-toolbox/classes/@plist/plist.m @ 18:947e2ff4b1b9 database-connection-manager

Update plist.FROM_REPOSITORY_PLIST and plist.TO_REPOSITORY_PLIST
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children a71a40911c27
comparison
equal deleted inserted replaced
17:7afc99ec5f04 18:947e2ff4b1b9
316 316
317 % Plist for retrieving objects from a repository. This is used in all 317 % Plist for retrieving objects from a repository. This is used in all
318 % user-object constructor default plists for the 'From Repository' set. 318 % user-object constructor default plists for the 'From Repository' set.
319 function pl = FROM_REPOSITORY_PLIST 319 function pl = FROM_REPOSITORY_PLIST
320 pl = plist(); 320 pl = plist();
321 321
322 % get repository list
323 prefs = getappdata(0, 'LTPDApreferences');
324 hostNames = prefs.getRepoPrefs.getHostnames;
325 repos = {};
326 for ii=0:hostNames.size()-1
327 repos = [repos {hostNames.get(ii)}];
328 end
329
330 % Hostname 322 % Hostname
331 if isempty(repos) 323 p = param({'hostname','The repository hostname'}, paramValue.EMPTY_STRING);
332 repos = {'localhost'};
333 end
334 p = param({'hostname','The repository hostname'}, {1, repos, paramValue.SINGLE});
335 pl.append(p); 324 pl.append(p);
336 325
337 % ID 326 % ID
338 p = param({'ID','A vector of object IDs.'}, paramValue.EMPTY_DOUBLE); 327 p = param({'ID','A vector of object IDs.'}, paramValue.EMPTY_DOUBLE);
339 pl.append(p); 328 pl.append(p);
363 % Plist for submitting/updating objects from a repository. This is used 352 % Plist for submitting/updating objects from a repository. This is used
364 % in ltpda_uo/ -submit, -bsubmit and -update. 353 % in ltpda_uo/ -submit, -bsubmit and -update.
365 function pl = TO_REPOSITORY_PLIST 354 function pl = TO_REPOSITORY_PLIST
366 pl = plist(); 355 pl = plist();
367 356
368 % get repository list
369 prefs = getappdata(0, 'LTPDApreferences');
370 hostNames = prefs.getRepoPrefs.getHostnames;
371 repos = {};
372 for ii=0:hostNames.size()-1
373 repos = [repos {hostNames.get(ii)}];
374 end
375
376 % Hostname 357 % Hostname
377 if isempty(repos) 358 p = param({'hostname', 'Repository server hostname'}, paramValue.EMPTY_STRING);
378 repos = {'localhost'};
379 end
380 p = param({'hostname', 'Repository server hostname'}, {1, repos, paramValue.SINGLE});
381 pl.append(p); 359 pl.append(p);
382 360
383 % Database 361 % Database
384 p = param({'database', 'Database name'}, paramValue.EMPTY_STRING); 362 p = param({'database', 'Database name'}, paramValue.EMPTY_STRING);
385 pl.append(p); 363 pl.append(p);
423 % additional authors 401 % additional authors
424 p = param({'additional authors', 'Additional author names'}, paramValue.EMPTY_STRING); 402 p = param({'additional authors', 'Additional author names'}, paramValue.EMPTY_STRING);
425 pl.append(p); 403 pl.append(p);
426 404
427 p = param({'no dialog', 'Do not use of the submission form. Mandatory fields must be supplied in the plist.'}, paramValue.FALSE_TRUE); 405 p = param({'no dialog', 'Do not use of the submission form. Mandatory fields must be supplied in the plist.'}, paramValue.FALSE_TRUE);
428 pl.append(p);
429
430 p = param({'use selector', 'Allow to select to which database to connect'}, paramValue.TRUE_FALSE);
431 pl.append(p); 406 pl.append(p);
432 407
433 end 408 end
434 409
435 % Plist for Welch-based, linearly spaced spectral estimators. 410 % Plist for Welch-based, linearly spaced spectral estimators.