Project

General

Profile

« Previous | Next » 

Revision 4892

split vocab/value into two columns (can easily switch back to single column)

View differences:

lib/style/skins/first/download.jsp
72 72
		//all vocab names/values
73 73
		List allVocabNames = new ArrayList();
74 74
		List allVocabValues = new ArrayList();
75
		boolean twoColumnMetadata = true;
75 76
		
76 77
		int colCount = rs.getMetaData().getColumnCount();
77 78
		String idColName = rs.getMetaData().getColumnName(idCol);
......
210 211
			OrderedMap row = (OrderedMap) metadataHeaders.get(label);
211 212
			List rowValues = new ArrayList(row.values());
212 213
			rowValues.add(0, label);
214
			if (twoColumnMetadata) {
215
				//add extra column
216
				rowValues.add(1, null);
217
			}
213 218
			retTable.add(rowValues.toArray(new String[0]));
214 219
		}
215 220
		
......
225 230
			if (uniqueVocabs.contains(key)) {
226 231
				continue;
227 232
			}
228
			uniqueVocabs.add(key);
229
			//TODO: expand the column count by one for _everything_
230
			vocabRow.add(key);
231
			//vocabRow.add(vocabName);
232
			//vocabRow.add(vocabValue);
233
			uniqueVocabs.add(key);			
234
			if (twoColumnMetadata) {
235
				vocabRow.add(vocabName);
236
				vocabRow.add(vocabValue);
237
			}
238
			else {
239
				vocabRow.add(key);
240
			}
233 241
			//go through the questions now, again
234 242
			headerIter = header.iterator();
235 243
			while (headerIter.hasNext()) {
......
260 268
		//put the vocab matrix on the table
261 269
		retTable.addAll(vocabTable);
262 270
		
271
		if (twoColumnMetadata) {
272
			//add column to data header row
273
			header.add(1, null);
274
		}
263 275
		//put the data header row on the table
264 276
		retTable.add(header.toArray(new String[0]));
265 277
		
......
281 293
				row.add(value);
282 294
			}
283 295
			rowCount++;
296
			if (twoColumnMetadata) {
297
				//add extra column
298
				row.add(1, null);
299
			}
284 300
			retTable.add(row.toArray(new String[0]));
285 301
		}
286 302
		

Also available in: Unified diff