changeset 15:ce3fbb7ebe71 database-connection-manager

Remove broken functions from utils.jmysql
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents 6d43f39633b8
children 91f21a0aab35
files m-toolbox/classes/+utils/@jmysql/jmysql.m m-toolbox/classes/+utils/@jmysql/queryDialog.m m-toolbox/classes/+utils/@jmysql/submitDialog.m
diffstat 3 files changed, 0 insertions(+), 181 deletions(-) [+]
line wrap: on
line diff
--- a/m-toolbox/classes/+utils/@jmysql/jmysql.m	Mon Dec 05 16:20:06 2011 +0100
+++ b/m-toolbox/classes/+utils/@jmysql/jmysql.m	Mon Dec 05 16:20:06 2011 +0100
@@ -29,8 +29,6 @@
     varargout = query(varargin) % perform a query on an LTPDA repository and returns the results
     varargout = resultsToCell(varargin) % convert a ResultSet to a cell-array
     varargout = displayResults(varargin) % display a ResultSet in a table
-    varargout = queryDialog(varargin) % show a query builder dialog
-    varargout = submitDialog(varargin) % show a submission dialog
     varargout = dbquery(varargin)
 
   end % End static methods
--- a/m-toolbox/classes/+utils/@jmysql/queryDialog.m	Mon Dec 05 16:20:06 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-% QUERYDIALOG a visual query builder for querying an LTPDA repository.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DESCRIPTION: QUERYDIALOG a visual query builder for querying an LTPDA
-%              repository.
-%
-% CALL:        utils.jmysql.queryDialog();
-%              utils.jmysql.queryDialog(conn);
-%
-% INPUTS:
-%              conn - a connection object like that returned from
-%                     utils.jmysql.connect.
-%
-%
-% VERSION:     $Id: queryDialog.m,v 1.2 2009/09/22 14:40:07 ingo Exp $
-%
-% HISTORY:     24-05-2007 M Hewitson
-%                 Creation
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-function  queryDialog(varargin)
-  
-  if nargin == 1 && ~isa(varargin{1}, 'mpipeline.repository.RepositoryConnection')
-    error('### The first argument should be empty or a RepositoryConnection');
-  end
-  
-  
-  % Inputs
-  conn = [];
-  if nargin > 0
-    conn  = varargin{1};
-  end
-  
-  if isempty(conn)
-    conn = utils.jmysql.connect();
-  end
-  
-  if ~conn.isConnected
-    conn.openConnection
-  end
-  
-  if ~conn.isConnected
-    error('### Failed to connect to repository.');
-  end
-  
-  % open a query dialog
-  if nargin == 0
-    closeConnectionOnExit = true;
-  else
-    closeConnectionOnExit = false;
-  end
-  warning('off', 'MATLAB:JavaEDTAutoDelegation');
-  qrd = mpipeline.repository.RepositoryQueryDialog([], false, conn, false, closeConnectionOnExit);
-  qrd.setVisible(true)
-  warning('off', 'MATLAB:JavaEDTAutoDelegation');
-  
-  
-  
-end
-
--- a/m-toolbox/classes/+utils/@jmysql/submitDialog.m	Mon Dec 05 16:20:06 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-% SUBMITDIALOG a submission dialog for submitting objects an LTPDA repository.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DESCRIPTION: SUBMITDIALOG a submission dialog for submitting objects an
-%              LTPDA repository.
-%
-% CALL:        sinfo = utils.jmysql.submitDialog();
-%              sinfo = utils.jmysql.submitDialog(conn);
-%              sinfo = utils.jmysql.submitDialog(conn,sinfo);
-%
-% INPUTS:
-%              conn  - a connection object like that returned from
-%                      utils.jmysql.connect.
-%              sinfo - an sinfo structure to pre-populate the entry fields
-%
-% OUTPUTS: 
-%              sinfo - an sinfo structure suitable to pass to submit
-% 
-% NOTE: the sinfo object contains a valid and connected database connection
-% object. It is up to the caller to close this connection when it is no
-% longer required.
-% 
-% NOTE: if an input connection is provided, this is not closed by this
-% process.
-%
-% VERSION:     $Id: submitDialog.m,v 1.4 2009/10/02 09:19:50 hewitson Exp $
-%
-% HISTORY:     24-05-2007 M Hewitson
-%                 Creation
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-function sinfo = submitDialog(varargin)
-  
-  if nargin > 0 && ~isa(varargin{1}, 'mpipeline.repository.RepositoryConnection')
-    error('### The first argument should be empty or a RepositoryConnection');
-  end
-  
-  isinfo = [];
-  
-  if nargin == 2 && isstruct(varargin{2})
-    isinfo = varargin{2};
-  end
-  
-  % Inputs
-  conn = [];
-  if nargin > 0
-    conn  = varargin{1};
-  end
-
-  % Check the connection
-  if ~isempty(conn)
-    closeConnection = false;
-    if ~conn.isConnected
-      conn.openConnection
-    end
-    if ~conn.isConnected
-      error('### Failed to connect to repository.');
-    end
-  else
-    closeConnection = true;
-  end
-  
-  % Get host list
-  prefs = getappdata(0, 'LTPDApreferences');
-  hosts = java.util.ArrayList();
-  servers = prefs.repository.servers;
-  for kk=1:numel(servers)
-    hosts.add(servers{kk});
-  end
-  
-  jisinfo = [];
-  if ~isempty(isinfo) 
-    
-    jisinfo = mpipeline.repository.SubmissionInfo([]);
-    jisinfo.setExperimentTitle(isinfo.experiment_title);
-    jisinfo.setExperimentDescription(isinfo.experiment_description);
-    jisinfo.setAnalysisDescription(isinfo.analysis_description);
-    jisinfo.setQuantity(isinfo.quantity);
-    jisinfo.setKeywords(isinfo.keywords);
-    jisinfo.setReferenceIDs(isinfo.reference_ids);
-    jisinfo.setAdditionalComments(isinfo.additional_comments);
-    jisinfo.setAdditionalAuthors(isinfo.additional_authors);
-    
-  end
-  
-  % Open submit dialog
-  warning('off', 'MATLAB:JavaEDTAutoDelegation');
-  srd = mpipeline.repository.SubmitInfoDialog([], jisinfo, hosts, conn);
-  srd.setVisible(true)
-  warning('on', 'MATLAB:JavaEDTAutoDelegation');
-  
-  sinfo = [];
-  if ~srd.isCancelled
-    
-    jsinfo = srd.getSubmissionInfo;
-    sinfo.experiment_title       = char(jsinfo.getExperimentTitle);
-    sinfo.experiment_description = char(jsinfo.getExperimentDescription);
-    sinfo.analysis_description   = char(jsinfo.getAnalysisDescription);
-    sinfo.quantity               = char(jsinfo.getQuantity);
-    sinfo.keywords               = char(jsinfo.getKeywords);
-    sinfo.reference_ids          = char(jsinfo.getReferenceIDs);
-    sinfo.additional_comments    = char(jsinfo.getAdditionalComments);
-    sinfo.additional_authors     = char(jsinfo.getAdditionalAuthors);
-    
-    jconn = srd.getRepoConnection;    
-    sinfo.conn = jconn; %utils.jmysql.jconnTodbconn(jconn);    
-    if closeConnection
-      jconn.closeConnection;
-    end
-  end
-  
-end
-