Index: MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_model.js
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_model.js	(revision 1575)
+++ MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_model.js	(revision 1584)
@@ -206,10 +206,10 @@
 @class Represents a Query. 
 */ 
-function Query(collection, columns, query, squery) {
+function Query(collection, columns, query) {
 	this.id = 0;
 	this.collection = collection;   // []
 	this.columns = columns;         // string
 	this.query = query;	         //sctext
-	this.squery = squery;
+	//this.squery = squery;
 	this.listid = "";
 	this.container = {};
@@ -314,4 +314,5 @@
 	}
 
+	/*
 	if (json["squerystring"] == "[NULL]"){
 		this.squery = null;
@@ -319,5 +320,5 @@
 		this.squery = json["squerystring"];	
 	}
-
+*/
 	this.columns = columns_text;
 	
@@ -446,4 +447,5 @@
 		params = params + "query=" + escape(this.query) + "&";
 	}
+	/*
 	if (this.squery != null) {
 		escaped_sq =escape(this.squery).replace(/%20/g,"%2520").replace(/\%2[27]/g,"%2522") ;
@@ -452,4 +454,5 @@
 		params = params + "query=" + escaped_sq + "&";
 	}
+	*/
 	params = params + "collection=" + this.getcollectiontext("index") + "&columns=" + this.getcolumnstext() + "&startRecord=" + this.startItem + "&maximumRecords=" + this.maximumItems + "&repository=" + this.repository;
 	if  (this.options != null) {
@@ -487,5 +490,6 @@
 	var str = "";
 	var coll = (this.getcollectiontext("name") != "" ) ? " in " + this.getcollectiontext("name") : "";
-	str = Query.queryliststring(this.squery,this.query) + coll + " @" + this.repository.toString();
+	//str = Query.queryliststring(this.squery,this.query) + coll + " @" + this.repository.toString();
+	str = Query.queryliststring(this.query) + coll + " @" + this.repository.toString();
 	return str;
 };
@@ -552,17 +556,9 @@
 		json_cols[i] = cols;
 	}
-/*
-	var q = "";
-	if (this.squery != undefined){
-		q = q + squery;
-	}
-	if (this.query != undefined){
-		q = q + query;
-	}
-*/
+
 	var jsonq = {"id":this.id,
 				 "name":"",
-			     "squerystring":this.squery, 
-				 "querystring":query,	
+			     //"squerystring":this.squery, 
+				 "querystring":this.query,	
 				 "searchclauses":"null" ,
 				 "collections" : json_coll, 
@@ -655,5 +651,5 @@
 Query.fullformatstring = function (json) {
 	var qs = json.querystring;
-	var sqs = json.squerystring;
+	//var sqs = json.squerystring;
 	
 	if (qs == "[NULL]") {
@@ -661,13 +657,13 @@
 	}
 	
-	if (sqs == "[NULL]") {
+	/*if (sqs == "[NULL]") {
 		sqs = null;
 	}
-	
+	*/
 	var collection_text = Query.collectiontext(json);
 	
 	var full_str = "";
 	var len = formatquerystring_len;
-	
+	/*
 	if (sqs != null) {
 		if (sqs.length > len){
@@ -678,5 +674,5 @@
 		}
 	}
-	
+	*/
 	if (qs != null) {
 		qs = Query.simplequerystring(qs);
@@ -697,12 +693,13 @@
 };
 
-Query.queryliststring = function(squery, query) {
+Query.queryliststring = function(query) {
 	var s_squery = "";
 	var s_query = "";
 	var str = "";
 	
-	if (squery != null){
+	/*if (squery != null){
 		s_squery = squery;
 	}
+	
 	if (query != null){
 		s_query = query;
@@ -715,4 +712,7 @@
 		str =  Query.simplequerystring(query);
 	}
+	*/
+	
+	str =  Query.simplequerystring(query);
 	return str;
 };
@@ -907,4 +907,5 @@
 					
 				 	addDetailFunctionality(q_header, query);
+				 	$(q_header).find('.result-header').height($(q_header).height());
 				 	
 					createTooltip($(this));
Index: MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_searchclause.js
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_searchclause.js	(revision 1575)
+++ MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_searchclause.js	(revision 1584)
@@ -569,13 +569,4 @@
 	},
 	
-	// from searchclauses to simple querystring only * any <string> is converted
-	simplequerytext: function(){
-		this.buildsctext();
-		if (sctext.substring(0,6) == '* any '){
-			return sctext.replace('* any ','');
-		}
-		return "";
-	},
-	
 	buildsctext: function(){
 	   var uncompletequery = false;
@@ -604,8 +595,13 @@
 			
 		}	
+		if ((i == 1 && j == 1) && (this.sctext.substring(0,6) == '* any ')) {
+			this.sctext  = sctext.replace('* any ','');
+		}
 		if (uncompletequery){
 			this.sctext = "";
 		}
 		notifyUser(this.sctext);
+		return this.sctext;
+		
 	},
 	
Index: MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui.js
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui.js	(revision 1575)
+++ MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui.js	(revision 1584)
@@ -93,5 +93,5 @@
 			searchclauseset.buildfromquerystring();
 		} else {
-			$('#input-simplequery').attr("value",searchclauseset.simplequerytext());
+			$('#input-simplequery').attr("value",searchclauseset.buildsctext());
 		}
 	});
