comparison m-toolbox/classes/@ltpda_uo/retrieve.m @ 10:75007001cbfe database-connection-manager

Check for binary only objects
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents fbbfcd56e449
children 86aabb42dd84
comparison
equal deleted inserted replaced
9:fbbfcd56e449 10:75007001cbfe
154 rows = utils.mysql.execute(conn, 'SELECT xml FROM objs WHERE id = ?', ids(j)); 154 rows = utils.mysql.execute(conn, 'SELECT xml FROM objs WHERE id = ?', ids(j));
155 if isempty(rows) 155 if isempty(rows)
156 error('### failed to get data for object %d', ids(j)); 156 error('### failed to get data for object %d', ids(j));
157 end 157 end
158 158
159 % parse xml 159 % check xml
160 if strcmp(rows{1}(1:13), 'binary submit')
161 error('### object %d has binary representation only', ids(j));
162 end
163
164 % parse xml
160 stream = java.io.StringBufferInputStream(java.lang.String(rows{1})); 165 stream = java.io.StringBufferInputStream(java.lang.String(rows{1}));
161 builder = javax.xml.parsers.DocumentBuilderFactory.newInstance.newDocumentBuilder(); 166 builder = javax.xml.parsers.DocumentBuilderFactory.newInstance.newDocumentBuilder();
162 xdoc = builder.parse(stream); 167 xdoc = builder.parse(stream);
163 obj = utils.xml.xmlread(xdoc); 168 obj = utils.xml.xmlread(xdoc);
164 169