Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/pom.xml
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/pom.xml	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/pom.xml	(revision 55815)
@@ -0,0 +1,39 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet45-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />	
+	</parent>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-modular-index-ui</artifactId>
+	<version>2.0.8</version>
+	<scm>
+   		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8</developerConnection>
+	</scm>
+
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>dnet-modular-ui</artifactId>
+			<version>[3.0.0,4.0.0)</version>
+		</dependency>
+		
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>${javax.servlet.version}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>dnet-index-client</artifactId>
+			<version>[2.3.4,3.0.0)</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexClientMap.java
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexClientMap.java	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexClientMap.java	(revision 55815)
@@ -0,0 +1,35 @@
+package eu.dnetlib.functionality.modular.ui.index;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.google.common.collect.Maps;
+
+import eu.dnetlib.functionality.index.client.IndexClient;
+import eu.dnetlib.functionality.index.client.IndexClientException;
+
+public class IndexClientMap {
+
+	private static final Log log = LogFactory.getLog(IndexClientMap.class);
+
+	private Map<String, IndexClient> map = Maps.newHashMap();
+
+	public void shutdown() throws IOException {
+		log.debug("shutdown index clients");
+		for (IndexClient client : map.values()) {
+			client.close();
+		}
+	}
+
+	public Map<String, IndexClient> getMap() {
+		return map;
+	}
+
+	public void setMap(final Map<String, IndexClient> map) {
+		this.map = map;
+	}
+
+}
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceInternalController.java
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceInternalController.java	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceInternalController.java	(revision 55815)
@@ -0,0 +1,287 @@
+package eu.dnetlib.functionality.modular.ui.index;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import eu.dnetlib.data.provision.index.rmi.IndexServiceException;
+import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
+import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
+import eu.dnetlib.enabling.locators.UniqueServiceLocator;
+import eu.dnetlib.functionality.index.client.IndexClient;
+import eu.dnetlib.functionality.index.client.IndexClientException;
+import eu.dnetlib.functionality.index.client.response.BrowseEntry;
+import eu.dnetlib.functionality.index.client.response.LookupResponse;
+import eu.dnetlib.functionality.index.client.solr.SolrIndexClientFactory;
+import eu.dnetlib.functionality.modular.ui.AbstractAjaxController;
+import eu.dnetlib.functionality.modular.ui.index.models.IndexInfo;
+import eu.dnetlib.functionality.modular.ui.index.models.MdFormatInfo;
+import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * The Class IndexServiceInternalController.
+ */
+@Controller
+public class IndexServiceInternalController extends AbstractAjaxController {
+
+	/** The Constant log. */
+	private static final Log log = LogFactory.getLog(IndexServiceInternalController.class);
+
+	/** The lookup locator. */
+	@Resource
+	private UniqueServiceLocator serviceLocator;
+
+	/** The index client factory. */
+	@Autowired
+	private SolrIndexClientFactory indexClientFactory;
+
+	@Autowired
+	private IndexClientMap clientMap;
+
+	/**
+	 * Index metadata formats.
+	 *
+	 * @param map
+	 *            the map
+	 * @return the list< md format info>
+	 * @throws Exception
+	 *             the exception
+	 */
+	@RequestMapping(value = "/ui/index/indexMetadataFormats.do")
+	@ResponseBody
+	public List<MdFormatInfo> indexMetadataFormats(final ModelMap map) throws Exception {
+		final String xquery =
+				"for $x in //RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='MDFormatDSResourceType'] "
+						+ "let $format:= $x//CONFIGURATION/NAME/string()  for $y in $x//LAYOUTS/LAYOUT  let $layout:= $y/@name/string() "
+						+ "let $interpretation:= $x//CONFIGURATION/INTERPRETATION/text() let $id:=$x//RESOURCE_IDENTIFIER/@value/string() "
+						+ " return concat($format,'-',$layout,'-',$interpretation,'::', $id) ";
+		log.debug("Executing lookup query" + xquery);
+
+		return quickSearchProfile(xquery).stream()
+				.map(MdFormatInfo::initFromXqueryResult)
+				.collect(Collectors.toList());
+	}
+
+	/**
+	 * Index datastructures.
+	 *
+	 * @param backend
+	 *            the backend
+	 * @return the list< index info>
+	 * @throws Exception
+	 *             the exception
+	 */
+	@RequestMapping(value = "/ui/index/indexDatastructures.do")
+	@ResponseBody
+	public List<IndexInfo> indexDatastructures(@RequestParam(value = "backend", required = true) final String backend) throws Exception {
+		final String xquery =
+				"for $x in //RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='IndexDSResourceType' and .//BACKEND/@ID='%s'] let $format := $x//METADATA_FORMAT "
+						+ "let $layout := $x//METADATA_FORMAT_LAYOUT let $interpretation :=$x//METADATA_FORMAT_INTERPRETATION "
+						+ "let $id :=$x//RESOURCE_IDENTIFIER/@value let $backendid := $x//BACKEND/@ID let $size := $x//INDEX_SIZE "
+						+ "return concat($format, ':-:',$layout,':-:',$interpretation,':-:',$id,':-:',$backendid,':-:',$size)";
+		log.debug("Executing lookup query" + String.format(xquery, backend));
+
+		return quickSearchProfile(String.format(xquery, backend)).stream()
+				.map(IndexInfo::newInstanceFromString)
+				.collect(Collectors.toList());
+	}
+
+	/**
+	 * Md format info.
+	 *
+	 * @param id
+	 *            the id
+	 * @param layout
+	 *            the layout
+	 * @return the list< string>
+	 * @throws Exception
+	 *             the exception
+	 */
+	@RequestMapping(value = "/ui/index/mdFormatInfo.do")
+	@ResponseBody
+	public List<String> mdFormatInfo(@RequestParam(value = "id", required = true) final String id,
+			@RequestParam(value = "layout", required = true) final String layout) throws Exception {
+
+		String xqueryTemplate =
+				"//RESOURCE_PROFILE[.//RESOURCE_IDENTIFIER/@value='%s']" + "//LAYOUT[./@name/string()='%s'] "
+						+ "//FIELD[./@tokenizable/string()='false' or ./@type = 'int' or ./@type = 'date']/@name/string()";
+		log.debug("executing query: " + String.format(xqueryTemplate, id, layout));
+		return quickSearchProfile(String.format(xqueryTemplate, id, layout));
+	}
+
+	/**
+	 * Gets the backend available.
+	 *
+	 * @return the backend available
+	 * @throws Exception
+	 *             the exception
+	 */
+	@RequestMapping(value = "/ui/index/backend.do")
+	@ResponseBody
+	public Set<String> getBackendAvailable() throws Exception {
+
+		String xquery = "for $x in //RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='IndexDSResourceType'] return distinct-values($x//BACKEND/@ID/string())";
+		log.debug("executing query: " + xquery);
+		return Sets.newHashSet(quickSearchProfile(xquery));
+
+	}
+
+	/**
+	 * Browse.
+	 *
+	 * @param map
+	 *            the map
+	 * @param backend
+	 *            the backend
+	 * @param format
+	 *            the format
+	 * @param layout
+	 *            the layout
+	 * @param interpretation
+	 *            the interpretation
+	 * @return the list< string>
+	 * @throws IndexClientException
+	 *             the index client exception
+	 */
+	@RequestMapping(value = "/ui/index/browse.do", method = RequestMethod.POST)
+	@ResponseBody
+	public List<BrowseEntry> browse(final ModelMap map,
+			@RequestParam(value = "backend", required = true) final String backend,
+			@RequestParam(value = "format", required = true) final String format,
+			@RequestParam(value = "layout", required = true) final String layout,
+			@RequestParam(value = "interpretation", required = true) final String interpretation,
+			@RequestParam(value = "fields", required = true) final String fields,
+			@RequestParam(value = "query", required = true) final String query) throws IndexClientException {
+
+		List<String> browseFields = new Gson().fromJson(fields, new TypeToken<List<String>>() {}.getType());
+
+		if (browseFields != null) {
+			for (String s : browseFields) {
+				log.debug("Browse field " + s);
+			}
+		}
+
+		String indexClientKeys = format + "-" + layout + "-" + interpretation;
+
+		IndexClient client = null;
+		if (clientMap.getMap().containsKey(indexClientKeys)) {
+			client = clientMap.getMap().get(indexClientKeys);
+		} else {
+			client = indexClientFactory.getClient(format, layout, interpretation);
+			clientMap.getMap().put(indexClientKeys, client);
+		}
+
+		// LookupResponse result = client.lookup("*=*", null, 0, 10);
+
+		List<BrowseEntry> result = client.browse(query, browseFields, 99);
+		return result;
+	}
+
+	@RequestMapping(value = "/ui/index/delete.do", method = RequestMethod.POST)
+	@ResponseBody
+	public long delete(final ModelMap map,
+			@RequestParam(value = "backend", required = true) final String backend,
+			@RequestParam(value = "format", required = true) final String format,
+			@RequestParam(value = "layout", required = true) final String layout,
+			@RequestParam(value = "interpretation", required = true) final String interpretation,
+			@RequestParam(value = "query", required = true) final String query,
+			@RequestParam(value = "indexidentifier", required = false) final String indexId) throws IndexServiceException {
+
+		String indexClientKeys = format + "-" + layout + "-" + interpretation;
+
+		IndexClient client = null;
+		if (clientMap.getMap().containsKey(indexClientKeys)) {
+			client = clientMap.getMap().get(indexClientKeys);
+		} else {
+			client = indexClientFactory.getClient(format, layout, interpretation);
+			clientMap.getMap().put(indexClientKeys, client);
+		}
+		String mquery = query;
+
+		if (!StringUtils.isEmpty(indexId)) {
+			mquery = query + " and __dsid exact \"" + indexId + "\"";
+		}
+
+		return client.delete(mquery);
+	}
+
+	@RequestMapping(value = "/ui/index/search.do", method = RequestMethod.POST)
+	@ResponseBody
+	public LookupResponse search(final ModelMap map,
+			@RequestParam(value = "backend", required = true) final String backend,
+			@RequestParam(value = "format", required = true) final String format,
+			@RequestParam(value = "layout", required = true) final String layout,
+			@RequestParam(value = "interpretation", required = true) final String interpretation,
+			@RequestParam(value = "query", required = true) final String query,
+			@RequestParam(value = "from", required = true) final int from,
+			@RequestParam(value = "number", required = true) final int number,
+			@RequestParam(value = "indexidentifier", required = false) final String indexId
+
+			) throws IndexClientException {
+
+		String indexClientKeys = format + "-" + layout + "-" + interpretation;
+
+		log.debug(indexClientKeys);
+
+		IndexClient client = null;
+
+		if (!clientMap.getMap().containsKey(indexClientKeys)) {
+			clientMap.getMap().put(indexClientKeys, indexClientFactory.getClient(format, layout, interpretation));
+		}
+		client = clientMap.getMap().get(indexClientKeys);
+
+		List<String> filterId = null;
+		if (indexId != null && !indexId.isEmpty()) {
+			filterId = Lists.newArrayList("__dsid:\"" + indexId + "\"");
+		}
+
+		log.debug(String.format("query: '%s', filter: '%s', from: '%d', number: '%d'", query, filterId, from, number));
+
+		LookupResponse result = client.lookup(query, filterId, from, number);
+
+		ClassPathResource cpr = new ClassPathResource("/eu/dnetlib/functionality/modular/ui/xslt/gmf2document.xslt");
+		ApplyXslt xslt = new ApplyXslt(cpr);
+		List<String> convertedList = new ArrayList<String>();
+
+		for (String s : result.getRecords()) {
+			log.debug("response record: \n" + s);
+			convertedList.add(xslt.evaluate(s));
+		}
+		result.setRecords(convertedList);
+		return result;
+	}
+
+	/**
+	 * Quick search profile.
+	 *
+	 * @param xquery
+	 *            the xquery
+	 * @return the list< string>
+	 * @throws Exception
+	 *             the exception
+	 */
+	private List<String> quickSearchProfile(final String xquery) throws Exception {
+		try {
+			return serviceLocator.getService(ISLookUpService.class).quickSearchProfile(xquery);
+		} catch (ISLookUpException e) {
+			throw new Exception(e);
+		}
+	}
+}
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceEntryPointController.java
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceEntryPointController.java	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/IndexServiceEntryPointController.java	(revision 55815)
@@ -0,0 +1,22 @@
+package eu.dnetlib.functionality.modular.ui.index;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.ui.ModelMap;
+
+import eu.dnetlib.enabling.locators.UniqueServiceLocator;
+import eu.dnetlib.functionality.modular.ui.ModuleEntryPoint;
+
+public class IndexServiceEntryPointController extends ModuleEntryPoint {
+
+	@Resource
+	private UniqueServiceLocator serviceLocator;
+
+	@Override
+	protected void initialize(final ModelMap map, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
+
+	}
+
+}
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/IndexInfo.java
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/IndexInfo.java	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/IndexInfo.java	(revision 55815)
@@ -0,0 +1,181 @@
+package eu.dnetlib.functionality.modular.ui.index.models;
+
+/**
+ * The Class IndexInfo.
+ */
+public class IndexInfo {
+
+	/** The Constant SEPARATOR. */
+	private static final String SEPARATOR = ":-:";
+
+	/** The id. */
+	private String id;
+
+	/** The forma. */
+	private String format;
+
+	/** The layout. */
+	private String layout;
+
+	/** The interpretation. */
+	private String interpretation;
+
+	/** The backend id. */
+	private String backendId;
+
+	private int size;
+
+	/**
+	 * The Constructor.
+	 */
+	public IndexInfo() {
+
+	}
+
+	/**
+	 * The Constructor.
+	 *
+	 * @param id
+	 *            the id
+	 * @param forma
+	 *            the forma
+	 * @param layout
+	 *            the layout
+	 * @param interpretation
+	 *            the interpretation
+	 * @param backendId
+	 *            the backend id
+	 */
+	public IndexInfo(final String id, final String forma, final String layout, final String interpretation, final String backendId) {
+		super();
+		this.id = id;
+		this.format = forma;
+		this.layout = layout;
+		this.interpretation = interpretation;
+		this.backendId = backendId;
+	}
+
+	/**
+	 * Gets the id.
+	 *
+	 * @return the id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id.
+	 *
+	 * @param id
+	 *            the id
+	 */
+	public void setId(final String id) {
+		this.id = id;
+	}
+
+	/**
+	 * Gets the forma.
+	 *
+	 * @return the forma
+	 */
+	public String getFormat() {
+		return format;
+	}
+
+	/**
+	 * Sets the forma.
+	 *
+	 * @param forma
+	 *            the forma
+	 */
+	public void setFormat(final String format) {
+		this.format = format;
+	}
+
+	/**
+	 * Gets the layout.
+	 *
+	 * @return the layout
+	 */
+	public String getLayout() {
+		return layout;
+	}
+
+	/**
+	 * Sets the layout.
+	 *
+	 * @param layout
+	 *            the layout
+	 */
+	public void setLayout(final String layout) {
+		this.layout = layout;
+	}
+
+	/**
+	 * Gets the interpretation.
+	 *
+	 * @return the interpretation
+	 */
+	public String getInterpretation() {
+		return interpretation;
+	}
+
+	/**
+	 * Sets the interpretation.
+	 *
+	 * @param interpretation
+	 *            the interpretation
+	 */
+	public void setInterpretation(final String interpretation) {
+		this.interpretation = interpretation;
+	}
+
+	/**
+	 * Gets the backend id.
+	 *
+	 * @return the backend id
+	 */
+	public String getBackendId() {
+		return backendId;
+	}
+
+	/**
+	 * Sets the backend id.
+	 *
+	 * @param backendId
+	 *            the backend id
+	 */
+	public void setBackendId(final String backendId) {
+		this.backendId = backendId;
+	}
+
+	public int getSize() {
+		return size;
+	}
+
+	public void setSize(final int size) {
+		this.size = size;
+	}
+
+	/**
+	 * New instance from string. the string must have the form format:-:layout:-:interpretation:-:id:-:backendid:-:size
+	 *
+	 * @param serialized
+	 *            the serialized
+	 * @return the index info
+	 */
+	public static IndexInfo newInstanceFromString(final String serialized) {
+		String[] values = serialized.split(SEPARATOR);
+		if ((values == null) || (values.length != 6)) return null;
+		IndexInfo tmp = new IndexInfo();
+		tmp.format = values[0];
+		tmp.layout = values[1];
+		tmp.interpretation = values[2];
+		tmp.id = values[3];
+		tmp.backendId = values[4];
+		tmp.size = Integer.parseInt(values[5]);
+		return tmp;
+
+	}
+}
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/MdFormatInfo.java
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/MdFormatInfo.java	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/java/eu/dnetlib/functionality/modular/ui/index/models/MdFormatInfo.java	(revision 55815)
@@ -0,0 +1,145 @@
+package eu.dnetlib.functionality.modular.ui.index.models;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class MdFormatInfo.
+ */
+public class MdFormatInfo {
+
+	/** The Constant SplitCharachters. */
+	private static final String SplitCharachters = "::";
+
+	/** The id. */
+	private String id;
+
+	/** The format. */
+	private String format;
+
+	/** The layout. */
+	private String layout;
+
+	/** The interpretation. */
+	private String interpretation;
+
+	/**
+	 * The Constructor.
+	 */
+	public MdFormatInfo() {
+
+	}
+
+	/**
+	 * The Constructor.
+	 *
+	 * @param id
+	 *            the id
+	 * @param format
+	 *            the format
+	 * @param layout
+	 *            the layout
+	 * @param interpretation
+	 *            the interpretation
+	 */
+	public MdFormatInfo(final String id, final String format, final String layout, final String interpretation) {
+		super();
+		this.id = id;
+		this.format = format;
+		this.layout = layout;
+		this.interpretation = interpretation;
+	}
+
+	/**
+	 * Gets the id.
+	 *
+	 * @return the id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id.
+	 *
+	 * @param id
+	 *            the id
+	 */
+	public void setId(final String id) {
+		this.id = id;
+	}
+
+	/**
+	 * Gets the format.
+	 *
+	 * @return the format
+	 */
+	public String getFormat() {
+		return format;
+	}
+
+	/**
+	 * Sets the format.
+	 *
+	 * @param format
+	 *            the format
+	 */
+	public void setFormat(final String format) {
+		this.format = format;
+	}
+
+	/**
+	 * Gets the layout.
+	 *
+	 * @return the layout
+	 */
+	public String getLayout() {
+		return layout;
+	}
+
+	/**
+	 * Sets the layout.
+	 *
+	 * @param layout
+	 *            the layout
+	 */
+	public void setLayout(final String layout) {
+		this.layout = layout;
+	}
+
+	/**
+	 * Gets the interpretation.
+	 *
+	 * @return the interpretation
+	 */
+	public String getInterpretation() {
+		return interpretation;
+	}
+
+	/**
+	 * Sets the interpretation.
+	 *
+	 * @param interpretation
+	 *            the interpretation
+	 */
+	public void setInterpretation(final String interpretation) {
+		this.interpretation = interpretation;
+	}
+
+	/**
+	 * Create a new MdFormatInfo starting from the xquery result the string MUST be in this forma $format-$layout-$interpretation::$id
+	 *
+	 * @param result
+	 *            the result
+	 * @return the md format info
+	 */
+	public static MdFormatInfo initFromXqueryResult(final String result) {
+		String[] values = result.split(SplitCharachters);
+		if ((values == null) || (values.length != 2)) return null;
+
+		String[] mdref = values[0].split("-");
+		if ((mdref == null) || (mdref.length != 3)) return null;
+
+		return new MdFormatInfo(values[1], mdref[0], mdref[1], mdref[2]);
+
+	}
+
+}
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexQuery.html
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexQuery.html	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexQuery.html	(revision 55815)
@@ -0,0 +1,107 @@
+
+
+<div class="row">
+	<div class="col-md-12">
+		<label for="xqueryInput" class="control-label">Cql Query</label>
+	</div>
+</div>
+<div class="row">
+	<div class="col-md-12">
+		<textarea class="form-control" id="xqueryInput" ng-model="query"></textarea>	
+	</div>
+</div>
+<div class="row">
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Metadata
+			Format</label>
+	</div>
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Backend</label>
+	</div>
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Index</label>
+	</div>
+</div>
+<div class="row">
+
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedMdref"
+			ng-change="metadataFormatSelected({{item.layout}})"
+			ng-options="(item.format +'-' + item.layout + '-' + item.interpretation) for item in mdFormats">
+			<option value="" selected="selected">--Select Metadata
+				Format--</option>
+		</select>
+
+
+	</div>
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedbackend"
+			ng-change="backendSelected()" ng-options="item for item in backends">
+			<option value="" selected="selected">--Select Backend--</option>
+		</select>
+	</div>
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedIndex"
+			ng-options="item.id for item in indices">
+			<option value="" selected="selected">--ALL --</option>
+		</select>
+	</div>
+</div>
+
+<div class="row" style="padding-top: 10px">
+	<div class="col-md-4">
+		<button class="btn btn-info" ng-click="startSearch()">Search</button>
+	</div>
+
+	<div class="col-md-6">
+		<button class="btn btn-info" ng-click="share()">Share</button>
+	</div>
+</div>
+
+<div class="container-fluid" style="padding-top: 10px">
+
+<div class="row" ng-show="error">
+		<div class="panel panel-default" >
+			<div class="panel-heading">
+				<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse_error"><b>Error:</b> <i>{{error.message}}</i></a>
+			</div>
+			<div id="collapse_error" class="panel-collapse collapse in">
+				<div class="panel-body">
+					<pre>{{error.stacktrace}}</pre>
+				</div>			
+			</div>
+		</div>
+	</div>
+
+<div class="row" ng-show="searchResult">
+	<div class="col-md-12 ">
+		<h3>Number of results: {{searchResult.total}}</h3>
+	</div>
+	<div class="col-md-12 text-center">
+		<ul class="pagination">
+			<li><a href="" ng-click="prevPage()">&laquo;</a></li>			
+			<li><a href="" ng-click="nextPage()">&raquo;</a></li>
+		</ul>
+	</div>
+</div>
+
+
+
+<div class="row" ng-repeat="item in searchResult.records">
+	<div class="col-md-12">
+		<div class="panel panel-default">
+			<div class="panel-heading">
+				<a class="accordion-toggle" data-toggle="collapse"
+					data-target="#collapse_{{$index}}"><b>{{$index+1 + from}}</b></a>
+			</div>
+			<div id="collapse_{{$index}}" class="panel-collapse collapse in">
+				<div class="panel-body">
+					<div ng-bind-html="to_trusted(item)" compile-template></div>
+				</div>
+
+
+			</div>
+		</div>
+	</div>
+</div>
+</div>
\ No newline at end of file
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/browse.html
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/browse.html	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/browse.html	(revision 55815)
@@ -0,0 +1,117 @@
+<form>
+<div class="container-fluid">
+<div class="row">
+  <div class="col-md-12"><label for="xqueryInput" class="control-label">CQL Query</label></div> 
+</div>
+<div class="row">
+  <div class="col-md-12">
+  	<textarea class="form-control" id="xqueryInput" ng-model="query"></textarea>	
+  </div>
+</div>
+<div class="row">
+	<div class="col-md-4"><label for="xqueryInput" class="control-label">Metadata Format:</label></div>
+	<div class="col-md-4"><label for="xqueryInput" class="control-label">Backend:</label></div>
+	<div class="col-md-4"><label for="xqueryInput" class="control-label">Index::</label></div>
+</div>
+<div class="row">
+
+  <div class="col-md-4">
+  <select class="form-control" ng-model="selectedMdref"  ng-change="metadataFormatSelected({{item.layout}})" ng-options="(item.format +'-' + item.layout + '-' + item.interpretation) for item in mdFormats" >
+		<option value="" selected="selected">--Select Metadata Format--</option>				
+	</select>
+	
+
+	</div>
+	<div class="col-md-4">
+	<select class="form-control" ng-model="selectedbackend" ng-change="backendSelected()" ng-options="item for item in backends">		
+		<option value="" selected="selected">--Select Backend--</option>		
+	</select>
+	</div>
+	<div class="col-md-4">
+	<select class="form-control" ng-model="selectedIndex" ng-options="item.id for item in indices" >
+			<option  value="" selected="selected" >--ALL --</option>			
+		</select>
+	</div>	
+</div>
+
+
+
+<div class="row" style="padding-top: 10px">
+<div class ="col-md-6">
+	<table class="table table-striped table-bordered">
+	<thead>
+      <tr>
+         <th width="80%">Browse Field</th>
+         <th width="20%">delete</th>         
+      </tr>
+   </thead>
+   <tbody>
+   	<tr ng-repeat="item in addedBrowseFields">
+   		<td>{{item}}</td>
+   		<td><a href="" ng-click="deleteBrowseField(item)" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span></a></td>
+   	</tr>   	   
+   </tbody>
+   
+		
+	</table>
+</div>
+</div>
+
+<div class="row" style="padding-top: 10px">
+<div class="col-md-4">
+   		<select class="form-control" ng-model="selectedBrowser" ng-options="item for item in browseFields">
+   			<option value="" selected="selected">--- Add Field --</option>			
+		</select> </td>
+</div>
+<div class="col-md-1">
+		<a href="" ng-click="browseFieldAdded()" class="btn btn-success btn-xs"><span class="glyphicon glyphicon-plus"></span></a>
+</div>
+
+</div>
+
+
+<div class="row" style="padding-top: 10px">
+	<div class="col-md-4">
+		<input type="submit" class="btn btn-info" ng-click="startBrowse()" value="Browse" >
+	</div>
+</div>
+</div>
+</form>
+
+
+<div class="container-fluid" style="padding-top: 10px">
+
+	<div class="row" ng-show="error">
+		<div class="panel panel-default" >
+			<div class="panel-heading">
+				<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse_error"><b>Error:</b> <i>{{error.message}}</i></a>
+			</div>
+			<div id="collapse_error" class="panel-collapse collapse in">
+				<div class="panel-body">
+					<pre>{{error.stacktrace}}</pre>
+				</div>			
+			</div>
+		</div>
+	</div>
+
+	<div class="row" ng-repeat="item in browseResult">
+		<div class ="col-md-6">
+			<div class="panel panel-default"  >
+				<div class="panel-heading">
+					<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse_{{$index}}"><b>{{item.label}} :</b></a>
+				</div>
+				<div id="collapse_{{$index}}" class="panel-collapse collapse in">
+					<table class="table">						
+							<tbody>
+								<tr ng-repeat="value in item.values">						
+									<td>{{value.value}}</td>
+									<td class="text-right">{{value.size}}</td>
+								</tr>
+							</tbody>
+					</table>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/deletebyquery.html
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/deletebyquery.html	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/deletebyquery.html	(revision 55815)
@@ -0,0 +1,64 @@
+<h3>Delete By Query</h3>
+
+
+<div class="row">
+	<div class="col-md-12">
+		<label for="xqueryInput" class="control-label">Cql Query</label>
+	</div>
+</div>
+<div class="row">
+	<div class="col-md-12">
+		<textarea class="form-control" id="xqueryInput" ng-model="query"></textarea>	
+	</div>
+</div>
+<div class="row">
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Metadata
+			Format</label>
+	</div>
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Backend</label>
+	</div>
+	<div class="col-md-3">
+		<label for="xqueryInput" class="control-label">Index</label>
+	</div>
+</div>
+<div class="row">
+
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedMdref"
+			ng-change="metadataFormatSelected({{item.layout}})"
+			ng-options="(item.format +'-' + item.layout + '-' + item.interpretation) for item in mdFormats">
+			<option value="" selected="selected">--Select Metadata
+				Format--</option>
+		</select>
+
+
+	</div>
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedbackend"
+			ng-change="backendSelected()" ng-options="item for item in backends">
+			<option value="" selected="selected">--Select Backend--</option>
+		</select>
+	</div>
+	<div class="col-md-3">
+		<select class="form-control" ng-model="selectedIndex"
+			ng-options="item.id for item in indices">
+			<option value="" selected="selected">--ALL --</option>
+		</select>
+	</div>
+</div>
+
+<div class="row" style="padding-top: 10px">
+	<div class="col-md-4">
+		<button class="btn btn-danger" ng-click="startDelete()">Delete</button>
+	</div>
+</div>
+
+
+<div class="row" ng-show="searchResult">
+	<div class="col-md-12 ">
+		<h3>Number of record deleted : {{searchResult}}</h3>
+	</div>	
+</div>
+
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexManage.html
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexManage.html	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/html/index/indexManage.html	(revision 55815)
@@ -0,0 +1 @@
+<h1>IT WORKSSS!</h1>
\ No newline at end of file
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector_controllers.js
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector_controllers.js	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector_controllers.js	(revision 55815)
@@ -0,0 +1,546 @@
+var indexInspectorControllers = angular.module('indexInspectorControllers', ['LocalStorageModule']);
+
+function common_init($scope, $http, $sce, $location) {
+	initSpinner();
+	$scope.showError = function (error) {
+		show_notification("error", error);
+	}
+	$scope.showNotification = function (message) {
+		show_notification("info", message);
+	}
+	$scope.showSpinner = function () {
+		showSpinner();
+	}
+	$scope.hideSpinner = function () {
+		hideSpinner();
+	}
+	$scope.to_trusted = function (html) {
+		return $sce.trustAsHtml(html);
+	}
+	$scope.go = function (path) {
+		$location.path(path);
+	}
+	$scope.encodeValue = function (val) {
+		return val;
+	}
+}
+
+indexInspectorControllers.directive('compileTemplate', function ($compile, $parse) {
+	return {
+		link: function (scope, element, attr) {
+			var parsed = $parse(attr.ngBindHtml);
+
+			function getStringValue() {
+				return (parsed(scope) || '').toString();
+			}
+
+			//Recompile if the template changes
+			scope.$watch(getStringValue, function () {
+				$compile(element, null, -9999)(scope);  //The -9999 makes it skip directives so that we do not recompile ourselves
+			});
+		}
+	}
+});
+
+
+indexInspectorControllers.controller('indexmanageController', [
+	'$scope', '$http', '$sce', '$location',
+	function ($scope, $http, $sce, $location) {
+		common_init($scope, $http, $sce, $location);
+
+
+	}]);
+
+indexInspectorControllers.controller('indexdbqController', ['$scope',
+	'$http', '$sce', '$location', function ($scope, $http, $sce, $location) {
+		common_init($scope, $http, $sce, $location);
+		$scope.mdFormats = []
+		$scope.backends = []
+		$scope.indices = []
+		$scope.query = '*=*'
+		$scope.from = 0
+		$scope.size = 10
+		$scope.error = null;
+
+		$scope.showSpinner();
+
+		$scope.to_trusted = function (html_code) {
+			return $sce.trustAsHtml(html_code);
+		}
+
+
+		$http.get('index/indexMetadataFormats.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.mdFormats = data;
+		}).error(function () {
+			$scope.showError('Error listing xmldb collections');
+			$scope.hideSpinner();
+		});
+
+		$http.get('index/backend.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.backends = data;
+		}).error(function (error) {
+			$scope.showError(error.message);
+			$scope.hideSpinner();
+		});
+
+		$scope.backendSelected = function (index) {
+
+			if ($scope.selectedbackend != null) {
+				$http.get('index/indexDatastructures.do', {
+					params: {
+						backend: $scope.selectedbackend
+					}
+				}).success(function (data) {
+					$scope.hideSpinner();
+					$scope.indices = data
+
+				}).error(function () {
+					$scope.showError('Error listing xmldb collections');
+					$scope.hideSpinner();
+				});
+			}
+
+
+		}
+
+
+		$scope.hideSpinner();
+
+		$scope.startDelete = function () {
+			$scope.from = 0;
+			$scope.size = 10
+			$scope.deleteByQuery()
+		}
+
+
+		$scope.deleteByQuery = function () {
+
+			if (($scope.selectedMdref == null) || ($scope.selectedbackend == null)) {
+				alert("You must select a metadata format and a backend identifier")
+				return;
+			}
+
+			$scope.showSpinner();
+			$scope.error = null;
+			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
+			var selectedId = null;
+			if ($scope.selectedIndex != null)
+				selectedId = $scope.selectedIndex.id
+			$http.post('index/delete.do', $.param({
+
+				'backend': $scope.selectedbackend,
+				'format': $scope.selectedMdref.format,
+				'layout': $scope.selectedMdref.layout,
+				'interpretation': $scope.selectedMdref.interpretation,
+				'query': $scope.query,
+				'indexidentifier': selectedId
+
+			}))
+				.success(function (data) {
+					$scope.hideSpinner();
+					$scope.searchResult = data
+					console.log(data)
+				}).error(function (error) {
+				$scope.error = error;
+				$scope.hideSpinner();
+			});
+		}
+
+		$scope.nextPage = function () {
+			if ($scope.searchResult == null)
+				return;
+			if ($scope.from > $scope.searchResult.total)
+				return;
+			$scope.from += 10;
+			$scope.size = $scope.from + 10
+			$scope.search()
+		}
+
+		$scope.prevPage = function () {
+			if ($scope.from <= 0) {
+				return;
+			}
+
+			$scope.from -= 10;
+			$scope.size -= 10
+			$scope.search()
+		}
+
+		$scope.range = function (n) {
+			return new Array(n);
+		};
+
+
+	}]);
+
+
+indexInspectorControllers.controller('indexBrowseController', [
+	'$scope', '$http', '$sce', '$location',
+	function ($scope, $http, $sce, $location) {
+		common_init($scope, $http, $sce, $location);
+		$scope.showSpinner();
+		$scope.mdFormats = []
+		$scope.backends = []
+		$scope.indices = []
+		$scope.query = '*=*'
+		$scope.error = null;
+
+		$scope.browseFields = [];
+		$scope.addedBrowseFields = [];
+		$scope.selectedMdref = "";
+
+		$http.get('index/indexMetadataFormats.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.mdFormats = data;
+		}).error(function () {
+			$scope.showError('Error listing xmldb collections');
+			$scope.hideSpinner();
+		});
+
+		$http.get('index/backend.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.backends = data;
+		}).error(function (error) {
+			$scope.showError(error.message);
+			$scope.hideSpinner();
+		});
+
+		$scope.backendSelected = function (index) {
+
+			if ($scope.selectedbackend != null) {
+				$http.get('index/indexDatastructures.do', {
+					params: {
+						backend: $scope.selectedbackend
+					}
+				}).success(function (data) {
+					$scope.hideSpinner();
+					$scope.indices = data
+
+				}).error(function () {
+					$scope.showError('Error listing xmldb collections');
+					$scope.hideSpinner();
+				});
+			}
+
+
+		}
+
+		$scope.metadataFormatSelected = function (index) {
+			if ($scope.selectedMdref == null) {
+				$scope.addedBrowseFields = [];
+				$scope.browseFields = []
+				return;
+			}
+
+			$http.get('index/mdFormatInfo.do', {
+				params: {
+					id: $scope.selectedMdref.id,
+					layout: $scope.selectedMdref.layout
+				}
+			}).success(function (data) {
+				$scope.hideSpinner();
+				$scope.browseFields = data;
+				$scope.browseFields.sort()
+				$scope.addedBrowseFields = [];
+				$scope.selectedBrowser = '--- Add Field --'
+			}).error(function () {
+				$scope.showError('Error listing xmldb collections');
+				$scope.hideSpinner();
+			});
+		};
+
+		$scope.startBrowse = function () {
+
+			if (($scope.selectedMdref == null) || ($scope.selectedbackend == null)) {
+				alert("You must select a metadata format and a backend identifier")
+				return;
+			}
+			if ($scope.addedBrowseFields.length == 0) {
+				alert("You must select at least one browse field")
+				return;
+			}
+			$scope.showSpinner();
+			$scope.error = null;
+			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
+			$http.post('index/browse.do', $.param({
+
+				'backend': $scope.selectedbackend,
+				'format': $scope.selectedMdref.format,
+				'layout': $scope.selectedMdref.layout,
+				'interpretation': $scope.selectedMdref.interpretation,
+				'fields': JSON.stringify($scope.addedBrowseFields),
+				'query': $scope.query
+			}))
+				.success(function (data) {
+					$scope.hideSpinner();
+					$scope.browseResult = data
+				}).error(function (error) {
+				$scope.error = error;
+				$scope.hideSpinner();
+			});
+		}
+
+
+		$scope.deleteBrowseField = function (item) {
+			var i = 0
+
+			for (; i < $scope.addedBrowseFields.length; i++) {
+				if ($scope.addedBrowseFields[i] == item)
+					break;
+			}
+			$scope.addedBrowseFields.splice(i, 1)
+			$scope.browseFields = $scope.browseFields.concat(item)
+			$scope.browseFields.sort();
+
+		}
+
+		$scope.browseFieldAdded = function () {
+			for (i = 0; i < $scope.browseFields.length; i++) {
+				if ($scope.browseFields[i] == $scope.selectedBrowser) {
+					var data = $scope.browseFields[i];
+					$scope.addedBrowseFields = $scope.addedBrowseFields.concat(data)
+					$scope.browseFields.splice(i, 1)
+					return;
+				}
+			}
+		}
+
+
+	}]);
+
+function replaceText(str) {
+	var str1 = String(str);
+
+	return str1.replace(/\n/g, "<br/>");
+}
+
+
+function constructMDREFfromString(input) {
+	if (input == null || input.length == 0)
+		return null;
+	var mdrefArr = input.split('-');
+	if (3 == mdrefArr.length) {
+		var x = [];
+		x['format'] = mdrefArr[0];
+		x['layout'] = mdrefArr[1];
+		x['interpretation'] = mdrefArr[2];
+		return x;
+	}
+}
+
+
+function counstructStringMDREF(item) {
+	if (item != null && item.hasOwnProperty('format') && item.hasOwnProperty('layout') && item.hasOwnProperty('interpretation'))
+		return item.format + '-' + item.layout + '-' + item.interpretation;
+
+	return null;
+}
+
+
+indexInspectorControllers.controller('indexQueryController', [
+	'$scope', '$http', '$sce', '$location', '$routeParams',
+	function ($scope, $http, $sce, $location, $routeParams) {
+		common_init($scope, $http, $sce, $location);
+
+		$scope.mdFormats = []
+		$scope.backends = []
+		$scope.indices = []
+		$scope.query = '*=*'
+		$scope.from = 0
+		$scope.size = 10
+		$scope.error = null;
+		console.log("Valore location");
+
+
+		if ($routeParams['backend'] != null && $routeParams['backend'].length > 0) {
+			$scope.selectedbackend_param = $routeParams['backend'];
+			$scope.selectedIndex_param = $routeParams['index'];
+			$scope.selectedMdref_param = constructMDREFfromString( $routeParams['mdformat']);
+			var selectedMdref_param = $routeParams['mdformat'];
+			$scope.start_param =  $routeParams['start'];
+			$scope.query_param =  $routeParams['query'];
+
+			$scope.query = $scope.query_param
+
+			$scope.showSpinner();
+			$scope.error = null;
+			$scope.size = 10;
+			$scope.from = $scope.start_param;
+
+			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
+			var selectedId = null;
+			if ($scope.selectedIndex != null)
+				selectedId = $scope.selectedIndex.id
+			$http.post('index/search.do', $.param({
+
+				'backend': $scope.selectedbackend_param,
+				'format': $scope.selectedMdref_param.format,
+				'layout': $scope.selectedMdref_param.layout,
+				'interpretation': $scope.selectedMdref_param.interpretation,
+				'query': $scope.query_param,
+				'from': $scope.start_param,
+				'number': $scope.size,
+				'indexidentifier': ""
+			}))
+				.success(function (data) {
+					$scope.hideSpinner();
+					$scope.searchResult = data
+					console.log(data)
+				}).error(function (error) {
+				$scope.error = error;
+				$scope.hideSpinner();
+			});
+		}
+
+		console.log(selectedMdref_param);
+
+		$scope.showSpinner();
+
+		$scope.to_trusted = function (html_code) {
+			return $sce.trustAsHtml(html_code);
+		}
+
+
+		$http.get('index/indexMetadataFormats.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.mdFormats = data;
+
+			if (selectedMdref_param != null) {
+				$scope.mdFormats.forEach(function (item) {
+					var mdref = counstructStringMDREF(item);
+
+					if (mdref === selectedMdref_param) {
+						$scope.selectedMdref = item;
+					}
+				})
+			}
+
+
+		}).error(function () {
+			$scope.showError('Error listing xmldb collections');
+			$scope.hideSpinner();
+		});
+
+		$http.get('index/backend.do').success(function (data) {
+			$scope.hideSpinner();
+			$scope.backends = data;
+			if ($scope.selectedbackend_param != null) {
+				$scope.backends.forEach(function (item) {
+					if (item === $scope.selectedbackend_param) {
+						$scope.selectedbackend = item;
+					}
+				})
+			}
+
+
+
+		}).error(function (error) {
+			$scope.showError(error.message);
+			$scope.hideSpinner();
+		});
+
+		$scope.backendSelected = function (index) {
+
+			if ($scope.selectedbackend != null) {
+				$http.get('index/indexDatastructures.do', {
+					params: {
+						backend: $scope.selectedbackend
+					}
+				}).success(function (data) {
+					$scope.hideSpinner();
+					$scope.indices = data
+
+				}).error(function () {
+					$scope.showError('Error listing xmldb collections');
+					$scope.hideSpinner();
+				});
+			}
+
+
+		}
+
+
+		$scope.hideSpinner();
+
+		$scope.startSearch = function () {
+			$scope.from = 0;
+			$scope.size = 10
+			$scope.search()
+		}
+
+
+		$scope.share = function () {
+			var currentUrl = $location.$$absUrl;
+			console.log(currentUrl);
+			var path = $location.$$path;
+			currentUrl = currentUrl.replace(path, "");
+			if ($scope.selectedIndex != null)
+				selectedId = $scope.selectedIndex.id
+			else
+				selectedId = "ALL"
+			var shareUrl = currentUrl + "/query/" + counstructStringMDREF($scope.selectedMdref) + "/" + $scope.selectedbackend + "/" + selectedId + "/" + $scope.from + "/" + $scope.query;
+			window.prompt("Copy to clipboard: Ctrl+C, Enter", shareUrl);
+		}
+
+
+		$scope.search = function () {
+			if (($scope.selectedMdref == null) || ($scope.selectedbackend == null)) {
+				alert("You must select a metadata format and a backend identifier")
+				return;
+			}
+
+			$scope.showSpinner();
+			$scope.error = null;
+			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
+			var selectedId = null;
+			if ($scope.selectedIndex != null)
+				selectedId = $scope.selectedIndex.id
+			$http.post('index/search.do', $.param({
+
+				'backend': $scope.selectedbackend,
+				'format': $scope.selectedMdref.format,
+				'layout': $scope.selectedMdref.layout,
+				'interpretation': $scope.selectedMdref.interpretation,
+				'query': $scope.query,
+				'from': $scope.from,
+				'number': $scope.size,
+				'indexidentifier': selectedId
+			}))
+				.success(function (data) {
+					$scope.hideSpinner();
+					$scope.searchResult = data
+				}).error(function (error) {
+				$scope.error = error;
+				$scope.hideSpinner();
+			});
+		}
+
+		$scope.nextPage = function () {
+			if ($scope.searchResult == null)
+				return;
+			if ($scope.from > $scope.searchResult.total)
+				return;
+			$scope.from += 10;
+			$scope.size = $scope.from + 10
+			$scope.search()
+		}
+
+		$scope.prevPage = function () {
+			if ($scope.from <= 0) {
+				return;
+			}
+
+			$scope.from -= 10;
+			$scope.size -= 10
+			$scope.search()
+		}
+
+		$scope.range = function (n) {
+			return new Array(n);
+		};
+
+
+	}]);
+
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector.js
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector.js	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/web/resources/js/index_inspector.js	(revision 55815)
@@ -0,0 +1,28 @@
+var module = angular.module('indexInspector', ['ngRoute', 'indexInspectorControllers']);
+
+module.config([
+	'$routeProvider',
+	function($routeProvider) {
+		$routeProvider
+			.when('/query',		                                    { templateUrl: '../resources/html/index/indexQuery.html', controller: 'indexQueryController' })
+			.when('/query/:mdformat/:backend/:index/:start/:query', { templateUrl: '../resources/html/index/indexQuery.html', controller: 'indexQueryController' })
+			.when('/browse',	{ templateUrl: '../resources/html/index/browse.html', controller: 'indexBrowseController' })
+			.when('/manage',	{ templateUrl: '../resources/html/index/indexManage.html', controller: 'indexmanageController' })
+			.when('/deletebyquery',	{ templateUrl: '../resources/html/index/deletebyquery.html', controller: 'indexdbqController' })			
+			.otherwise({ redirectTo: '/query' });
+	}
+]);
+
+
+module.controller('moduleMenuCtrl', [ '$scope', '$location',  
+	function ($scope, $location) {
+		$scope.isActive = function(regex) {
+			var re = new RegExp(regex);			
+			return re.test($location.path());
+		}
+	}
+]);
+
+module.filter('encodeURIComponent', function() {
+    return window.encodeURIComponent;
+});
\ No newline at end of file
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/xslt/gmf2document.xslt
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/xslt/gmf2document.xslt	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/xslt/gmf2document.xslt	(revision 55815)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="2.0" 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
+
+	<xsl:output method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
+
+	<xsl:template match="/">
+		<xsl:for-each select="//*[local-name()='record']">
+			<div
+				style="color:black; font-family:'Courier New', Courier, monospace; font-size:small">
+				<xsl:call-template name="xmlItem">
+					<xsl:with-param name="indent" select="string('')" />
+				</xsl:call-template>
+			</div>
+		</xsl:for-each>
+	</xsl:template>
+	
+	<xsl:template name="xmlAttr">
+		<span style='color:red'><xsl:value-of select="concat(' ', local-name())"/></span>
+		<xsl:value-of select="concat('=&quot;', ., '&quot;')"/>
+	</xsl:template>
+	
+	<xsl:template name="xmlItem">
+		<xsl:param name="indent" />
+		<xsl:variable name="tag" select="local-name()" />
+		<xsl:variable name="newindent"><xsl:value-of select="$indent" />&#160;&#160;&#160;&#160;</xsl:variable>
+
+		<xsl:if test="string-length($tag)">
+			<br/><xsl:value-of select="$indent" /><span style='color:blue'><xsl:value-of select="concat('&lt;',$tag)" /></span> 
+			<xsl:for-each select="@*">
+				<xsl:call-template name="xmlAttr"/>
+			</xsl:for-each>
+
+			<xsl:choose>
+				<xsl:when test="count(child::*) = 0 and count(child::text()) = 1">
+					<span style='color:blue'>&gt;</span>
+					<xsl:value-of select="normalize-space(.)" />
+					<span style='color:blue'><xsl:value-of select="concat('&lt;/',$tag,'&gt;')" /></span>
+				</xsl:when>
+				<xsl:when test="count(child::* | child::text()) &gt; 0">
+					<span style='color:blue'>&gt;</span>
+					<xsl:for-each select="child::* | child::text()">
+						<xsl:choose>
+							<xsl:when test="self::text() and string-length(normalize-space(.)) &gt; 0">
+								<xsl:value-of select="normalize-space(.)" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="xmlItem">
+									<xsl:with-param name="indent" select="$newindent" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each>
+					<br /><xsl:value-of select="$indent" /><span style='color:blue'><xsl:value-of select="concat('&lt;/',$tag,'&gt;')" /></span>
+				</xsl:when>
+				<xsl:otherwise>
+				 	<span style='color:blue'>&#160;/&gt;</span>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/webContext-modular-ui-index.xml
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/webContext-modular-ui-index.xml	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/webContext-modular-ui-index.xml	(revision 55815)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:wsa="http://cxf.apache.org/ws/addressing"
+	xmlns:p="http://www.springframework.org/schema/p" xmlns:http="http://cxf.apache.org/transports/http/configuration"
+	xmlns:t="http://dnetlib.eu/springbeans/t" xmlns:template="http://dnetlib.eu/springbeans/template"
+	xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+						http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd
+						http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
+						http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+						http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd
+						http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
+						http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+
+	<bean name="/ui/indexInspector.do"
+		class="eu.dnetlib.functionality.modular.ui.index.IndexServiceEntryPointController"
+		p:menu="Index Service Inspector" 
+		p:title="Index Service Inspector"
+		p:description="Index Service Inspector"
+		p:order="3" 
+		p:group="Tools">
+		<property name="permissionLevels">
+			<set>
+				<value>IS_ADMIN</value>
+			</set>
+		</property>
+	</bean>
+	
+	<bean id="indexClientMap" class="eu.dnetlib.functionality.modular.ui.index.IndexClientMap"
+		destroy-method="shutdown"/>
+
+</beans>
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/indexInspector.st
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/indexInspector.st	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/indexInspector.st	(revision 55815)
@@ -0,0 +1,29 @@
+$common/master( header={
+	<script type="text/javascript" src="../resources/js/angular.min.js" ></script>
+	<script type="text/javascript" src="../resources/js/angular-route.min.js"></script>
+	<script type="text/javascript" src="../resources/js/angular-local-storage.min.js"></script>
+	
+	<script type="text/javascript" src="../resources/js/index_inspector_controllers.js"></script>
+	<script type="text/javascript" src="../resources/js/index_inspector.js"></script>
+}, body={
+	<div ng-app="indexInspector" class="row">
+		<div class="col-sm-3 col-lg-2" ng-controller="moduleMenuCtrl">
+			<ul class="nav nav-pills nav-stacked">
+				<li ng-class="{active : isActive('^\/q')}"><a href="#/query">Query</a></li>
+				<li ng-class="{active : isActive('^\/(schemas|schema)')}"><a href="#/deletebyquery">Delete By Query</a></li>
+				<li ng-class="{active : isActive('^\/browse')}"><a href="#/browse">Browse</a></li>
+				<li ng-class="{active : isActive('^\/register')}"><a href="#/manage">Manage Index DS</a></li>				
+			</ul>
+		</div>
+		<div ng-view class="col-sm-9 col-lg-10"></div>
+		<script type="text/javascript" src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
+		<script>
+function reload(){
+	alert("prima");
+	prettyPrint();
+	alert("dopo");
+}
+
+</script>
+	</div>
+} )$
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/deploy.info
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/deploy.info	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8/deploy.info	(revision 55815)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-index-ui/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "dnet-modular-index-ui"}
\ No newline at end of file
Index: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8
===================================================================
--- modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8	(nonexistent)
+++ modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8	(revision 55815)

Property changes on: modules/dnet-modular-index-ui/tags/dnet-modular-index-ui-2.0.8
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,6 ##
+.project
+.classpath
+target
+testbin
+.settings
+*.iml
