Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
4
	xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:wsa="http://cxf.apache.org/ws/addressing"
5
	xmlns:p="http://www.springframework.org/schema/p" xmlns:http="http://cxf.apache.org/transports/http/configuration"
6
	xmlns:t="http://dnetlib.eu/springbeans/t" xmlns:template="http://dnetlib.eu/springbeans/template"
7
	xmlns:util="http://www.springframework.org/schema/util"
8
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
9
                                    http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd
10
                                    http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
11
                                    http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
12
                            http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
13
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
14
                            http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd">
15

    
16
	<bean id="localOpenaireDatasourceManager"
17
		class="eu.dnetlib.enabling.datasources.LocalOpenaireDatasourceManagerImpl"
18
		p:datasourceManagerClients-ref="datasourceManagerClients">
19
		<property name="browsableFields">
20
			<list>
21
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
22
					p:id="country" p:label="Datasource countries"
23
					p:sql="select o.country as term, count(*) as count from dsm_api a left outer join dsm_datasources d on (a.datasource = d.id) left outer join dsm_datasource_organization dao on (d.id = dao.datasource) left outer join dsm_organizations o on (dao.organization = o.id) group by o.country order by count desc" />
24
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
25
					p:id="type" p:label="API typologies"
26
					p:sql="select a.typology as term, count(*) as count from dsm_api a group by a.typology order by count desc" />
27
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
28
					p:id="protocol" p:label="API protocols"
29
					p:sql="select a.protocol as term, count(*) as count from dsm_api a group by a.protocol order by count desc" />
30
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
31
					p:id="compliance" p:label="API compatibility levels"
32
					p:sql="select coalesce(a.compatibility_override, a.compatibility) as term, count(*) as count from dsm_api a group by coalesce(a.compatibility_override, a.compatibility) order by count desc" />
33
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
34
					p:id="active" p:label="API activation"
35
					p:sql="select a.active as term, count(*) as count from dsm_api a group by a.active order by count desc" />
36
			</list>
37
		</property>
38
	</bean>
39

    
40
	<bean id="datasourceManagerClients"
41
		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients">
42
		<property name="jdbcTemplate">
43
			<bean class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
44
				<constructor-arg>
45
					<bean class="org.springframework.jdbc.datasource.DriverManagerDataSource"
46
						p:driverClassName="org.postgresql.Driver" p:url="${dnet.openaire.db.url}"
47
						p:username="${dnet.openaire.db.username}" p:password="${dnet.openaire.db.password}" />
48
				</constructor-arg>
49
			</bean>
50
		</property>
51
	</bean>
52

    
53
</beans>
(2-2/2)