Index: metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/EmbeddedSolrQueryService.java
===================================================================
--- metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/EmbeddedSolrQueryService.java	(nonexistent)
+++ metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/EmbeddedSolrQueryService.java	(revision 7713)
@@ -0,0 +1,161 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class that gets Accession Number, check for uniqueness
+ *             and register it into db
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jivka Bojilova, Matt Jones
+ *
+ *   '$Author: tao $'
+ *     '$Date: 2013-04-19 17:47:14 -0700 (Fri, 19 Apr 2013) $'
+ * '$Revision: 7595 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.common.query;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.core.SolrCore;
+import org.apache.solr.schema.SchemaField;
+import org.dataone.cn.indexer.solrhttp.SolrDoc;
+import org.dataone.service.exceptions.NotFound;
+import org.dataone.service.exceptions.NotImplemented;
+import org.dataone.service.exceptions.UnsupportedType;
+import org.dataone.service.types.v1.Subject;
+import org.xml.sax.SAXException;
+
+import edu.ucsb.nceas.metacat.common.SolrQueryResponseTransformer;
+
+
+/**
+ *The query service of the embedded solr server.
+ * @author tao
+ *
+ */
+public class EmbeddedSolrQueryService extends SolrQueryService {
+    private EmbeddedSolrServer solrServer = null;
+    private CoreContainer coreContainer = null;
+    private String collectionName = null;
+    private SolrCore solrCore = null;
+    /**
+     * Constructor.
+     * @param solrServer
+     * @param solrCore
+     * @throws NotFound 
+     */
+    public EmbeddedSolrQueryService(EmbeddedSolrServer solrServer, CoreContainer coreContainer, String collectionName) throws NotFound {
+        if(solrServer == null) {
+            throw new NullPointerException("EmbeddedSolrQueryService.constructor - the EmbeddedSolrServer parameter can't be null.");
+        }
+        if(coreContainer == null) {
+            throw new NullPointerException("EmbeddedSolrQueryService.constructor - the CoreContainer parameter can't be null.");
+        }
+        if(collectionName == null || collectionName.trim().equals("")) {
+            throw new NullPointerException("EmbeddedSolrQueryService.constructor - the name of Collection parameter can't be null or empty.");
+        }
+        this.solrServer = solrServer;
+        this.coreContainer = coreContainer;
+        this.collectionName = collectionName;
+        this.solrCore = this.coreContainer.getCore(collectionName);
+        if(solrCore == null) {
+            throw new NotFound("0000","EmbeddedSolrQueryService.constructor - There is no SolrCore named "+collectionName+".");
+        }
+    }
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is the for the http solr server.
+     * @param query the query string
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws Exception
+     */
+    public InputStream query(String query, Set<Subject>subjects) throws Exception {
+        throw new NotImplemented("0000", "EmbeddSolrQueryService - the method of  query(String query, Set<Subject>subjects) is not for the EmbeddedSolrServer. We donot need to implemente it");
+    }
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is for the embedded solr server.
+     * @param query the query params. 
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws SAXException 
+     * @throws IOException 
+     * @throws ParserConfigurationException 
+     * @throws SolrServerException 
+     * @throws UnsupportedType 
+     * @throws Exception
+     */
+    public  InputStream query(SolrParams query, Set<Subject>subjects) throws ParserConfigurationException, IOException, SAXException, SolrServerException, UnsupportedType {
+        InputStream inputStream = null;
+        String wt = query.get(WT);
+        query = appendAccessFilterParams(query, subjects);
+        SolrQueryResponseTransformer solrTransformer = new SolrQueryResponseTransformer(solrCore);
+        // handle normal and skin-based queries
+        if (isSupportedWT(wt)) {
+            // just handle as normal solr query
+            //reload the core before query. Only after reloading the core, the query result can reflect the change made in metacat-index module.
+            coreContainer.reload(collectionName);
+            QueryResponse response = solrServer.query(query);
+            inputStream = solrTransformer.transformResults(query, response, wt);
+        } else {
+            throw new UnsupportedType("0000","EmbeddSolrQueryService.query - the wt type "+wt+" in the solr query is not supported");
+        }
+        return inputStream;
+    }
+    
+    
+    /**
+     * Get the list of SolrDocs for the specified ids from the solr server.
+     *  * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it
+     * wouldn't be added to the list.
+     * @param ids the specified ids
+     * @return the SolrDocs of the ids.
+     * @throws Exception
+     */
+    public  List<SolrDoc> query(List<String> ids) throws Exception {
+        return null;
+    }
+    
+    
+    /**
+     * Get the fields list of the index schema
+     * @return
+     * @throws Exception
+     */
+    public  Map<String, SchemaField> getIndexSchemaFields() throws Exception {
+        return null;
+    }
+    
+    /**
+     * Get the version of the solr server.
+     * @return
+     */
+    public String getSolrServerVersion() {
+        return null;
+    }
+}
Index: metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/HttpSolrQueryService.java
===================================================================
--- metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/HttpSolrQueryService.java	(nonexistent)
+++ metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/HttpSolrQueryService.java	(revision 7713)
@@ -0,0 +1,136 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class that gets Accession Number, check for uniqueness
+ *             and register it into db
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jivka Bojilova, Matt Jones
+ *
+ *   '$Author: tao $'
+ *     '$Date: 2013-04-19 17:47:14 -0700 (Fri, 19 Apr 2013) $'
+ * '$Revision: 7595 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.common.query;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.schema.SchemaField;
+import org.dataone.cn.indexer.solrhttp.HTTPService;
+import org.dataone.cn.indexer.solrhttp.SolrDoc;
+import org.dataone.service.exceptions.NotFound;
+import org.dataone.service.exceptions.NotImplemented;
+import org.dataone.service.exceptions.UnsupportedType;
+import org.dataone.service.types.v1.Subject;
+
+import edu.ucsb.nceas.metacat.common.SolrQueryResponseTransformer;
+
+/**
+ * The query service for the http solr server.
+ * @author tao
+ *
+ */
+public class HttpSolrQueryService extends SolrQueryService {
+    
+    private String solrServerBaseURL = null;
+    private CommonsHttpSolrServer httpSolrServer = null;
+    
+    /**
+     * Constructor
+     * @param httpSolrServer
+     */
+    public HttpSolrQueryService(CommonsHttpSolrServer httpSolrServer) {
+        if(httpSolrServer == null) {
+            throw new NullPointerException("HttpSolrQueryService.constructor - The httpSolrServer parameter can't be null");
+        }
+        this.httpSolrServer = httpSolrServer;
+        this.solrServerBaseURL = httpSolrServer.getBaseURL();
+    }
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is the for the http solr server.
+     * @param query the query string
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws NotFound 
+     * @throws IOException 
+     * @throws Exception
+     */
+    public InputStream query(String query, Set<Subject>subjects) throws NotFound, IOException {
+        StringBuffer accessFilter = generateAccessFilterParamsString(subjects);
+        if(accessFilter != null && accessFilter.length() != 0) {
+            query = solrServerBaseURL+"/select?"+query+"&"+FILTERQUERY+"="+accessFilter.toString();
+            query = HTTPService.escapeQueryChars(query);
+        } else {
+            throw new NotFound("0000", "HttpSolrQueryService.query - There is no identity (even user public) for the user who issued the query");
+        }
+        URL url = new URL(query);
+        return url.openStream();
+    }
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is for the embedded solr server.
+     * @param query the query params. 
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws Exception
+     */
+    public  InputStream query(SolrParams query, Set<Subject>subjects) throws Exception {
+        throw new NotImplemented("0000", "HttpSolrQueryService - the method of  query(SolrParams query, Set<Subject>subjects) is not for the HttpSolrQueryService. We donot need to implemente it");
+    }
+    
+    
+    /**
+     * Get the list of SolrDocs for the specified ids from the solr server.
+     *  * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it
+     * wouldn't be added to the list.
+     * @param ids the specified ids
+     * @return the SolrDocs of the ids.
+     * @throws Exception
+     */
+    public  List<SolrDoc> query(List<String> ids) throws Exception {
+        return null;
+    }
+    
+    
+    /**
+     * Get the fields list of the index schema
+     * @return
+     * @throws Exception
+     */
+    public  Map<String, SchemaField> getIndexSchemaFields() throws Exception {
+        return null;
+    }
+    
+    /**
+     * Get the version of the solr server.
+     * @return
+     */
+    public String getSolrServerVersion() {
+        return null;
+    }
+}
Index: metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryService.java
===================================================================
--- metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryService.java	(nonexistent)
+++ metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryService.java	(revision 7713)
@@ -0,0 +1,187 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class that gets Accession Number, check for uniqueness
+ *             and register it into db
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jivka Bojilova, Matt Jones
+ *
+ *   '$Author: tao $'
+ *     '$Date: 2013-04-19 17:47:14 -0700 (Fri, 19 Apr 2013) $'
+ * '$Revision: 7595 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.common.query;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.params.AppendedSolrParams;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.schema.SchemaField;
+import org.dataone.cn.indexer.solrhttp.SolrDoc;
+import org.dataone.service.types.v1.Subject;
+import org.dataone.service.util.Constants;
+
+import edu.ucsb.nceas.metacat.common.SolrQueryResponseWriterFactory;
+
+
+/**
+ * A query interface for the solr server
+ * @author tao
+ *
+ */
+public abstract class SolrQueryService {
+    
+    public static final String WT = "wt";//the property name to specify the return type
+    
+    protected static final String FILTERQUERY = "fq";
+    private static final String READPERMISSION = "readPermission";
+    private static final String RIGHTSHOLDER = "rightsHolder";
+    private static final String OPENPARENTHESE = "(";
+    private static final String CLOSEPARENTHESE = ")";
+    private static final String COLON = ":";
+    private static final String OR = "OR";
+    
+    private static Log log = LogFactory.getLog(SolrQueryService.class);
+    private static List<String> supportedWriterTypes = null;
+    static {
+        supportedWriterTypes = new ArrayList<String>();
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.CSV);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.JSON);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.PHP);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.PHPS);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.RUBY);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.VELOCITY);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.PYTHON);
+        supportedWriterTypes.add(SolrQueryResponseWriterFactory.XML);
+    }
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is the for the http solr server.
+     * @param query the query string
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws Exception
+     */
+    public abstract InputStream query(String query, Set<Subject>subjects) throws Exception;
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is for the embedded solr server.
+     * @param query the query params. 
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws Exception
+     */
+    public abstract InputStream query(SolrParams query, Set<Subject>subjects) throws Exception;
+    
+    
+    /**
+     * Get the list of SolrDocs for the specified ids from the solr server.
+     *  * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it
+     * wouldn't be added to the list.
+     * @param ids the specified ids
+     * @return the SolrDocs of the ids.
+     * @throws Exception
+     */
+    public abstract List<SolrDoc> query(List<String> ids) throws Exception;
+    
+    
+    /**
+     * Get the fields list of the index schema
+     * @return
+     * @throws Exception
+     */
+    public abstract Map<String, SchemaField> getIndexSchemaFields() throws Exception;
+    
+    /**
+     * Get the version of the solr server.
+     * @return
+     */
+    public abstract String getSolrServerVersion();
+    
+    
+    
+    /**
+     * If the solr server supports the specified wt.
+     * @param wt
+     * @return true if it supports; otherwise false.
+     */
+    public static boolean isSupportedWT(String wt) {
+        if (wt == null ||supportedWriterTypes.contains(wt)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+    
+    /*
+     * Append the access filter query to the params
+     */
+    protected SolrParams appendAccessFilterParams(SolrParams solrParams, Set<Subject>subjects) {
+        SolrParams append = null;
+        if(solrParams != null) {
+            StringBuffer query = generateAccessFilterParamsString(subjects);      
+            if(query != null && query.length() != 0) {
+                log.info("=================== fq query is "+query.toString());
+                NamedList fq = new NamedList();
+                fq.add(FILTERQUERY, query.toString());
+                SolrParams fqParam = SolrParams.toSolrParams(fq);
+                append = new AppendedSolrParams(solrParams, fqParam);
+            } else {
+                append = solrParams;
+            }
+        }
+        return append;
+    }
+    
+    protected StringBuffer generateAccessFilterParamsString(Set<Subject>subjects) {
+        StringBuffer query = new StringBuffer();
+        boolean first = true;
+        if(subjects != null) {
+            for(Subject subject : subjects) {
+                if(subject != null) {
+                    String subjectName = subject.getValue();
+                    if(subjectName != null && !subjectName.trim().equals("")) {
+                        if(first) {
+                            first = false;
+                            query.append(OPENPARENTHESE+READPERMISSION+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
+                            if(!subjectName.equals(Constants.SUBJECT_PUBLIC) && !subjectName.equals(Constants.SUBJECT_AUTHENTICATED_USER)) {
+                                query.append(OR+OPENPARENTHESE+RIGHTSHOLDER+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
+                            }
+                        } else {
+                            query.append(OR + OPENPARENTHESE+READPERMISSION+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
+                            if(!subjectName.equals(Constants.SUBJECT_PUBLIC) && !subjectName.equals(Constants.SUBJECT_AUTHENTICATED_USER)) {
+                                query.append(OR + OPENPARENTHESE+RIGHTSHOLDER+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
+                            }
+                        }
+                    }
+                   
+                }
+               
+            }
+        }
+        return query;
+    }
+}
Index: metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceController.java
===================================================================
--- metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceController.java	(nonexistent)
+++ metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceController.java	(revision 7713)
@@ -0,0 +1,138 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class that gets Accession Number, check for uniqueness
+ *             and register it into db
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jivka Bojilova, Matt Jones
+ *
+ *   '$Author: tao $'
+ *     '$Date: 2013-04-19 17:47:14 -0700 (Fri, 19 Apr 2013) $'
+ * '$Revision: 7595 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.common.query;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
+import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.core.CoreContainer;
+import org.dataone.service.exceptions.NotFound;
+import org.dataone.service.exceptions.NotImplemented;
+import org.dataone.service.exceptions.UnsupportedType;
+import org.dataone.service.types.v1.Subject;
+import org.xml.sax.SAXException;
+
+import edu.ucsb.nceas.metacat.common.SolrQueryResponseTransformer;
+import edu.ucsb.nceas.metacat.common.SolrServerFactory;
+
+/**
+ * A class to handle the solr query. 
+ * @author tao
+ *
+ */
+public class SolrQueryServiceController {
+    private static SolrQueryServiceController controller = null;
+    private boolean isEmbeddedSolrServer = false;
+    private EmbeddedSolrQueryService embeddedQueryService = null;
+    private HttpSolrQueryService httpQueryService = null;
+    
+    /*
+     * Private consctructor
+     */
+    private SolrQueryServiceController() throws UnsupportedType, ParserConfigurationException, IOException, SAXException, NotFound {
+        SolrServer solrServer = SolrServerFactory.createSolrServer();
+        if(solrServer instanceof EmbeddedSolrServer) {
+            isEmbeddedSolrServer = true;
+            EmbeddedSolrServer embeddedServer = (EmbeddedSolrServer) solrServer;
+            CoreContainer coreContainer = SolrServerFactory.getCoreContainer();
+            String collectionName = SolrServerFactory.getCollectionName();
+            embeddedQueryService = new EmbeddedSolrQueryService(embeddedServer, coreContainer, collectionName);
+        } else {
+            isEmbeddedSolrServer = false;
+            CommonsHttpSolrServer httpServer = (CommonsHttpSolrServer)solrServer;
+            httpQueryService = new HttpSolrQueryService(httpServer);
+        }
+    }
+    
+    /**
+     * Get the controller
+     * @return
+     * @throws UnsupportedType
+     * @throws NotFound
+     * @throws ParserConfigurationException
+     * @throws IOException
+     * @throws SAXException
+     */
+    public static SolrQueryServiceController getInstance() throws UnsupportedType, NotFound, ParserConfigurationException, IOException, SAXException {
+        if(controller == null) {
+            controller = new SolrQueryServiceController();
+        }
+        return controller;
+    }
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is the for the http solr server.
+     * @param query the query string
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws NotImplemented 
+     * @throws IOException 
+     * @throws NotFound 
+     * @throws Exception
+     */
+    public InputStream query(String query, Set<Subject>subjects) throws NotImplemented, NotFound, IOException  {
+        if(isEmbeddedSolrServer) {
+            throw new NotImplemented("0000", "SolrQueryServiceController - the method of  query(String query, Set<Subject>subjects) is not for the EmbeddedSolrServer. We donot need to implemente it");
+        } else {
+            return httpQueryService.query(query, subjects);
+        }
+      
+    }
+    
+    /**
+     * Query the Solr server with specified query and user's identity. If the Subjects
+     * is null, there will be no access rules for the query. This is for the embedded solr server.
+     * @param query the query params. 
+     * @param subjects the user's identity which sent the query
+     * @return the response
+     * @throws SAXException 
+     * @throws IOException 
+     * @throws ParserConfigurationException 
+     * @throws SolrServerException 
+     * @throws UnsupportedType 
+     * @throws NotImplemented 
+     * @throws Exception
+     */
+    public  InputStream query(SolrParams query, Set<Subject>subjects) throws UnsupportedType, ParserConfigurationException, IOException, SAXException, SolrServerException, NotImplemented {
+        if(isEmbeddedSolrServer) {
+            return embeddedQueryService.query(query, subjects);
+        } else {
+            throw new NotImplemented("0000", "QueryServiceController - the method of  query(String query, Set<Subject>subjects) is not for the EmbeddedSolrServer. We donot need to implemente it");
+        }
+    }
+    
+}
Index: metacat-common/pom.xml
===================================================================
--- metacat-common/pom.xml	(revision 7712)
+++ metacat-common/pom.xml	(revision 7713)
@@ -25,45 +25,16 @@
 			<version>3.4.0</version>
 		</dependency>
 		<dependency>
-			<groupId>org.dataone</groupId>
-			<artifactId>d1_common_java</artifactId>
-			<version>1.2.0-SNAPSHOT</version>
-			<type>jar</type>
-			<!-- exclude extraneous artifacts (jars) -->
-			<exclusions>
-		        <exclusion>
-		          <groupId>org.jibx</groupId>
-		          <artifactId>jibx-tools</artifactId>
-		        </exclusion>
-		        <exclusion>
-		          <groupId>org.jibx</groupId>
-		          <artifactId>jibx-schema</artifactId>
-		        </exclusion>
-		        <exclusion>
-		          <groupId>org.jibx</groupId>
-		          <artifactId>jibx-extras</artifactId>
-		        </exclusion>
-		        <exclusion>
-		          <groupId>org.jibx</groupId>
-		          <artifactId>jibx-bind</artifactId>
-		        </exclusion>
-		        <exclusion>
-		        	<groupId>org.apache.maven.plugins</groupId>
-					<artifactId>maven-compiler-plugin</artifactId>
-		        </exclusion>
-		        <exclusion>
-		        	<groupId>org.apache.maven.plugins</groupId>
-					<artifactId>maven-jar-plugin</artifactId>
-		        </exclusion>
-		        <exclusion>
-		        	<groupId>org.apache.maven.plugins</groupId>
-					<artifactId>maven-clean-plugin</artifactId>
-		        </exclusion>
-		        <exclusion>
-		        	<groupId>org.jibx</groupId>
-					<artifactId>maven-jibx-plugin</artifactId>
-		        </exclusion>
-			</exclusions>
-		</dependency>
+        <groupId>org.dataone</groupId>
+        <artifactId>d1_cn_index_processor</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <type>jar</type>
+        <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+        </exclusions>
+    </dependency>
 	</dependencies>
 </project>
