Index: MDService2/branches/MDService_simple3/WebContent/static/queries2.xml
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/static/queries2.xml	(revision 1594)
+++ MDService2/branches/MDService_simple3/WebContent/static/queries2.xml	(revision 1613)
@@ -28,5 +28,5 @@
 			<dd>
 				<ul>
-					<li><a class="query" href="?q=clarin.eu:ws-registry&amp;repository=localhost-mirror">WS registry</a></li>
+					<li><a class="query" href="?query=clarin.eu:ws-registry&amp;repository=localhost-mirror">WS registry</a></li>
 				</ul>
 			</dd>
Index: MDService2/branches/MDService_simple3/WebContent/static/test2.xml
===================================================================
--- MDService2/branches/MDService_simple3/WebContent/static/test2.xml	(revision 1594)
+++ MDService2/branches/MDService_simple3/WebContent/static/test2.xml	(revision 1613)
@@ -25,6 +25,6 @@
 		 
 		 <a class="request count" href="/model/xml?repository=clarin.at-mirror&amp;q=teiHeader">model teiHeader</a>
-		<a class="request count" href="/terms/xml/?repository=localhost-mirror&amp;q=all">terms localhost</a>
-		<a class="query count" href="?squery=syntax">squery=syntax</a>
+		<a class="request count" href="/terms/xml?repository=localhost-mirror&amp;q=all">terms localhost</a>
+		<a class="query count" href="?query=syntax">squery=syntax</a>
 		<!-- <a class="query" href="/terms/htmldetail/?repository=localhost-mirror&amp;q=all">terms localhost</a>  -->
 				
Index: MDService2/branches/MDService_simple3/build.properties
===================================================================
--- MDService2/branches/MDService_simple3/build.properties	(revision 1594)
+++ MDService2/branches/MDService_simple3/build.properties	(revision 1613)
@@ -20,4 +20,5 @@
 source.home=./src
 lib.home=./WebContent/WEB-INF/lib
+smc.home=C:/Users/m/3lingua/clarin/CMDI/_repo2/SMC/dist
 #used for Jar files that are needed for compiling
 #but should not be part of the war file
Index: MDService2/branches/MDService_simple3/build.xml
===================================================================
--- MDService2/branches/MDService_simple3/build.xml	(revision 1594)
+++ MDService2/branches/MDService_simple3/build.xml	(revision 1613)
@@ -5,15 +5,13 @@
      Date:     January 2010
      
-     Project:  Struts 2 Coding Actions
+     Project:  MDService
      
-     Author:   Bruce Phillips
+     (based on Bruce Phillips Struts 2 Coding Actions)
      ====================================================================== -->
-
-
 	
-<project name="Coding_Actions_Struts2_Ant" default="archive" basedir=".">
+<project name="MDService" default="archive" basedir=".">
 	
     <description>
-           Example of using Struts 2 tags.
+      Basic targets for building MDService webapp
     </description>
 	
@@ -72,4 +70,5 @@
 				<path>
 			    	<fileset dir="${lib.home}" />
+					<fileset dir="${smc.home}" />
 					<fileset dir="${lib.external}" />
 			    </path>
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java	(revision 1613)
@@ -1,3 +1,3 @@
- package eu.clarin.cmdi.mdservice.action;
+package eu.clarin.cmdi.mdservice.action;
 
 import java.io.InputStream;
@@ -48,25 +48,9 @@
 	}
 	
