Example usage for javax.xml.xpath XPathConstants BOOLEAN

List of usage examples for javax.xml.xpath XPathConstants BOOLEAN

Introduction

In this page you can find the example usage for javax.xml.xpath XPathConstants BOOLEAN.

Prototype

QName BOOLEAN

To view the source code for javax.xml.xpath XPathConstants BOOLEAN.

Click Source Link

Document

The XPath 1.0 boolean data type.

Maps to Java Boolean .

Usage

From source file:org.xwiki.validator.DutchWebGuidelinesValidator.java

/**
 * CSS should be placed in linked files and not mixed with the HTML source code.
 *///from w  ww  .j a  va 2 s.c o m
public void validateRpd9s1() {
    String exprString = "//@style";
    assertFalse(Type.ERROR, "rpd9s1.attr",
            ((Boolean) evaluate(getElement(ELEM_BODY), exprString, XPathConstants.BOOLEAN)));
    assertFalse(Type.ERROR, "rpd9s1.tag",
            getChildren(getElement(ELEM_BODY), "style").getNodeList().getLength() > 0);
}

From source file:org.xwiki.validator.DutchWebGuidelinesValidator.java

/**
 * @param table Table to analyze/*  w ww. ja  v a2 s.c  om*/
 * @return true if the table contains th with ids and td
 */
private boolean hasTableHeadersAndIds(Node table) {
    boolean hasHeadersAndIds = false;

    String exprString = "//td[@headers]";
    hasHeadersAndIds = (Boolean) evaluate(table, exprString, XPathConstants.BOOLEAN);
    exprString = "//th[@id]";
    hasHeadersAndIds = hasHeadersAndIds && (Boolean) evaluate(table, exprString, XPathConstants.BOOLEAN);

    return hasHeadersAndIds;
}

From source file:org.xwiki.validator.DutchWebGuidelinesValidator.java

/**
 * Use the label element to explicitly associate text with an input field in a form.
 *///from w ww . ja  v a2s . co m
public void validateRpd13s1() {
    String message = "rpd13s1.label";
    // type = text|password|checkbox|radio|submit|reset|file|hidden|image|button
    List<String> inputWithoutLabels = Arrays.asList(SUBMIT, RESET, IMAGE, BUTTON, HIDDEN);

    for (Node input : getElements(ELEM_INPUT)) {
        // Some inputs doesn't need a label.
        if (!inputWithoutLabels.contains(getAttributeValue(input, ATTR_TYPE))) {

            // Labelled inputs must have an ID.
            String id = getAttributeValue(input, ATTR_ID);
            assertFalse(Type.ERROR, message, id == null);

            if (id != null) {
                // Looking for the label associated to the input.
                String exprString = "//label[@for='" + id + "']";
                assertTrue(Type.ERROR, message,
                        (Boolean) evaluate(this.document, exprString, XPathConstants.BOOLEAN));
            }
        }
    }
}

From source file:org.xwiki.validator.DutchWebGuidelinesValidator.java

/**
 * Avoid automatic redirection during interaction with forms.
 *///from ww w . j  a va  2s . c o  m
public void validateRpd13s4() {
    for (Node form : getElements(ELEM_FORM)) {
        boolean hasSubmit = false;
        boolean hasDynamicSelect = false;

        String exprString = "//input[@type='submit']";
        hasSubmit = (Boolean) evaluate(form, exprString, XPathConstants.BOOLEAN);
        exprString = "//input[@type='image']";
        hasSubmit = hasSubmit || (Boolean) evaluate(this.document, exprString, XPathConstants.BOOLEAN);
        assertTrue(Type.ERROR, "rpd13s4.submit", hasSubmit);

        exprString = "//select[@onchange]";
        hasDynamicSelect = (Boolean) evaluate(form, exprString, XPathConstants.BOOLEAN);

        if (hasDynamicSelect) {
            addError(Type.WARNING, -1, -1, "rpd13s4.select");
        }
    }
}

From source file:org.xwiki.validator.DutchWebGuidelinesValidator.java

/**
 * Do not add any reset buttons to forms.
 *///from w ww  .j a  v a 2  s . c  om
public void validateRpd13s18() {
    String exprString = "//input[@type='reset']";
    assertFalse(Type.ERROR, "rpd13s18.reset",
            (Boolean) evaluate(this.document, exprString, XPathConstants.BOOLEAN));
}

