# HG changeset patch # User Daniele Nicolodi # Date 1323098406 -3600 # Node ID 86aabb42dd8466034848ba8f6a9a9609e07d982a # Parent 9174aadb93a56093645453051589d2fbc3f6d60a Use utils.repository utilities diff -r 9174aadb93a5 -r 86aabb42dd84 m-toolbox/classes/@ltpda_uo/retrieve.m --- 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)