-	public void setTargetProxy(){
-		
-	   	setTargetProxy(new BasicProxy());
-		
+	public void setTargetProxy(){		
+	   	setTargetProxy(new BasicProxy());		
 	}
 	
-	@Override
-	/*
 	public String getRequestKey() {
-		String key="";
-		if (getActionkey()!=null) {
-			key += getActionkey() + "//-" ;
-		}
-		if (getCompid()!=null) {
-			key += getCompid() + "//-" ;
-		}
-		 
-		return key;
-	}
-*/
-	 public String getRequestKey() {
 		String key="";
 		if (getActionkey()!=null) {
@@ -107,6 +91,4 @@
 			key +="//-" ;
 		}
-		
-		 
 		return key;
 	}
@@ -117,6 +99,5 @@
 	public void prepare()  {		
 		
-		try {
-		
+		try {		
 			//log.debug("CRPA.prepare");
 			if (!getActionkey().equals("elements"))	{
@@ -159,17 +140,5 @@
 				//		log.debug("CRPA-putting in cache: " + getRequestKey());
 						_sourceStream = Cache.getCache().getFromCache(getRequestKey());
-				} /*else {
-						log.debug("CRPA-reading from cache: " + getRequestKey());
-				}*/
-					/*
-				File file=new File(Cache.getCache().formPath(getRequestKey()));
-				log.debug("File-absolutePath " + file.getAbsolutePath());
-				URL url = null;
-				   try{
-					   url = file.toURL();
-					   log.debug("URL-tostring " + url.toString());
-					   }  catch (MalformedURLException me){
-				  }
-				 */
+				} 
 				
 				if (getFormat().equals("xml")) {			
@@ -188,24 +157,9 @@
 				setSourceStream(_sourceStream);
 				setResultStream(_resultStream);
-
-				/*
-				if (getFormat().equals("txt")) {
-					File f=new File(Cache.getCache().formPath("terms_autocomplete.txt"));
-				    OutputStream out=new FileOutputStream(f);
-				    byte buf[]=new byte[1024];
-				    int len;
-				    while((len=getResultStream().read(buf))>0)
-				    	out.write(buf,0,len);
-				    out.close();
-	log.debug("terms_autocomplete.txt");
-				}
-				*/
 			}
 		} catch(Exception e){
 			
 		}			
-
 	}
-
 
 	/**
@@ -226,4 +180,5 @@
 		return paramstr;
 	}
+
 	/*
 	public URL getTargetRequest() throws IOException {
@@ -240,6 +195,4 @@
         return targetURL;
 	}
-	*/
-
-	
+	*/	
 }
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java	(revision 1613)
@@ -5,4 +5,5 @@
 import eu.clarin.cmdi.mdservice.model.Termset;
 import eu.clarin.cmdi.mdservice.proxy.BasicProxy;
+import eu.clarin.cmdi.mdservice.proxy.DCRProxy;
 
 /**
@@ -79,5 +80,5 @@
 	public void setTargetProxy(){
 		
-	   	setTargetProxy(new BasicProxy());
+	   	setTargetProxy(new DCRProxy());
 		
 	}
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java	(revision 1613)
@@ -43,7 +43,4 @@
 	private Diagnostics diagnostics;
 
-	/** 
-	 * Properties to be filled by Struts with according request-parameters
-	 */
 	private String actionkey = "generic";
 	private String q;
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java	(revision 1613)
@@ -34,4 +34,5 @@
 		return getActionkey() + "2" + getFormat();
 	}
+
 	/**
 	 * Based on the repository type - we create a typed Proxy, that will do the work.
@@ -64,18 +65,5 @@
 			    	getDiagnostics().Add(Diagnostic.SYSTEM_ERROR, "Error in workspaceprofile configuration", "repository=" + getRepository() );
 			}
-			
 	}
-	
-
-	/**
-	 * Internal identification of the target-proxy
-	 * base for finding the right base_url in the properties
-	 * subclass has to override with its specific proxykey.
-	 * 
-	 * @return the key identifying this type of proxy
-	 */
-	public String getProxyKey() {
-		return "";
-	}	
 
 }
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/TermsProxyAction.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/TermsProxyAction.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/TermsProxyAction.java	(revision 1613)
@@ -5,7 +5,5 @@
 import java.net.MalformedURLException;
 import java.net.URL;
-
 import javax.xml.transform.TransformerException;
-
 import org.apache.log4j.Logger;
 
@@ -21,14 +19,11 @@
  *  
  * @author vronk
- *
  */
 public class TermsProxyAction extends GenericProxyAction {
 
-	public static Logger log = Logger.getLogger("TermsProxyAction");
+	public static Logger log = Logger.getLogger("TermsProxyAction");	
+	private static final long serialVersionUID = 1L;
 	
-	private static final long serialVersionUID = 1L;
-
-	public static String ALL = "all";
-	
+	public static String ALL = "all";	
 	private String proxy_key = "terms";
 	
@@ -43,43 +38,4 @@
 	}
 	
-	
-/* 	@Override
-	public String getFullFormat() {		
-		return "terms2extract";
-	}
-	*/
-	
-	/*
-	 @Override
-	 public String getRequestKey() {
-			String key="";
-			if (getActionkey()!=null) {
-				key += getActionkey() + "//-" ;
-			}
-			if (getQ()!=null) {
-				key += getQ() + "//-" ;
-			} else {
-				key +="//-" ;
-			}
-			if (getCollection()!=null) {
-				key += getCollection() + "//-";
-			} else {
-				key +="//-" ;
-			}
-			if (getSquery()!=null) {
-				key += getSquery() + "//-" ;
-			} else {
-				key +="//-" ;
-			}
-			if (getStartRecord()!=null) {
-				key += getStartRecord() + "//-";
-			}
-			if (getMaximumRecords()!=null) {
-				key += getMaximumRecords();
-			}
-			 
-			return key;
-	}
-	 */
 	public Termset getTermset() {		
 		String ts_id="";
@@ -106,6 +62,5 @@
 		return base_url;
 	}
