template.getQuery().getView().add(node.getPath()); qai.addIndex(qn);
indexes.add(qn);
    protected QueryAndIndexes processTemplate(TemplateQuery template) {        QueryAndIndexes qai = new QueryAndIndexes();        HashMap pathToQueryNode = new HashMap();        Query tmp = MainHelper.makeQuery(template.getQuery(), new HashMap(), pathToQueryNode);        // find nodes with editable constraints to index and possibly add to select list        Iterator niter = template.getNodes().iterator();        while (niter.hasNext()) {            PathNode node = (PathNode) niter.next();            List ecs = template.getConstraints(node);            if (ecs != null && ecs.size() > 0) {                // node has editable constraints                QueryNode qn = (QueryNode) pathToQueryNode.get(node.getPath());                if (qn == null) {                    throw new BuildException("no QueryNode for path " + node.getPath());                }                template.getQuery().getView().add(node.getPath());                qai.addIndex(qn);            }        }        // now generate query with editable constraints removed        template.removeEditableConstraints();        Query query = MainHelper.makeQuery(template.getQuery(), new HashMap(), new HashMap());        qai.setQuery(query);        return qai;    }