Project

General

Profile

« Previous | Next » 

Revision 2641

Added by Jing Tao over 18 years ago

Change the code to make sure DocumentImpl class's constructor should have rev attached.

View differences:

DBQuery.java
481 481
                    // xmldoc = new DocumentImpl(dbconn, packageDocid);
482 482
                    //  thus use the following to get the doc info only
483 483
                    //  xmldoc = new DocumentImpl(dbconn);
484
                    xmldoc = new DocumentImpl(packageDocid, false);
484
                    String accNumber = packageDocid + MetaCatUtil.getOption("accNumSeparator") +
485
                    DBUtil.getLatestRevisionInDocumentTable(packageDocid);
486
                    xmldoc = new DocumentImpl(accNumber, false);
485 487
                    if (xmldoc == null)
486 488
                    {
487 489
                       MetaCatUtil.debugMessage("Document was null for: "
......
1621 1623
     *
1622 1624
     * @param dataPackageDocid, the string in docId field of xml_relation table
1623 1625
     */
1624
    private Vector getOldVersionDocidListForDataPackage(String dataPackageDocid)
1626
    private Vector getOldVersionDocidListForDataPackage(String dataPackageDocidWithRev)
1625 1627
    {
1626 1628

  
1627 1629
        Vector docIdList = new Vector();//return value
......
1629 1631
        String xml = null;
1630 1632

  
1631 1633
        // Check the parameter
1632
        if (dataPackageDocid == null || dataPackageDocid.equals("")) { return docIdList; }//if
1634
        if (dataPackageDocidWithRev == null || dataPackageDocidWithRev.equals("")) { return docIdList; }//if
1633 1635

  
1634 1636
        try {
1635 1637
            //initial a documentImpl object
1636
            DocumentImpl packageDocument = new DocumentImpl(dataPackageDocid);
1638
            DocumentImpl packageDocument = new DocumentImpl(dataPackageDocidWithRev);
1637 1639
            //transfer to documentImpl object to string
1638 1640
            xml = packageDocument.toString();
1639 1641

  
......
2045 2047
    /**
2046 2048
     * put a data packadge into a zip output stream
2047 2049
     *
2048
     * @param docId, which the user want to put into zip output stream
2050
     * @param docId, which the user want to put into zip output stream,it has version
2049 2051
     * @param out, a servletoutput stream which the zip output stream will be
2050 2052
     *            put
2051 2053
     * @param user, the username of the user
......
2092 2094
                throw e;
2093 2095
            }
2094 2096

  
2095
            docImpls = new DocumentImpl(docId);
2097
            docImpls = new DocumentImpl(docIdString);
2096 2098
            //checking if the user has the permission to read the documents
2097 2099
            if (DocumentImpl.hasReadPermission(user, groups, docImpls
2098 2100
                    .getDocID())) {

Also available in: Unified diff