Project

General

Profile

« Previous | Next » 

Revision 1068

Added by Jing Tao almost 22 years ago

Revise Update method.

View differences:

src/edu/ucsb/nceas/metacat/ReplicationHandler.java
269 269
            String docInfoStr = MetacatReplication.getURLContent(docinfoUrl);
270 270
            docinfoParser.parse(new InputSource(new StringReader(docInfoStr)));
271 271
            Hashtable docinfoHash = dih.getDocInfo();
272
            int serverCode = MetacatReplication.getServerCode(docServer);
272
            String docHomeServer = (String)docinfoHash.get("home_server");
273
            //int serverCode = MetacatReplication.getServerCode(docServer);
273 274
            //System.out.println("updating doc: " + docid +" action: "+ action);
274 275
            //docid should include rev number too
275 276
            String accnum=docid+util.getOption("accNumSeparator")+
......
277 278
            //System.out.println("accnum: "+accnum);
278 279
            try
279 280
            {
280
              String newDocid = DocumentImpl.write(conn, 
281
             
282
              String newDocid = DocumentImpl.writeReplication(conn, 
281 283
                              new StringReader(newxmldoc),
282 284
                              (String)docinfoHash.get("public_access"),
283 285
                              null,  /* the dtd text */
......
285 287
                              accnum, 
286 288
                              (String)docinfoHash.get("user_owner"),
287 289
                              null, /* null for groups[] */
288
                              serverCode, 
289
                              true, /* override */
290
                              docHomeServer, 
290 291
                              false /* validate */);
291 292
              MetacatReplication.replLog("wrote doc " + docid + " from " + 
292 293
                                         docServer);
......
319 320
            String docName = (String)docinfoHash.get("docname");
320 321
            String docType = (String)docinfoHash.get("doctype");
321 322
            String docHomeServer = (String)docinfoHash.get("home_server");
323
          
322 324
            //int serverCode = MetacatReplication.getServerCode(docServer);
323 325
            //System.out.println("updating doc: " + docid +" action: "+ action);
324 326
            //docid should include rev number too

Also available in: Unified diff