Ignore:
Timestamp:
07/29/10 20:23:44 (14 years ago)
Author:
gaba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java

    r595 r614  
    1717import java.util.Map;
    1818
     19import org.w3c.dom.*;
     20import javax.xml.parsers.*;
     21
     22import org.xml.sax.SAXException;
    1923import org.z3950.zing.cql.CQLParseException;
    2024import org.z3950.zing.cql.CQLParser;
    2125import org.z3950.zing.cql.CQLNode;
    2226
     27import eu.clarin.cmdi.mdservice.action.Admin;
    2328import eu.clarin.cmdi.mdservice.action.MDTransformer;
    2429
     
    114119                if (type.equals(RECORDSET)) {
    115120                        parse();
     121                        //preprocess();
    116122                }
    117123                       
     
    199205       
    200206        /**
     207         * tries to parse the query_string according the CQL-syntax
     208         * if successful returns the root-node of the parse-tree
     209         */
     210        public void  preprocess() {
     211                 
     212          try {
     213                Admin.notifyUser(toXCQL());
     214                       
     215               
     216                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
     217                DocumentBuilder builder = factory.newDocumentBuilder();
     218                Document doc = builder.parse(new org.xml.sax.InputSource(new java.io.StringReader(toXCQL())));
     219                       
     220                //Admin.notifyUser("document created");
     221                SearchClauses searchclauses = new SearchClauses(doc);
     222                //do the processing
     223                searchclauses.process();
     224                String xml_s = searchclauses.toXML();
     225               
     226                //Admin.notifyUser("AAAA2:" + xml_s);
     227          }
     228                catch (Exception e) {
     229                        e.printStackTrace();
     230                }
     231                return;
     232        }
     233       
     234       
     235        /**
    201236         * provides a xml-version of the query (if parsed successfully)
    202237         * according to the XCQL-schema defined in the SRU/CQL standard
Note: See TracChangeset for help on using the changeset viewer.