Project

General

Profile

« Previous | Next » 

Revision 2278

Added by sgarg about 20 years ago

Fixed error in handling of multiple additional metadata tags...

View differences:

src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java
918 918
              firstDescribesNodeId = startNodeId;
919 919
              // we started process additional access rules here
920 920
              // because access and describe couldn't be seperated
921
              NodeRecord nodeElement = new NodeRecord(-2, -2, -2, "ELEMENT",
922
                        localName, prefix, MetaCatUtil.normalize(null));
923
              storedAccessNodeStack.push(nodeElement);
921 924
              processAdditionalAccess = true;
922 925
              System.out.println("set processAdditonalAccess ture when meet describe");
923 926
            }
......
1342 1345
                describesId = null;
1343 1346
                describesId = new Vector();
1344 1347
                inAddtionalMetaData = false;
1348
                firstDescribesNodeId = -1;
1349
                // reset tmp stored node stack
1350
                storedAccessNodeStack = null;
1351
                storedAccessNodeStack = new Stack();
1345 1352

  
1353

  
1346 1354
            }
1347 1355
            else if (currentTag.equals(DISTRIBUTION) && !inAddtionalMetaData)
1348 1356
            {
......
1375 1383
            else if (currentTag.equals(DESCRIBES))
1376 1384
            {
1377 1385
                firstDescribesInAdditionalMetadata = false;
1378
                firstDescribesNodeId = -1;
1386

  
1379 1387
            }
1380 1388

  
1381 1389

  
......
1766 1774
      while (!stack1.isEmpty()) {
1767 1775
          // Pop an element from stack1
1768 1776
          NodeRecord record1 = (NodeRecord) stack1.pop();
1777

  
1769 1778
          // Pop an element from stack2(stack 2 maybe empty)
1770 1779
          NodeRecord record2 = null;
1771 1780
          try {
1772 1781
              record2 = (NodeRecord) stack2.pop();
1773 1782
          } catch (EmptyStackException ee) {
1783

  
1774 1784
              MetaCatUtil.debugMessage(
1775 1785
                      "Node stack2 is empty but stack1 isn't!", 35);
1776 1786
              throw new SAXException(UPDATEACCESSERROR);
......
1787 1797

  
1788 1798
      // now stack1 is empty and we should make sure stack2 is empty too
1789 1799
      if (!stack2.isEmpty()) {
1800

  
1790 1801
          MetaCatUtil.debugMessage(
1791
                  "stack2 still have some elements while stack "
1802
                  "stack2 still have some elements while stack1 "
1792 1803
                          + "is empty! ", 30);
1793 1804
          throw new SAXException(UPDATEACCESSERROR);
1794 1805
      }//if
......
2455 2466
     // get old file id from previousUnreadable data object
2456 2467
    String oldInlineInternalFileName =
2457 2468
         (String)previousUnreadableInlineDataObjectHash.get(inlineDistributionId);
2469

  
2458 2470
    if (oldInlineInternalFileName == null ||
2459 2471
        oldInlineInternalFileName.trim().equals(""))
2460 2472
    {

Also available in: Unified diff