Index: /MDService2/trunk/MDService2/WorkspaceProfile.xml
===================================================================
--- /MDService2/trunk/MDService2/WorkspaceProfile.xml	(revision 1490)
+++ /MDService2/trunk/MDService2/WorkspaceProfile.xml	(revision 1491)
@@ -104,8 +104,12 @@
          <Querysets>null</Querysets>
          <Bookmarksets>null</Bookmarksets>
+         
 	        <created>a</created>
 	        <lastchanged>a</lastchanged>
 	        <profilename>a</profilename>
 	        <username>a</username>
+	        <Options>
+	        	<pazpartimeout>10</pazpartimeout>
+	        </Options>
       </WorkspaceProfile>
       
Index: /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
===================================================================
--- /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java	(revision 1490)
+++ /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java	(revision 1491)
@@ -46,4 +46,5 @@
 	
 	private static JSONArray repositories = null;
+	private static JSONObject wp_options = null;
 	
 	private Diagnostics diagnostics;
@@ -326,4 +327,12 @@
 	}
 	
+	public JSONObject getWPOptions(){
+		return wp_options;
+	}
+	
+	public void setWPOptions(JSONObject op){
+		GenericProxyAction.wp_options = op;
+	}
+	
 	protected URL base_url ;
 	
@@ -484,4 +493,61 @@
 	}
 	
+	public static JSONObject createWPOptions() throws IOException, InterruptedException, TransformerException, NoStylesheetException{
+		String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
+		File file=new File(path);
+		InputStream in  = new BufferedInputStream( new FileInputStream(path));;
+		
+		MDTransformer transformer = new MDTransformer();
+		transformer.setSrcFile(file.toURI().toURL());
+		transformer.setParams(MDTransformer.createParamsMap("xml2json"));
+		InputStream jsonstream = transformer.transformXML(in);
+		
+		JSONObject json = JSONObject.fromObject(convertStreamToString(jsonstream));
+		JSONArray wparray = json.getJSONObject("Profiles").getJSONArray("WorkspaceProfiles");
+		JSONObject obj = null;
+		for (int i = 0; i < wparray.size(); ++i) {     
+			JSONObject wp = wparray.getJSONObject(i); 
+			if (wp.get("Options") != null){
+				obj = wp.getJSONObject("Options");
+				break;
+			}
+		}	
+		
+		// options as static variable
+		return obj;
+	
+	}
+	
+	public String getWPOption(String opt_key){
+		String option_val = null;
+		
+		
+		if (wp_options == null ) {
+			try {
+				setWPOptions(GenericProxyAction.createWPOptions());
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (TransformerException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (NoStylesheetException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		// static options
+		if (wp_options != null){
+			net.sf.json.JSONObject json = getWPOptions(); 
+			option_val = json.getString(opt_key);
+		}
+		
+		
+		return option_val;
+		
+	}
 	
 	public String getRepositoryPath(){
Index: /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java
===================================================================
--- /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java	(revision 1490)
+++ /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java	(revision 1491)
@@ -189,5 +189,5 @@
 		
 		InputStream is = null;
-		
+		// TODO param settings
 		//init
 		setCommand("init");
@@ -203,9 +203,21 @@
 		setSort("relevance");
 		setBlock("1");
+		//TODO timeout  settings
+		long startMillis = System.currentTimeMillis();
+		long timeout = 0;
+		if (this.getWPOption("pazpartimeout") == null){
+			timeout = 1000;
+		} else {
+			timeout = Integer.parseInt(this.getWPOption("pazpartimeout"));
+		}
 		while (Integer.parseInt(activeclients) > 0){
 			//activeclients = getDocumentData(this.getSourceStream(), "//show/activeclients");
 			is = this.getSourceStream();
 			activeclients = getDocumentData(is, "//show/activeclients");
-			
+			Thread.sleep(1000); 
+			Admin.notifyUser("ActiveClients: " + activeclients, Admin.DEBUG);
+			if ((System.currentTimeMillis() - startMillis) > timeout) {
+				break;
+			}
 		}
 		is = this.getSourceStream();
