Index: modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoApisEntryPointController.java
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoApisEntryPointController.java	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoApisEntryPointController.java	(revision 50485)
@@ -13,6 +13,7 @@
 import org.dom4j.Document;
 import org.dom4j.Node;
 import org.dom4j.io.SAXReader;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Required;
 import org.springframework.ui.ModelMap;
 
@@ -21,7 +22,9 @@
 import com.google.common.collect.Sets;
 import com.google.gson.Gson;
 
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService;
+import eu.dnetlib.enabling.datasources.common.Api;
+import eu.dnetlib.enabling.datasources.common.Datasource;
+import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
 import eu.dnetlib.enabling.locators.UniqueServiceLocator;
@@ -41,12 +44,15 @@
 	private String validatorAddress;
 	private String validatorServiceAddress;
 
+	@Autowired
+	private LocalDatasourceManager<Datasource<?, ?>, Api<?>> dsManager;
+
 	public class RepoHIWorkflow implements Comparable<RepoHIWorkflow> {
 
-		private String id;
-		private String name;
-		private Set<String> ifaceTypes;
-		private Set<String> compliances;
+		private final String id;
+		private final String name;
+		private final Set<String> ifaceTypes;
+		private final Set<String> compliances;
 		private List<Pair<String, String>> fields;
 
 		/**
@@ -123,12 +129,12 @@
 			final Set<String> ifcTypes = Sets.newHashSet(Splitter.on(",").omitEmptyStrings().trimResults().split(type));
 			final Set<String> compliances = Sets.newHashSet(Splitter.on(",").omitEmptyStrings().trimResults().split(compliance));
 
-			final List<Pair<String, String>> fields = new ArrayList<Pair<String, String>>();
+			final List<Pair<String, String>> fields = new ArrayList<>();
 			for (final Object o : doc.selectNodes(".//FIELD")) {
 				final Node currentNode = (Node) o;
 				final String key = currentNode.valueOf("@name");
 				final String value = currentNode.getText();
-				fields.add(new Pair<String, String>(key, value));
+				fields.add(new Pair<>(key, value));
 			}
 			return new RepoHIWorkflow(id, name, ifcTypes, compliances, fields);
 		} catch (final Exception e) {
@@ -156,7 +162,7 @@
 		final Gson gson = new Gson();
 		map.addAttribute("availableRepohiWfs", gson.toJson(listRepoHIWorkflows()));
 		map.addAttribute("compatibilityLevels", gson.toJson(repoUIUtils.fetchVocabularyTerms(getCompatibilityLevelsVocabulary())));
-		map.addAttribute("browseFields", gson.toJson(serviceLocator.getService(DatasourceManagerService.class).listBrowsableFields()));
+		map.addAttribute("browseFields", gson.toJson(dsManager.listBrowsableFields()));
 		map.addAttribute("validatorAddress", getValidatorAddress());
 		map.addAttribute("validatorServiceAddress", getValidatorServiceAddress());
 	}
Index: modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoUIUtils.java
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoUIUtils.java	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoUIUtils.java	(revision 50485)
@@ -26,7 +26,6 @@
 import eu.dnetlib.data.collector.rmi.CollectorService;
 import eu.dnetlib.data.collector.rmi.ProtocolDescriptor;
 import eu.dnetlib.data.collector.rmi.ProtocolParameter;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
 import eu.dnetlib.enabling.locators.UniqueServiceLocator;
@@ -41,11 +40,12 @@
 	@Resource
 	private UniqueServiceLocator serviceLocator;
 
-	private ClassPathResource getRepoApiQueryTmpl = new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st");
+	private final ClassPathResource getRepoApiQueryTmpl =
+			new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st");
 
 	private static final Log log = LogFactory.getLog(RepoUIUtils.class);
 
-	private Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap();
+	private final Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap();
 
 	public RepoInterfaceEntry getApi(final String repoId, final String ifaceId) throws Exception {
 		final RepoInterfaceEntry ifc = new RepoInterfaceEntry();
@@ -64,7 +64,7 @@
 
 		ifc.setId(doc.valueOf("/api/id"));
 		ifc.setLabel(doc.valueOf("/api/label"));
-		ifc.setRemovable((doc.valueOf("/api/removable").equalsIgnoreCase("true")) && doc.selectNodes("//metaWF").isEmpty());
+		ifc.setRemovable(doc.valueOf("/api/removable").equalsIgnoreCase("true") && doc.selectNodes("//metaWF").isEmpty());
 		ifc.setRepoId(doc.valueOf("/api/repo/@id"));
 		ifc.setRepoName(StringEscapeUtils.unescapeHtml(doc.valueOf("/api/repo")));
 		ifc.setRepoCountry(doc.valueOf("/api/repo/@country"));
@@ -100,12 +100,11 @@
 			final Node n = (Node) o;
 			final String name = n.valueOf("@name");
 			final String value = n.getText();
-			if (name.equalsIgnoreCase(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
+			if (name.equalsIgnoreCase("overriding_compliance")) {
 				for (final SimpleParamEntry e : ifc.getCommonParams()) {
 					if (e.getName().equals("compliance")) {
 						// The original compliance (assigned by the validator) is stored in otherValue
-						e.setOtherValue(e.getValue());
-						e.setValue(value);
+						e.setOtherValue(value);
 					}
 				}
 			} else if (name.equalsIgnoreCase("last_aggregation_date")) {
Index: modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoInternalController.java
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoInternalController.java	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoInternalController.java	(revision 50485)
@@ -9,12 +9,12 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import com.google.common.cache.Cache;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.http.HttpStatus;
@@ -28,18 +28,22 @@
 
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 
 import eu.dnetlib.data.collector.rmi.CollectorService;
 import eu.dnetlib.data.collector.rmi.CollectorServiceException;
 import eu.dnetlib.data.collector.rmi.ProtocolParameterValue;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-import eu.dnetlib.enabling.datasources.rmi.RepositoryMapEntry;
-import eu.dnetlib.enabling.datasources.rmi.SearchInterfacesEntry;
-import eu.dnetlib.enabling.datasources.rmi.SimpleDatasourceDesc;
+import eu.dnetlib.enabling.datasources.common.Api;
+import eu.dnetlib.enabling.datasources.common.ApiParam;
+import eu.dnetlib.enabling.datasources.common.ApiParamImpl;
+import eu.dnetlib.enabling.datasources.common.BrowseTerm;
+import eu.dnetlib.enabling.datasources.common.Datasource;
+import eu.dnetlib.enabling.datasources.common.DsmException;
+import eu.dnetlib.enabling.datasources.common.Identity;
+import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager;
+import eu.dnetlib.enabling.datasources.common.Organization;
+import eu.dnetlib.enabling.datasources.common.SearchApisEntry;
+import eu.dnetlib.enabling.datasources.common.SimpleDatasource;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
 import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
 import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
@@ -54,6 +58,9 @@
 @Controller
 public class RepoInternalController {
 
+	@Autowired
+	private LocalDatasourceManager<Datasource<?, ?>, Api<?>> dsManager;
+
 	@Resource
 	private UniqueServiceLocator serviceLocator;
 
@@ -69,28 +76,23 @@
 	private static final Log log = LogFactory.getLog(RepoInternalController.class);
 
 	@RequestMapping(value = "/ui/browseRepoField.do")
-	public @ResponseBody List<BrowseTerm> browseRepoField(@RequestParam(value = "field", required = true) final String field) throws Exception {
-		return serviceLocator.getService(DatasourceManagerService.class).browseField(field);
+	public @ResponseBody List<? extends BrowseTerm> browseRepoField(@RequestParam(value = "field", required = true) final String field) throws Exception {
+		return dsManager.browseField(field);
 	}
 
 	@Cacheable(cacheNames = "repoUIJsonCache", key = "#param, #value", condition = "#refresh == false")
 	@RequestMapping(value = "/ui/listApis.do")
-	public @ResponseBody List<SearchInterfacesEntry> listApis(
+	public @ResponseBody List<? extends SearchApisEntry> listApis(
 			@RequestParam(value = "param", required = true) final String param,
 			@RequestParam(value = "value", required = true) final String value,
 			@RequestParam(value = "refresh", required = false) final String refresh) throws Exception {
 
-		return serviceLocator.getService(DatasourceManagerService.class).searchInterface(param, value);
+		return dsManager.searchApis(param, value);
 	}
 
-	@RequestMapping(value = "/ui/listRepositories.map")
-	public @ResponseBody List<RepositoryMapEntry> listRepositories_asMap() throws Exception {
-		return serviceLocator.getService(DatasourceManagerService.class).getRepositoryMap();
-	}
-
 	@RequestMapping(value = "/ui/listRepositories.json")
-	public @ResponseBody List<SimpleDatasourceDesc> listRepositories(@RequestParam(value = "type", required = true) final String type) throws Exception {
-		return serviceLocator.getService(DatasourceManagerService.class).simpleListDatasourcesByType(type);
+	public @ResponseBody List<SimpleDatasource> listRepositories(@RequestParam(value = "type", required = true) final String type) throws Exception {
+		return dsManager.searchDatasourcesByType(type);
 	}
 
 	@CacheEvict("repoUIJsonCache")
@@ -99,7 +101,7 @@
 			@RequestParam(value = "b", required = true) final boolean b) throws Exception {
 
 		final String query = "count(/*[.//RESOURCE_TYPE/@value='MetaWorkflowDSResourceType' and .//DATAPROVIDER/@id='" + id + "'])";
-		if (!b && (Integer.parseInt(serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(query)) > 0)) { throw new Exception("Repo " + id
+		if (!b && Integer.parseInt(serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(query)) > 0) { throw new Exception("Repo " + id
 				+ " can be invalidated: it is related to some metawfs"); }
 
 		final String newId = b ? serviceLocator.getService(ISRegistryService.class).validateProfile(id)
@@ -150,7 +152,6 @@
 		return repoUIUtils.getApi(repoId, ifaceId);
 	}
 
-	@SuppressWarnings("unchecked")
 	@RequestMapping("/ui/repoApi.update")
 	public @ResponseBody boolean updateRepoApi(
 			@RequestParam(value = "id", required = true) final String repoId,
@@ -158,14 +159,11 @@
 			@RequestParam(value = "accessParams", required = false) final String accessParamsJson,
 			@RequestParam(value = "mdIdPath", required = false) final String mdIdPath) throws Exception {
 
-		final DatasourceManagerService dsManager = serviceLocator.getService(DatasourceManagerService.class);
-
 		if (!StringUtils.isEmpty(accessParamsJson)) {
-			dsManager.bulkUpdateApiAccessParams(repoId, ifaceId, new Gson().fromJson(accessParamsJson, Map.class));
+			final Map<String, String> params = new Gson().fromJson(accessParamsJson, new TypeToken<Map<String, String>>() {}.getType());
+			final String baseUrl = params.remove("baseUrl");
+			dsManager.updateApiDetails(repoId, ifaceId, mdIdPath, baseUrl, params);
 		}
-		if (mdIdPath != null) {
-			dsManager.updateExtraField(repoId, ifaceId, "metadata_identifier_path", mdIdPath, true);
-		}
 
 		return true;
 	}
@@ -174,7 +172,8 @@
 	public @ResponseBody boolean updateRepoApi(
 			@RequestParam(value = "repo", required = true) final String repoId,
 			@RequestParam(value = "iface", required = true) final String ifaceId) throws Exception {
-		return serviceLocator.getService(DatasourceManagerService.class).deleteInterface(repoId, ifaceId);
+		dsManager.deleteApi(repoId, ifaceId);
+		return true;
 	}
 
 	@CacheEvict("repoUIJsonCache")
@@ -185,7 +184,7 @@
 
 		log.debug("SET COMPLIANCE TO " + compliance);
 
-		serviceLocator.getService(DatasourceManagerService.class).overrideCompliance(repoId, ifaceId, compliance);
+		dsManager.updateCompliance(repoId, ifaceId, compliance, true);
 
 		return true;
 	}
@@ -197,7 +196,7 @@
 
 		log.debug("RESET COMPLIANCE");
 
-		serviceLocator.getService(DatasourceManagerService.class).overrideCompliance(repoId, ifaceId, null);
+		dsManager.updateCompliance(repoId, ifaceId, null, true);
 
 		return true;
 	}
@@ -207,29 +206,33 @@
 
 	@RequestMapping("/ui/repoApi.new")
 	public @ResponseBody boolean addRepoApi(@RequestParam(value = "repoId", required = true) final String repoId,
-			@RequestParam(value = "iface", required = true) final String ifaceJson) throws DatasourceManagerServiceException {
-		final IfaceDesc iface = new Gson().fromJson(ifaceJson, IfaceDesc.class);
+			@RequestParam(value = "iface", required = true) final String ifaceJson) throws DsmException {
+		final Api<ApiParam> iface = new Gson().fromJson(ifaceJson, new TypeToken<Api<ApiParamImpl>>() {}.getType());
 
-		log.info("Adding interface " + iface.getId() + " to repository " + repoId);
+		iface.setDatasource(repoId);
 
-		final DatasourceManagerService dsManager = serviceLocator.getService(DatasourceManagerService.class);
-		return dsManager.addInterface(repoId, iface);
+		log.info("Adding api " + iface.getId() + " to repository " + repoId);
+
+		dsManager.addApi(iface);
+
+		return true;
 	}
 
 	@RequestMapping("/ui/repo.new")
-	public @ResponseBody boolean addRepoApi(@RequestParam(value = "repo", required = true) final String repoJson) throws DatasourceManagerServiceException {
-		final DatasourceDesc ds = new Gson().fromJson(repoJson, DatasourceDesc.class);
-		ds.setDateOfCollection(new Date());
+	public @ResponseBody boolean addRepoApi(@RequestParam(value = "repo", required = true) final String repoJson) throws DsmException {
+		final Datasource<Organization<?>, Identity> ds = new Gson().fromJson(repoJson, new TypeToken<Datasource<Organization<?>, Identity>>() {}.getType());
+		final Date now = new Date();
+		ds.setDateofcollection(new java.sql.Date(now.getTime()));
 
-		if (StringUtils.isBlank(ds.getEnglishName())) {
-			ds.setEnglishName(ds.getOfficialName());
+		if (StringUtils.isBlank(ds.getEnglishname())) {
+			ds.setEnglishname(ds.getOfficialname());
 		}
 
-		log.info("Adding datasource " + ds.getId() + " - name " + ds.getOfficialName());
+		log.info("Adding datasource " + ds.getId() + " - name " + ds.getOfficialname());
 
-		final DatasourceManagerService dsManager = serviceLocator.getService(DatasourceManagerService.class);
+		dsManager.saveDs(ds);
 
-		return dsManager.addDatasource(ds);
+		return true;
 	}
 
 	@RequestMapping("/ui/listValidValuesForParam.do")
Index: modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/objects/RepoInterfaceEntry.java
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/objects/RepoInterfaceEntry.java	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/objects/RepoInterfaceEntry.java	(revision 50485)
@@ -1,13 +1,12 @@
 package eu.dnetlib.functionality.modular.ui.repositories.objects;
 
+import java.util.ArrayList;
 import java.util.List;
 
-import com.google.common.collect.Lists;
+import eu.dnetlib.enabling.datasources.common.SearchApisEntry;
 
-import eu.dnetlib.enabling.datasources.rmi.SearchInterfacesEntry;
+public class RepoInterfaceEntry extends SearchApisEntry {
 
-public class RepoInterfaceEntry extends SearchInterfacesEntry {
-
 	private String label;
 	private boolean removable = false;
 	private String collDate = "";
@@ -19,10 +18,10 @@
 	private String downloadObjId = "";
 	private String repoType;
 	private String email;
-	private List<SimpleParamEntry> commonParams = Lists.newArrayList();
-	private List<SimpleParamEntry> accessParams = Lists.newArrayList();
-	private List<SimpleParamEntry> otherParams = Lists.newArrayList();
-	private List<RepoMetaWfEntry> metaWFs = Lists.newArrayList();
+	private List<SimpleParamEntry> commonParams = new ArrayList<>();
+	private List<SimpleParamEntry> accessParams = new ArrayList<>();
+	private List<SimpleParamEntry> otherParams = new ArrayList<>();
+	private List<RepoMetaWfEntry> metaWFs = new ArrayList<>();
 
 	public String getLabel() {
 		return label;
@@ -140,7 +139,7 @@
 		return removable;
 	}
 
-	public void setRemovable(boolean removable) {
+	public void setRemovable(final boolean removable) {
 		this.removable = removable;
 	}
 
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepo.st
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepo.st	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepo.st	(revision 50485)
@@ -27,21 +27,21 @@
 			<fieldset>
 				<legend>General Info</legend>
 				<ng-simple-edit-field label="Datasource ID (template: 12Chars_____::theId)" selection="repo.id" regex="^\w{12}::\w+\$"></ng-simple-edit-field>
-				<ng-simple-edit-field label="Official Name" selection="repo.officialName"></ng-simple-edit-field>
-				<ng-simple-edit-field label="English Name" selection="repo.englishName" optional="true"></ng-simple-edit-field>
-				<ng-simple-edit-field label="Organization" selection="repo.organization"></ng-simple-edit-field>
-				<ng-select-vocabulary-field label="Typology Class" vocabulary="validTypes" selection="repo.datasourceClass"></ng-select-vocabulary-field>
+				<ng-simple-edit-field label="Official Name" selection="repo.officialname"></ng-simple-edit-field>
+				<ng-simple-edit-field label="English Name" selection="repo.englishname" optional="true"></ng-simple-edit-field>
+				<ng-simple-edit-field label="Organization" selection="org.legalname"></ng-simple-edit-field>
+				<ng-select-vocabulary-field label="Typology Class" vocabulary="validTypes" selection="repo.typology"></ng-select-vocabulary-field>
 			</fieldset>
 			
 			<fieldset>
 				<legend>Contacts</legend>
-				<ng-simple-edit-field label="WebSite Url" selection="repo.websiteUrl" regex="^(http|https):\/\/"></ng-simple-edit-field>
-				<ng-simple-edit-field label="Contact Email" selection="repo.contactEmail" regex="^.+@.+"></ng-simple-edit-field>
+				<ng-simple-edit-field label="WebSite Url" selection="repo.websiteurl" regex="^(http|https):\/\/"></ng-simple-edit-field>
+				<ng-simple-edit-field label="Contact Email" selection="repo.contactemail" regex="^.+@.+"></ng-simple-edit-field>
 			</fieldset>
 				
 			<fieldset>
 				<legend>Geographical Info</legend>
-				<ng-select-vocabulary-field label="Country" vocabulary="validCountries" selection="repo.countryCode"></ng-select-vocabulary-field>
+				<ng-select-vocabulary-field label="Country" vocabulary="validCountries" selection="org.country"></ng-select-vocabulary-field>
 				<ng-simple-edit-field label="Latitude" selection="repo.latitude" type="NUMBER"></ng-simple-edit-field>
 				<ng-simple-edit-field label="Longitude" selection="repo.longitude" type="NUMBER"></ng-simple-edit-field>
 			</fieldset>
@@ -48,9 +48,9 @@
 			
 			<fieldset>
 				<legend>Technical Info</legend>
-				<ng-simple-edit-field label="Namespace Prefix (12 chars)" selection="repo.namespacePrefix" regex="^\w{12}\$"></ng-simple-edit-field>
-				<ng-simple-edit-field label="Software Typology" selection="repo.typology" optional="true"></ng-simple-edit-field>
-				<ng-simple-edit-field label="Logo Url" selection="repo.logoUrl" regex="^(http|https):\/\/" optional="true"></ng-simple-edit-field>
+				<ng-simple-edit-field label="Namespace Prefix (12 chars)" selection="repo.namespaceprefix" regex="^\w{12}\$"></ng-simple-edit-field>
+				<ng-simple-edit-field label="Software Typology" selection="repo.platform" optional="true"></ng-simple-edit-field>
+				<ng-simple-edit-field label="Logo Url" selection="repo.logourl" regex="^(http|https):\/\/" optional="true"></ng-simple-edit-field>
 			</fieldset>
 			
 			<br /><br />
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoApi.st
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoApi.st	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoApi.st	(revision 50485)
@@ -75,7 +75,7 @@
 			        	<a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-click="overrideApiCompliance(l.name)">override to <b>{{l.name}}</b> (<i>{{l.desc}}</i>)</a>
 			        </li>
 					<li class="divider" role="presentation" ng-show="p.otherValue"></li>
-			        <li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-show="p.otherValue" ng-click="resetApiCompliance()">reset to the validator value: <b>{{p.otherValue}}</b></a></li>
+			        <li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-show="p.otherValue" ng-click="resetApiCompliance()">reset to the original value</b></a></li>
 			    </ul>
 			</div>
 		</div>
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepoApi.st
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepoApi.st	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepoApi.st	(revision 50485)
@@ -47,17 +47,17 @@
 			<ng-fixed-value-field label="Typology" value="api.typology"></ng-fixed-value-field>
 			<ng-api-id-field label="Api ID" prefix="api_________::{{repo.origId}}::" exclusion="repo.apis" selection="api.id"></ng-api-id-field>
 			<!-- <ng-select-vocabulary-field label="Typology" vocabulary="values.types" selection="api.typology"></ng-select-vocabulary-field> -->
-			<ng-select-vocabulary-field label="Compatibility level" vocabulary="values.compliances" selection="api.compliance"></ng-select-vocabulary-field>
-			<ng-select-vocabulary-field label="Content description" vocabulary="values.contentDescriptions" selection="api.contentDescription"></ng-select-vocabulary-field>
-			<ng-select-vocabulary-field label="Protocol" vocabulary="values.protocols" selection="api.accessProtocol" contextual-params="currentParams"></ng-select-vocabulary-field>
-			<ng-simple-edit-field label="BaseURL" selection="api.baseUrl" regex="^(http|https|ftp|file|sftp|jar):\/\/"></ng-simple-edit-field>
+			<ng-select-vocabulary-field label="Compatibility level" vocabulary="values.compliances" selection="api.compatibility"></ng-select-vocabulary-field>
+			<ng-select-vocabulary-field label="Content description" vocabulary="values.contentDescriptions" selection="api.contentdescription"></ng-select-vocabulary-field>
+			<ng-select-vocabulary-field label="Protocol" vocabulary="values.protocols" selection="api.protocol" contextual-params="currentParams"></ng-select-vocabulary-field>
+			<ng-simple-edit-field label="BaseURL" selection="api.baseurl" regex="^(http|https|ftp|file|sftp|jar):\/\/"></ng-simple-edit-field>
 			
 			
 			
 			<ng-simple-edit-field 
 				ng-repeat="param in currentParams | filter: { functionPopulated : false }" 
-				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
-				selection="api.accessParams[param.name]" 
+				label="{{param.name}} [{{api.protocol}} protocol]" 
+				selection="apiParams[param.name]" 
 				optional="{{param.optional}}" 
 				regex="{{param.regex}}" 
 				type="{{param.type}}"></ng-simple-edit-field>
@@ -64,21 +64,21 @@
 				
 			<ng-simple-select-field 
 				ng-repeat="param in currentParams | filter: { functionPopulated : true, type : 'TEXT' }" 
-				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
-				selection="api.accessParams[param.name]"
-				valid-values="validValues[api.baseUrl + '@@@' + param.name]"
+				label="{{param.name}} [{{api.protocol}} protocol]" 
+				selection="apiParams[param.name]"
+				valid-values="validValues[api.baseurl + '@@@' + param.name]"
 				refresh-function="listValidValuesForParam(param.name)"
 				optional="{{param.optional}}"></ng-simple-select-field>
 			
 			<ng-multi-select-field 
 				ng-repeat="param in currentParams | filter: { functionPopulated : true, type : 'LIST' }" 
-				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
-				selection="api.accessParams[param.name]"
-				valid-values="validValues[api.baseUrl + '@@@' + param.name]"
+				label="{{param.name}} [{{api.protocol}} protocol]" 
+				selection="apiParams[param.name]"
+				valid-values="validValues[api.baseurl + '@@@' + param.name]"
 				refresh-function="listValidValuesForParam(param.name)"
 				optional="{{param.optional}}"></ng-multi-select-field>
 			
-			<ng-simple-edit-field label="Xpath for Metadata Identifier" selection="api.extraFields['metadata_identifier_path']"></ng-simple-edit-field>
+			<ng-simple-edit-field label="Xpath for Metadata Identifier" selection="api.metadataIdentifierPath"></ng-simple-edit-field>
 				
 			<div class="form-group">
 				<div class="col-sm-offset-3 col-sm-9">
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepoApi.js
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepoApi.js	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepoApi.js	(revision 50485)
@@ -250,10 +250,10 @@
 		
 	$scope.$watch('repo', function() {
 		if ($scope.repo) {
+			$scope.apiParams = {};
 			$scope.api = {
-				'typology'     : $scope.repo.typology,
-				'accessParams' : {},
-				'extraFields'  : {}
+				'typology'  : $scope.repo.typology,
+				'apiParams' : []
 			};
 		}
 	});
@@ -263,11 +263,21 @@
 		$scope.selectedTypology = '';
 		$scope.repo = {};
 		$scope.api = {};
+		$scope.apiParams = {};
 		$scope.validValues = [];
 	}
 	
 	$scope.registerApi = function() {
 		if (confirm('Add new api to repository \n\n' + $scope.repo.name + '?')) {
+			
+			$scope.api.apiParams = [];
+			angular.forEach($scope.apiParams, function(value, param) {
+				$scope.api.apiParams.push({
+					'param' : param,
+					'value' : value
+				});
+			});
+						
 			$scope.showSpinner();
 			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
 			$http.post('repoApi.new', $.param({
@@ -297,24 +307,24 @@
 			return;
 		}
 		
-		if (!$scope.api.accessProtocol) {
+		if (!$scope.api.protocol) {
 			$scope.showError("Access Protocol is missing");
 			return;	
 		}
-		if (!$scope.api.baseUrl) {
+		if (!$scope.api.baseurl) {
 			$scope.showError("BaseUrl is missing");
 			return;
 		}
 		
-		var key = $scope.api.baseUrl + '@@@' + param;
+		var key = $scope.api.baseurl + '@@@' + param;
 		$scope.validValues[key] = [];
 
 		$scope.showSpinner();
 		$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
 		$http.post('listValidValuesForParam.do', $.param({
-			'protocol' : $scope.api.accessProtocol,
+			'protocol' : $scope.api.protocol,
 			'param'    : param,
-			'baseUrl'  : $scope.api.baseUrl,
+			'baseUrl'  : $scope.api.baseurl,
 		})).success(function(data) {
 			$scope.hideSpinner();
 			$scope.validValues[key] = data;
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repoControllers.js
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repoControllers.js	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repoControllers.js	(revision 50485)
@@ -14,10 +14,10 @@
 				enableCellEditOnFocus: false,
 				enableHighlighting: true,
 				filterOptions: $scope.filterBrowseData,
-				sortInfo: { fields: ['value'], directions: ['desc'] },
+				sortInfo: { fields: ['term'], directions: ['desc'] },
 				columnDefs: [
-				             {field: 'name', displayName: 'Name', cellTemplate: '<div class="ngCellText"><a href="javascript:void(0)" ng-click="browseApis(repoBrowseData.id, row.getProperty(\'id\'))">{{row.getProperty(col.field)}}</a></div>' },
-				             {field: 'value', displayName: '# datasources', width: '20%', headerClass: 'text-right', cellClass: 'text-right' }
+				             {field: 'term', displayName: 'Name', cellTemplate: '<div class="ngCellText"><a href="javascript:void(0)" ng-click="browseApis(repoBrowseData.id, row.getProperty(\'term\'))">{{row.getProperty(col.field)}}</a></div>' },
+				             {field: 'total', displayName: '# datasources', width: '20%', headerClass: 'text-right', cellClass: 'text-right' }
 				             ]
 		};
 		
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepo.js
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepo.js	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/addRepo.js	(revision 50485)
@@ -102,14 +102,20 @@
 		$scope.repo = {
 			latitude : '0.0',
 			longitude : '0.0',
-			timezone : '0.0'
+			timezone : '0.0',
 		};
+		
+		$scope.org = {};
 	}
 	
 	$scope.registerRepo = function() {
-		if (confirm('Add new datasource \n\n' + $scope.repo.officialName + '?')) {
+		if (confirm('Add new datasource \n\n' + $scope.repo.officialname + '?')) {
 			$scope.showSpinner();
 			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
+			
+			$scope.org.id = 'openaire____::' + $scope.repo.id;
+			$scope.repo.organizations = [$scope.org];
+			
 			$http.post('repo.new', $.param({
 				'repo'  : JSON.stringify($scope.repo)
 			})).success(function(res) {
Index: modules/dnet-modular-repositories-ui/trunk/pom.xml
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/pom.xml	(revision 50484)
+++ modules/dnet-modular-repositories-ui/trunk/pom.xml	(revision 50485)
@@ -11,7 +11,7 @@
 	<packaging>jar</packaging>
 	<version>4.0.18-SNAPSHOT</version>
 	<scm>
-   		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-repositories-ui/trunk</developerConnection>
+   		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-repositories-ui/branches/dsm</developerConnection>
 	</scm>
 	<dependencies>
 		<dependency>
@@ -26,8 +26,8 @@
 		</dependency>
 		<dependency>
 			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0, 5.0.0)</version>
+			<artifactId>dnet-datasource-manager-common</artifactId>
+			<version>[1.0.0-SNAPSHOT,2.0.0)</version>
 		</dependency>
 		<dependency>
 			<groupId>junit</groupId>
