Project

General

Profile

« Previous | Next » 

Revision 2467

Added by Chris Jones over 19 years ago

Changed the handleReturnField() method so that it handles path expressions with
only attributes in the path.

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
656 656
        // make sure if return fields has an attribute or not
657 657
        if (inputString.indexOf(ATTRIBUTESYMBOL) == -1) {
658 658
            // no attribute value will be returned
659
            MetaCatUtil.debugMessage("QuerySpecification.handleReturnField(): " , 35);
660
            MetaCatUtil.debugMessage("  there are no attributes in the XPATH statement" , 35);
659 661
            returnFieldList.add(inputString);
660 662
            containsExtendedSQL = true;
661 663
        } else {
664
            
665
          if ( inputString.startsWith(ATTRIBUTESYMBOL) ) {
666
            
667
            // case where the return field is solely an attribute
668
            MetaCatUtil.debugMessage("QuerySpecification.handleReturnField(): " , 35);
669
            MetaCatUtil.debugMessage("  there are *only* attributes in the XPATH statement" , 35);
670
            returnFieldList.add(inputString);
671
            containsExtendedSQL = true;
672
          } else {
662 673
            // has a attribute return field
663 674
            // divied the return filed into two parts, one is path and the
664 675
            // other is attribue name
676
            MetaCatUtil.debugMessage("QuerySpecification.handleReturnField: " , 35);
677
            MetaCatUtil.debugMessage("  there are both attributes and elements" , 35);
678
            MetaCatUtil.debugMessage("  in the XPATH statement" , 35);
665 679
            String returnPath = newPathExpressionWithOutAttribute(inputString);
666 680
            String attributeName = getAttributeName(inputString);
667 681
            Vector pathInfo = new Vector();
......
677 691
            countAttributeReturnField++;
678 692
            hasAttributeReturnField = true;
679 693
            containsExtendedSQL = true;
694
          }
680 695
        }
681 696
    }
682 697

  

Also available in: Unified diff