Mercurial > hg > ltpda
diff m-toolbox/classes/@ltpda_uo/retrieve.m @ 12:86aabb42dd84 database-connection-manager
Use utils.repository utilities
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | 75007001cbfe |
children | a59cdb8aaf31 |
line wrap: on
line diff
--- a/m-toolbox/classes/@ltpda_uo/retrieve.m Mon Dec 05 16:20:06 2011 +0100 +++ b/m-toolbox/classes/@ltpda_uo/retrieve.m Mon Dec 05 16:20:06 2011 +0100 @@ -66,13 +66,8 @@ utils.helper.msg(msg.PROC1, 'retrieving collection %d', cid); % get list of object IDs from the collection ID - rows = utils.mysql.execute(conn, 'SELECT nobjs, obj_ids FROM collections WHERE id = ?', cid); - nobjs = rows{1}; - ids = strread(rows{2}, '%d', 'delimiter', ','); - if length(ids) ~= nobjs - error('### inconsistent collection description'); - end - + ids = utils.repository.getCollectionIDs(conn, cid); + else % IDs list if isnumeric([varargin{:}]) @@ -90,12 +85,7 @@ try % get username and user id - username = utils.mysql.execute(conn, 'SELECT SUBSTRING_INDEX(USER(),''@'',1)'); - rows = utils.mysql.execute(conn, 'SELECT id FROM users WHERE username = ?', username{1}); - if isempty(rows) - error('### could not determine user id'); - end - userid = rows{1}; + [username, userid] = utils.repository.getUser(conn); v = ver('LTPDA'); for j=1:length(ids)