Changeset 764 for MDService2/trunk/MDService2/src/eu
- Timestamp:
- 10/10/10 12:27:11 (14 years ago)
- Location:
- MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java
r762 r764 193 193 if (str.trim().length() == 0) return ""; 194 194 195 query = new Query(null, str,"recordset",""); 195 // provisional hack, setting simple string to "" 196 query = new Query("", str,"recordset",""); 196 197 if (query.isStatus(Query.PARSEERROR)) { 197 198 Admin.notifyUser("Cache.transformQuery.PARSEERROR:" + query.getMsg()); -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r762 r764 46 46 } 47 47 48 public void setQ(String q) { 48 public void setQ(String pq) { 49 if (pq == null) pq=""; 50 /* 49 51 if (q != null){ 50 52 if (q.trim().length() == 0){ … … 52 54 } 53 55 } 54 this.q = q; 56 */ 57 this.q = pq; 55 58 } 56 59 … … 59 62 } 60 63 61 public void setSquery(String squery) { 62 this.squery = squery; 64 public void setSquery(String psquery) { 65 if (psquery==null) psquery=""; 66 this.squery = psquery; 63 67 } 64 68 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java
r763 r764 40 40 import java.security.PrivilegedExceptionAction; 41 41 //import javax.servlet.ServletInputStream; 42 import org.apache.catalina.connector.CoyoteInputStream;43 import org.apache.catalina.security.SecurityUtil;44 45 42 46 43 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java
r762 r764 47 47 private String squery_string; 48 48 private String query_string; 49 private String full_query_string; 49 50 private CQLNode query_cql; 50 51 private String msg; … … 52 53 * temporary default; 53 54 */ 54 private String collection=" olac";55 private String collection=""; 55 56 private String columns="Id,name"; 56 private String startRecord = null;57 private String maximumRecords = null;57 private String startRecord = "1"; 58 private String maximumRecords = "50"; 58 59 private String squery = null; 59 60 private int maxdepth=1; … … 78 79 public Query(String squeryString,String queryString, String type, String collection, String columns) { 79 80 this.type =type; 80 set QueryString(squeryString, queryString);81 setFullQueryString(squeryString, queryString); 81 82 setCollection(collection); 82 83 setColumns(columns); … … 92 93 public Query(String squeryString, String queryString, String type, String collection) { 93 94 this.type =type; 94 set QueryString(squeryString, queryString);95 setFullQueryString(squeryString, queryString); 95 96 setCollection(collection); 96 97 } … … 105 106 public Query(String squeryString, String queryString, String type) { 106 107 this.type =type; 107 setQueryString(squeryString, queryString); 108 if (squeryString == null)squeryString =""; 109 setFullQueryString(squeryString, queryString); 108 110 } 109 111 … … 113 115 114 116 public String getStatus() { 115 if (type.equals(Query.RECORDSET) && query_cql== null && ( query_string != "")) {117 if (type.equals(Query.RECORDSET) && query_cql== null && (full_query_string != "")) { 116 118 return Query.PARSEERROR; 117 119 } else { … … 133 135 } 134 136 135 public void setQueryString(String squeryString, String queryString) { 136 /* 137 public void setFullQueryString(String squeryString, String queryString) { 138 139 query_string=queryString; 140 137 141 if (squeryString.trim().length() == 0){ 138 142 squeryString = null; … … 141 145 queryString = null; 142 146 } 143 */147 144 148 String squery = createsqueryString(squeryString); 145 149 if (squery != null && queryString != null){ 146 query_string = "(" + squery + " ) and (" + queryString + ")";150 full_query_string = "(" + squery + " ) and (" + queryString + ")"; 147 151 } else if (squery != null) { 148 query_string = squery;152 full_query_string = squery; 149 153 } else if (queryString != null){ 150 query_string = queryString;154 full_query_string = queryString; 151 155 } else { 152 query_string = "";153 } 154 Admin.notifyUser("QUERY. QUERYSTRING:" +query_string);155 if (type.equals(RECORDSET) && ( query_string.length() > 0)) {156 full_query_string = ""; 157 } 158 Admin.notifyUser("QUERY.FULLQUERYSTRING:" + full_query_string); 159 if (type.equals(RECORDSET) && (full_query_string.length() > 0)) { 156 160 parse(); 157 161 //preprocess(); … … 159 163 160 164 } 165 166 public String getFullQueryString() { 167 return full_query_string; 168 } 169 161 170 162 171 public void setCollection(String collection) { … … 321 330 322 331 /** 323 * tries to parse the query_string according the CQL-syntax332 * tries to parse the full_query_string according the CQL-syntax 324 333 * if successful returns the root-node of the parse-tree 325 334 */ … … 328 337 try { 329 338 CQLParser parser = new CQLParser(); 330 query_cql = parser.parse( query_string);339 query_cql = parser.parse(full_query_string); 331 340 } 332 341 catch (CQLParseException e) {
Note: See TracChangeset
for help on using the changeset viewer.