Changeset 1626


Ignore:
Timestamp:
11/22/11 21:04:35 (12 years ago)
Author:
gaba
Message:
 
Location:
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model
Files:
2 edited

Legend:

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

    r1623 r1626  
    198198         */
    199199        public String getParam(String key) {
    200                 String v = null;
     200                String v = "";
    201201                if (!(params.get(key)==null)) v=(String)params.get(key)[0];
    202202                return v;
     
    209209       
    210210        public String getStatus() {
    211                 if (type.equals(Query.RECORDSET) && query_cql== null && (this.getQueryString() != "")) {
     211                if (type.equals(Query.RECORDSET) && query_cql== null && (!getParam("query").equals(""))) {
    212212                        return Query.PARSEERROR;
    213213                } else {
     
    225225        }
    226226
    227         public String getQueryString() {
    228                 //return query_string;
    229                 if (getParam("query") == null){
    230                         return "";
    231                 }
    232                 return  getParam("query");
    233         }
    234227
    235228        //public void setFullQueryString(String queryString) {
    236229        public void setFullQueryString() {
    237230               
    238                 String query_string = this.getQueryString();
     231                String query_string = getParam("query");
    239232               
    240233                //if (queryString.trim().length() == 0){
     
    445438                        //  2010-12-28 needed for the lucene-index to recognize..
    446439                                //  probably not the best place to handle -> move to repository: sanitize-query?
    447                         String corrid = getQueryString().replace(":","\\:").toLowerCase();
     440                        String corrid = getParam("query").replace(":","\\:").toLowerCase();
    448441                        log.debug("Query.toURLParam.corrid=" + corrid);
    449442                        targetRequest = "//MdSelfLink[ft:query(.,'" + corrid + "')]";                   
     
    454447                                        targetRequest = toXPath() + "&collection=" + getParam("collection");   
    455448                                }
    456                                 if (getParam("startItem") != null) {
     449                                if (!getParam("startItem").equals("")) {
    457450                                        targetRequest = targetRequest +  "&startItem=" + getParam("startItem");
    458451                                }
    459                                 if (getParam("maximumItems") != null) {
     452                                if (!getParam("maximumItems").equals("")) {
    460453                                        targetRequest = targetRequest +  "&maxItems=" + getParam("maximumItems");
    461454                                }
    462                                 if ((getParam("options") != null)) {
     455                                if ((!getParam("options").equals(""))) {
    463456                                        targetRequest = targetRequest +  "&format=xml-" + getParam("options");
    464457                                }
     
    478471                CQLParser parser = new CQLParser();             
    479472                // cannot accept '-' at the CQL beginning
    480                 String local_full_query_string = this.getQueryString();
     473                String local_full_query_string = getParam("query");
    481474                local_full_query_string = local_full_query_string.replace("-", "%2D");
    482475
     
    555548        public String fromCMDIndex2Xpath() {
    556549                String xpath = "";
    557                 String query_string= getQueryString();
     550                String query_string= getParam("query");
    558551                if (query_string.contains(":")) {
    559552                        int delim_index = query_string.indexOf(":");
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Result.java

    r1540 r1626  
    9595                       
    9696                header = "<header>";
    97                 header += "<userquery>" + parentQuery.getQueryString() + "</userquery>";
     97                header += "<userquery>" + parentQuery.getParam("query") + "</userquery>";
    9898                header += "<xpathquery>" + parentQuery.toXPath() + "</xpathquery>";             
    9999                header += "</header>";
Note: See TracChangeset for help on using the changeset viewer.