Changeset 1626
- Timestamp:
- 11/22/11 21:04:35 (12 years ago)
- 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 198 198 */ 199 199 public String getParam(String key) { 200 String v = null;200 String v = ""; 201 201 if (!(params.get(key)==null)) v=(String)params.get(key)[0]; 202 202 return v; … … 209 209 210 210 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(""))) { 212 212 return Query.PARSEERROR; 213 213 } else { … … 225 225 } 226 226 227 public String getQueryString() {228 //return query_string;229 if (getParam("query") == null){230 return "";231 }232 return getParam("query");233 }234 227 235 228 //public void setFullQueryString(String queryString) { 236 229 public void setFullQueryString() { 237 230 238 String query_string = this.getQueryString();231 String query_string = getParam("query"); 239 232 240 233 //if (queryString.trim().length() == 0){ … … 445 438 // 2010-12-28 needed for the lucene-index to recognize.. 446 439 // probably not the best place to handle -> move to repository: sanitize-query? 447 String corrid = get QueryString().replace(":","\\:").toLowerCase();440 String corrid = getParam("query").replace(":","\\:").toLowerCase(); 448 441 log.debug("Query.toURLParam.corrid=" + corrid); 449 442 targetRequest = "//MdSelfLink[ft:query(.,'" + corrid + "')]"; … … 454 447 targetRequest = toXPath() + "&collection=" + getParam("collection"); 455 448 } 456 if ( getParam("startItem") != null) {449 if (!getParam("startItem").equals("")) { 457 450 targetRequest = targetRequest + "&startItem=" + getParam("startItem"); 458 451 } 459 if ( getParam("maximumItems") != null) {452 if (!getParam("maximumItems").equals("")) { 460 453 targetRequest = targetRequest + "&maxItems=" + getParam("maximumItems"); 461 454 } 462 if (( getParam("options") != null)) {455 if ((!getParam("options").equals(""))) { 463 456 targetRequest = targetRequest + "&format=xml-" + getParam("options"); 464 457 } … … 478 471 CQLParser parser = new CQLParser(); 479 472 // cannot accept '-' at the CQL beginning 480 String local_full_query_string = this.getQueryString();473 String local_full_query_string = getParam("query"); 481 474 local_full_query_string = local_full_query_string.replace("-", "%2D"); 482 475 … … 555 548 public String fromCMDIndex2Xpath() { 556 549 String xpath = ""; 557 String query_string= get QueryString();550 String query_string= getParam("query"); 558 551 if (query_string.contains(":")) { 559 552 int delim_index = query_string.indexOf(":"); -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Result.java
r1540 r1626 95 95 96 96 header = "<header>"; 97 header += "<userquery>" + parentQuery.get QueryString() + "</userquery>";97 header += "<userquery>" + parentQuery.getParam("query") + "</userquery>"; 98 98 header += "<xpathquery>" + parentQuery.toXPath() + "</xpathquery>"; 99 99 header += "</header>";
Note: See TracChangeset
for help on using the changeset viewer.