Project

General

Profile

Revision 2464

Added by sgarg over 16 years ago

Modified code for computing the returnfield string - earlier only elements were used to construct the string. e.g. /dataset/title
Now attributes are also added to the returnfield. e.g. title/@id

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
947 947

  
948 948
        // Create a temporary vector and copy returnFieldList into it
949 949
        Vector tempVector = new Vector();
950

  
950 951
        Iterator it = returnFieldList.iterator();
951 952
        while(it.hasNext()){
952 953
            tempVector.add(it.next());
953 954
        }
954 955

  
956
        Enumeration attEnum = attributeReturnList.elements();
957
        while(attEnum.hasMoreElements()){
958
            Iterator tempIt = ((Vector)attEnum.nextElement()).iterator();
959
	    String rfield = "";
960
            if(tempIt.hasNext()){
961
		String element = (String)tempIt.next();
962
		if(element != null) { 
963
		    rfield +=element; 
964
		}
965
	    }
966
            if(tempIt.hasNext()){
967
		String attribute = (String)tempIt.next();
968
		if(attribute != null) { 
969
  		    rfield = "@" + attribute; 
970
                }
971
	    }
972
            tempVector.add(rfield);
973
        }
974

  
955 975
        // Sort the temporary vector
956 976
        java.util.Collections.sort(tempVector);
957 977

  

Also available in: Unified diff