Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager-service/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-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,47 +0,0 @@
-SELECT * FROM (
-	SELECT
-		(array_agg(DISTINCT o.country))[1]      AS country,
-		(array_agg(DISTINCT o.legalname))[1]    AS organization,
-		d.id                                    AS repoid,
-		d.officialname                          AS reponame,
-		d.englishname                           AS othername,
-		d.namespaceprefix                       AS repoprefix,
-		d.websiteurl                            AS repourl,
-		a.id                                    AS id,
-		a.active                                AS active,
-		a.protocol                              AS protocol,
-		a.typology                              AS type,
-		a.compatibility                         AS compliance,
-		CASE
-			WHEN (a.last_aggregation_date IS NOT NULL) THEN to_char(a.last_aggregation_date, 'YYYY-MM-DD')
-			WHEN (a.last_download_date IS NOT NULL) THEN to_char(a.last_download_date, 'YYYY-MM-DD')
-			ELSE ''
-		END AS aggrdate,
-		CASE
-			WHEN (a.last_aggregation_total IS NOT NULL) THEN to_char(a.last_aggregation_total, '')
-			WHEN (a.last_download_total IS NOT NULL) THEN to_char(a.last_download_total, '')
-			ELSE '0'
-		END AS aggrtotal
-	FROM
-		api a
-		LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-		LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-		LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-		GROUP BY
-			d.id, d.officialname, d.englishname, d.namespaceprefix, d.websiteurl,
-			a.id, a.active, a.protocol, a.typology, a.compatibility,
-			a.last_aggregation_date, a.last_download_date,
-			a.last_aggregation_total, a.last_download_total
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%'
-		OR othername ILIKE '%$value$%'
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.properties
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.properties	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.properties	(nonexistent)
@@ -1 +0,0 @@
-dnet.openaire.dsm.db.name   =   dnet_dsm
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.dsm.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,313 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseException;
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-	private String db;
-	private UniqueServiceLocator serviceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	public boolean isManaged(final String dsId) throws DatasourceManagerServiceException {
-		try {
-
-
-			serviceLocator.getService(DatabaseService.class).contains(getDb(), "datasources", "managed", "true");
-
-
-			return true;
-		} catch (final DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-	}
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (final Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (final Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error saving profile, id: " + dsId, e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) throws DatabaseException {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-
-		try {
-			serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql);
-		} catch (final DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-
-		if (updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (final Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (final Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (final Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (final ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (final ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (final ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,495 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import eu.dnetlib.enabling.datasources.rmi.*;
-import eu.dnetlib.enabling.tools.AbstractBaseService;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import static eu.dnetlib.enabling.datasources.DatasourceFunctions.asMapOfSqlValues;
-import static eu.dnetlib.enabling.datasources.DatasourceFunctions.asSqlValue;
-
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-
-
-		params.put("dsId", asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", asSqlValue(active));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("dsId", asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", asSqlValue(level));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("dsId", asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", asSqlValue(desc));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("dsId", asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", asSqlValue(dsId));
-		params.put("id", asSqlValue(iface.getId()));
-		params.put("typology", asSqlValue(iface.getTypology()));
-		params.put("protocol", asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-		params.put("description", asSqlValue(iface.getContentDescription()));
-		params.put("compliance", asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<>();
-		if (iface.getAccessParams() != null) {
-			for (final Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<>();
-		if (iface.getExtraFields() != null) {
-			for (final Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", asSqlValue(dsId));
-		params.put("id", asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final String openaireDsId = datasourceManagerClients.findDatasourceId(dsId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", asSqlValue(openaireDsId));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("field", asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(openaireDsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", asSqlValue(dsId));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("field", asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (final Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", asSqlValue(dsId));
-		params.put("ifaceId", asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", asSqlValue(dsId));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("field", asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", asSqlValue(dsId));
-		params.put("ifaceId", asSqlValue(ifaceId));
-		params.put("field", asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return getBrowsableFields().stream()
-				.map(f -> new BrowsableField(f.getId(), f.getLabel()))
-				.collect(Collectors.toList());
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (final String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (final Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if ((f == null) || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, s -> {
-				final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-				try {
-					final Document doc = reader.read(new StringReader(s));
-					final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-					iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-					iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-					iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-					iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-					iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-					iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-					iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-					iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-					iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-					iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-				} catch (final Exception e) {
-					log.error(e);
-				}
-				return iface;
-			}));
-		} catch (final Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (final DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, s -> {
-				final RepositoryMapEntry r = new RepositoryMapEntry();
-				try {
-					final Document doc = reader.read(new StringReader(s));
-					r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-					r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-					r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-					r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-				} catch (final Exception e) {
-					log.error(e);
-				}
-				return r;
-			}));
-		} catch (final Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (final String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (final Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (final Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet45-parent</artifactId>
-                <version>1.0.0-SNAPSHOT</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.2.3-SNAPSHOT</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-service</artifactId>
-			<version>[3.0.0,4.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45/dnet-openaireplus-datasource-manager-service.iml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45/dnet-openaireplus-datasource-manager-service.iml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45/dnet-openaireplus-datasource-manager-service.iml	(nonexistent)
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
-      <excludeFolder url="file://$MODULE_DIR$/target" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:2.2.1-SNAPSHOT" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.2-SNAPSHOT" level="project" />
-    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
-    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:2.1.1-SNAPSHOT" level="project" />
-    <orderEntry type="module" module-name="cnr-service-common" />
-    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
-    <orderEntry type="module" module-name="cnr-misc-utils" />
-    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
-    <orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" />
-    <orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" />
-    <orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
-    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:dnet-datasource-manager-rmi:4.0.1-SNAPSHOT" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.1-SNAPSHOT" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
-    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
-    <orderEntry type="module" module-name="cnr-enabling-database-service" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
-    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
-    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
-    <orderEntry type="library" name="Maven: org.postgresql:jdbc4driver:8.3" level="project" />
-    <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.3.2.Final" level="project" />
-    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA" level="project" />
-    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1" level="project" />
-    <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final" level="project" />
-    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
-    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
-    <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.4.Final" level="project" />
-    <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" />
-    <orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
-    <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
-    <orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-enabling-database-api:2.1.1-SNAPSHOT" level="project" />
-    <orderEntry type="module" module-name="cnr-resultset-service" />
-    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
-    <orderEntry type="module" module-name="cnr-spring-utils" />
-    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" />
-    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" />
-    <orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" />
-    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.2" level="project" />
-    <orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" />
-    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-resultset-client:2.1.2-SNAPSHOT" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.5" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.9" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
-    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
-  </component>
-</module>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/branches/dnet45
===================================================================
--- modules/dnet-openaireplus-datasource-manager/branches/dnet45	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/branches/dnet45	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/branches/dnet45
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-*.iml
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,41 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-		
-	<bean id="openaireplusDatasourceUpdater"
-		class="eu.dnetlib.enabling.datasources.OpenaireplusDatasourceUpdater" 
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,4 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,311 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery("/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '" + dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final int nActiveInterfaces = doc.selectNodes("//INTERFACE[@active='true']").size();
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				final String profKind = docOld.valueOf("//RESOURCE_KIND/@value");
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-				doc.selectSingleNode("//RESOURCE_KIND/@value").setText(profKind);
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-
-				if (DatasourceFunctions.verifyCompliance(doc) && profKind.equals("PendingRepositoryResources")) {
-					registry.validateProfile(profId);
-				}
-
-			} else {
-				if (DatasourceFunctions.verifyCompliance(doc) || nActiveInterfaces > 0) {
-					if (!DatasourceFunctions.verifyCompliance(doc)) { throw new DatasourceManagerServiceException(
-							"I cannot register an invalide datasource with active interfaces"); }
-
-					final String profId = registry.registerProfile(doc.asXML());
-					log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-				} else {
-					final String profId = registry.insertProfileForValidation(REPOSITORY_SERVICE_RESOURCE_TYPE, doc.asXML());
-					log.info("Pending Profile " + profId + " REGISTERED for ds " + dsId);
-				}
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public W3CEndpointReference searchSQL(final String sql) {
-		return serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-
-			st.setAttributes(params);
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			final W3CEndpointReference epr = searchSQL(sql);
-
-			return resultSetClientFactory.getClient(epr);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,244 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public Date findNextScheduledExecution(String dsId, String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,363 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if ((infopackage == null) || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = (arr.length > 2) ? arr[2].trim() : "";
-	
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if ((pre == null) && (post == null)) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return (s == null) ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return (b == null) ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return (d == null) ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) {
-					return true; 
-				}
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if ((val == null) || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if ((iface.getId() != null) && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(nonexistent)
@@ -1,123 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DatasourceUpdater;
-import eu.dnetlib.datasource.common.utils.DatasourceUpdaterException;
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-
-public class OpenaireplusDatasourceUpdater implements DatasourceUpdater {
-
-	private DatasourceManagerClients datasourceManagerClients;
-	
-	private static final Log log = LogFactory.getLog(OpenaireplusDatasourceUpdater.class);
-
-	@Override
-	public boolean updateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean updateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceUpdaterException {
-
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-			if (!accessParam) {
-				deleteOldExtraFields(dsId, ifaceId);
-			}
-			
-			for (Map.Entry<String, String> e : params.entrySet()) {
-				performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-			}
-			datasourceManagerClients.regenerateProfile(dsId);
-			return true;
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error updating profile: " + repoId, e);
-			throw new DatasourceUpdaterException("Error updating profile: " + repoId, e);
-		}
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceUpdaterException {
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-			
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-			params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-			params.put("field", DatasourceFunctions.asSqlValue(DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD));
-			
-			if (StringUtils.isEmpty(compliance)) {
-				params.put("delete", true);
-				log.debug("Removing compliance");
-			} else {
-				params.put("value", DatasourceFunctions.asSqlValue(compliance));
-				if (datasourceManagerClients.isDefinedParam(ifaceId, DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD)) {
-					params.put("update", true);
-					log.debug("Updating compliance: " + compliance);
-				} else {
-					params.put("insert", true);
-					log.debug("Adding compliance: " + compliance);
-				} 
-			}
-			return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error overriding compliance", e);
-			throw new DatasourceUpdaterException("Error overriding compliance", e);
-		}
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0/pom.xml	(nonexistent)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>4.0.0</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-4.0.0</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-common</artifactId>
-			<version>[3.0.0,4.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[3.0.1,4.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-4.0.0
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,4 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,52 +0,0 @@
-SELECT * FROM (SELECT
-	o.countryclass    AS country,
-	o.legalname       AS organization,
-	d.id              AS repoid,
-	d.officialname    AS reponame,
-	d.namespaceprefix AS repoprefix,
-	d.websiteurl      AS repourl,
-	a.id              AS id,
-	a.active          AS active,
-	a.protocolclass   AS protocol,
-	a.typologyclass   AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,509 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(doc.valueOf("/ROW/FIELD[@name='reponame']"));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.0</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.0</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.0
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,514 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,297 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import eu.dnetlib.enabling.database.rmi.DatabaseException;
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-public class DatasourceManagerClients {
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-	private String db;
-	private UniqueServiceLocator serviceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) throws DatabaseException {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-
-		try {
-			serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql);
-		} catch (DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-
-		if (updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.2.0</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.2.0</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/dnet-openaireplus-datasource-manager-service.iml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/dnet-openaireplus-datasource-manager-service.iml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0/dnet-openaireplus-datasource-manager-service.iml	(nonexistent)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="false">
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.0
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-*.iml
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,43 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-		
-	<bean id="openaireplusDatasourceUpdater"
-		class="eu.dnetlib.enabling.datasources.OpenaireplusDatasourceUpdater" 
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:dbServiceLocator-ref="dbServiceLocator" 
-		p:lookupLocator-ref="lookupLocator"
-		p:registryLocator-ref="registryLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,4 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param||'@@' WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,363 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if ((infopackage == null) || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = (arr.length > 2) ? arr[2].trim() : "";
-	
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if ((pre == null) && (post == null)) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return (s == null) ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return (b == null) ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return (d == null) ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) {
-					return true; 
-				}
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if ((val == null) || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if ((iface.getId() != null) && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(nonexistent)
@@ -1,123 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DatasourceUpdater;
-import eu.dnetlib.datasource.common.utils.DatasourceUpdaterException;
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-
-public class OpenaireplusDatasourceUpdater implements DatasourceUpdater {
-
-	private DatasourceManagerClients datasourceManagerClients;
-	
-	private static final Log log = LogFactory.getLog(OpenaireplusDatasourceUpdater.class);
-
-	@Override
-	public boolean updateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean updateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceUpdaterException {
-
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-			if (!accessParam) {
-				deleteOldExtraFields(dsId, ifaceId);
-			}
-			
-			for (Map.Entry<String, String> e : params.entrySet()) {
-				performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-			}
-			datasourceManagerClients.regenerateProfile(dsId);
-			return true;
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error updating profile: " + repoId, e);
-			throw new DatasourceUpdaterException("Error updating profile: " + repoId, e);
-		}
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceUpdaterException {
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-			
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-			params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-			params.put("field", DatasourceFunctions.asSqlValue(DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD));
-			
-			if (StringUtils.isEmpty(compliance)) {
-				params.put("delete", true);
-				log.debug("Removing compliance");
-			} else {
-				params.put("value", DatasourceFunctions.asSqlValue(compliance));
-				if (datasourceManagerClients.isDefinedParam(ifaceId, DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD)) {
-					params.put("update", true);
-					log.debug("Updating compliance: " + compliance);
-				} else {
-					params.put("insert", true);
-					log.debug("Adding compliance: " + compliance);
-				} 
-			}
-			return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error overriding compliance", e);
-			throw new DatasourceUpdaterException("Error overriding compliance", e);
-		}
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,327 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.enabling.tools.ServiceLocator;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-	private ServiceLocator<ISRegistryService> registryLocator;
-	private ServiceLocator<ISLookUpService> lookupLocator;
-	private ServiceLocator<DatabaseService> dbServiceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return lookupLocator.getService().getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-		    log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return lookupLocator.getService()
-					.getResourceProfileByQuery("/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '" + dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				registryLocator.getService().deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-		    log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final int nActiveInterfaces = doc.selectNodes("//INTERFACE[@active='true']").size();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				final String profKind = docOld.valueOf("//RESOURCE_KIND/@value");
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-				doc.selectSingleNode("//RESOURCE_KIND/@value").setText(profKind);
-				registryLocator.getService().updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-
-				if (DatasourceFunctions.verifyCompliance(doc) && profKind.equals("PendingRepositoryResources")) {
-					registryLocator.getService().validateProfile(profId);
-				}
-				
-			} else {
-				if (DatasourceFunctions.verifyCompliance(doc) || (nActiveInterfaces > 0)) {
-					if (!DatasourceFunctions.verifyCompliance(doc)) { throw new DatasourceManagerServiceException(
-							"I cannot register an invalide datasource with active interfaces"); }
-
-					final String profId = registryLocator.getService().registerProfile(doc.asXML());
-					log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-				} else {
-					final String profId = registryLocator.getService().insertProfileForValidation(REPOSITORY_SERVICE_RESOURCE_TYPE, doc.asXML());
-					log.info("Pending Profile " + profId + " REGISTERED for ds " + dsId);
-				}
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public W3CEndpointReference searchSQL(final String sql) {
-		return dbServiceLocator.getService().searchSQL(getDb(), sql);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (dbServiceLocator.getService().updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-		    log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-			    log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-			    log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-
-			st.setAttributes(params);
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			final W3CEndpointReference epr = searchSQL(sql);
-
-			return resultSetClientFactory.getClient(epr);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-	
-	public Date findNextScheduledExecution(String dsId, String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = lookupLocator.getService().getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-		    log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-		    log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ServiceLocator<ISRegistryService> getRegistryLocator() {
-		return registryLocator;
-	}
-
-	@Required
-	public void setRegistryLocator(final ServiceLocator<ISRegistryService> registryLocator) {
-		this.registryLocator = registryLocator;
-	}
-
-	public ServiceLocator<ISLookUpService> getLookupLocator() {
-		return lookupLocator;
-	}
-
-	@Required
-	public void setLookupLocator(final ServiceLocator<ISLookUpService> lookupLocator) {
-		this.lookupLocator = lookupLocator;
-	}
-
-	public ServiceLocator<DatabaseService> getDbServiceLocator() {
-		return dbServiceLocator;
-	}
-
-	@Required
-	public void setDbServiceLocator(final ServiceLocator<DatabaseService> dbServiceLocator) {
-		this.dbServiceLocator = dbServiceLocator;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,244 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public Date findNextScheduledExecution(String dsId, String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/pom.xml	(nonexistent)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>3.0.1</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-3.0.1</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-common</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[3.0.1,4.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.1
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,509 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(doc.valueOf("/ROW/FIELD[@name='reponame']"));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,4 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.1</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.1</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.1
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/dnet-openaireplus-datasource-manager-service.iml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/dnet-openaireplus-datasource-manager-service.iml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/dnet-openaireplus-datasource-manager-service.iml	(nonexistent)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="false">
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,300 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseException;
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-	private String db;
-	private UniqueServiceLocator serviceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (final Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (final Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error saving profile, id: " + dsId, e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) throws DatabaseException {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-
-		try {
-			serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql);
-		} catch (final DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-
-		if (updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (final Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (final Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (final Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (final ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (final ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (final ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,516 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (final Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (final Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final String openaireDsId = datasourceManagerClients.findDatasourceId(dsId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(openaireDsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(openaireDsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (final Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (final String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (final Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if ((f == null) || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (final Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (final Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (final DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (final Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (final Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (final String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (final Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (final Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.2.1</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.2.1</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.1
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-*.iml
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,363 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if ((infopackage == null) || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = (arr.length > 2) ? arr[2].trim() : "";
-	
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if ((pre == null) && (post == null)) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return (s == null) ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return (b == null) ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return (d == null) ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) {
-					return true; 
-				}
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if ((val == null) || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if ((iface.getId() != null) && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if ((k != null) && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/OpenaireplusDatasourceUpdater.java	(nonexistent)
@@ -1,123 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.datasource.common.utils.DatasourceUpdater;
-import eu.dnetlib.datasource.common.utils.DatasourceUpdaterException;
-import eu.dnetlib.datasource.common.utils.DefaultDatasourceUpdater;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-
-public class OpenaireplusDatasourceUpdater implements DatasourceUpdater {
-
-	private DatasourceManagerClients datasourceManagerClients;
-	
-	private static final Log log = LogFactory.getLog(OpenaireplusDatasourceUpdater.class);
-
-	@Override
-	public boolean updateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean updateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params) throws DatasourceUpdaterException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceUpdaterException {
-
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-			if (!accessParam) {
-				deleteOldExtraFields(dsId, ifaceId);
-			}
-			
-			for (Map.Entry<String, String> e : params.entrySet()) {
-				performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-			}
-			datasourceManagerClients.regenerateProfile(dsId);
-			return true;
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error updating profile: " + repoId, e);
-			throw new DatasourceUpdaterException("Error updating profile: " + repoId, e);
-		}
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceUpdaterException {
-		try {
-			final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-			
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-			params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-			params.put("field", DatasourceFunctions.asSqlValue(DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD));
-			
-			if (StringUtils.isEmpty(compliance)) {
-				params.put("delete", true);
-				log.debug("Removing compliance");
-			} else {
-				params.put("value", DatasourceFunctions.asSqlValue(compliance));
-				if (datasourceManagerClients.isDefinedParam(ifaceId, DefaultDatasourceUpdater.OVERRIDING_COMPLIANCE_FIELD)) {
-					params.put("update", true);
-					log.debug("Updating compliance: " + compliance);
-				} else {
-					params.put("insert", true);
-					log.debug("Adding compliance: " + compliance);
-				} 
-			}
-			return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-		} catch (DatasourceManagerServiceException e) {
-			log.error("Error overriding compliance", e);
-			throw new DatasourceUpdaterException("Error overriding compliance", e);
-		}
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,327 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.enabling.tools.ServiceLocator;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-	private ServiceLocator<ISRegistryService> registryLocator;
-	private ServiceLocator<ISLookUpService> lookupLocator;
-	private ServiceLocator<DatabaseService> dbServiceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return lookupLocator.getService().getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-		    log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return lookupLocator.getService()
-					.getResourceProfileByQuery("/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '" + dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				registryLocator.getService().deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-		    log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final int nActiveInterfaces = doc.selectNodes("//INTERFACE[@active='true']").size();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				final String profKind = docOld.valueOf("//RESOURCE_KIND/@value");
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-				doc.selectSingleNode("//RESOURCE_KIND/@value").setText(profKind);
-				registryLocator.getService().updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-
-				if (DatasourceFunctions.verifyCompliance(doc) && profKind.equals("PendingRepositoryResources")) {
-					registryLocator.getService().validateProfile(profId);
-				}
-				
-			} else {
-				if (DatasourceFunctions.verifyCompliance(doc) || (nActiveInterfaces > 0)) {
-					if (!DatasourceFunctions.verifyCompliance(doc)) { throw new DatasourceManagerServiceException(
-							"I cannot register an invalide datasource with active interfaces"); }
-
-					final String profId = registryLocator.getService().registerProfile(doc.asXML());
-					log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-				} else {
-					final String profId = registryLocator.getService().insertProfileForValidation(REPOSITORY_SERVICE_RESOURCE_TYPE, doc.asXML());
-					log.info("Pending Profile " + profId + " REGISTERED for ds " + dsId);
-				}
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public W3CEndpointReference searchSQL(final String sql) {
-		return dbServiceLocator.getService().searchSQL(getDb(), sql);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (dbServiceLocator.getService().updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-		    log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-			    log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-			    log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-		    log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-
-			st.setAttributes(params);
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			final W3CEndpointReference epr = searchSQL(sql);
-
-			return resultSetClientFactory.getClient(epr);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-	
-	public Date findNextScheduledExecution(String dsId, String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = lookupLocator.getService().getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-		    log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-		    log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ServiceLocator<ISRegistryService> getRegistryLocator() {
-		return registryLocator;
-	}
-
-	@Required
-	public void setRegistryLocator(final ServiceLocator<ISRegistryService> registryLocator) {
-		this.registryLocator = registryLocator;
-	}
-
-	public ServiceLocator<ISLookUpService> getLookupLocator() {
-		return lookupLocator;
-	}
-
-	@Required
-	public void setLookupLocator(final ServiceLocator<ISLookUpService> lookupLocator) {
-		this.lookupLocator = lookupLocator;
-	}
-
-	public ServiceLocator<DatabaseService> getDbServiceLocator() {
-		return dbServiceLocator;
-	}
-
-	@Required
-	public void setDbServiceLocator(final ServiceLocator<DatabaseService> dbServiceLocator) {
-		this.dbServiceLocator = dbServiceLocator;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,244 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.collect.Maps;
-
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public Date findNextScheduledExecution(String dsId, String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,43 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-		
-	<bean id="openaireplusDatasourceUpdater"
-		class="eu.dnetlib.enabling.datasources.OpenaireplusDatasourceUpdater" 
-		p:datasourceManagerClients-ref="datasourceManagerClients" />
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:dbServiceLocator-ref="dbServiceLocator" 
-		p:lookupLocator-ref="lookupLocator"
-		p:registryLocator-ref="registryLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,4 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2/pom.xml	(nonexistent)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>3.0.2</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-3.0.2</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-common</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[3.0.1,4.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-3.0.2
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,509 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(doc.valueOf("/ROW/FIELD[@name='reponame']"));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'::'||$organization$||'@@'||$id$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.2</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.2</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.2
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,300 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseException;
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-	private String db;
-	private UniqueServiceLocator serviceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (final Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (final Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error saving profile, id: " + dsId, e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) throws DatabaseException {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-
-		try {
-			serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql);
-		} catch (final DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-
-		if (updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (final Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (final Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (final Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (final ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (final ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (final ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,516 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (final Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (final Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final String openaireDsId = datasourceManagerClients.findDatasourceId(dsId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(openaireDsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(openaireDsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (final Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (final String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (final Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if ((f == null) || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (final Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (final Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (final DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (final Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (final Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (final String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (final Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (final Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,62 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.englishname                           AS othername,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.englishname, d.namespaceprefix, d.websiteurl, 
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%'
-		OR othername ILIKE '%$value$%'
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.2.2</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.2.2</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/dnet-openaireplus-datasource-manager-service.iml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/dnet-openaireplus-datasource-manager-service.iml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2/dnet-openaireplus-datasource-manager-service.iml	(nonexistent)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="false">
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.2
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-*.iml
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.3</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.3</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,513 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(doc.valueOf("/ROW/FIELD[@name='reponame']"));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.3
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet45-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.2.3</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.2.3</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/dnet-openaireplus-datasource-manager-service.iml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/dnet-openaireplus-datasource-manager-service.iml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/dnet-openaireplus-datasource-manager-service.iml	(nonexistent)
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
-      <excludeFolder url="file://$MODULE_DIR$/target" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:2.2.0" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.1" level="project" />
-    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
-    <orderEntry type="library" name="Maven: asm:asm:3.3.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-core:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.6" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:2.1.0" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-common:2.1.5" level="project" />
-    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.0.0.RELEASE" level="project" />
-    <orderEntry type="module" module-name="cnr-misc-utils" />
-    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
-    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
-    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
-    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
-    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
-    <orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" />
-    <orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" />
-    <orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: opensymphony:quartz:1.6.6" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:dnet-datasource-manager-rmi:4.0.0" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-api:2.7.8" level="project" />
-    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.2.0" level="project" />
-    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1" level="project" />
-    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-enabling-database-api:2.0.0" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-resultset-client:2.1.1" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-resultset-service:2.0.2" level="project" />
-    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
-    <orderEntry type="library" name="Maven: cglib:cglib-nodep:2.2" level="project" />
-    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-spring-utils:1.0.0" level="project" />
-    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.0.0.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" />
-    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.6" level="project" />
-    <orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.2" level="project" />
-    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
-  </component>
-</module>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager-service/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-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,62 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.englishname                           AS othername,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.englishname, d.namespaceprefix, d.websiteurl, 
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%'
-		OR othername ILIKE '%$value$%'
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,300 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseException;
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-	private String db;
-	private UniqueServiceLocator serviceLocator;
-	private ResultSetClientFactory resultSetClientFactory;
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (final Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (final Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (final Exception e) {
-			log.error("Error saving profile, id: " + dsId, e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) throws DatabaseException {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-
-		try {
-			serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql);
-		} catch (final DatabaseException e) {
-			throw new DatasourceManagerServiceException(e);
-		}
-
-		if (updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (final Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (final Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if ((p == null) || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (final String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if ((condition != null) && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (final Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (final Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (final ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (final ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (final ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,512 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if ((ds.getOrganization() != null) && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if ((compliance != null) && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if ((contentDescription != null) && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if ((iisProcessingWorkflow != null) && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if ((collectedFrom != null) && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (final Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (final Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final String openaireDsId = datasourceManagerClients.findDatasourceId(dsId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(openaireDsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(openaireDsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (final Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (final String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (final Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if ((f == null) || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (final Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (final Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (final DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, s -> {
-				final RepositoryMapEntry r = new RepositoryMapEntry();
-				try {
-					final Document doc = reader.read(new StringReader(s));
-					r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-					r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-					r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-					r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-				} catch (final Exception e) {
-					log.error(e);
-				}
-				return r;
-			}));
-		} catch (final Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (final String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (final Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (final Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.2.3
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-*.iml
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,513 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(doc.valueOf("/ROW/FIELD[@name='reponame']"));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(doc.valueOf("/ROW/FIELD[@name='name']"));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.4</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.4</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.4
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/deploy.info	(nonexistent)
@@ -1 +0,0 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/trunk/", "deploy_repository": "dnet4-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/dnet4-snapshots", "name": "dnet-openaireplus-datasource-manager-service"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerServiceImpl.java	(nonexistent)
@@ -1,514 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-import org.springframework.beans.factory.annotation.Required;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-import eu.dnetlib.enabling.datasources.rmi.BrowseTerm;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-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.tools.AbstractBaseService;
-
-public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
-
-	private DatasourceManagerClients datasourceManagerClients;
-
-	private List<DbBrowsableField> browsableFields;
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerServiceImpl.class);
-
-	@Override
-	public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
-		if (StringUtils.isBlank(ds.getAggregator())) {
-			ds.setAggregator("OPENAIRE");
-		}
-
-		final Map<String, Object> params = DatasourceFunctions.asMapOfSqlValues(ds);
-
-		if (ds.getOrganization() != null && !ds.getOrganization().trim().isEmpty()) {
-			params.put("hasOrganization", 1);
-		}
-		return datasourceManagerClients.updateSQL(ds.getId(), "addDatasource.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteDatasource.sql.st", params, true, true);
-	}
-
-	@Override
-	public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
-		final List<DatasourceDesc> list = datasourceManagerClients.getDatasourcesByCondition("ds.id = " + DatasourceFunctions.asSqlValue(dsId));
-		if (list.size() != 1) { throw new DatasourceManagerServiceException("Datasource not found, id=" + dsId); }
-
-		return list.get(0);
-	}
-
-	@Override
-	public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
-		return datasourceManagerClients.getDatasourcesByCondition(null);
-	}
-
-	@Override
-	public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
-			final String contentDescription,
-			final String iisProcessingWorkflow,
-			final String collectedFrom) throws DatasourceManagerServiceException {
-
-		String cond = "";
-
-		if (compliance != null && !compliance.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.compatibilityclass=" + DatasourceFunctions.asSqlValue(compliance);
-		}
-
-		if (contentDescription != null && !contentDescription.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.contentdescriptionclass=" + DatasourceFunctions.asSqlValue(contentDescription);
-		}
-
-		if (iisProcessingWorkflow != null && !iisProcessingWorkflow.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ag.accessinfopackage LIKE '%###" + DatasourceParams.iis_processing_workflow + "###" + iisProcessingWorkflow + "###%'";
-		}
-
-		if (collectedFrom != null && !collectedFrom.isEmpty()) {
-			if (!cond.isEmpty()) {
-				cond += " and ";
-			}
-			cond += "ds.collectedfrom=" + DatasourceFunctions.asSqlValue(collectedFrom);
-		}
-
-		return datasourceManagerClients.getDatasourcesByCondition(cond);
-	}
-
-	@Override
-	public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("active", DatasourceFunctions.asSqlValue(active));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateActivationStatus.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("level", DatasourceFunctions.asSqlValue(level));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateLevelOfCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
-		return updateAccessParam(dsId, ifaceId, DatasourceParams.baseUrl.toString(), baseUrl, true);
-	}
-
-	@Override
-	public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("desc", DatasourceFunctions.asSqlValue(desc));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-
-		return datasourceManagerClients.updateSQL(dsId, "updateContentDescription.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
-		return updateExtraField(dsId, ifaceId, DatasourceParams.iis_processing_workflow.toString(), wf, false);
-	}
-
-	@Override
-	public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(iface.getId()));
-		params.put("typology", DatasourceFunctions.asSqlValue(iface.getTypology()));
-		params.put("protocol", DatasourceFunctions.asSqlValue(iface.getAccessProtocol()));
-		params.put("baseUrl", DatasourceFunctions.asSqlValue(iface.getBaseUrl()));
-		params.put("description", DatasourceFunctions.asSqlValue(iface.getContentDescription()));
-		params.put("compliance", DatasourceFunctions.asSqlValue(iface.getCompliance()));
-
-		final Map<String, String> accessParams = new HashMap<String, String>();
-		if (iface.getAccessParams() != null) {
-			for (Entry<String, String> e : iface.getAccessParams().entrySet()) {
-				accessParams.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("accessParams", accessParams);
-
-		final Map<String, String> extraFields = new HashMap<String, String>();
-		if (iface.getExtraFields() != null) {
-			for (Entry<String, String> e : iface.getExtraFields().entrySet()) {
-				extraFields.put(DatasourceFunctions.asSqlValue(e.getKey()), DatasourceFunctions.asSqlValue(e.getValue()));
-			}
-		}
-		params.put("extraFields", extraFields);
-
-		return datasourceManagerClients.updateSQL(dsId, "insertInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteInterface(final String dsId, final String ifcId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("datasource", DatasourceFunctions.asSqlValue(dsId));
-		params.put("id", DatasourceFunctions.asSqlValue(ifcId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteInterface.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, false);
-	}
-
-	@Override
-	public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
-			throws DatasourceManagerServiceException {
-		return updateApiCollectionsRow(dsId, ifaceId, field, value, preserveOriginal, true);
-	}
-
-	private boolean updateApiCollectionsRow(final String dsId,
-			final String ifaceId,
-			final String field,
-			final String value,
-			final boolean preserveOriginal,
-			final boolean accessParam) throws DatasourceManagerServiceException {
-
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-		}
-		if (preserveOriginal) {
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteApiCollectionsRow.sql.st", params, false, true);
-	}
-
-	@Override
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
-		return datasourceManagerClients.updateSQL(dsId, sql, delete, true);
-	}
-
-	@Override
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId)
-			throws DatasourceManagerServiceException {
-		return datasourceManagerClients.findNextScheduledExecution(dsId, ifaceId);
-	}
-
-	@Override
-	public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, fields, false);
-	}
-
-	@Override
-	public boolean bulkUpdateApiAccessParams(final String repoId, final String ifaceId, final Map<String, String> params)
-			throws DatasourceManagerServiceException {
-		return performUpdate(repoId, ifaceId, params, true);
-	}
-
-	private boolean performUpdate(final String repoId, final String ifaceId, final Map<String, String> params, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		if (!accessParam) {
-			deleteOldExtraFields(dsId, ifaceId);
-		}
-
-		for (Map.Entry<String, String> e : params.entrySet()) {
-			performSingleUpdate(dsId, ifaceId, e.getKey(), e.getValue(), accessParam);
-		}
-		datasourceManagerClients.regenerateProfile(dsId);
-		return true;
-	}
-
-	private boolean deleteOldExtraFields(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-
-		return datasourceManagerClients.updateSQL(dsId, "deleteOldExtraFields.sql.st", params, false, false);
-	}
-
-	private boolean performSingleUpdate(final String dsId, final String ifaceId, final String field, final String value, final boolean accessParam)
-			throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-		params.put("accessParam", accessParam);
-
-		if (value != null) {
-			params.put("value", DatasourceFunctions.asSqlValue(value));
-		}
-
-		if (accessParam && datasourceManagerClients.isDefinedParam(ifaceId, field)) {
-			params.put("update", 1);
-			params.put("preserveOriginal", 1);
-		}
-
-		return datasourceManagerClients.updateSQL(dsId, "updateApiCollectionsRow.sql.st", params, false, false);
-	}
-
-	public DatasourceManagerClients getDatasourceManagerClients() {
-		return datasourceManagerClients;
-	}
-
-	@Required
-	public void setDatasourceManagerClients(final DatasourceManagerClients datasourceManagerClients) {
-		this.datasourceManagerClients = datasourceManagerClients;
-	}
-
-	@Override
-	public boolean overrideCompliance(final String repoId, final String ifaceId, final String compliance) throws DatasourceManagerServiceException {
-
-		final String dsId = datasourceManagerClients.findDatasourceId(repoId);
-
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("dsId", DatasourceFunctions.asSqlValue(dsId));
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD));
-
-		if (StringUtils.isEmpty(compliance)) {
-			params.put("delete", true);
-			log.debug("Removing compliance");
-		} else {
-			params.put("value", DatasourceFunctions.asSqlValue(compliance));
-			if (datasourceManagerClients.isDefinedParam(ifaceId, DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
-				params.put("update", true);
-				log.debug("Updating compliance: " + compliance);
-			} else {
-				params.put("insert", true);
-				log.debug("Adding compliance: " + compliance);
-			}
-		}
-		return datasourceManagerClients.updateSQL(dsId, "overrideCompliance.sql.st", params, false, true);
-	}
-
-	@Override
-	public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
-		return Lists.transform(getBrowsableFields(), new Function<DbBrowsableField, BrowsableField>() {
-
-			@Override
-			public BrowsableField apply(final DbBrowsableField f) {
-				return new BrowsableField(f.getId(), f.getLabel());
-			}
-		});
-	}
-
-	@Override
-	public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
-		final List<BrowseTerm> list = Lists.newArrayList();
-
-		try {
-			final DbBrowsableField field = findBrowseField(f);
-			if (field != null) {
-				final SAXReader reader = new SAXReader();
-				for (String s : datasourceManagerClients.searchSQL(field.getSql())) {
-					final Document doc = reader.read(new StringReader(s));
-					final String id = doc.valueOf("/ROW/FIELD[@name='id']");
-					final String name = doc.valueOf("/ROW/FIELD[@name='name']");
-					final int value = NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='count']"), 0);
-					if (StringUtils.isNotEmpty(id)) {
-						list.add(new BrowseTerm(id, name, value));
-					}
-				}
-			}
-		} catch (Exception e) {
-			log.error("Error browsing field " + f, e);
-		}
-
-		return list;
-	}
-
-	@Override
-	public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-			params.put("value", value);
-
-			if (!field.equalsIgnoreCase("__search__")) {
-				params.put("field", field);
-			}
-
-			final DbBrowsableField f = findBrowseField(field);
-			if (f == null || f.isText()) {
-				params.put("delimeter", "'");
-			}
-
-			final SAXReader reader = new SAXReader();
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("searchRepoInterfaces.sql.st", params);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, SearchInterfacesEntry>() {
-
-				@Override
-				public SearchInterfacesEntry apply(final String s) {
-					final SearchInterfacesEntry iface = new SearchInterfacesEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						final String country = doc.valueOf("/ROW/FIELD[@name='country']");
-
-						iface.setRepoId(doc.valueOf("/ROW/FIELD[@name='repoid']"));
-						iface.setRepoCountry(StringUtils.isEmpty(country) ? "-" : country.toUpperCase());
-						iface.setRepoName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='reponame']")));
-						iface.setRepoPrefix(doc.valueOf("/ROW/FIELD[@name='repoprefix']"));
-
-						iface.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						iface.setActive(Boolean.valueOf(doc.valueOf("/ROW/FIELD[@name='active']")));
-						iface.setProtocol(doc.valueOf("/ROW/FIELD[@name='protocol']"));
-						iface.setCompliance(doc.valueOf("/ROW/FIELD[@name='compliance']"));
-						iface.setAggrDate(doc.valueOf("/ROW/FIELD[@name='aggrdate']"));
-						iface.setAggrTotal(NumberUtils.toInt(doc.valueOf("/ROW/FIELD[@name='aggrtotal']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return iface;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error searching field " + field + " - value: " + value, e);
-		}
-		return Lists.newArrayList();
-	}
-
-	private DbBrowsableField findBrowseField(final String id) {
-		for (DbBrowsableField f : getBrowsableFields()) {
-			if (f.getId().equals(id)) { return f; }
-		}
-		return null;
-	}
-
-	@Override
-	public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-
-		try {
-			final Iterable<String> iter = datasourceManagerClients.searchSQL("findReposMap.sql.st", null);
-			return Lists.newArrayList(Iterables.transform(iter, new Function<String, RepositoryMapEntry>() {
-
-				@Override
-				public RepositoryMapEntry apply(final String s) {
-					final RepositoryMapEntry r = new RepositoryMapEntry();
-					try {
-						final Document doc = reader.read(new StringReader(s));
-						r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-						r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-						r.setLat(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lat']"), 0));
-						r.setLng(NumberUtils.toFloat(doc.valueOf("/ROW/FIELD[@name='lng']"), 0));
-					} catch (Exception e) {
-						log.error(e);
-					}
-					return r;
-				}
-			}));
-		} catch (Exception e) {
-			log.error("Error obtaing repo map entries", e);
-		}
-		return Lists.newArrayList();
-	}
-
-	@Override
-	public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("type", type);
-		final List<SimpleDatasourceDesc> list = Lists.newArrayList();
-		try {
-			final SAXReader reader = new SAXReader();
-			for (String s : datasourceManagerClients.searchSQL("simpleFindRepos.sql.st", params)) {
-				final Document doc = reader.read(new StringReader(s));
-				final SimpleDatasourceDesc r = new SimpleDatasourceDesc();
-				r.setId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setOrigId(doc.valueOf("/ROW/FIELD[@name='id']"));
-				r.setName(StringEscapeUtils.unescapeXml(doc.valueOf("/ROW/FIELD[@name='name']")));
-				for (Object o : doc.selectNodes("/ROW/FIELD[@name='apis']/ITEM")) {
-					r.getApis().add(((Node) o).getText());
-				}
-				r.setValid(true); // TODO
-				r.setTypology(type);
-				list.add(r);
-			}
-			Collections.sort(list);
-		} catch (Exception e) {
-			log.error("Error listing repos", e);
-		}
-		return list;
-	}
-
-	public List<DbBrowsableField> getBrowsableFields() {
-		return browsableFields;
-	}
-
-	@Required
-	public void setBrowsableFields(final List<DbBrowsableField> browsableFields) {
-		this.browsableFields = browsableFields;
-	}
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DbBrowsableField.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import eu.dnetlib.enabling.datasources.rmi.BrowsableField;
-
-public class DbBrowsableField extends BrowsableField {
-
-	private String sql;
-
-	private boolean text = true;
-
-	public DbBrowsableField() {
-		super();
-	}
-
-	public DbBrowsableField(final String id, final String label) {
-		super(id, label);
-	}
-
-	public DbBrowsableField(final String id, final String label, final String sql) {
-		super(id, label);
-		this.sql = sql;
-	}
-
-	public String getSql() {
-		return sql;
-	}
-
-	public void setSql(final String sql) {
-		this.sql = sql;
-	}
-
-	public boolean isText() {
-		return text;
-	}
-
-	public void setText(boolean text) {
-		this.text = text;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceParams.java	(nonexistent)
@@ -1,5 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-public enum DatasourceParams {
-	baseUrl, iis_processing_workflow, metadata_identifier_path
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceFunctions.java	(nonexistent)
@@ -1,359 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Node;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.datasources.rmi.IfaceDesc;
-
-public class DatasourceFunctions {
-
-	private static final Log log = LogFactory.getLog(DatasourceFunctions.class); // NOPMD by marko on 11/24/08 5:02 PM
-
-	private static Resource ifaceTemplate = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_interface.st");
-
-	public static String buildInterface(final String infopackage) {
-		final IfaceDesc iface = generateIfaceDesc(infopackage);
-
-		if (iface != null) {
-			final StringTemplate i = getTemplate(ifaceTemplate);
-			i.setAttribute("ifc", iface);
-
-			return i.toString();
-		} else {
-			return "";
-		}
-	}
-
-	public static IfaceDesc generateIfaceDesc(final String infopackage) {
-		if (infopackage == null || infopackage.trim().isEmpty()) { return null; }
-
-		final IfaceDesc iface = new IfaceDesc();
-		iface.setId(getValueBetween(infopackage, null, "<==1==>"));
-		iface.setTypology(getValueBetween(infopackage, "<==1==>", "<==2==>"));
-		iface.setCompliance(getValueBetween(infopackage, "<==2==>", "<==3==>"));
-		iface.setContentDescription(getValueBetween(infopackage, "<==3==>", "<==4==>"));
-		iface.setAccessProtocol(getValueBetween(infopackage, "<==4==>", "<==5==>"));
-		iface.setActive(Boolean.parseBoolean(getValueBetween(infopackage, "<==5==>", "<==6==>")));
-		iface.setRemovable(Boolean.parseBoolean(getValueBetween(infopackage, "<==6==>", "<==7==>")));
-
-		final Map<String, String> accessParams = Maps.newHashMap();
-		final Map<String, String> extraParams = Maps.newHashMap();
-
-		for (String param : parseParams(getValueBetween(infopackage, "<==7==>", null))) {
-
-			final String[] arr = param.split("###");
-
-			if (arr.length == 3) {
-				final boolean accessParam = Boolean.parseBoolean(arr[0].trim());
-				final String paramName = arr[1].trim();
-				final String paramValue = arr.length > 2 ? arr[2].trim() : "";
-
-				if (accessParam) {
-					if (paramName.equals(DatasourceParams.baseUrl.toString())) {
-						iface.setBaseUrl(paramValue);
-					} else {
-						accessParams.put(paramName, paramValue);
-					}
-				} else {
-					extraParams.put(paramName, paramValue);
-				}
-			} else {
-				log.debug("Invalid Datasource Parameter");
-			}
-		}
-
-		iface.setAccessParams(accessParams);
-		iface.setExtraFields(extraParams);
-
-		return iface;
-	}
-
-	private static String getValueBetween(final String s, final String pre, final String post) {
-		if (pre == null && post == null) {
-			return StringEscapeUtils.escapeXml(s);
-		} else if (pre == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBefore(s, post));
-		} else if (post == null) {
-			return StringEscapeUtils.escapeXml(StringUtils.substringAfter(s, pre));
-		} else {
-			return StringEscapeUtils.escapeXml(StringUtils.substringBetween(s, pre, post));
-		}
-	}
-
-	private static Iterable<String> parseParams(final String s) {
-		return Splitter.on("@@@").omitEmptyStrings().trimResults().split(s);
-	}
-
-	private static StringTemplate getTemplate(final Resource res) {
-		try {
-			return new StringTemplate(IOUtils.toString(res.getInputStream()));
-		} catch (IOException e) {
-			log.error("unable to get template", e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	public static String asSqlValue(final String s) {
-		return s == null ? "NULL" : "'" + StringEscapeUtils.escapeSql(s) + "'";
-	}
-
-	public static String asSqlValue(final Boolean b) {
-		return b == null ? "NULL" : b.toString();
-	}
-
-	private static String asSqlValue(final Double d) {
-		return d == null ? "NULL" : d.toString();
-	}
-
-	private static Object asSqlValue(final Date date) {
-		if (date == null) { return "NULL"; }
-		final long millis = date.getTime();
-		final java.sql.Date sqlDate = new java.sql.Date(millis);
-		return "'" + sqlDate.toString() + "'";
-	}
-
-	public static boolean verifyCompliance(final Document doc) {
-
-		for (Object o : doc.selectNodes("//INTERFACE")) {
-			final String compliance = ((Node) o).valueOf("./INTERFACE_EXTRA_FIELD[@name='" + DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD + "']");
-			if (!StringUtils.isEmpty(compliance)) {
-				if (!"unknown".equalsIgnoreCase(compliance) && !"notCompatible".equalsIgnoreCase(compliance)) { return true; }
-			} else {
-				final String compliance2 = ((Node) o).valueOf("@compliance");
-				if (!"unknown".equalsIgnoreCase(compliance2) && !"notCompatible".equalsIgnoreCase(compliance2)) { return true; }
-			}
-		}
-
-		return false;
-	}
-
-	@SuppressWarnings("unchecked")
-	public static DatasourceDesc xmlToDatasourceDesc(final Document doc) throws DatasourceManagerServiceException {
-
-		final DatasourceDesc ds = new DatasourceDesc();
-
-		ds.setId(findValue(doc, "id", String.class));
-		ds.setOfficialName(findValue(doc, "officialname", String.class));
-		ds.setEnglishName(findValue(doc, "englishname", String.class));
-		ds.setWebsiteUrl(findValue(doc, "websiteurl", String.class));
-		ds.setLogoUrl(findValue(doc, "logourl", String.class));
-		ds.setCountryCode(findValue(doc, "countrycode", String.class));
-		ds.setCountryName(findValue(doc, "countryname", String.class));
-		ds.setOrganization(findValue(doc, "organization", String.class));
-		ds.setContactEmail(findValue(doc, "contactemail", String.class));
-		ds.setLatitude(findValue(doc, "latitude", Double.class));
-		ds.setLongitude(findValue(doc, "longitude", Double.class));
-		ds.setTimezone(findValue(doc, "timezone", Double.class));
-		ds.setNamespacePrefix(findValue(doc, "namespaceprefix", String.class));
-		ds.setOdNumberOfItems(findValue(doc, "od_numberofitems", String.class));
-		ds.setOdNumberOfItemsDate(findValue(doc, "od_numberofitemsdate", String.class));
-		ds.setOdPolicies(findValue(doc, "od_policies", String.class));
-		ds.setOdLanguages(findValue(doc, "od_languages", String.class));
-		ds.setOdContentTypes(findValue(doc, "od_contenttypes", String.class));
-		ds.setCollectedFrom(findValue(doc, "collectedfrom", String.class));
-		ds.setInferred(findValue(doc, "inferred", Boolean.class));
-		ds.setDeletedByInference(findValue(doc, "deletedbyinference", Boolean.class));
-		ds.setTrust(findValue(doc, "trust", Double.class));
-		ds.setInferenceProvenance(findValue(doc, "inferenceprovenance", String.class));
-		ds.setDateOfValidation(findValue(doc, "dateofvalidation", Date.class));
-		ds.setRegisteredBy(findValue(doc, "registeredby", String.class));
-		ds.setDatasourceClass(findValue(doc, "datasourceclass", String.class));
-		ds.setProvenanceActionClass(findValue(doc, "provenanceactionclass", String.class));
-		ds.setDateOfCollection(findValue(doc, "dateofcollection", Date.class));
-		ds.setTypology(findValue(doc, "typology", String.class));
-		ds.setActivationId(findValue(doc, "activationid", String.class));
-		ds.setMergehomonyms(findValue(doc, "mergehomonyms", Boolean.class));
-		ds.setDescription(findValue(doc, "description", String.class));
-		ds.setReleaseStartDate(findValue(doc, "releasestartdate", Date.class));
-		ds.setReleaseEndDate(findValue(doc, "releaseenddate", Date.class));
-		ds.setMissionStatementUrl(findValue(doc, "missionstatementurl", String.class));
-		ds.setDataProvider(findValue(doc, "dataprovider", Boolean.class));
-		ds.setServiceProvider(findValue(doc, "serviceprovider", Boolean.class));
-		ds.setDatabaseAccessType(findValue(doc, "databaseaccesstype", String.class));
-		ds.setDataUploadType(findValue(doc, "datauploadtype", String.class));
-		ds.setDatabaseAccessRestriction(findValue(doc, "databaseaccessrestriction", String.class));
-		ds.setDataUploadRestriction(findValue(doc, "datauploadrestriction", String.class));
-		ds.setVersioning(findValue(doc, "versioning", Boolean.class));
-		ds.setCitationGuidelineUrl(findValue(doc, "citationguidelineurl", String.class));
-		ds.setQualityManagementKind(findValue(doc, "qualitymanagementkind", String.class));
-		ds.setPidSystems(findValue(doc, "pidsystems", String.class));
-		ds.setCertificates(findValue(doc, "certificates", String.class));
-		ds.setAggregator(findValue(doc, "aggregator", String.class));
-		ds.setIssn(findValue(doc, "issn", String.class));
-		ds.setEissn(findValue(doc, "eissn", String.class));
-		ds.setLissn(findValue(doc, "lissn", String.class));
-		ds.setInterfaces(findValue(doc, "accessinfopackage", List.class));
-
-		return ds;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T findValue(final Document doc, final String elem, final Class<T> clazz) throws DatasourceManagerServiceException {
-
-		if (clazz == List.class) {
-			if (elem.equalsIgnoreCase("accessinfopackage")) {
-				final List<IfaceDesc> ifaces = Lists.newArrayList();
-				for (Object o : doc.selectNodes("//FIELD[@name='accessinfopackage']/ITEM")) {
-					final IfaceDesc ifaceDesc = generateIfaceDesc(((Node) o).getText());
-					if (ifaceDesc != null) {
-						ifaces.add(ifaceDesc);
-					}
-				}
-				return (T) ifaces;
-			} else {
-				throw new DatasourceManagerServiceException("Invalid List element " + elem);
-			}
-		} else {
-			final String val = doc.valueOf("//FIELD[@name='" + elem + "' and not(@isNull='true')]");
-
-			if (clazz == String.class) {
-				return (T) val;
-			} else if (val == null || val.isEmpty()) {
-				return null;
-			} else if (clazz == Boolean.class) {
-				return (T) new Boolean(val);
-			} else if (clazz == Double.class) {
-				return (T) new Double(val);
-			} else if (clazz == Date.class) {
-				try {
-					return (T) new SimpleDateFormat("yyyy-MM-dd").parse(val);
-				} catch (ParseException e) {
-					throw new DatasourceManagerServiceException("Invalid date: " + val);
-				}
-			} else {
-				throw new DatasourceManagerServiceException("Invalid type " + clazz + " for element " + elem);
-			}
-		}
-
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final DatasourceDesc ds) {
-		final Map<String, Object> map = Maps.newHashMap();
-		map.put("id", asSqlValue(ds.getId()));
-		map.put("officialName", asSqlValue(ds.getOfficialName()));
-		map.put("englishName", asSqlValue(ds.getEnglishName()));
-		map.put("websiteUrl", asSqlValue(ds.getWebsiteUrl()));
-		map.put("logoUrl", asSqlValue(ds.getLogoUrl()));
-		map.put("countryCode", asSqlValue(ds.getCountryCode()));
-		map.put("countryName", asSqlValue(ds.getCountryName()));
-		map.put("organization", asSqlValue(ds.getOrganization()));
-		map.put("contactEmail", asSqlValue(ds.getContactEmail()));
-		map.put("latitude", asSqlValue(ds.getLatitude()));
-		map.put("longitude", asSqlValue(ds.getLongitude()));
-		map.put("timezone", asSqlValue(ds.getTimezone()));
-		map.put("namespacePrefix", asSqlValue(ds.getNamespacePrefix()));
-		map.put("odNumberOfItems", asSqlValue(ds.getOdNumberOfItems()));
-		map.put("odNumberOfItemsDate", asSqlValue(ds.getOdNumberOfItemsDate()));
-		map.put("odPolicies", asSqlValue(ds.getOdPolicies()));
-		map.put("odLanguages", asSqlValue(ds.getOdLanguages()));
-		map.put("odContentTypes", asSqlValue(ds.getOdContentTypes()));
-		map.put("collectedFrom", asSqlValue(ds.getCollectedFrom()));
-		map.put("inferred", asSqlValue(ds.isInferred()));
-		map.put("deletedByInference", asSqlValue(ds.isDeletedByInference()));
-		map.put("trust", asSqlValue(ds.getTrust()));
-		map.put("inferenceProvenance", asSqlValue(ds.getInferenceProvenance()));
-		map.put("dateOfValidation", asSqlValue(ds.getDateOfValidation()));
-		map.put("registeredBy", asSqlValue(ds.getRegisteredBy()));
-		map.put("datasourceClass", asSqlValue(ds.getDatasourceClass()));
-		map.put("provenanceActionClass", asSqlValue(ds.getProvenanceActionClass()));
-		map.put("dateOfCollection", asSqlValue(ds.getDateOfCollection()));
-		map.put("typology", asSqlValue(ds.getTypology()));
-		map.put("activationId", asSqlValue(ds.getActivationId()));
-		map.put("mergehomonyms", asSqlValue(ds.isMergehomonyms()));
-		map.put("description", asSqlValue(ds.getDescription()));
-		map.put("releaseStartDate", asSqlValue(ds.getReleaseStartDate()));
-		map.put("releaseEndDate", asSqlValue(ds.getReleaseEndDate()));
-		map.put("missionStatementUrl", asSqlValue(ds.getMissionStatementUrl()));
-		map.put("dataProvider", asSqlValue(ds.isDataProvider()));
-		map.put("serviceProvider", asSqlValue(ds.isServiceProvider()));
-		map.put("databaseAccessType", asSqlValue(ds.getDatabaseAccessType()));
-		map.put("dataUploadType", asSqlValue(ds.getDataUploadType()));
-		map.put("databaseAccessRestriction", asSqlValue(ds.getDatabaseAccessRestriction()));
-		map.put("dataUploadRestriction", asSqlValue(ds.getDataUploadRestriction()));
-		map.put("versioning", asSqlValue(ds.isVersioning()));
-		map.put("citationGuidelineUrl", asSqlValue(ds.getCitationGuidelineUrl()));
-		map.put("qualityManagementKind", asSqlValue(ds.getQualityManagementKind()));
-		map.put("pidSystems", asSqlValue(ds.getPidSystems()));
-		map.put("certificates", asSqlValue(ds.getCertificates()));
-		map.put("aggregator", asSqlValue(ds.getAggregator()));
-		map.put("issn", asSqlValue(ds.getIssn()));
-		map.put("eissn", asSqlValue(ds.getEissn()));
-		map.put("lissn", asSqlValue(ds.getLissn()));
-
-		final ArrayList<Map<String, Object>> ifaces = new ArrayList<Map<String, Object>>();
-
-		if (ds.getInterfaces() != null) {
-
-			for (IfaceDesc iface : ds.getInterfaces()) {
-				if (iface.getId() != null && !iface.getId().trim().isEmpty()) {
-					final Map<String, Object> mapIface = Maps.newHashMap();
-
-					mapIface.put("id", asSqlValue(iface.getId()));
-					mapIface.put("typology", asSqlValue(iface.getTypology()));
-					mapIface.put("compliance", asSqlValue(iface.getCompliance()));
-					mapIface.put("contentDescription", asSqlValue(iface.getContentDescription()));
-					mapIface.put("accessProtocol", asSqlValue(iface.getAccessProtocol()));
-					mapIface.put("baseUrl", asSqlValue(iface.getBaseUrl()));
-
-					final Map<String, String> extraFields = Maps.newHashMap();
-					if (iface.getExtraFields() != null) {
-						for (String k : iface.getExtraFields().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								extraFields.put(asSqlValue(k), asSqlValue(iface.getExtraFields().get(k)));
-							}
-						}
-					}
-					mapIface.put("extraFields", extraFields);
-
-					final Map<String, String> accessParams = Maps.newHashMap();
-					if (iface.getAccessParams() != null) {
-						for (String k : iface.getAccessParams().keySet()) {
-							if (k != null && !k.trim().isEmpty()) {
-								accessParams.put(asSqlValue(k), asSqlValue(iface.getAccessParams().get(k)));
-							}
-						}
-					}
-					mapIface.put("accessParams", accessParams);
-
-					ifaces.add(mapIface);
-				}
-			}
-
-			map.put("interfaces", ifaces);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Object> asMapOfSqlValues(final Map<String, String> input) {
-		final Map<String, Object> map = Maps.newHashMap();
-		for (Map.Entry<String, String> e : input.entrySet()) {
-			map.put(asSqlValue(e.getKey()), asSqlValue(e.getValue()));
-		}
-		return map;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java	(nonexistent)
@@ -1,298 +0,0 @@
-package eu.dnetlib.enabling.datasources;
-
-import java.io.StringReader;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import eu.dnetlib.enabling.database.rmi.DatabaseService;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceDesc;
-import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerServiceException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
-import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
-import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
-import eu.dnetlib.enabling.locators.UniqueServiceLocator;
-import eu.dnetlib.enabling.resultset.client.ResultSetClientFactory;
-import eu.dnetlib.miscutils.functional.UnaryFunction;
-import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
-
-public class DatasourceManagerClients {
-
-	private String db;
-
-	private UniqueServiceLocator serviceLocator;
-
-	private ResultSetClientFactory resultSetClientFactory;
-
-	private static final Resource xslt = new ClassPathResource("/eu/dnetlib/enabling/datasources/repo_2_is.xslt");
-
-	private static final String REPOSITORY_SERVICE_RESOURCE_TYPE = "RepositoryServiceResourceType";
-
-	private static final Log log = LogFactory.getLog(DatasourceManagerClients.class);
-
-	private static final String TMPLS_BASEDIR = "/eu/dnetlib/enabling/datasources/";
-
-	public String findDatasourceId(final String profileId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(
-					"/*[.//RESOURCE_IDENTIFIER/@value='" + profileId + "']//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text()");
-		} catch (Exception e) {
-			log.error("Error finding dsId of profile " + profileId, e);
-			throw new DatasourceManagerServiceException("Error finding dsId of profile " + profileId, e);
-		}
-	}
-
-	public String getDatasourceProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			return serviceLocator.getService(ISLookUpService.class)
-					.getResourceProfileByQuery(
-							"collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')/*[.//EXTRA_FIELDS/FIELD[./key='OpenAireDataSourceId']/value/text() = '"
-									+ dsId + "']");
-		} catch (Exception e) {
-			return null;
-		}
-	}
-
-	public boolean deleteProfile(final String dsId) throws DatasourceManagerServiceException {
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-				serviceLocator.getService(ISRegistryService.class).deleteProfile(profId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error deleting profile", e);
-			throw new DatasourceManagerServiceException("Error deleting profile", e);
-		}
-	}
-
-	public boolean regenerateProfile(final String dsId) throws DatasourceManagerServiceException {
-
-		try {
-			final SAXReader reader = new SAXReader();
-
-			final List<String> list = getTransformedDatasourcesByCondition("ds.id= '" + dsId + "'", new ApplyXslt(xslt));
-
-			if (list.size() != 1) { throw new DatasourceManagerServiceException("Illegal number of datasource with id " + dsId + ", size: " + list.size()); }
-
-			final Document doc = reader.read(new StringReader(list.get(0)));
-
-			final ISRegistryService registry = serviceLocator.getService(ISRegistryService.class);
-
-			final String profile = getDatasourceProfile(dsId);
-
-			if (profile != null) {
-				final Document docOld = reader.read(new StringReader(profile));
-				final String profId = docOld.valueOf("//RESOURCE_IDENTIFIER/@value");
-
-				doc.selectSingleNode("//RESOURCE_IDENTIFIER/@value").setText(profId);
-
-				registry.updateProfile(profId, doc.asXML(), REPOSITORY_SERVICE_RESOURCE_TYPE);
-				log.info("Profile " + profId + " UPDATED for ds " + dsId);
-			} else {
-				final String profId = registry.registerProfile(doc.asXML());
-				log.info("Valid Profile " + profId + " REGISTERED for ds " + dsId);
-			}
-			return true;
-		} catch (Exception e) {
-			log.error("Error saving profile: ", e);
-			throw new DatasourceManagerServiceException("Error regenerating profile", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sql) {
-		final W3CEndpointReference epr = serviceLocator.getService(DatabaseService.class).searchSQL(getDb(), sql);
-		return resultSetClientFactory.getClient(epr);
-	}
-
-	public boolean updateSQL(final String dsId, final String sql, final boolean delete, final boolean updateprofile) throws DatasourceManagerServiceException {
-		log.debug("Executing query SQL: " + sql);
-		if (serviceLocator.getService(DatabaseService.class).updateSQL(getDb(), sql) && updateprofile) {
-			if (delete) {
-				return deleteProfile(dsId);
-			} else {
-				return regenerateProfile(dsId);
-			}
-		}
-		return false;
-	}
-
-	public boolean updateSQL(final String dsId, final String sqlTemplate, final Map<String, Object> params, final boolean delete, final boolean updateProfile)
-			throws DatasourceManagerServiceException {
-
-		verifyParams(params.values());
-		verifyParams(params.keySet().toArray());
-
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			st.setAttributes(params);
-			return updateSQL(dsId, st.toString(), delete, updateProfile);
-		} catch (Exception e) {
-			log.error("Error in updateSQL", e);
-			throw new DatasourceManagerServiceException("Error in updateSQL", e);
-		}
-	}
-
-	public List<DatasourceDesc> getDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		final SAXReader reader = new SAXReader();
-		final List<DatasourceDesc> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				final Document doc = reader.read(new StringReader(s));
-				list.add(DatasourceFunctions.xmlToDatasourceDesc(doc));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-
-	}
-
-	private void verifyParams(final Object... params) throws DatasourceManagerServiceException {
-
-		final Pattern pattern = Pattern.compile("\\n");
-
-		for (Object p : params) {
-			log.debug("TESTING SQL PARAM:" + p);
-			if (p == null || p.toString().isEmpty()) {
-				log.error("Parameter null or empty");
-				throw new DatasourceManagerServiceException("Parameter null or empty");
-			} else if (pattern.matcher(p.toString()).matches()) {
-				log.error("Parameter [" + p + "] contains an invalid character");
-				throw new DatasourceManagerServiceException("Parameter [" + p + "] contains an invalid character");
-			} else {
-				log.debug("TEST OK");
-			}
-		}
-	}
-
-	private List<String> getTransformedDatasourcesByCondition(final String condition, final UnaryFunction<String, String> function)
-			throws DatasourceManagerServiceException {
-		final List<String> list = Lists.newArrayList();
-		try {
-			for (String s : getXmlDatasourcesByCondition(condition)) {
-				list.add(function.evaluate(s));
-			}
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-		return list;
-	}
-
-	private Iterable<String> getXmlDatasourcesByCondition(final String condition) throws DatasourceManagerServiceException {
-		try {
-			final Map<String, Object> params = Maps.newHashMap();
-
-			if (condition != null && !condition.trim().isEmpty()) {
-				params.put("condition", condition);
-			}
-			return searchSQL("getDatasources.sql.st", params);
-		} catch (Exception e) {
-			log.error("Error obtaining datasources from db", e);
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public Iterable<String> searchSQL(final String sqlTemplate, final Map<String, Object> params) throws DatasourceManagerServiceException {
-		try {
-			final Resource resource = new ClassPathResource(TMPLS_BASEDIR + sqlTemplate);
-			final StringTemplate st = new StringTemplate(IOUtils.toString(resource.getInputStream()));
-			if (params != null) {
-				st.setAttributes(params);
-			}
-
-			final String sql = st.toString();
-
-			log.debug("Executing SQL: " + sql);
-
-			return searchSQL(sql);
-		} catch (Exception e) {
-			log.error("Error executing sql", e);
-
-			throw new DatasourceManagerServiceException("Error obtaining datasources from db", e);
-		}
-	}
-
-	public boolean isDefinedParam(final String ifaceId, final String field) throws DatasourceManagerServiceException {
-		final Map<String, Object> params = Maps.newHashMap();
-		params.put("ifaceId", DatasourceFunctions.asSqlValue(ifaceId));
-		params.put("field", DatasourceFunctions.asSqlValue(field));
-
-		final List<String> list = Lists.newArrayList(searchSQL("searchApiCollectionParam.sql.st", params));
-
-		return !list.isEmpty();
-	}
-
-	public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
-		final String xquery = "/*[.//DATAPROVIDER/@interface='" + ifaceId + "' and .//SCHEDULING/@enabled='true']//CRON/text()";
-		try {
-			final String cronExpression = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xquery);
-			final CronExpression cron = new CronExpression(cronExpression);
-			return cron.getNextValidTimeAfter(new Date());
-		} catch (ISLookUpDocumentNotFoundException e) {
-			// When the value is not found a null value must be returned
-			return null;
-		} catch (ISLookUpException e) {
-			log.error("Error in xquery: " + xquery, e);
-			throw new DatasourceManagerServiceException("Error in xquery: " + xquery, e);
-		} catch (ParseException e) {
-			log.error("Error parsing cron expression", e);
-			throw new DatasourceManagerServiceException("Error parsing cron expression", e);
-		}
-	}
-
-	public String getDb() {
-		return db;
-	}
-
-	@Required
-	public void setDb(final String db) {
-		this.db = db;
-	}
-
-	public ResultSetClientFactory getResultSetClientFactory() {
-		return resultSetClientFactory;
-	}
-
-	@Required
-	public void setResultSetClientFactory(final ResultSetClientFactory resultSetClientFactory) {
-		this.resultSetClientFactory = resultSetClientFactory;
-	}
-
-	public UniqueServiceLocator getServiceLocator() {
-		return serviceLocator;
-	}
-
-	@Required
-	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
-		this.serviceLocator = serviceLocator;
-	}
-
-}
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/insertInterface.sql.st	(nonexistent)
@@ -1,27 +0,0 @@
-BEGIN;
-
-INSERT INTO 
-	api(_dnet_resource_identifier_, id, typologyclass, protocolclass, datasource, contentdescriptionclass, compatibilityclass, removable) 
-VALUES
-	($id$, $id$, $typology$, $protocol$, $datasource$, $description$, $compliance$, true);
-
-
--- baseUrl
-$if(baseUrl)$
-	INSERT INTO apicollections(param, original, api) VALUES	('baseUrl', $baseUrl$, $id$);
-$endif$
-
--- ACCESS PARAMS
-$accessParams.keys:{k|
-	INSERT INTO apicollections(param, original, api) VALUES ($k$, $accessParams.(k)$, $id$);
-}$
-
--- OTHER PARAMS
-$extraFields.keys:{k|
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($k$, $extraFields.(k)$, $id$, false);
-}$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $id$;
-
-COMMIT;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_2_is.xslt	(nonexistent)
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:dnet="eu.dnetlib.enabling.datasources.DatasourceFunctions"
-	exclude-result-prefixes="xsl dnet">
-
-	<xsl:template match="/">
-	
-		<RESOURCE_PROFILE>
-			<HEADER>
-				<RESOURCE_IDENTIFIER value="" />
-				<RESOURCE_TYPE value="RepositoryServiceResourceType" />
-				<RESOURCE_KIND value="RepositoryServiceResources" />
-				<RESOURCE_URI value="" />
-				<DATE_OF_CREATION value="" />
-				<PROTOCOL />
-			</HEADER>
-			<BODY>
-				<CONFIGURATION>
-		            <DATASOURCE_TYPE>
-		            	<xsl:value-of select="//FIELD[@name='datasourceclass']" />
-		            </DATASOURCE_TYPE>
-            		<DATASOURCE_ORIGINAL_ID provenance="OPENAIRE">
-            			<xsl:value-of select="//FIELD[@name='id']" />
-            		</DATASOURCE_ORIGINAL_ID>
-            		<DATASOURCE_AGGREGATED>false</DATASOURCE_AGGREGATED>
-            		<ENVIRONMENTS>
-                		<ENVIRONMENT>OPENAIRE</ENVIRONMENT>
-            		</ENVIRONMENTS>
-				
-					<TYPOLOGY><xsl:value-of select="//FIELD[@name='typology']" /></TYPOLOGY>
-					<MAX_SIZE_OF_DATASTRUCTURE>0</MAX_SIZE_OF_DATASTRUCTURE>
-					<AVAILABLE_DISKSPACE>0</AVAILABLE_DISKSPACE>
-					<MAX_NUMBER_OF_DATASTRUCTURE>0</MAX_NUMBER_OF_DATASTRUCTURE>
-					<OFFICIAL_NAME>
-						<xsl:value-of select="//FIELD[@name='officialname']" />
-					</OFFICIAL_NAME>
-					<ENGLISH_NAME>
-						<xsl:choose>
-							<xsl:when
-								test="//FIELD[@name='englishname' and (@isNull='true' or string-length(normalize-space(.)) = 0)]">
-								<xsl:value-of select="//FIELD[@name='officialname']" />
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='englishname']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</ENGLISH_NAME>
-					<ICON_URI>
-						<xsl:value-of select="//FIELD[@name='logourl']" />
-					</ICON_URI>
-					<COUNTRY>
-						<xsl:value-of select="//FIELD[@name='countrycode']" />
-					</COUNTRY>
-					<LOCATION>
-						<LONGITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='longitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='longitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LONGITUDE>
-						<LATITUDE>
-							<xsl:choose>
-								<xsl:when test="//FIELD[@name='latitude' and @isNull='true']">
-									0.0
-								</xsl:when>
-								<xsl:otherwise>
-									<xsl:value-of select="//FIELD[@name='latitude']" />
-								</xsl:otherwise>
-							</xsl:choose>
-						</LATITUDE>
-						<TIMEZONE>0.0</TIMEZONE>
-					</LOCATION>
-					<REPOSITORY_WEBPAGE>
-						<xsl:value-of select="//FIELD[@name='websiteurl']" />
-					</REPOSITORY_WEBPAGE>
-					<REPOSITORY_INSTITUTION>
-						<xsl:value-of select="//FIELD[@name='organization']" />
-					</REPOSITORY_INSTITUTION>
-					<ADMIN_INFO>
-						<xsl:value-of select="//FIELD[@name='contactemail']" />
-					</ADMIN_INFO>
-					<INTERFACES>
-					<xsl:for-each select="//FIELD[@name='accessinfopackage']/ITEM">
-						<xsl:value-of select="dnet:buildInterface(.)" disable-output-escaping="yes"/>
-					</xsl:for-each>
-					</INTERFACES>
-					<EXTRA_FIELDS>
-						<FIELD>
-							<key>OpenAireDataSourceId</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='id']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>NamespacePrefix</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='namespaceprefix']" />
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>VERIFIED</key>
-							<value>NO</value>
-						</FIELD>
-						<FIELD>
-							<key>aggregatorName</key>
-							<value><xsl:value-of select="//FIELD[@name='aggregator']" /></value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfValidation</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofvalidation']"/>
-							</value>
-						</FIELD>
-						<FIELD>
-							<key>dateOfCollection</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='dateofcollection']"/>
-							</value>
-						</FIELD>
-						
-						<FIELD>
-							<key>mergeHomonyms</key>
-							<value>
-								<xsl:value-of select="//FIELD[@name='mergehomonyms']"/>
-							</value>
-						</FIELD>
-						
-						<xsl:if test="string-length(normalize-space(//FIELD[@name='activationid'])) &gt; 0">
-							<FIELD>
-								<key>ACTID</key>
-								<value>
-									<xsl:value-of select="//FIELD[@name='activationid']"/>
-								</value>
-							</FIELD>
-						</xsl:if>					
-					</EXTRA_FIELDS>
-					<REGISTERED_BY><xsl:value-of select="//FIELD[@name='registeredby']"/></REGISTERED_BY>
-				</CONFIGURATION>
-				<STATUS>
-					<NUMBER_OF_OBJECTS>
-						<xsl:choose>
-							<xsl:when test="//FIELD[@name='od_numberofitems' and (@isNull='true' or normalize-space(text()) = '')]">
-								0
-							</xsl:when>
-							<xsl:otherwise>
-								<xsl:value-of select="//FIELD[@name='od_numberofitems']" />
-							</xsl:otherwise>
-						</xsl:choose>
-					</NUMBER_OF_OBJECTS>
-					<LAST_UPDATE value="{//FIELD[@name='now']}"/>
-				</STATUS>
-				<QOS>
-					<AVAILABILITY>0</AVAILABILITY>
-					<CAPACITY/>
-					<THROUGHPUT>0.0</THROUGHPUT>
-				</QOS>
-				<SECURITY_PARAMETERS />
-				<BLACKBOARD />
-			</BODY>
-		</RESOURCE_PROFILE>
-	</xsl:template>
-</xsl:stylesheet>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/repo_interface.st	(nonexistent)
@@ -1,5 +0,0 @@
-<INTERFACE id="$ifc.id$" label="$ifc.typology$ ($ifc.compliance$)" typology="$ifc.typology$" compliance="$ifc.compliance$" active="$ifc.active$" removable="$ifc.removable$" contentDescription="$ifc.contentDescription$">
-	<ACCESS_PROTOCOL $ifc.accessParams.keys:{k| $k$="$ifc.accessParams.(k)$"};separator=" "$>$ifc.accessProtocol$</ACCESS_PROTOCOL>
-	<BASE_URL>$ifc.baseUrl$</BASE_URL>
-	$ifc.extraFields.keys:{k|<INTERFACE_EXTRA_FIELD name="$k$">$ifc.extraFields.(k)$</INTERFACE_EXTRA_FIELD>}$
-</INTERFACE>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/findReposMap.sql.st	(nonexistent)
@@ -1,8 +0,0 @@
-SELECT
-	d.id           AS id,
-	d.officialname AS name,
-	d.latitude     AS lat,
-	d.longitude    AS lng
-FROM datasources d 
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE a.active = true AND d.latitude IS NOT NULL AND d.longitude IS NOT NULL
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateBulkApiCollections.sql.st	(nonexistent)
@@ -1,3 +0,0 @@
-$params.keys:{k|
-	UPDATE apicollections SET edited = $params.(k)$ WHERE api=$ifaceId$ AND lower(param)=lower($k$);
-}$
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateLevelOfCompliance.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET compatibilityclass = $level$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteOldExtraFields.sql.st	(nonexistent)
@@ -1 +0,0 @@
-DELETE FROM apicollections WHERE api = $ifaceId$ AND accessparam = false;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchApiCollectionParam.sql.st	(nonexistent)
@@ -1 +0,0 @@
-SELECT * FROM apicollections WHERE api = $ifaceId$ AND lower(param) = lower($field$)
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/searchRepoInterfaces.sql.st	(nonexistent)
@@ -1,60 +0,0 @@
-SELECT * FROM (SELECT
-	(array_agg(DISTINCT o.countryclass))[1] AS country,
-	(array_agg(DISTINCT o.legalname))[1]    AS organization,
-	d.id                                    AS repoid,
-	d.officialname                          AS reponame,
-	d.namespaceprefix                       AS repoprefix,
-	d.websiteurl                            AS repourl,
-	a.id                                    AS id,
-	a.active                                AS active,
-	a.protocolclass                         AS protocol,
-	a.typologyclass                         AS type,
-	CASE 
-		WHEN (accomp.edited IS NOT NULL) THEN accomp.edited 
-		WHEN (accomp.original IS NOT NULL) THEN accomp.original
-		ELSE a.compatibilityclass
-	END AS compliance,
-	CASE 
-		WHEN (acaggrdate.edited   IS NOT NULL) THEN acaggrdate.edited 
-		WHEN (acaggrdate.original IS NOT NULL) THEN acaggrdate.original
-		WHEN (acdowndate.edited   IS NOT NULL) THEN acdowndate.edited 
-		WHEN (acdowndate.original IS NOT NULL) THEN acdowndate.original
-		ELSE ''
-	END AS aggrdate,
-	CASE 
-		WHEN (acaggrtotal.edited   IS NOT NULL) THEN acaggrtotal.edited 
-		WHEN (acaggrtotal.original IS NOT NULL) THEN acaggrtotal.original
-		WHEN (acdowntotal.edited   IS NOT NULL) THEN acdowntotal.edited 
-		WHEN (acdowntotal.original IS NOT NULL) THEN acdowntotal.original
-		ELSE '0'
-	END AS aggrtotal
-FROM
-	api a 
-	LEFT OUTER JOIN datasources d               ON (a.datasource = d.id)
-	LEFT OUTER JOIN datasource_organization dao ON (d.id = dao.datasource)
-	LEFT OUTER JOIN organizations o             ON (dao.organization = o.id)
-	LEFT OUTER JOIN apicollections accomp       ON (a.id = accomp.api      AND accomp.param = 'overriding_compliance')
-	LEFT OUTER JOIN apicollections acaggrdate   ON (a.id = acaggrdate.api  AND acaggrdate.param = 'last_aggregation_date')
-	LEFT OUTER JOIN apicollections acaggrtotal  ON (a.id = acaggrtotal.api AND acaggrtotal.param = 'last_aggregation_total')
-	LEFT OUTER JOIN apicollections acdowndate   ON (a.id = acdowndate.api  AND acdowndate.param = 'last_download_date')
-	LEFT OUTER JOIN apicollections acdowntotal  ON (a.id = acdowntotal.api AND acdowntotal.param = 'last_download_total')
-	GROUP BY
-		d.id, d.officialname, d.namespaceprefix, d.websiteurl,
-		a.id, a.active, a.protocolclass, a.typologyclass, a.compatibilityclass,
-		accomp.edited, accomp.original,
-		acaggrdate.edited, acaggrdate.original, 
-		acdowndate.edited, acdowndate.original,
-		acaggrtotal.edited, acaggrtotal.original,
-		acdowntotal.edited, acdowntotal.original
-) AS t WHERE
-	$if(field)$
-		$field$ = $delimeter$$value$$delimeter$
-	$else$
-		repoid ILIKE '%$value$%' 
-		OR reponame ILIKE '%$value$%' 
-		OR repoprefix ILIKE '%$value$%' 
-		OR repourl ILIKE '%$value$%' 
-		OR organization ILIKE '%$value$%' 
-	$endif$
-
-
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateApiCollectionsRow.sql.st	(nonexistent)
@@ -1,16 +0,0 @@
-$if(update)$
-	$if(value)$
-		$if(preserveOriginal)$
-			UPDATE apicollections SET (edited, accessparam) = ($value$, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$else$
-			UPDATE apicollections SET (original, edited, accessparam) = ($value$, NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-		$endif$
-	$else$
-		UPDATE apicollections SET (edited, accessparam) = (NULL, $accessParam$) WHERE api=$ifaceId$ AND lower(param)=lower($field$);
-	$endif$
-$else$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, $accessParam$); 
-$endif$
-
--- FIX
-UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/addDatasource.sql.st	(nonexistent)
@@ -1,183 +0,0 @@
-BEGIN;
-
-INSERT INTO datasources (
-	_dnet_resource_identifier_,
-	id,
-	officialName,
-	englishName,
-	websiteUrl,
-	logoUrl,
-	contactEmail,
-	latitude,
-	longitude,
-	timezone,
-	namespacePrefix,
-	od_NumberOfItems,
-	od_NumberOfItemsDate,
-	od_Policies,
-	od_Languages,
-	od_ContentTypes,
-	collectedFrom,
-	inferred,
-	deletedByInference,
-	trust,
-	inferenceProvenance,
-	dateOfValidation,
-	registeredby,
-	datasourceClass,
-	provenanceActionClass,
-	dateOfCollection,
-	typology,
-	activationId,
-	mergehomonyms,
-	description,
-	releaseStartDate,
-	releaseEndDate,
-	missionStatementUrl,
-	dataProvider,
-	serviceProvider,
-	databaseAccessType,
-	dataUploadType,
-	databaseAccessRestriction,
-	dataUploadRestriction,
-	versioning,
-	citationGuidelineUrl,
-	qualityManagementKind,
-	pidSystems,
-	certificates,
-	aggregator,
-	issn,
-	eissn,
-	lissn
-) VALUES (
-	$id$,
-	$id$,
-	$officialName$,
-	$englishName$,
-	$websiteUrl$,
-	$logoUrl$,
-	$contactEmail$,
-	$latitude$,
-	$longitude$,
-	$timezone$,
-	$namespacePrefix$,
-	$odNumberOfItems$,
-	$odNumberOfItemsDate$,
-	$odPolicies$,
-	$odLanguages$,
-	$odContentTypes$,
-	$collectedFrom$,
-	$inferred$,
-	$deletedByInference$,
-	$trust$,
-	$inferenceProvenance$,
-	$dateOfValidation$,
-	$registeredBy$,
-	$datasourceClass$,
-	$provenanceActionClass$,
-	$dateOfCollection$,
-	$typology$,
-	$activationId$,
-	$mergehomonyms$,
-	$description$,
-	$releaseStartDate$,
-	$releaseEndDate$,
-	$missionStatementUrl$,
-	$dataProvider$,
-	$serviceProvider$,
-	$databaseAccessType$,
-	$dataUploadType$,
-	$databaseAccessRestriction$,
-	$dataUploadRestriction$,
-	$versioning$,
-	$citationGuidelineUrl$,
-	$qualityManagementKind$,
-	$pidSystems$,
-	$certificates$,
-	$aggregator$,
-	$issn$,
-	$eissn$,
-	$lissn$
-);
-
-$if(hasOrganization)$
-	INSERT INTO organizations (
-		_dnet_resource_identifier_,
-		id,
-		legalname,
-		countryclass
-	) VALUES (
-		$id$||'::'||$organization$,
-		$id$||'::'||$organization$,
-		$organization$,
-		$countryCode$
-	);
-	
-	INSERT INTO datasource_organization (
-		_dnet_resource_identifier_,
-		datasource,
-		organization
-	) VALUES (
-		$id$||'@@'||$id$||'::'||$organization$,
-		$id$,
-		$id$||'::'||$organization$
-	);
-$endif$
-
-
-
-$interfaces:{ifc|
-	INSERT INTO api (
-		_dnet_resource_identifier_,
-		id,
-		datasource, 
-		protocolclass, 
-		contentdescriptionclass,
-		removable,
-		typologyclass,
-		compatibilityclass
-	) VALUES (
-		$ifc.id$,
-		$ifc.id$,
-		$id$,
-		$ifc.accessProtocol$,
-		$ifc.contentDescription$,
-		true,
-		$ifc.typology$,
-		$ifc.compliance$
-	);
-	
-	$ifc.accessParams.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.accessParams.(p)$,
-			$ifc.id$,
-			true
-		);
-	}$
-	
-	$ifc.extraFields.keys:{p|
-		INSERT INTO apicollections (
-			_dnet_resource_identifier_,
-			param,
-			original,
-			api,
-			accessparam
-		) VALUES (
-			$ifc.id$||'@@'||$p$,
-			$p$,
-			$ifc.extraFields.(p)$,
-			$ifc.id$,
-			false
-		);
-	}$
-}$
-
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/simpleFindRepos.sql.st	(nonexistent)
@@ -1,15 +0,0 @@
-SELECT 
-	d.id                     AS id,
-	d.officialname           AS name,
-	array_agg(DISTINCT a.id) AS apis
-FROM
-	datasources d
-	LEFT OUTER JOIN api a ON (d.id = a.datasource)
-WHERE
-	datasourceclass = '$type$'
-GROUP BY 
-	d.id,
-	d.officialname
-ORDER BY
-	d.officialname
-	
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateActivationStatus.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET active = $active$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/overrideCompliance.sql.st	(nonexistent)
@@ -1,12 +0,0 @@
-$if(insert)$
-	INSERT INTO apicollections(param, original, api, accessparam) VALUES ($field$, $value$, $ifaceId$, false);
-	UPDATE apicollections SET _dnet_resource_identifier_ = api||'@@'||param WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(update)$
-	UPDATE apicollections SET original = $value$ WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
-
-$if(delete)$
-	DELETE FROM apicollections WHERE api = $ifaceId$ AND lower(param)=lower($field$);
-$endif$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/getDatasources.sql.st	(nonexistent)
@@ -1,132 +0,0 @@
-SELECT 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn,
-	(array_agg(o.legalname))[1] as organization,
-	(array_agg(ccl.code))[1] as countrycode,
-	(array_agg(ccl.name))[1] as countryname,
-	array_agg(distinct ag.accessinfopackage) as accessinfopackage,
-	to_char(now(), 'YYYY-MM-DDThh24:mi:ssZ') AS now
-	
-FROM datasources ds
-	LEFT OUTER JOIN datasource_organization dso ON ds.id = dso.datasource
-	LEFT OUTER JOIN organizations o ON dso.organization = o.id
-	LEFT OUTER JOIN class ccl ON ccl.code = o.countryclass
-	LEFT OUTER JOIN (
-			SELECT 	api.datasource, api.contentdescriptionclass, api.compatibilityclass,
-					COALESCE(api.id, '')||'<==1==>'||COALESCE(api.typologyclass, '')||'<==2==>'||COALESCE(api.compatibilityclass, '')||'<==3==>'||COALESCE(api.contentdescriptionclass,'')||'<==4==>'||COALESCE(api.protocolclass,'')||'<==5==>'||COALESCE(api.active,false)||'<==6==>'||COALESCE(api.removable,false)||'<==7==>'||array_to_string(array_agg(distinct COALESCE(ac.accessparam, true)||'###'||COALESCE(ac.param,'')||'###'||COALESCE(ac.value,'')||'###'), '@@@') AS accessinfopackage 
-			FROM api 
-			LEFT OUTER JOIN (
-				SELECT api, param, accessparam, CASE WHEN edited IS NULL THEN original ELSE edited END as value FROM apicollections
-			) AS ac ON (ac.api = api.id) 
-			GROUP BY 
-				api.id,
-				api.datasource,
-				api.contentdescriptionclass,
-				api.typologyclass,
-				api.compatibilityclass,
-				api.protocolclass,
-				api.active,
-				api.removable
-		) AS ag on (ag.datasource = ds.id)
-
-$if(condition)$
-	WHERE $condition$
-$endif$
-
-GROUP BY 
-	ds.id,
-	ds.officialname,
-	ds.englishname,
-	ds.websiteurl,
-	ds.logourl,
-	ds.contactemail,
-	ds.latitude,
-	ds.longitude,
-	ds.timezone,
-	ds.namespaceprefix,
-	ds.od_numberofitems, 
-	ds.od_numberofitemsdate,
-	ds.od_policies,
-	ds.od_languages, 
-	ds.od_contenttypes, 
-	ds.collectedfrom,
-	ds.inferred,
-	ds.deletedbyinference,
-	ds.trust,
-	ds.inferenceprovenance,
-	ds.dateofvalidation,
-	ds.registeredby,
-	ds.optional1,
-	ds.optional2,
-	ds.datasourceclass,
-	ds.provenanceactionclass,
-	ds.dateofcollection,
-	ds.typology,
-	ds.activationid, 
-	ds.mergehomonyms,
-	ds.description,
-	ds.releasestartdate,
-	ds.releaseenddate,
-	ds.missionstatementurl,
-	ds.dataprovider,
-	ds.serviceprovider,
-	ds.databaseaccesstype,
-	ds.datauploadtype,
-	ds.databaseaccessrestriction,
-	ds.datauploadrestriction,
-	ds.versioning,
-	ds.citationguidelineurl,
-	ds.qualitymanagementkind, 
-	ds.pidsystems,
-	ds.certificates, 
-	ds.aggregator,
-	ds.issn,
-	ds.eissn,
-	ds.lissn
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteDatasource.sql.st	(nonexistent)
@@ -1,5 +0,0 @@
-BEGIN;
-DELETE FROM apicollections USING api WHERE api=api.id AND api.datasource=$dsId$;
-DELETE FROM api WHERE datasource=$dsId$;
-DELETE FROM datasources WHERE id=$dsId$;
-COMMIT;
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaireplus-datasource-manager-service.xml	(nonexistent)
@@ -1,63 +0,0 @@
-<?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"
-	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://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
-                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
-
-	<bean id="datasourceManagerService" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerServiceImpl"
-		p:datasourceManagerClients-ref="datasourceManagerClients">
-		<property name="browsableFields">
-		<list>
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="country"
-					p:label="Datasource countries"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join datasources d on (a.datasource = d.id) left outer join datasource_organization dao on (d.id = dao.datasource) left outer join organizations o on (dao.organization = o.id) left outer join class c on (o.countryclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="type"
-					p:label="API typologies"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.typologyclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="protocol"
-					p:label="API protocols"
-					p:sql="select c.code as id, c.name as name, count(*) as count from api a left outer join class c on (a.protocolclass = c.code) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="compliance"
-					p:label="API compatibility levels"
-					p:sql="select c.code as id, c.name as name, count(*) from api a left outer join apicollections ac on (a.id = ac.api and ac.param = 'overriding_compliance') left outer join class c on (c.code = case when (ac.edited IS NOT NULL) then ac.edited when (ac.original IS NOT NULL) then ac.original else a.compatibilityclass end) group by c.code, c.name order by count desc" />
-				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
-					p:id="active"
-					p:label="API activation"
-					p:sql="select active as id, active as name, count(*) as count from api group by active order by count desc" 
-					p:text="false"/>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="datasourceManagerClients" 
-		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients" 
-		p:db="${dnet.openaire.db.name}"
-		p:serviceLocator-ref="uniqueServiceLocator"
-		p:resultSetClientFactory-ref="resultSetClientFactory" />
-
-	<!-- endpoints -->
-	<jaxws:endpoint id="datasourceManagerServiceEndpoint"
-		implementor="#datasourceManagerService"
-		implementorClass="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"
-		address="/datasourceManager" />
-
-	<template:instance name="serviceRegistrationManager"
-		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
-		t:name="datasourceManagerServiceRegistrationManager" t:service="datasourceManagerService"
-		t:endpoint="datasourceManagerServiceEndpoint" t:jobScheduler="jobScheduler" />
-		
-</beans>
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/updateContentDescription.sql.st	(nonexistent)
@@ -1 +0,0 @@
-UPDATE api SET contentdescriptionclass = $desc$ WHERE id = $ifaceId$ AND datasource = $dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteApiCollectionsRow.sql.st	(nonexistent)
@@ -1,9 +0,0 @@
-DELETE FROM 
-	apicollections 
-USING 
-	api 
-WHERE 
-	param=$field$ 
-	AND api=api.id 
-	AND api.id=$ifaceId$ 
-	AND api.datasource=$dsId$
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/src/main/resources/eu/dnetlib/enabling/datasources/deleteInterface.sql.st	(nonexistent)
@@ -1,7 +0,0 @@
-DO \$\$BEGIN
-	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
-	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
-	IF NOT FOUND THEN
-		raise exception 'Api not deleted'; 
-	END IF;
-END\$\$;
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5/pom.xml	(nonexistent)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-	<parent>
-    		<groupId>eu.dnetlib</groupId>
-	        <artifactId>dnet-parent</artifactId>
-                <version>1.0.0</version>
-  	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
-	<packaging>jar</packaging>
-	<version>5.0.5</version>
-	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaireplus-datasource-manager-service/tags/dnet-openaireplus-datasource-manager-service-5.0.5</developerConnection>
-	</scm>
-	<dependencies>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-blackboard-common</artifactId>
-			<version>[2.1.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>dnet-datasource-manager-rmi</artifactId>
-			<version>[4.0.0,5.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-enabling-database-api</artifactId>
-			<version>[1.0.0,2.0.0)</version>
-		</dependency>
-		<dependency>
-			<groupId>eu.dnetlib</groupId>
-			<artifactId>cnr-resultset-client</artifactId>
-			<version>[2.0.0,3.0.0)</version>
-		</dependency>
-		<dependency>
-  		    <groupId>junit</groupId>
-    		    <artifactId>junit</artifactId>
-      		    <version>${junit.version}</version>
-	            <scope>test</scope>
-    		</dependency>
-	</dependencies>
-</project>
Index: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5
===================================================================
--- modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5	(nonexistent)

Property changes on: modules/dnet-openaireplus-datasource-manager/tags/dnet-openaireplus-datasource-manager-service-5.0.5
___________________________________________________________________
Deleted: svn:ignore
## -1,5 +0,0 ##
-target
-.classpath
-.settings
-.project
-
Index: modules/dnet-openaireplus-datasource-manager/trunk/deploy.info
===================================================================
--- modules/dnet-openaireplus-datasource-manager/trunk/deploy.info	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/trunk/deploy.info	(revision 49077)
@@ -1 +1 @@
-{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager-service/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-openaireplus-datasource-manager-service"}
\ No newline at end of file
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager/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-openaireplus-datasource-manager"}
\ No newline at end of file
Index: modules/dnet-openaireplus-datasource-manager/trunk/pom.xml
===================================================================
--- modules/dnet-openaireplus-datasource-manager/trunk/pom.xml	(revision 49076)
+++ modules/dnet-openaireplus-datasource-manager/trunk/pom.xml	(revision 49077)
@@ -7,11 +7,11 @@
   	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>eu.dnetlib</groupId>
-	<artifactId>dnet-openaireplus-datasource-manager-service</artifactId>
+	<artifactId>dnet-openaireplus-datasource-manager</artifactId>
 	<packaging>jar</packaging>
 	<version>5.2.4-SNAPSHOT</version>
 	<scm>
-		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager-service/trunk</developerConnection>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-datasource-manager/trunk</developerConnection>
 	</scm>
 	<dependencies>
 		<dependency>
