Project

General

Profile

« Previous | Next » 

Revision 3395

Added by barteau about 17 years ago

Modifications to the removeDataDocIdFromFGDC method, to use the metadata Doc Id rather than the data file Doc Id, to locate the FGDC node branch to update.

View differences:

src/edu/ucsb/nceas/metacat/clientview/ClientFgdcHelper.java
9 9

  
10 10
package edu.ucsb.nceas.metacat.clientview;
11 11

  
12
import com.oreilly.servlet.multipart.MultipartParser;
13 12
import edu.ucsb.nceas.metacat.client.MetacatException;
14 13
import edu.ucsb.nceas.utilities.XMLUtilities;
15 14
import java.io.BufferedReader;
......
127 126
        //*** Get the metadata document and remove the digform branch.
128 127
        doc = clientViewHelper.getMetadataDoc();
129 128
        if (doc != null) {
130
            //pathToDigform = String.format(PATH4ANCESTOR, docId, "digform");
131 129
            tmp = PATH4ANCESTOR.replaceFirst("%1s", docId);
132 130
            pathToDigform = tmp.replaceFirst("%2s", "digform");
133 131
            node = (Node) xpath.evaluate(pathToDigform, doc.getDocumentElement(), XPathConstants.NODE);
134 132
            node.getParentNode().removeChild(node);
135
            //xPathQuery = String.format(XPATH_QUERY_TEMPLATE, docId);
136
            xPathQuery = XPATH_QUERY_TEMPLATE.replaceFirst("%1s", docId);
133
            xPathQuery = XPATH_QUERY_TEMPLATE.replaceFirst("%1s", parentDocId);
137 134
            revision = clientViewHelper.nextVersion(parentDocId, xPathQuery);
138 135
            reader = XMLUtilities.getDOMTreeAsReader(doc.getDocumentElement(), false);
139 136
            clientViewHelper.getMetacatClient().update(revision, reader, null);

Also available in: Unified diff