Revision 8164
Added by Jing Tao over 10 years ago
MetacatHandler.java | ||
---|---|---|
84 | 84 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
85 | 85 |
import edu.ucsb.nceas.metacat.cart.CartManager; |
86 | 86 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
87 |
import edu.ucsb.nceas.metacat.common.query.EnabledQueryEngines; |
|
87 | 88 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
88 | 89 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
89 | 90 |
import edu.ucsb.nceas.metacat.dataone.SystemMetadataFactory; |
... | ... | |
2537 | 2538 |
try { |
2538 | 2539 |
response.setContentType("text/xml"); |
2539 | 2540 |
PrintWriter out = response.getWriter(); |
2541 |
if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) { |
|
2542 |
out.print("<error>"); |
|
2543 |
out.print(DBQuery.XPATHQUERYOFFINFO); |
|
2544 |
out.print("</error>"); |
|
2545 |
return; |
|
2546 |
} |
|
2540 | 2547 |
|
2541 | 2548 |
// Check that the user is authenticated as an administrator account |
2542 | 2549 |
if (!AuthUtil.isAdministrator(username, groups)) { |
... | ... | |
2690 | 2697 |
* @param out the PrintWriter to which output is printed |
2691 | 2698 |
*/ |
2692 | 2699 |
private void buildDocumentIndex(String docid, PrintWriter out) { |
2700 |
//if the pathquery option is off, we don't need to build index. |
|
2701 |
if(!EnabledQueryEngines.getInstance().isEnabled(EnabledQueryEngines.PATHQUERYENGINE)) { |
|
2702 |
return; |
|
2703 |
} |
|
2693 | 2704 |
try { |
2694 | 2705 |
DocumentImpl doc = new DocumentImpl(docid, false); |
2695 | 2706 |
doc.buildIndex(); |
Also available in: Unified diff
If the pathquery engine is disabled, the xml path index queue will be disabled as well.