Project

General

Profile

« Previous | Next » 

Revision 3552

Added by barteau about 17 years ago

Fixed bug with file updating (lost qformat value). Also fixed bug with message.

View differences:

src/edu/ucsb/nceas/metacat/clientview/ClientViewHelper.java
480 480
            action = (String) paramsMap.get("action");
481 481
            //*** Get the Doc Id.
482 482
            lastDocId = (String) paramsMap.get("docid");
483
            
483 484
            //*** Get the metadata Doc Id.
484 485
            metadataDocId = (String) paramsMap.get("metadataDocId");
486
            clientViewBean.setMetaFileDocId(metadataDocId);
487
            
485 488
            //*** Get the qformat.
486 489
            qFrmt = (String) paramsMap.get("qformat");
487
            
490
            clientViewBean.setQformat(qFrmt);
491

  
488 492
            fNm = fileName.toString();
489 493
            
490 494
            try {
......
530 534
                        newDocId = nextVersion(lastDocId, xPathQuery);
531 535
                        ClientFgdcHelper.updateFileNameAndType(getMetadataDoc().getDocumentElement(), newDocId, fileInfo);
532 536
                        //*** Upload the data file to metacat.
533
                        result = getMetacatClient().upload(newDocId, fNm, inputStream, Integer.MAX_VALUE);
537
                        getMetacatClient().upload(newDocId, fNm, inputStream, Integer.MAX_VALUE);
538
                        result = "Updated to new document (from " + lastDocId + " to " + newDocId + ")";
534 539
                        
535 540
                        //*** Upload the metadata file to metacat.
536 541
                        xPathQuery = ClientFgdcHelper.XPATH_QUERY_TEMPLATE.replaceFirst("%1s", metadataDocId);
......
539 544
                        //*** Save the new meta Doc Id for re-query.
540 545
                        clientViewBean.setMetaFileDocId(newDocId);
541 546
                        clientViewBean.setAction("read"); //*** Set for re-query.
542
                        //result = makeRedirectUrl(newDocId, qFrmt);
543
                        result = "Updated to new document (from " + lastDocId + " to " + newDocId + ")";
544 547
                        
545 548
                    } else {
546 549
                        //***TODO This is EML.
......
800 803
        if (getMetadataDoc() != null) {
801 804
            node = (Node) xpath.evaluate(xPathQuery, getMetadataDoc().getDocumentElement(), XPathConstants.NODE);
802 805
            setTextContent(xpath, node, result);
803
            //node.setTextContent(result);
804 806
        }
805 807
        return(result);
806 808
    }

Also available in: Unified diff