-	
-	
+		
 	 /**
 	 * uses base_url + url_pattern (parametrized by actionkey) to form a url
@@ -115,5 +70,4 @@
 	public URL getTargetRequest() throws IOException {
         // URL targetURL =new URL( base_url, compname + ".xml");
-	
 		
 		URL targetURL = null;
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Utils.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Utils.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/internal/Utils.java	(revision 1613)
@@ -103,4 +103,14 @@
 		return config;
 	}
+
+	/**
+	 * convenience function to get a config property value
+	 * @param key
+	 * @return
+	 */
+		public static String getConfig(String key) {
+				return getConfig().getProperty(key);		
+		}
+		
 	
 	/**
@@ -185,5 +195,7 @@
 		    DocumentBuilderFactory.newInstance();
 		    DocumentBuilder builder = factory.newDocumentBuilder();
-		    document = builder.parse(path);		    
+		    InputStream doc_is = load2Stream(path); 
+		    document = builder.parse(doc_is);		    
+		    
 		}
 		catch (FactoryConfigurationError e) {
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 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Query.java	(revision 1613)
@@ -48,11 +48,5 @@
 	
 	private String type;
-	/**
-	 * meant a target url/service, allowing querying different services on per query basis
-	 * not used yet 
-	 */
-	private String target;	
-	
-	private URL targetRequest;
+	
 	private String syntax = "cql";  /* cql, cmdIndex, xpath */
 	private String query_string;
@@ -429,5 +423,4 @@
 	}
 	
-	
 	/**
 	 * provides a xml-version of the query (if parsed successfully)
@@ -482,6 +475,4 @@
 				
 		 return xpath.replace(".", "//"); 
-	}
-
-	
+	}	
 }
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/BasicProxy.java	(revision 1613)
@@ -6,4 +6,6 @@
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.Map;
+
 import org.apache.log4j.Logger;
 import eu.clarin.cmdi.mdservice.action.GenericAction;
@@ -11,5 +13,5 @@
 import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
 import eu.clarin.cmdi.mdservice.internal.Utils;
-import eu.clarin.cmdi.mdservice.model.Termset;
+
 
 /**
@@ -44,4 +46,8 @@
 	}
 	
+	public Map<String,String[]> getParams() {
+		return getSourceAction().getParams();
+	}
+	
 	/**
 	 * Convenience function to access the request-parameters in the Action  
@@ -56,5 +62,4 @@
 		// required Params	
 	}
-	
 	
 	/**
Index: MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java
===================================================================
--- MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/proxy/RepoProxy.java	(revision 1613)
@@ -1,37 +1,16 @@
 package eu.clarin.cmdi.mdservice.proxy;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
 import java.net.MalformedURLException;
-import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.HashMap;
 import java.util.Map;
-import java.io.ByteArrayInputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
 
 import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
 
 import eu.clarin.cmdi.mdservice.action.GenericAction;
-import eu.clarin.cmdi.mdservice.action.RepoAction;
 import eu.clarin.cmdi.mdservice.internal.CQLParseException;
 import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
 import eu.clarin.cmdi.mdservice.model.Diagnostic;
-import eu.clarin.cmdi.mdservice.model.Query;
 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile;
 
@@ -78,11 +57,11 @@
 	 * @return
 	 */
