use of org.mycore.services.fieldquery.MCRQueryParser in project mycore by MyCoRe-Org.
the class MCRQLSearchUtilsTest method getMCRQuery.
private MCRQuery getMCRQuery(String mcrql) {
LogManager.getLogger(getClass()).info("Building query from condition: {}", mcrql);
Element query = new Element("query").setAttribute("numPerPage", "20");
Element conditions = new Element("conditions").setAttribute("format", "xml");
MCRCondition<Void> condition = new MCRQueryParser().parse(mcrql);
query.addContent(conditions);
conditions.addContent(condition.toXML());
Document queryDoc = new Document(query);
return MCRQLSearchUtils.buildFormQuery(queryDoc.getRootElement());
}
Aggregations