Project

General

Profile

« Previous | Next » 

Revision 6907

check that the resourceMap (based on Id only) does not currently exist in the local metacat when generating OREs

View differences:

src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java
566 566
								}
567 567
							}
568 568
				            
569
							// save it locally
570
							Session session = new Session();
571
							session.setSubject(submitter);
572
							MockHttpServletRequest request = new MockHttpServletRequest(null, null, null);
573
							MNodeService.getInstance(request).insertDataObject(IOUtils.toInputStream(resourceMapXML, MetaCatServlet.DEFAULT_ENCODING), resourceMapId, session);
574
							MNodeService.getInstance(request).insertSystemMetadata(resourceMapSysMeta);
569
							// save it locally, if it doesn't already exist
570
							if (!IdentifierManager.getInstance().identifierExists(resourceMapId.getValue())) {
571
								Session session = new Session();
572
								session.setSubject(submitter);
573
								MockHttpServletRequest request = new MockHttpServletRequest(null, null, null);
574
								MNodeService.getInstance(request).insertDataObject(IOUtils.toInputStream(resourceMapXML, MetaCatServlet.DEFAULT_ENCODING), resourceMapId, session);
575
								MNodeService.getInstance(request).insertSystemMetadata(resourceMapSysMeta);
576
								logMetacat.info("Inserted ORE package: " + resourceMapId.getValue());
577
							}
575 578
			        	}
576 579
			        }
577 580
				}

Also available in: Unified diff