Jing,
In regards to the bug where only one attribute per element is returned
in a metacat pathquery, I found a fix that I want to run by you. I'm
not sure if there was a reason that this limitation was coded, but it
seems like an unreasonable thing to enforce.
In the method putInArray(...) I've commented out the for loop that
checks if there is already an entry with the same parentId. This allows
multiple ReturnFieldValues with the same parent to be included in the
results. The method is only called on line 1178 of
edu.ucsb.nceas.metacat.DBQuery in metacat. I've included it below (with
my change).
Do you think this is an appropriate solution? I'll wait to check it
into cvs until I hear back.
Thanks,
-ben
Method starting on line 1404:
/*
* A method to put key and value in Vector
*/
private void putInArray(Vector parentidList, String key,
ReturnFieldValue value)
{
Vector tempVector = null;
// for (int count = 0; count < parentidList.size(); count++) {
// tempVector = (Vector) parentidList.get(count);
//
//
// if (key.compareTo((String) tempVector.get(0)) == 0) {
// tempVector.remove(1);
// tempVector.add(1, value);
// return;
// }
// }
tempVector = new Vector();
tempVector.add(0, key);
tempVector.add(1, value);
parentidList.add(tempVector);
return;
}