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 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoInternalController.java	(revision 58375)
@@ -2,6 +2,7 @@
 
 import java.io.StringReader;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -10,11 +11,12 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.http.HttpStatus;
@@ -21,7 +23,9 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RequestBody;
 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;
 import org.springframework.web.bind.annotation.ResponseStatus;
@@ -73,6 +77,21 @@
 	@Resource
 	private RepoUIUtils repoUIUtils;
 
+	@Value("${repo.ui.mdstore.sync.desc}")
+	private String syncDescription;
+
+	@Value("${repo.ui.mdstore.sync.baseUrl}")
+	private String syncApi;
+
+	@Value("${services.mdstore.mongodb.db}")
+	private String mongoDb;
+
+	@Value("${services.mdstore.mongodb.host}")
+	private String mongoHost;
+
+	@Value("${services.mdstore.mongodb.port}")
+	private int mongoPort;
+
 	private static final Log log = LogFactory.getLog(RepoInternalController.class);
 
 	@RequestMapping(value = "/ui/browseRepoField.do")
@@ -101,8 +120,10 @@
 			@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
-				+ " can be invalidated: it is related to some metawfs"); }
+		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)
 				: serviceLocator.getService(ISRegistryService.class).invalidateProfile(id);
@@ -116,12 +137,13 @@
 		try {
 			profile = serviceLocator.getService(ISLookUpService.class).getResourceProfile(id);
 		} catch (final ISLookUpDocumentNotFoundException e) {
-			profile = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//DATASOURCE_ORIGINAL_ID='" + id + "']");
+			profile = serviceLocator.getService(ISLookUpService.class)
+					.getResourceProfileByQuery("collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//DATASOURCE_ORIGINAL_ID='"
+							+ id + "']");
 		}
 
-		final ApplyXslt xslt = new ApplyXslt(IOUtils.toString(getClass().getResourceAsStream(
-				"/eu/dnetlib/functionality/modular/ui/repositories/xslt/repoDetails.xslt")));
+		final ApplyXslt xslt =
+				new ApplyXslt(IOUtils.toString(getClass().getResourceAsStream("/eu/dnetlib/functionality/modular/ui/repositories/xslt/repoDetails.xslt")));
 
 		IOUtils.copy(new StringReader(xslt.evaluate(profile)), response.getOutputStream());
 	}
@@ -152,9 +174,10 @@
 
 		try {
 			return repoUIUtils.getApi(repoId, ifaceId);
-		} catch (ISLookUpDocumentNotFoundException e) {
+		} catch (final ISLookUpDocumentNotFoundException e) {
 
-			log.warn(String.format("the Interface '%s' is not available for repository '%s', try to sync DB and profiles via the DatasourceManager", ifaceId, repoId));
+			log.warn(String
+					.format("the Interface '%s' is not available for repository '%s', try to sync DB and profiles via the DatasourceManager", ifaceId, repoId));
 			dsManager.setActive(repoId, ifaceId, dsManager.isActive(repoId, ifaceId));
 			return repoUIUtils.getApi(repoId, ifaceId);
 		}
@@ -177,7 +200,7 @@
 	}
 
 	@RequestMapping("/ui/repoApi.delete")