-	public String getParam(String key) {
+	/* This is already defined in BasicProxy! ?
+	 public String getParam(String key) {
+	 
 		return getSourceAction().getParam(key);
 	}
+	*/
 	
-	public Map<String,String[]> getParams() {
-		return getSourceAction().getParams();
-	}
 	
 	public void checkParams() {
Index: MDService2/branches/MDService_simple3/src/mdservice.properties
===================================================================
--- MDService2/branches/MDService_simple3/src/mdservice.properties	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/mdservice.properties	(revision 1613)
@@ -14,7 +14,8 @@
 
 //?? dcregistry.uri = http://www.isocat.org/rest/
-compregistry.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
-components.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
-profiles.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
+//moving to SMC
+//compregistry.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
+//components.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
+//profiles.uri = http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/
 virtualcollection.uri = http://clarin.ids-mannheim.de/vcr/service/virtualcollection
 
@@ -22,12 +23,14 @@
 //cache.path = /srv/tomcat6/webapps/MDService2_cache/
 //workspaceprofile.path = /srv/tomcat6/webapps/MDService2_profiles/
-//cache.path = C:/apps/apache-tomcat/webapps/MDService2_cache/
-//workspaceprofile.path = C:/apps/apache-tomcat/webapps/MDService2_profiles/
-cache.path = C:/apache-tomcat-6.0.26/webapps/MDService2_cache/
-workspaceprofile.path = C:/apache-tomcat-6.0.26/webapps/MDService2_profiles/
+cache.path = C:/apps/apache-tomcat/webapps/MDService2_cache/
+workspaceprofile.path = C:/apps/apache-tomcat/webapps/MDService2_profiles/
+//cache.path = C:/apache-tomcat-6.0.26/webapps/MDService2_cache/
+//workspaceprofile.path = C:/apache-tomcat-6.0.26/webapps/MDService2_profiles/
 workspace.file = WorkspaceProfile.xml
 
 cacheindex.file = cache_index.xml
 xml.comp = 
+
+
 xsl.profile2VC = profile2VC.xsl
 xsl.XCQL2XPATH = XCQL2Xpath.xsl
@@ -73,5 +76,5 @@
 
 xsl.datcat-all2terms = datcat_all2terms.xsl
-xsl.dcr-rdf2terms = datcat_rdf2terms.xsl
+//xsl.dcr-rdf2terms = datcat_rdf2terms.xsl
 xsl.rr-rdf2terms = datcat_rdf2terms.xsl
 xsl.dcr-dcif2terms = datcat_dcif2terms.xsl
Index: MDService2/branches/MDService_simple3/src/struts.xml
===================================================================
--- MDService2/branches/MDService_simple3/src/struts.xml	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/struts.xml	(revision 1613)
@@ -140,5 +140,25 @@
 		</action>
 		
-<!-- REGISTRY PROXY ACTIONS -->		
+<!-- REGISTRY PROXY ACTIONS -->
+<!-- SMCAction replaces all registry actions -->
+		<action name="smc/list/*" class="eu.clarin.cmdi.mdservice.action.SMCAction" method="execute">
+			   	<param name="context">{1}</param>
+			   	<param name="actionkey">list</param>
+			    <result type="stream">		
+			        <param name="contentType">${getActionContentType()}</param>			        
+			        <param name="inputName">resultStream</param>
+			    </result>
+		</action>
+
+		<action name="smc/map/*" class="eu.clarin.cmdi.mdservice.action.SMCAction" method="execute">
+			   	<param name="term">{1}</param>
+			   	<param name="actionkey">map</param>
+			    <result type="stream">		
+			        <param name="contentType">${getActionContentType()}</param>			        
+			        <param name="inputName">resultStream</param>
+			    </result>
+		</action>
+
+		
 		<action name="comp/*" class="eu.clarin.cmdi.mdservice.action.CompRegistryProxyAction" method="execute">
 			   	<param name="compid">{1}</param>
Index: MDService2/branches/MDService_simple3/src/xsl/mdinst2view.xsl
===================================================================
--- MDService2/branches/MDService_simple3/src/xsl/mdinst2view.xsl	(revision 1594)
+++ MDService2/branches/MDService_simple3/src/xsl/mdinst2view.xsl	(revision 1613)
@@ -92,5 +92,7 @@
 						<xsl:if test="count(ResourceProxy) &gt; $resourceref_limit" >
 							<span class="label" >showing first </span> <xsl:value-of select="$resourceref_limit" /> <span class="label" > references. </span> 
-							<s><a href="{concat($default_prefix, my:encodePID(./ancestor::CMD/Header/MdSelfLink))}">see more</a></s>							
+							<!--   <s><a href="{concat($default_prefix, my:encodePID(./ancestor::CMD/Header/MdSelfLink))}">see more</a></s> -->
+							<s><a href="{my:formURL('record', 'htmlpage', my:encodePID(./ancestor::CMD/Header/MdSelfLink))}">see more</a></s>
+														
 						</xsl:if>
 						<xsl:apply-templates select="ResourceProxy[position() &lt; $resourceref_limit]" />
@@ -115,5 +117,5 @@
 					</xsl:when>
 					<xsl:otherwise>
-							<xsl:value-of select="concat($default_prefix, my:encodePID(ResourceRef))" />
+							<xsl:value-of select="my:formURL('record', 'htmlpage', my:encodePID(ResourceRef))" />
 					</xsl:otherwise>
 				</xsl:choose>				