@@ -247,10 +247,9 @@
 		event.preventDefault();
 		//hideWelcomeMessage();
-		var query, squery;
+		var query;
 		if (getInputMode() == 'complex'){
-			searchclauseset.buildsctext();
-			query = searchclauseset.sctext;
+			query = searchclauseset.buildsctext();
 		} else {
-			squery = $('#input-simplequery').attr("value");
+			query = $('#input-simplequery').attr("value");
 		}
 		//searchclauseset.buildsctext();
@@ -269,5 +268,5 @@
 			query = null;
 		}
-		var q = new Query(collections, columns, query, squery); //actions.collections.current, query );
+		var q = new Query(collections, columns, query); //actions.collections.current, query );
 		q.repository = getSelectedRepository();
 		//if (ws) {
@@ -390,5 +389,5 @@
 			qstring = qstring.substring(18,qstring.length);
 			
-			var q = new Query([],"",qstring,"");
+			var q = new Query([],"",qstring);
 			q.bookmark = 1;
 			q.save();
@@ -695,5 +694,5 @@
 		var columns = columns_widget.getListText();//$('#columns_list').attr("value");
 		//var collections = collections_widget.getListText();
-		var query = new Query(collections,columns,"","");
+		var query = new Query(collections,columns,"");
 		query.repository = getSelectedRepository();
 	
@@ -816,4 +815,6 @@
 	$("#detail-float").tabs();
 };
+
+//TODO squery remove
 function submit_query (columns, query, squery, ws) {
 	notifyUser("processing query");
@@ -822,9 +823,9 @@
 		query = null;
 	}