From source file:org.xwiki.validator.framework.AbstractDOMValidator.java

/**
 * Check if an element has an child element with the given tag name.
 * /*  w w w.  ja  v  a2 s  .  c om*/
 * @param element element to analyze
 * @param tagName tag name to search for
 * @return true if the element has an child element with the given tag name
 */
public boolean hasChildElement(Node element, String tagName) {
    String exprString = XPATH_CATCHALL + tagName;
    return (Boolean) evaluate(element, exprString, XPathConstants.BOOLEAN);

}

From source file:smartrics.rest.fitnesse.fixture.support.XPathBodyTypeAdapter.java

private boolean eval(String expr, String content) {
    try {//  w ww .  j a  v a2s  . c  o m
        NodeList ret = Tools.extractXPath(expr, content);
        return !(ret == null || ret.getLength() == 0);
    } catch (IllegalArgumentException e) {
        // may be evaluatable as BOOLEAN
        LOG.debug("XPath does not evaluate to a node list. " + "Trying to match to boolean: " + expr, e);
    }
    Boolean b = (Boolean) Tools.extractXPath(expr, content, XPathConstants.BOOLEAN);
    return b;
}

From source file:uk.ac.ebi.arrayexpress.utils.saxon.search.AbstractIndexEnvironment.java

public void indexIncrementalFromXmlDB(String indexLocationDirectory, String dbHost, int dbPort,
        String dbPassword, String dbName) throws Exception {
    // I'm upgrading so the baseline is the current nodes number
    int countNodes = getCountDocuments();
    String driverXml = "";
    String connectionString = "";
    Collection coll;/*  w  ww .  j a v a  2  s.c  o m*/
    IndexWriter w = null;
    Map<String, XPathExpression> fieldXpe = new HashMap<String, XPathExpression>();
    logger.info("indexIncrementalFromXmlDB(generic) is starting for [{}], and initially I have[{}] ... ",
            new Object[] { indexId, countNodes });
    try {

        Directory indexTempDirectory = FSDirectory.open(new File(indexLocationDirectory, indexId));
        w = openIndex(indexTempDirectory, indexAnalyzer);
        HierarchicalConfiguration connsConf = (HierarchicalConfiguration) Application.getInstance()
                .getPreferences().getConfSubset("bs.xmldatabase");
        if (null != connsConf) {
            driverXml = connsConf.getString("driver");
            connectionString = connsConf.getString("base") + "://" + dbHost + ":" + dbPort + "/" + dbName;
        } else {
            logger.error("bs.xmldatabase Configuration is missing!!");
        }
        logger.debug("connectionString->" + connectionString);
        coll = DatabaseManager.getCollection(connectionString);
        XPathQueryService service = (XPathQueryService) coll.getService("XPathQueryService", "1.0");

        DocumentInfo source = null;
        Configuration config = ((SaxonEngine) Application.getAppComponent("SaxonEngine")).trFactory
                .getConfiguration();
        XPath xp = new XPathEvaluator(config);
        for (FieldInfo field : fields.values()) {
            fieldXpe.put(field.name, xp.compile(field.path));
            logger.debug("Field Path->[{}]", field.path);
        }

        // the xmldatabase is not very correct and have memory problem for
        // queires with huge results, so its necessary to implement our own
        // iteration mechanism
        //
        // // I will collect all the results
        // ResourceSet set = service.query(this.env.indexDocumentPath);
        long numberResults = 0;
        ResourceSet set = service.query("count(" + indexDocumentPath + ")");
        if (set.getIterator().hasMoreResources()) {
            numberResults = Integer.parseInt((String) set.getIterator().nextResource().getContent());
        }

        // TODO:######################################Change this after -
        // this is just a performance test
        // float percentage=0.1F;
        // numberResults=Math.round(numberResults * percentage);

        logger.debug("Number of results->" + numberResults);
        long pageSizeDefault = 50000;
        if (numberResults > 1000000) {
            pageSizeDefault = 1000000;
        }

        long pageNumber = 1;
        int count = 0;
        Map<String, AttsInfo[]> cacheAtt = new HashMap<String, AttsInfo[]>();
        Map<String, XPathExpression> cacheXpathAtt = new HashMap<String, XPathExpression>();
        Map<String, XPathExpression> cacheXpathAttValue = new HashMap<String, XPathExpression>();
        while ((pageNumber * pageSizeDefault) <= (numberResults + pageSizeDefault - 1)) {
            // calculate the last hit
            long pageInit = (pageNumber - 1) * pageSizeDefault + 1;
            long pageSize = (pageNumber * pageSizeDefault < numberResults) ? pageSizeDefault
                    : (numberResults - pageInit + 1);

            service = (XPathQueryService) coll.getService("XPathQueryService", "1.0");

            // xquery paging using subsequence function
            long time = System.nanoTime();
            // TODO: I'm assuming that there is always an attribute @id in
            // each element
            set = service.query("for $x in(subsequence(" + indexDocumentPath + "/@id," + pageInit + ","
                    + pageSize + ")) return string($x)");
            double ms = (System.nanoTime() - time) / 1000000d;
            logger.info("Query XMLDB took ->[{}]", ms);

            ResourceIterator iter = set.getIterator();
            XPath xp2;
            XPathExpression xpe2;
            List documentNodes;
            StringReader reader;
            // cache of distinct attributes fora each sample group

            while (iter.hasMoreResources()) {
                count++;
                logger.debug("its beeing processed the number ->" + count);
                String idToProcess = (String) iter.nextResource().getContent();

                logger.debug("@id that is being processed->" + idToProcess);
                // I need to get the sample
                ResourceSet setid = service.query(indexDocumentPath + "[@id='" + idToProcess + "']");
                ResourceIterator iterid = setid.getIterator();
                while (iterid.hasMoreResources()) {
                    StringBuilder xml = new StringBuilder();
                    xml.append((String) iterid.nextResource().getContent());
                    // logger.debug(xml.toString());
                    reader = new StringReader(xml.toString());
                    source = config.buildDocument(new StreamSource(reader));

                    // logger.debug("XML DB->[{}]",
                    // PrintUtils.printNodeInfo((NodeInfo) source, config));
                    Document d = new Document();

                    xp2 = new XPathEvaluator(source.getConfiguration());

                    int position = indexDocumentPath.lastIndexOf("/");
                    // TODO: I also need to change this
                    String pathRoot = "";
                    if (position != -1) {
                        pathRoot = indexDocumentPath.substring(position);
                    } else {
                        pathRoot = indexDocumentPath;
                    }
                    // logger.debug("PathRoot->[{}]",pathRoot);
                    xpe2 = xp2.compile(pathRoot);
                    documentNodes = (List) xpe2.evaluate(source, XPathConstants.NODESET);

                    for (Object node : documentNodes) {
                        // logger.debug("XML DB->[{}]",PrintUtils.printNodeInfo((NodeInfo)node,config));

                        String idElement = (String) fieldXpe.get("id").evaluate(node, XPathConstants.STRING);
                        // I need to see if it already exists
                        // I will also add this document if it is nor marked
                        // as "todelete"
                        Boolean toDelete = (Boolean) fieldXpe.get("delete").evaluate(node,
                                XPathConstants.BOOLEAN);

                        // TODO:######################################Change
                        // this after - this is just a performance test
                        int deletePercentage = 10;
                        toDelete = (count % deletePercentage) == 0 ? true : false;

                        logger.debug(
                                "Incremental Update - The document [{}] is being processed and is marked to delete?[{}]",
                                new Object[] { idElement, toDelete });
                        // I will always try to delete the document (i don't
                        // know if it is new or if it was changed)
                        Term idTerm = new Term("id", idElement.toLowerCase());
                        int countToDelete = getIndexReader().docFreq(idTerm);
                        if (countToDelete > 0) {
                            // if has more than one, I have to send an email
                            // to warn
                            if (countToDelete > 1) {
                                Application.getInstance().sendEmail(null, null,
                                        "BIOSAMPLES ERROR - Incremental Update - Removing more than one document! id-> "
                                                + idElement,
                                        " documents found:" + countToDelete);
                                // I will launch an exception
                                throw new Exception(
                                        "BIOSAMPLES ERROR - Incremental Update -  Removing more than one document in incremental update id-> "
                                                + idElement + " documents found:" + countToDelete);
                            }
                            logger.debug("The document with id [{}] is being deleted from Lucene", idElement);
                            w.deleteDocuments(idTerm);
                            // need to remove one from the number of
                            // documents count
                            countNodes--;

                        }
                        // the element doesn't exist on GUI
                        else {
                            // if it is marked to delete I will just an
                            // warning email - it's possible that it was
                            // inserted and deleted on the Backend but it
                            // had never been sent to the GUI before
                            if (toDelete) {
                                Application.getInstance().sendEmail(null, null,
                                        "BIOSAMPLES WARNING - Incremental Update - Id marked for deletion but the id doesn't exist on the GUI! id-> "
                                                + idElement,
                                        "");

                            }
                        }

                        // if (toDelete) {
                        // logger.debug(
                        // "The document with id [{}] was marked to deletion so I will not process it",
                        // idElement);
                        // } else {

                        // I just process it is it is not for deletion)
                        if (!toDelete) {
                            try {
                                d = processEntryIndex(node, config, service, fieldXpe);

                            } catch (Exception x) {
                                String xmlError = PrintUtils.printNodeInfo((NodeInfo) node, config);
                                logger.error("XML that was being processed when the error occurred DB->[{}]",
                                        xmlError);
                                // to avoid the next running to stop
                                // because its not able to delete the
                                // newSetup directory
                                w.close();
                                throw new Exception("Xml that is being processed:" + xmlError, x);
                            }
                            countNodes++;
                            addIndexDocument(w, d);
                        }
                    }

                    // }

                    documentNodes = null;
                    source = null;
                    reader = null;
                    xml = null;
                    // logger.debug("count->[{}]", countNodes);

                }
            }
            logger.debug("until now it were processed->[{}]", pageNumber * pageSizeDefault);
            pageNumber++;
            //            if (coll != null) {
            //               try {
            //                  // coll.close();
            //               } catch (Exception e) {
            //                  // TODO Auto-generated catch block
            //                  e.printStackTrace();
            //               }
            //            }
            set = null;

        }

        setCountDocuments(countNodes);
        // add metadata to the lucene index
        Map<String, String> map = new HashMap<String, String>();
        map.put("numberDocs", Integer.toString(countNodes));
        map.put("date", Long.toString(System.nanoTime()));
        // logger.debug(Application.getInstance().getComponent("XmlDbConnectionPool").getMetaDataInformation());
        // I cannot call directly
        // getComponent("XmlDbConnectionPool").getMetaDataInformation(),
        // because I can be working in a did
        String dbInfo = ((XmlDbConnectionPool) Application.getInstance().getComponent("XmlDbConnectionPool"))
                .getDBInfo(dbHost, dbPort, dbPassword, dbName);

        // TODO: I need to put here what I have before - to track all the
        // changes (old numberDocs + old date + oldDBInfo)
        map.put("DBInfo", dbInfo + "<BR>##################################################<BR>"
                + getMetadataInformation());
        commitIndex(w, map);

    } catch (Exception x) {
        logger.error("Caught an exception:", x);
        w.close();
        throw x;
    }
}

