Revision 8069
Added by ben leinfelder over 11 years ago
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/resourcemap/ResourceMapSubprocessor.java | ||
---|---|---|
69 | 69 |
import org.dataone.cn.indexer.parser.AbstractDocumentSubprocessor; |
70 | 70 |
import org.dataone.cn.indexer.parser.IDocumentSubprocessor; |
71 | 71 |
import org.dataone.cn.indexer.resourcemap.ResourceMap; |
72 |
import org.dataone.cn.indexer.resourcemap.ResourceMapFactory; |
|
73 | 72 |
import org.dataone.cn.indexer.solrhttp.SolrDoc; |
74 | 73 |
import org.dataone.cn.indexer.solrhttp.SolrElementField; |
75 | 74 |
import org.dataone.service.exceptions.NotFound; |
... | ... | |
128 | 127 |
private List<SolrDoc> processResourceMap(SolrDoc indexDocument, Document resourceMapDocument) |
129 | 128 |
throws XPathExpressionException, IOException, SAXException, ParserConfigurationException, EncoderException, SolrServerException, NotImplemented, NotFound, UnsupportedType, OREParserException{ |
130 | 129 |
//ResourceMap resourceMap = new ResourceMap(resourceMapDocument); |
131 |
ResourceMap resourceMap = ResourceMapFactory.buildResourceMap(resourceMapDocument);
|
|
130 |
ResourceMap resourceMap = new ResourceMap(resourceMapDocument);
|
|
132 | 131 |
List<String> documentIds = resourceMap.getAllDocumentIDs();//this list includes the resourceMap id itself. |
133 | 132 |
//List<SolrDoc> updateDocuments = getHttpService().getDocuments(getSolrQueryUri(), documentIds); |
134 | 133 |
List<SolrDoc> updateDocuments = getSolrDocs(resourceMap.getIdentifier(), documentIds); |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java | ||
---|---|---|
63 | 63 |
import org.dataone.cn.indexer.parser.SolrField; |
64 | 64 |
import org.dataone.cn.indexer.resourcemap.ResourceEntry; |
65 | 65 |
import org.dataone.cn.indexer.resourcemap.ResourceMap; |
66 |
import org.dataone.cn.indexer.resourcemap.ResourceMapFactory; |
|
67 | 66 |
import org.dataone.cn.indexer.solrhttp.SolrDoc; |
68 | 67 |
import org.dataone.cn.indexer.solrhttp.SolrElementField; |
69 | 68 |
import org.dataone.service.exceptions.NotFound; |
... | ... | |
548 | 547 |
private void removeDataPackage(String pid) throws ServiceFailure, SAXException, XPathExpressionException, NotImplemented, NotFound, UnsupportedType, SolrServerException, IOException, ParserConfigurationException, OREParserException { |
549 | 548 |
Document resourceMapDoc = generateXmlDocument(DistributedMapsFactory.getDataObject(pid)); |
550 | 549 |
//ResourceMap resourceMap = new ResourceMap(resourceMapDoc); |
551 |
ResourceMap resourceMap = ResourceMapFactory.buildResourceMap(resourceMapDoc);
|
|
550 |
ResourceMap resourceMap = new ResourceMap(resourceMapDoc);
|
|
552 | 551 |
List<String> documentIds = resourceMap.getAllDocumentIDs(); |
553 | 552 |
List<SolrDoc> indexDocuments =ResourceMapSubprocessor.getSolrDocs(documentIds); |
554 | 553 |
removeFromIndex(pid); |
Also available in: Unified diff
use the v1.1.x branch ResourceMap class for metacat-index