Revision 8200
Added by ben leinfelder over 10 years ago
MNodeService.java | ||
---|---|---|
1622 | 1622 |
// this is probably okay for many sci meta data docs |
1623 | 1623 |
logMetacat.warn("No potential ORE map found for: " + potentialOreIdentifier.getValue()); |
1624 | 1624 |
// try the SOLR index |
1625 |
List<Identifier> potentialOreIdentifiers = this.lookupOreFor(originalIdentifier); |
|
1625 |
List<Identifier> potentialOreIdentifiers = this.lookupOreFor(originalIdentifier, false);
|
|
1626 | 1626 |
if (potentialOreIdentifiers != null) { |
1627 | 1627 |
potentialOreIdentifier = potentialOreIdentifiers.get(0); |
1628 | 1628 |
try { |
... | ... | |
1722 | 1722 |
* @param guid of the EML/packaging object |
1723 | 1723 |
* @return list of resource map identifiers for the given pid |
1724 | 1724 |
*/ |
1725 |
public List<Identifier> lookupOreFor(Identifier guid) { |
|
1725 |
public List<Identifier> lookupOreFor(Identifier guid, boolean includeObsolete) {
|
|
1726 | 1726 |
// Search for the ORE if we can find it |
1727 | 1727 |
String pid = guid.getValue(); |
1728 | 1728 |
List<Identifier> retList = null; |
1729 | 1729 |
try { |
1730 |
MockHttpServletRequest request = new MockHttpServletRequest(null, null, null); |
|
1731 |
String query = "fl=id,resourceMap&wt=xml&q=formatType:METADATA+-obsoletedBy:*+resourceMap:*+id:\"" + pid + "\""; |
|
1730 |
String query = "fl=id,resourceMap&wt=xml&q=-obsoletedBy:*+resourceMap:*+id:\"" + pid + "\"";; |
|
1731 |
if (includeObsolete) { |
|
1732 |
query = "fl=id,resourceMap&wt=xml&q=resourceMap:*+id:\"" + pid + "\""; |
|
1733 |
} |
|
1734 |
|
|
1732 | 1735 |
InputStream results = this.query("solr", query); |
1733 | 1736 |
org.w3c.dom.Node rootNode = XMLUtilities.getXMLReaderAsDOMTreeRootNode(new InputStreamReader(results, "UTF-8")); |
1734 | 1737 |
//String resultString = XMLUtilities.getDOMTreeAsString(rootNode); |
Also available in: Unified diff
only attempt to generate OREs for objects that we know not to have them already. https://projects.ecoinformatics.org/ecoinfo/issues/6061