From source file:uk.ac.ebi.fg.biostudies.utils.saxon.search.AbstractIndexEnvironment.java

public void indexIncrementalFromXmlDB(String indexLocationDirectory, String dbHost, int dbPort,
        String dbPassword, String dbName) throws Exception {
    // I'm upgrading so the baseline is the current nodes number
    int countNodes = getCountDocuments();
    String driverXml = "";
    String connectionString = "";
    Collection coll;//from   ww w.j a  va2 s. com
    IndexWriter w = null;
    Map<String, XPathExpression> fieldXpe = new HashMap<String, XPathExpression>();
    logger.info("indexIncrementalFromXmlDB(generic) is starting for [{}], and initially I have[{}] ... ",
            new Object[] { indexId, countNodes });
    try {

        Directory indexTempDirectory = FSDirectory.open(new File(indexLocationDirectory, indexId));
        w = openIndex(indexTempDirectory, indexAnalyzer);
        HierarchicalConfiguration connsConf = (HierarchicalConfiguration) Application.getInstance()
                .getPreferences().getConfSubset("bs.xmldatabase");
        if (null != connsConf) {
            driverXml = connsConf.getString("driver");
            connectionString = connsConf.getString("base") + "://" + dbHost + ":" + dbPort + "/" + dbName;
        } else {
            logger.error("bs.xmldatabase Configuration is missing!!");
        }
        logger.debug("connectionString->" + connectionString);
        coll = DatabaseManager.getCollection(connectionString);
        XPathQueryService service = (XPathQueryService) coll.getService("XPathQueryService", "1.0");

        DocumentInfo source = null;
        Configuration config = ((SaxonEngine) Application.getAppComponent("SaxonEngine")).trFactory
                .getConfiguration();
        XPath xp = new XPathEvaluator(config);
        for (FieldInfo field : fields.values()) {
            fieldXpe.put(field.name, xp.compile(field.path));
            logger.debug("Field Path->[{}]", field.path);
        }

        // the xmldatabase is not very correct and have memory problem for
        // queires with huge results, so its necessary to implement our own
        // iteration mechanism
        //
        // // I will collect all the results
        // ResourceSet set = service.query(this.env.indexDocumentPath);
        long numberResults = 0;
        ResourceSet set = service.query("count(" + indexDocumentPath + ")");
        if (set.getIterator().hasMoreResources()) {
            numberResults = Integer.parseInt((String) set.getIterator().nextResource().getContent());
        }

        // TODO:######################################Change this after -
        // this is just a performance test
        // float percentage=0.1F;
        // numberResults=Math.round(numberResults * percentage);

        logger.debug("Number of results->" + numberResults);
        long pageSizeDefault = 50000;
        if (numberResults > 1000000) {
            pageSizeDefault = 1000000;
        }

        long pageNumber = 1;
        int count = 0;
        Map<String, AttsInfo[]> cacheAtt = new HashMap<String, AttsInfo[]>();
        Map<String, XPathExpression> cacheXpathAtt = new HashMap<String, XPathExpression>();
        Map<String, XPathExpression> cacheXpathAttValue = new HashMap<String, XPathExpression>();
        while ((pageNumber * pageSizeDefault) <= (numberResults + pageSizeDefault - 1)) {
            // calculate the last hit
            long pageInit = (pageNumber - 1) * pageSizeDefault + 1;
            long pageSize = (pageNumber * pageSizeDefault < numberResults) ? pageSizeDefault
                    : (numberResults - pageInit + 1);

            service = (XPathQueryService) coll.getService("XPathQueryService", "1.0");

            // xquery paging using subsequence function
            long time = System.nanoTime();
            // TODO: I'm assuming that there is always an attribute @id in
            // each element
            set = service.query("for $x in(subsequence(" + indexDocumentPath + "/@id," + pageInit + ","
                    + pageSize + ")) return string($x)");
            double ms = (System.nanoTime() - time) / 1000000d;
            logger.info("Query XMLDB took ->[{}]", ms);

            ResourceIterator iter = set.getIterator();
            XPath xp2;
            XPathExpression xpe2;
            List documentNodes;
            StringReader reader;
            // cache of distinct attributes fora each sample group

            while (iter.hasMoreResources()) {
                count++;
                logger.debug("its beeing processed the number ->" + count);
                String idToProcess = (String) iter.nextResource().getContent();

                logger.debug("@id that is being processed->" + idToProcess);
                // I need to get the sample
                ResourceSet setid = service.query(indexDocumentPath + "[@id='" + idToProcess + "']");
                ResourceIterator iterid = setid.getIterator();
                while (iterid.hasMoreResources()) {
                    StringBuilder xml = new StringBuilder();
                    xml.append((String) iterid.nextResource().getContent());
                    // logger.debug(xml.toString());
                    reader = new StringReader(xml.toString());
                    source = config.buildDocument(new StreamSource(reader));

                    // logger.debug("XML DB->[{}]",
                    // PrintUtils.printNodeInfo((NodeInfo) source, config));
                    Document d = new Document();

                    xp2 = new XPathEvaluator(source.getConfiguration());

                    int position = indexDocumentPath.lastIndexOf("/");
                    // TODO: I also need to change this
                    String pathRoot = "";
                    if (position != -1) {
                        pathRoot = indexDocumentPath.substring(position);
                    } else {
                        pathRoot = indexDocumentPath;
                    }
                    // logger.debug("PathRoot->[{}]",pathRoot);
                    xpe2 = xp2.compile(pathRoot);
                    documentNodes = (List) xpe2.evaluate(source, XPathConstants.NODESET);

                    for (Object node : documentNodes) {
                        // logger.debug("XML DB->[{}]",PrintUtils.printNodeInfo((NodeInfo)node,config));

                        String idElement = (String) fieldXpe.get("id").evaluate(node, XPathConstants.STRING);
                        // I need to see if it already exists
                        // I will also add this document if it is nor marked
                        // as "todelete"
                        Boolean toDelete = (Boolean) fieldXpe.get("delete").evaluate(node,
                                XPathConstants.BOOLEAN);

                        // TODO:######################################Change
                        // this after - this is just a performance test
                        int deletePercentage = 10;
                        toDelete = (count % deletePercentage) == 0 ? true : false;

                        logger.debug(
                                "Incremental Update - The document [{}] is being processed and is marked to delete?[{}]",
                                new Object[] { idElement, toDelete });
                        // I will always try to delete the document (i don't
                        // know if it is new or if it was changed)
                        Term idTerm = new Term("id", idElement.toLowerCase());
                        int countToDelete = getIndexReader().docFreq(idTerm);
                        if (countToDelete > 0) {
                            // if has more than one, I have to send an email
                            // to warn
                            if (countToDelete > 1) {
                                Application.getInstance().sendEmail(null, null,
                                        "BIOSAMPLES ERROR - Incremental Update - Removing more than one document! id-> "
                                                + idElement,
                                        " documents found:" + countToDelete);
                                // I will launch an exception
                                throw new Exception(
                                        "BIOSAMPLES ERROR - Incremental Update -  Removing more than one document in incremental update id-> "
                                                + idElement + " documents found:" + countToDelete);
                            }
                            logger.debug("The document with id [{}] is being deleted from Lucene", idElement);
                            w.deleteDocuments(idTerm);
                            // need to remove one from the number of
                            // documents count
                            countNodes--;

                        }
                        // the element doesn't exist on GUI
                        else {
                            // if it is marked to delete I will just an
                            // warning email - it's possible that it was
                            // inserted and deleted on the Backend but it
                            // had never been sent to the GUI before
                            if (toDelete) {
                                Application.getInstance().sendEmail(null, null,
                                        "BIOSAMPLES WARNING - Incremental Update - Id marked for deletion but the id doesn't exist on the GUI! id-> "
                                                + idElement,
                                        "");

                            }
                        }

                        // if (toDelete) {
                        // logger.debug(
                        // "The document with id [{}] was marked to deletion so I will not process it",
                        // idElement);
                        // } else {

                        // I just process it is it is not for deletion)
                        if (!toDelete) {
                            try {
                                d = processEntryIndex(node, config, service, fieldXpe);

                            } catch (Exception x) {
                                String xmlError = PrintUtils.printNodeInfo((NodeInfo) node, config);
                                logger.error("XML that was being processed when the error occurred DB->[{}]",
                                        xmlError);
                                // to avoid the next running to stop
                                // because its not able to delete the
                                // newSetup directory
                                w.close();
                                throw new Exception("Xml that is being processed:" + xmlError, x);
                            }
                            countNodes++;
                            addIndexDocument(w, d);
                        }
                    }

                    // }

                    documentNodes = null;
                    source = null;
                    reader = null;
                    xml = null;
                    // logger.debug("count->[{}]", countNodes);

                }
            }
            logger.debug("until now it were processed->[{}]", pageNumber * pageSizeDefault);
            pageNumber++;
            // if (coll != null) {
            // try {
            // // coll.close();
            // } catch (Exception e) {
            // // TODO Auto-generated catch block
            // e.printStackTrace();
            // }
            // }
            set = null;

        }

        setCountDocuments(countNodes);
        // add metadata to the lucene index
        Map<String, String> map = new HashMap<String, String>();
        map.put("numberDocs", Integer.toString(countNodes));
        map.put("date", Long.toString(System.nanoTime()));
        // logger.debug(Application.getInstance().getComponent("XmlDbConnectionPool").getMetaDataInformation());
        // I cannot call directly
        // getComponent("XmlDbConnectionPool").getMetaDataInformation(),
        // because I can be working in a did
        String dbInfo = ((XmlDbConnectionPool) Application.getInstance().getComponent("XmlDbConnectionPool"))
                .getDBInfo(dbHost, dbPort, dbPassword, dbName);

        // TODO: I need to put here what I have before - to track all the
        // changes (old numberDocs + old date + oldDBInfo)
        map.put("DBInfo", dbInfo + "<BR>##################################################<BR>"
                + getMetadataInformation());
        commitIndex(w, map);

    } catch (Exception x) {
        logger.error("Caught an exception:", x);
        w.close();
        throw x;
    }
}