-	public @ResponseBody boolean updateRepoApi(
+	public @ResponseBody boolean deleteRepoApi(
 			@RequestParam(value = "repo", required = true) final String repoId,
 			@RequestParam(value = "iface", required = true) final String ifaceId) throws Exception {
 		dsManager.deleteApi(repoId, ifaceId);
@@ -210,7 +233,13 @@
 	}
 
 	@RequestMapping("/ui/repos/repoApi.html")
-	public void resetRepoApiCompliance(final ModelMap map) throws Exception {}
+	public void repoApiHtml(final ModelMap map) throws Exception {
+		if (StringUtils.isNoneBlank(syncDescription, syncApi)) {
+			map.addAttribute("syncDesc", syncDescription);
+			map.addAttribute("mongoDB", mongoDb);
+			map.addAttribute("mongoUrl", String.format("mongodb://%s:%s", mongoHost, mongoPort));
+		}
+	}
 
 	@RequestMapping("/ui/repoApi.new")
 	public @ResponseBody boolean addRepoApi(@RequestParam(value = "repoId", required = true) final String repoId,
@@ -252,6 +281,19 @@
 		return serviceLocator.getService(CollectorService.class).listValidValuesForParam(protocol, baseUrl, param, null);
 	}
 
+	@RequestMapping(value = "/ui/remoteDatasource/apis", method = RequestMethod.GET)
+	public @ResponseBody Map<String, String> listRemoteApis(@RequestParam(value = "repo", required = true) final String repoId) {
+		// TODO
+		return new HashMap<>();
+	}
+
+	@RequestMapping(value = "/ui/remoteDatasource/api", method = RequestMethod.POST)
+	public @ResponseBody Map<String, String> listRemoteApis(@RequestParam(value = "repo", required = true) final String repoId,
+			@RequestBody final Api<ApiParam> api) {
+		// TODO
+		return new HashMap<>();
+	}
+
 	@ExceptionHandler(Exception.class)
 	@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
 	public @ResponseBody ErrorMessage handleException(final HttpServletRequest req, final Exception e) {
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/repositories/applicationContext-modular-ui-repositories.properties
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/repositories/applicationContext-modular-ui-repositories.properties	(revision 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/repositories/applicationContext-modular-ui-repositories.properties	(revision 58375)
@@ -8,3 +8,6 @@
 repo.ui.addRepo.show 					= true
 repo.ui.validator.address               = http://dev.openaire.research-infrastructures.eu:8880/validator/compatibility/browseHistory
 repo.ui.validatorService.address        = http://dev.openaire.research-infrastructures.eu:8880/validator-service
+
+repo.ui.mdstore.sync.desc               = sync with beta
+repo.ui.mdstore.sync.baseUrl            = http://xxxxxx
\ No newline at end of file
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 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoApi.st	(revision 58375)
@@ -82,8 +82,8 @@
 			
 		<div class="input-group input-group-sm col-xs-12 col-md-6" style="padding: 10px; float: left;">
 	  		<span class="input-group-addon" style="width: 150px;"><b>Last aggregation</b></span>
-	  		<ng-api-mdstore-info label="Collect" date="currentRepoApi.collDate" total="currentRepoApi.collTotal" id="currentRepoApi.collMdId"></ng-api-mdstore-info>	  		
-	  		<ng-api-mdstore-info label="Transform" date="currentRepoApi.aggrDate" total="currentRepoApi.aggrTotal" id="currentRepoApi.aggrMdId"></ng-api-mdstore-info>
+	  		<ng-api-mdstore-info label="Collect" date="currentRepoApi.collDate" total="currentRepoApi.collTotal" id="currentRepoApi.collMdId" sync-description="$syncDesc$" sync-function="showCreateRemoteSyncApi('$mongoUrl$','$mongoDB$',currentRepoApi.collMdId, 'remoteCollectedMdStore')"></ng-api-mdstore-info>	  		
+	  		<ng-api-mdstore-info label="Transform" date="currentRepoApi.aggrDate" total="currentRepoApi.aggrTotal" id="currentRepoApi.aggrMdId" sync-description="$syncDesc$" sync-function="showCreateRemoteSyncApi('$mongoUrl$','$mongoDB$',currentRepoApi.aggrMdId, 'remoteAggregatedMdStore')"></ng-api-mdstore-info>
 	  		<ng-api-objectstore-info label="Download" date="currentRepoApi.downloadDate" total="currentRepoApi.downloadTotal" id="currentRepoApi.downloadObjId"></ng-api-objectstore-info>
 		</div>		
 		
@@ -241,6 +241,25 @@
 	</div>
 </div>
 
+<div id="remoteSyncApiModal" class="modal fade" tabindex="-1" role="dialog">
+	<div class="modal-dialog modal-lg">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal">&times;</button>
+				<h4 class="modal-title">Create remote API</h4>
+			</div>
+			<div class="modal-body">
+				The following API will be created on ...:
+				<br /><br />
+				<pre>{{newSyncApi | json}}</pre>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="btn btn-primary" data-dismiss="modal">Confirm</button>
+				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+			</div>
+		</div>
+	</div>
+</div>
 
 $ui/repos/repoDetails()$
 $ui/workflows/common/atomwf()$
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/ngApiMdstoreInfo.html
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/ngApiMdstoreInfo.html	(revision 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/ngApiMdstoreInfo.html	(revision 58375)
@@ -1,18 +1,22 @@
-<div class="form-control">
-	<b>{{label}}:</b>
-	<span ng-show="date">
-		{{date | date:'yyyy-MM-dd HH:mm:ss'}}
-	</span>
-	<span ng-hide="date">
-		<i>not yet available</i>
-	</span>
-	<span class="pull-right">
-		<span ng-hide="id" ng-class="{'text-success' : total > 0, 'text-danger' : total == 0}">
-			<b>Total:</b> {{total}}
+<div class="input-group">
+	<div class="form-control">
+		<b>{{label}}:</b>
+		<span ng-show="date">
+			{{date | date:'yyyy-MM-dd HH:mm:ss'}}
 		</span>
-		<a ng-show="id"	href="../inspector/mdstore.do?id={{id}}">
-			<b>Total:</b> {{total}}
-		</a>
+		<span ng-hide="date">
+			<i>not yet available</i>
+		</span>
+		<span class="pull-right">
+			<span ng-hide="id" ng-class="{'text-success' : total > 0, 'text-danger' : total == 0}">
+				<b>Total:</b> {{total}}
+			</span>
+			<a ng-show="id"	href="../inspector/mdstore.do?id={{id}}">
+				<b>Total:</b> {{total}}
+			</a>
+		</span>
+	</div>
+	<span class="input-group-btn" ng-if="id && syncDescription">
+		<button class="btn btn-default" ng-click="syncFunction()">{{syncDescription}}</button>
 	</span>
-</div>
-
+</div>
\ No newline at end of file
Index: modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repos.js
===================================================================
--- modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repos.js	(revision 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repos.js	(revision 58375)
@@ -20,7 +20,9 @@
 			'label' : '@',
 			'date'  : '=',
 			'total' : '=',
-			'id'    : '='
+			'id'    : '=',
+			'syncDescription' : '@',
+			'syncFunction'    : '&',
 		},
 		templateUrl: '../resources/html/ngApiMdstoreInfo.html'
 	}
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 58374)
+++ modules/dnet-modular-repositories-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/repoControllers.js	(revision 58375)
@@ -103,6 +103,8 @@
 		$scope.currentRepoApi = {};
 		$scope.currentSets = [];
 		$scope.selectedSets = [];
+		
+		$scope.newSyncApi = {};
     	
     	$scope.loadApi = function() {
     		$scope.showSpinner();
@@ -389,6 +391,40 @@
 	        		}
 	        );
 		}
+		
+		$scope.showCreateRemoteSyncApi = function(mongoUrl, mongoDB, mdId, apiSuffix) {
+			
+			var path = "//*[local-name()='header']/*[local-name()='identifier']";
+			angular.forEach($scope.currentRepoApi.otherParams, function(p) {
+				if (p.id=='metadata_identifier_path') {
+					path = p.value;
+				}
+			});
+			
+			var compliance = "UNKNOWN";
+			angular.forEach($scope.currentRepoApi.commonParams, function(p) {
+				if (p.id=='compliance') {
+					compliance = p.value;
+				}
+			});
+			
+			$scope.newSyncApi = {
+				'dsId'  : $routeParams.repoId,
+				'apiId' : 'api_________::' + $routeParams.repoId + "::" + apiSuffix,
+				'compatibility' : compliance,
+				'contentdescription' : 'metadata',
+				'protocol' : 'remoteMdstore',
+				'baseurl'  : mongoUrl,
+				'apiParams' : {
+					'remote_database'   : mongoDB,
+					'remote_mdstore_id' : mdId
+				},
+				'metadataIdentifierPath' : path
+			};
+			
+			$('#remoteSyncApiModal').modal('show');
+			
+		}
 				
     	$scope.loadApi();
 	}
