Project

General

Profile

« Previous | Next » 

Revision 826

Added by bojilova over 22 years ago

changes to store namespace prefixes separately from the local names of nodes (elements and attributes)
in xml_nodes.nodeprefix column

View differences:

DocumentImpl.java
431 431
              out.print(">");
432 432
              previousNodeWasElement = false;
433 433
            }  
434
            out.print("</" + currentElement.nodename + ">" );
434
            if ( currentElement.nodeprefix != null ) {
435
              out.print("</" + currentElement.nodeprefix + ":" + 
436
                        currentElement.nodename + ">" );
437
            } else {
438
              out.print("</" + currentElement.nodename + ">" );
439
            }
435 440
            currentElement = (NodeRecord)openElements.peek();
436 441
          }
437 442
        }
......
462 467
        openElements.push(currentNode);
463 468
        util.debugMessage("\n PUSHED: " + currentNode.nodename);
464 469
        previousNodeWasElement = true;
465
        out.print("<" + currentNode.nodename);
470
        if ( currentNode.nodeprefix != null ) {
471
          out.print("<" + currentNode.nodeprefix + ":" + currentNode.nodename);
472
        } else {
473
          out.print("<" + currentNode.nodename);
474
        }
466 475

  
467 476
      // Handle the ATTRIBUTE nodes
468 477
      } else if (currentNode.nodetype.equals("ATTRIBUTE")) {
469
        out.print(" " + currentNode.nodename + "=\""
470
                 + currentNode.nodedata + "\"");
478
        if ( currentNode.nodeprefix != null ) {
479
          out.print(" " + currentNode.nodeprefix + ":" + currentNode.nodename +
480
                    "=\"" + currentNode.nodedata + "\"");
481
        } else {
482
          out.print(" " + currentNode.nodename + "=\"" +
483
                    currentNode.nodedata + "\"");
484
        }
471 485

  
472 486
      // Handle the NAMESPACE nodes
473 487
      } else if (currentNode.nodetype.equals("NAMESPACE")) {
......
512 526
    {
513 527
      NodeRecord currentElement = (NodeRecord)openElements.pop();
514 528
      util.debugMessage("\n POPPED: " + currentElement.nodename);
515
      out.print("</" + currentElement.nodename + ">" );
529
      if ( currentElement.nodeprefix != null ) {
530
        out.print("</" + currentElement.nodeprefix + ":" + 
531
                  currentElement.nodename + ">" );
532
      } else {
533
        out.print("</" + currentElement.nodename + ">" );
534
      }
516 535
    }
517 536
    out.flush();
518 537
  }
......
671 690
    long nodeindex = 0;
672 691
    String nodetype = null;
673 692
    String nodename = null;
693
    String nodeprefix = null;
674 694
    String nodedata = null;
675 695

  
676 696
    try {
677 697
      pstmt =
678 698
      conn.prepareStatement("SELECT nodeid,parentnodeid,nodeindex, " +
679
           "nodetype,nodename,"+               
699
           "nodetype,nodename,nodeprefix,"+               
680 700
           "replace(" +
681 701
           "replace(" +
682 702
           "replace(nodedata,'&','&amp;') " +
......
696 716
        nodeindex = rs.getLong(3);
697 717
        nodetype = rs.getString(4);
698 718
        nodename = rs.getString(5);
699
        nodedata = rs.getString(6);
719
        nodeprefix = rs.getString(6);
720
        nodedata = rs.getString(7);
700 721

  
701 722
        // add the data to the node record list hashtable
702
        NodeRecord currentRecord = new NodeRecord(nodeid, parentnodeid, 
703
                                   nodeindex, nodetype, nodename, nodedata);
723
        NodeRecord currentRecord = new NodeRecord(nodeid,parentnodeid,nodeindex,
724
                                       nodetype, nodename, nodeprefix, nodedata);
704 725
        nodeRecordList.add(currentRecord);
705 726

  
706 727
        // Advance to the next node
......
709 730
      pstmt.close();
710 731

  
711 732
    } catch (SQLException e) {
712
      throw new McdbException("Error accessing database connection from " +
713
                              "DocumentImpl.getNodeRecordList ", e);
733
      throw new McdbException("Error in DocumentImpl.getNodeRecordList " +
734
                              e.getMessage());
714 735
    }
715 736

  
716 737
    if (nodeRecordList != null) {
......
1055 1076
    //force replicate out the new document to each server in our server list.
1056 1077
    if(serverCode == 1)
1057 1078
    { //start the thread to replicate this new document out to the other servers
1058
      ForceReplicationHandler frh = new ForceReplicationHandler(docid, action);
1079
//      ForceReplicationHandler frh = new ForceReplicationHandler(docid, action);
1059 1080
    }
1060 1081
      
1061 1082
    //return (docid + sep + rev);

Also available in: Unified diff