Project

General

Profile

« Previous | Next » 

Revision 8628

example of how we can look up pid (guid) given a metacat docid.

View differences:

src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java
2002 2002
                                        inlineFileName, subreeid);
2003 2003
             // Save guid of data object for syncing of access policy with CN after parsing
2004 2004
             // is successful (see DocumentImpl.write)
2005
             guidsToSync.add(inlineFileName);
2005
             
2006
             // look-up pid assuming docid
2007
             String dataGuid = inlineFileName;
2008
             try {
2009
	             String dataDocid = DocumentUtil.getDocIdFromAccessionNumber(inlineFileName);
2010
	             int dataRev = DocumentUtil.getRevisionFromAccessionNumber(inlineFileName);
2011
	             dataGuid = IdentifierManager.getInstance().getGUID(dataDocid, dataRev);
2012
             } catch (McdbDocNotFoundException e) {
2013
            	 // log the warning
2014
            	 logMetacat.warn("No pid found for [assumed] data docid: " + inlineFileName);
2015
            	 // what do you do?
2016
             }
2017
			guidsToSync.add(dataGuid);
2006 2018
           }
2007 2019
           else if (onlineURLDistributionIdList.containsKey(subreeid))
2008 2020
           {

Also available in: Unified diff