Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SMCAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SMCAction.java	(revision 1614)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SMCAction.java	(revision 1614)
@@ -0,0 +1,39 @@
+package eu.clarin.cmdi.mdservice.action;
+
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import eu.clarin.cmdi.mdservice.proxy.SMCProxy;
+
+/**
+ * A Struts2 controller, responsible for calls to repositories.
+ * After 2011-09 rework Action and Proxy are decoupled.
+ * So Action calls appropriate Proxy based upon the target repository type
+ * 
+ * responds to requests (collections, model, recordset) 
+ * by dispatching the requests to appropriate Proxy and filling the inputStream with the result
+ * It is possible to switch target-repository dynamically  (on every request). I.e. the client explicitly selects one of the repositories.
+ *
+ *  
+ * @author vronk
+ */
+public class SMCAction extends GenericAction 
+{
+
+	private static final long serialVersionUID = 1L;
+	private static Logger log = Logger.getLogger("SMCAction");
+	
+	protected URL base_url ;
+
+	// FIXME: fraglich! 
+	@Override	
+	public String getFullFormat() {		
+		return getActionkey() + "2" + getFormat();
+	}
+	
+	public void setTargetProxy(){						
+		setTargetProxy(new SMCProxy());
+		return;			    
+	}
+
+}
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/SMCProxy.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/SMCProxy.java	(revision 1614)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/SMCProxy.java	(revision 1614)
@@ -0,0 +1,114 @@
+package eu.clarin.cmdi.mdservice.proxy;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import eu.clarin.cmdi.mdservice.action.GenericAction;
+import eu.clarin.cmdi.mdservice.internal.CQLParseException;
+import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
+import eu.clarin.cmdi.mdservice.internal.Utils;
+import eu.clarin.cmdi.smc.SMC;
+
+/**
+ * Special proxy for SMC
+ * @since 2011-10-31   
+ * @author vronk
+ *
+ */
+public class SMCProxy implements ProxyInterface{
+
+	private static final long serialVersionUID = 1L;
+	private static Logger log = Logger.getLogger("SMCProxy");
+ 
+	private String proxy_key = "smc";
+	
+	private GenericAction source_action;
+	
+	public GenericAction getSourceAction() {
+			return source_action;
+	}
+	
+	@Override
+	public void setSourceAction(GenericAction action) {		
+		source_action = action;
+		
+	}
+	
+	public Map<String,String[]> getParams() {
+		return getSourceAction().getParams();
+	}
+	
+	/**
+	 * Convenience function to access the request-parameters in the Action  
+	 * @param key
+	 * @return
+	 */
+	public String getParam(String key) {
+		return getSourceAction().getParam(key);
+	}
+	
+	public void checkParams() {
+		// required Params	
+	}
+	
+	/**
+	 * identification of the target-proxy (type)
+	 * base for finding the right base_url in the props
+	 * subclass has to override with its specific proxykey
+	 * @return
+	 */
+	public String getProxyKey() {				
+			return proxy_key;		
+	}
+
+	/**
+	 * Get the base_uri based on the action-key
+	 * FIXME: this is provisional, what to use as base URI for smc?
+	 */		
+	public String getBaseURI() {		
+		//String uri =Utils.getConfig().getProperty(getSourceAction().getActionkey() + ".uri");	
+		//String uri = Termset.getTermsetAttr(getSourceAction().getActionkey(), "url");
+		return "http://localhost:8080/MDService2/smc/";
+	}
+
+	/**
+	 * Provides the base-URL specific to given target repository or registry 
+	 * @return 
+	 * @throws MalformedURLException
+	 */	
+	public URL getBaseURL() throws MalformedURLException {		
+		URL base_url = new URL(getBaseURI());		
+		return base_url;
+	}
+	
+	
+	/**
+	 * uses base_url + url_pattern (parametrized by actionkey) to form a url
+	 * @return the full target-request URL to be sent to the target repository
+	 * @throws CQLParseException 
+	 * @throws Exception 
+	 */	
+	public URL getTargetRequest() throws IOException, CQLParseException {
+		 
+		URL targetURL =new URL(getBaseURI() + this.getSourceAction().getTargetRequestParams());
+		
+		log.debug("getTargetRequest().targetURL:" + targetURL);
+	    return targetURL;
+		
+	}
+
+	public InputStream getSourceStream() throws IOException, NoStylesheetException, CQLParseException {
+		SMC smc = new SMC();
+		smc.addParam("operation", "termsets");
+			
+		return smc.listTermsets("");		
+	}
+
+	
+
+}	
