37 |
37 |
import org.apache.solr.common.params.SolrParams;
|
38 |
38 |
import org.apache.solr.schema.IndexSchema;
|
39 |
39 |
import org.apache.solr.servlet.SolrRequestParsers;
|
40 |
|
import org.dataone.cn.indexer.XPathDocumentParser;
|
|
40 |
import org.dataone.cn.indexer.XmlDocumentUtility;
|
41 |
41 |
import org.dataone.cn.indexer.convert.SolrDateConverter;
|
42 |
|
import org.dataone.cn.indexer.parser.AbstractDocumentSubprocessor;
|
|
42 |
import org.dataone.cn.indexer.parser.BaseXPathDocumentSubprocessor;
|
43 |
43 |
import org.dataone.cn.indexer.parser.IDocumentSubprocessor;
|
44 |
44 |
import org.dataone.cn.indexer.resourcemap.ResourceMap;
|
45 |
45 |
import org.dataone.cn.indexer.resourcemap.ResourceMapFactory;
|
... | ... | |
63 |
63 |
* The solr doc of the ResourceMap self only has the system metadata information.
|
64 |
64 |
* The solr docs of the science metadata doc and data file have the resource map package information.
|
65 |
65 |
*/
|
66 |
|
public class ResourceMapSubprocessor extends AbstractDocumentSubprocessor implements IDocumentSubprocessor {
|
|
66 |
public class ResourceMapSubprocessor extends BaseXPathDocumentSubprocessor implements IDocumentSubprocessor {
|
67 |
67 |
|
68 |
68 |
private static final String QUERY ="q=id:";
|
69 |
69 |
private static final String QUERY2="q="+SolrElementField.FIELD_RESOURCEMAP+":";
|
... | ... | |
82 |
82 |
InputStream is) throws IOException, EncoderException, SAXException,
|
83 |
83 |
XPathExpressionException, ParserConfigurationException, SolrServerException, NotImplemented, NotFound, UnsupportedType, OREParserException, ResourceMapException {
|
84 |
84 |
SolrDoc resourceMapDoc = docs.get(identifier);
|
85 |
|
Document doc = XPathDocumentParser.generateXmlDocument(is);
|
|
85 |
Document doc = XmlDocumentUtility.generateXmlDocument(is);
|
86 |
86 |
List<SolrDoc> processedDocs = processResourceMap(resourceMapDoc, doc );
|
87 |
87 |
Map<String, SolrDoc> processedDocsMap = new HashMap<String, SolrDoc>();
|
88 |
88 |
for (SolrDoc processedDoc : processedDocs) {
|
use refactored classes from cn-index-processor. still in flux, but improving to better handle non-xml files