r4892 - trunk/lib/style/skins/first
leinfelder at ecoinformatics.org
leinfelder at ecoinformatics.org
Thu Apr 2 09:36:24 PDT 2009
Author: leinfelder
Date: 2009-04-02 09:36:23 -0700 (Thu, 02 Apr 2009)
New Revision: 4892
Modified:
trunk/lib/style/skins/first/download.jsp
Log:
split vocab/value into two columns (can easily switch back to single column)
Modified: trunk/lib/style/skins/first/download.jsp
===================================================================
--- trunk/lib/style/skins/first/download.jsp 2009-04-02 00:01:34 UTC (rev 4891)
+++ trunk/lib/style/skins/first/download.jsp 2009-04-02 16:36:23 UTC (rev 4892)
@@ -72,6 +72,7 @@
//all vocab names/values
List allVocabNames = new ArrayList();
List allVocabValues = new ArrayList();
+ boolean twoColumnMetadata = true;
int colCount = rs.getMetaData().getColumnCount();
String idColName = rs.getMetaData().getColumnName(idCol);
@@ -210,6 +211,10 @@
OrderedMap row = (OrderedMap) metadataHeaders.get(label);
List rowValues = new ArrayList(row.values());
rowValues.add(0, label);
+ if (twoColumnMetadata) {
+ //add extra column
+ rowValues.add(1, null);
+ }
retTable.add(rowValues.toArray(new String[0]));
}
@@ -225,11 +230,14 @@
if (uniqueVocabs.contains(key)) {
continue;
}
- uniqueVocabs.add(key);
- //TODO: expand the column count by one for _everything_
- vocabRow.add(key);
- //vocabRow.add(vocabName);
- //vocabRow.add(vocabValue);
+ uniqueVocabs.add(key);
+ if (twoColumnMetadata) {
+ vocabRow.add(vocabName);
+ vocabRow.add(vocabValue);
+ }
+ else {
+ vocabRow.add(key);
+ }
//go through the questions now, again
headerIter = header.iterator();
while (headerIter.hasNext()) {
@@ -260,6 +268,10 @@
//put the vocab matrix on the table
retTable.addAll(vocabTable);
+ if (twoColumnMetadata) {
+ //add column to data header row
+ header.add(1, null);
+ }
//put the data header row on the table
retTable.add(header.toArray(new String[0]));
@@ -281,6 +293,10 @@
row.add(value);
}
rowCount++;
+ if (twoColumnMetadata) {
+ //add extra column
+ row.add(1, null);
+ }
retTable.add(row.toArray(new String[0]));
}
More information about the Metacat-cvs
mailing list