view m-toolbox/classes/+utils/@jmysql/queryDialog.m @ 1:2014ba5b353a database-connection-manager

Remove old code
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Sat, 03 Dec 2011 18:13:55 +0100
parents f0afece42f48
children
line wrap: on
line source

% 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