-	if (jQuery.trim(squery).length == 0){
+	/*if (jQuery.trim(squery).length == 0){
 		squery = null;
 	}
-	
-	var q = new Query(collections, columns, query, squery); //actions.collections.current, query );
+	*/
+	var q = new Query(collections, columns, query); //actions.collections.current, query );
 	q.repository = getSelectedRepository();
 	if (ws) {
@@ -996,5 +997,5 @@
 	collections_widget.load(query.collection);
 	columns_widget.load(query.columns.split(','));
-	$('#input-simplequery').attr("value",query.squery);
+	$('#input-simplequery').attr("value",query.query);
 	$('#input-withsummary').attr("checked",(query.options != null));
 	updateCollectionTree();
Index: MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_load.js
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_load.js	(revision 1575)
+++ MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_load.js	(revision 1584)
@@ -55,33 +55,29 @@
  
 
-	
-	// USER WORKSPACEPROFILE
-	jQuery.getJSON("/MDService2/workspaceprofile/json/user",function(data){
-		notifyUser(data['WorkspaceProfile'],'debug');
-				workspace.user_json  = preprocessJSON(data);
+	// server profile first - options needed
+	jQuery.getJSON("/MDService2/workspaceprofile/json/server",function(sdata){
+				//notifyUser(sdata['WorkspaceProfile'],'debug');
+				var json = preprocessJSON(sdata);
+				workspace.server_json = json;
+				$("#serverqs").attr("data",JSON.stringify(json));
+				loadQuerysets("server");
+				loadRepositories(workspace.server_json["WorkspaceProfile"]["Repositories"]);
+				loadCollections(true);				
+				loadTerms();
+				loadTermsAutocomplete();
+				loadQueryFromUriParams();
+				createTooltip(null);
 				
-				jQuery.getJSON("/MDService2/workspaceprofile/json/server",function(data){
-					notifyUser(data['WorkspaceProfile'],'debug');
-							var json = preprocessJSON(data);
-							workspace.server_json = json;
-							$("#serverqs").attr("data",JSON.stringify(json));
-							//loadQuerysets(json["WorkspaceProfile"]["Querysets"],"server");
-							loadQuerysets("server");
-							loadRepositories(json["WorkspaceProfile"]["Repositories"]);
-							loadCollections(true);				
-							loadTerms();
-							loadTermsAutocomplete();
-							loadQueryFromUriParams();
-							createTooltip(null);
-							
-							
-					});
-
-				//loadQuerysets(workspace.user_json["WorkspaceProfile"]["Querysets"],"user");
-				loadQuerysets("user");
-				loadBookmarksets();
-				//loadTermsets(jsonw["WorkspaceProfile"]["CustomTermsets"]);
-				createTooltip(this);
-	});
+				// USER WORKSPACEPROFILE
+				jQuery.getJSON("/MDService2/workspaceprofile/json/user",function(data){
+							notifyUser(data['WorkspaceProfile'],'debug');
+							workspace.user_json  = preprocessJSON(data);
+							loadQuerysets("user");
+							loadBookmarksets();
+							createTooltip(this);
+				});
+				
+		});
+	
 	
 	
@@ -279,10 +275,6 @@
 		timestr = json.time;
 	}
-	var squery = json.squerystring;
-	if (squery = "[NULL]"){
-		squery = "";
-	}
 	var qq = json.querystring;
-	if (qq = "[NULL]"){
+	if (qq == "[NULL]"){
 		qq = "";
 	}
@@ -292,5 +284,4 @@
 	'<span class="cmd cmd_publish"></span><div class="detail" >' +
 	name +
-	'<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + squery + '</span></div>' +
 	'<div class="cmds-elem-prop"><span class="label">query:</span><span class="value">' + Query.simplequerystring(qq) + '</span></div>' + 
 	'<div class="cmds-elem-prop"><span class="label">collections:</span><span class="value">' + Query.collectiontext(json) + '</span></div>' +
@@ -307,5 +298,5 @@
 	$(qs).append(x);
 	
-	var query = new Query([],"","","");
+	var query = new Query([],"","");
 	query.load(json);
 	$(qs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('query',query);
@@ -450,5 +441,5 @@
 	$(bs).append(x);
 	
-	var query = new Query([],"","","");
+	var query = new Query([],"","");
 	query.load(json);
 	$(bs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('query',query);
Index: MDService2/branches/MDService_simple3/WebContent/static/queries.xml
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/static/queries.xml	(revision 1575)
+++ MDService2/branches/MDService_simple3/WebContent/static/queries.xml	(revision 1584)
@@ -6,7 +6,7 @@
 			<dd><p>just one word like:</p>
 				<ul>		
-					<li><a class="query" href="/MDService2/?query=system">system</a></li>
-					<li><a class="query" href="/MDService2/?query=-year-olds">-year-olds</a> - a bug there (don't use '-'!)</li>
-					<li><a class="query" href="/MDService2/?query=acquisition">acquisition</a></li>			
+					<li><a class="query" href="?query=system">system</a></li>
+					<li><a class="query" href="?query=-year-olds">-year-olds</a> - a bug there (don't use '-'!)</li>
+					<li><a class="query" href="?query=acquisition">acquisition</a></li>			
 				</ul>
 			</dd>
@@ -14,6 +14,6 @@
 			<dd>
 				<ul>
-					<!-- <li><a class="query" href="/MDService2/?squery=/?squery=child%20%7C%20acquisition">child | acquisition</a></li> 
-					-->
+				 <li><a class="query" href="?squery=/?squery=child%20%7C%20acquisition">child | acquisition</a></li> 
+				
 				</ul>
 			</dd>
@@ -21,6 +21,6 @@
 			<dd>
 				<ul>
-					<li><a class="query" href="/MDService2/?query=child%20acquisition">child acquisition</a></li>
-					<li><a class="query" href="/MDService2/?query=longitudinal%20study">longitudinal study</a></li>			
+					<li><a class="query" href="?query=child%20acquisition">child acquisition</a></li>
+					<li><a class="query" href="?query=longitudinal%20study">longitudinal study</a></li>			
 				</ul>
 			</dd>
@@ -28,5 +28,5 @@
 			<dd>a sequence of terms
 				<ul>
-					<li><a class="query" href="/MDService2/?query=%22longitudinal%20study%22">"longitudinal study"</a></li>
+					<li><a class="query" href="?query=%22longitudinal%20study%22">"longitudinal study"</a></li>
 				</ul>
 			</dd> 
Index: MDService2/branches/MDService_simple3/WorkspaceProfile.xml
===================================================================
--- MDService2/branches/MDService_simple3/WorkspaceProfile.xml	(revision 1575)
+++ MDService2/branches/MDService_simple3/WorkspaceProfile.xml	(revision 1584)
@@ -78,5 +78,5 @@
             </item>
             <item>
-               <type></type> 
+               <type>model</type> 
                <id>compreg</id> 
                <name>compreg</name> 
@@ -139,8 +139,7 @@
                      <maximumItems>10</maximumItems>
                      <name>lrt:2787?repository=clarin.at-mirror</name>
-                     <options null="true"/>
+                     <options>null</options>
                      <querystring>clarin%252Eeu%3Alrt%3A2787?repository=clarin.at-mirror</querystring>
                      <searchclauses>null</searchclauses>
-                     <squerystring null="true"/>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:22:33</time>
@@ -162,8 +161,7 @@
                      <maximumItems>10</maximumItems>
                      <name>C4:220?repository=clarin.at-mirror</name>
-                     <options null="true"/>
+                     <options>null</options>
                      <querystring>clarin-at%3Aaac-test-corpus%3AC4%3A220?repository=clarin.at-mirror</querystring>
                      <searchclauses>null</searchclauses>
-                     <squerystring null="true"/>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:18:28</time>
@@ -195,8 +193,7 @@
                      <maximumItems>10</maximumItems>
                      <name>schule                     | </name>
-                     <options null="true"/>
-                     <querystring null="true"/>
-                     <searchclauses>null</searchclauses>
-                     <squerystring>schule</squerystring>
+                     <options>null</options>
+                     <searchclauses>null</searchclauses>
+                     <querystring>schule</querystring>
                      <startItem>1</startItem>
                      <time>2011-06-05 22:49:20</time>
@@ -210,8 +207,7 @@
                      <maximumItems>10</maximumItems>
                      <name>machine                    | </name>
-                     <options null="true"/>
-                     <querystring null="true"/>
-                     <searchclauses>null</searchclauses>
-                     <squerystring>machine</squerystring>
+                     <options>null</options>
+                     <searchclauses>null</searchclauses>
+                     <querystring>machine</querystring>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:023:58</time>
@@ -232,8 +228,7 @@
                      <maximumItems>10</maximumItems>
                      <name>mar                        | </name>
-                     <options null="true"/>
-                     <querystring null="true"/>
-                     <searchclauses>null</searchclauses>
-                     <squerystring>mar</squerystring>
+                     <options>null</options>
+                     <searchclauses>null</searchclauses>
+                     <querystring>mar</querystring>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:023:31</time>
@@ -247,8 +242,7 @@
                      <maximumItems>10</maximumItems>
                      <name>januar                     | </name>
-                     <options null="true"/>
-                     <querystring null="true"/>
-                     <searchclauses>null</searchclauses>
-                     <squerystring>januar</squerystring>
+                     <options>null</options>
+                     <searchclauses>null</searchclauses>
+                     <querystring>januar</querystring>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:15:59</time>
@@ -269,8 +263,7 @@
                      <maximumItems>10</maximumItems>
                      <name>januar                     | </name>
-                     <options null="true"/>
-                     <querystring null="true"/>
-                     <searchclauses>null</searchclauses>
-                     <squerystring>januar</squerystring>
+                     <options>null</options>
+                     <searchclauses>null</searchclauses>
+                     <querystring>januar</querystring>
                      <startItem>1</startItem>
                      <time>2011-06-05 23:16:33</time>
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Cache.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Cache.java	(revision 1575)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Cache.java	(revision 1584)
@@ -237,6 +237,5 @@
 		if (str.trim().length() == 0) return "";
 		
-		// provisional hack, setting simple string to ""
-		query = new Query("", str,"recordset","");
+		query = new Query(str,"recordset","");
 		if (query.isStatus(Query.PARSEERROR)) {
 			log.debug("Cache.transformQuery.PARSEERROR:" + query.getMsg());
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Query.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Query.java	(revision 1575)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Query.java	(revision 1584)
@@ -56,7 +56,6 @@
 	private URL targetRequest;
 	private String syntax = "cql";  /* cql, cmdIndex, xpath */
-	private String squery_string;
 	private String query_string;
-	private String full_query_string;
+	//private String full_query_string;
 	private CQLNode query_cql;
 	private String msg;
@@ -80,6 +79,6 @@
 
 	
-	public Query(String squeryString, String queryString) {		
-		this(squeryString, queryString, MODEL);
+	public Query(String queryString) {		
+		this(queryString, MODEL);
 	}
 
@@ -91,9 +90,8 @@
 	 */
 
-	public Query(String squeryString,String queryString, String type, String collection, String columns) {
+	public Query(String queryString, String type, String collection, String columns) {
 		this.type =type;
-		if (squeryString == null)squeryString ="";
 		if (queryString == null)queryString ="";
-		setFullQueryString(squeryString, queryString);
+		setFullQueryString(queryString);
 		setCollection(collection);
 		setColumns(columns);
@@ -107,9 +105,6 @@
 	 */
 
-	public Query(String squeryString, String queryString, String type, String collection) {
-		//this.type =type;
-		//setFullQueryString(squeryString, queryString);
-		//setCollection(collection);
-		this(squeryString, queryString, type, collection, "Id,name");
+	public Query(String queryString, String type, String collection) {
+		this( queryString, type, collection, "Id,name");
 	}
 
@@ -121,9 +116,6 @@
 	 */
 
-	public Query(String squeryString, String queryString, String type) {
-		//this.type =type;
-		//if (squeryString == null)squeryString =""; 
-		//setFullQueryString(squeryString, queryString);
-		this(squeryString, queryString, type, "");
+	public Query(String queryString, String type) {
+		this(queryString, type, "");
 	}
 
@@ -133,5 +125,5 @@
 	
 	public String getStatus() {
-		if (type.equals(Query.RECORDSET) && query_cql== null && (full_query_string != "")) {
+		if (type.equals(Query.RECORDSET) && query_cql== null && (query_string != "")) {
 			return Query.PARSEERROR;
 		} else {
@@ -153,15 +145,12 @@
 	}
 
-	public void setFullQueryString(String squeryString, String queryString) {
+	public void setFullQueryString(String queryString) {
 		
 		query_string=queryString;
 		
-		if (squeryString.trim().length() == 0){
-			squeryString = null;
-		}
 		if (queryString.trim().length() == 0){
 			queryString = null;
 		}
-		
+		/*
 		String squery = createsqueryString(squeryString);
 		if (squery != null && queryString != null){
@@ -174,6 +163,7 @@
 			full_query_string = "";
 		}
-		log.debug("QUERY.FULLQUERYSTRING:" + full_query_string);
-		if (type.equals(RECORDSET) && (full_query_string.length() > 0)) {	
+		*/
+		log.debug("QUERY.FULLQUERYSTRING:" + query_string);
+		if (type.equals(RECORDSET) && (query_string.length() > 0)) {	
 			parse();
 			//preprocess();
@@ -181,9 +171,9 @@
 			
 	}
-	
+	/*
 	public String getFullQueryString() {
 		return full_query_string;
 	}
-
+*/
 	
 	public void setCollection(String collection) {
@@ -428,5 +418,5 @@
 		CQLParser parser = new CQLParser();		
 		// cannot accept '-' at the CQL beginning
-		String local_full_query_string = full_query_string;
+		String local_full_query_string = query_string;
 		local_full_query_string = local_full_query_string.replace("-", "%2D");
 
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java	(revision 1575)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/MDRepoProxy.java	(revision 1584)
@@ -65,5 +65,5 @@
 		//TODO squery removed
 		//Query query = new Query(getParam("squery"), getParam("query"),getSourceAction().getActionkey());
-		Query query = new Query("", getParam("query"),getSourceAction().getActionkey());
+		Query query = new Query(getParam("query"),getSourceAction().getActionkey());
 	
 		//log.debug("MDRPx.getQ:" + getSquery() + " and (" +  getQ() + ")");
