Project

General

Profile

« Previous | Next » 

Revision 50268

some fix (maven versions, properties, appContexts)

View differences:

modules/dnet-msro-service/branches/dsm/pom.xml
10 10
	<groupId>eu.dnetlib</groupId>
11 11
	<artifactId>dnet-msro-service</artifactId>
12 12
	<packaging>jar</packaging>
13
	<version>3.1.24-SNAPSHOT</version>
13
	<version>3.2.0-SNAPSHOT</version>
14 14
	<scm>
15
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-msro-service/trunk</developerConnection>
15
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-msro-service/branches/dsm</developerConnection>
16 16
	</scm>
17 17
	<dependencies>
18 18
		<dependency>
modules/dnet-openaireplus-workflows/branches/dsm/pom.xml
10 10
	<groupId>eu.dnetlib</groupId>
11 11
	<artifactId>dnet-openaireplus-workflows</artifactId>
12 12
	<packaging>jar</packaging>
13
	<version>6.1.2-SNAPSHOT</version>
13
	<version>6.2.0-SNAPSHOT</version>
14 14

  
15 15
	<scm>
16 16
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-workflows/trunk</developerConnection>
modules/dnet-openaire-datasource-manager/trunk/src/main/java/eu/dnetlib/enabling/datasources/DatasourceManagerClients.java
218 218
		}
219 219
	}
220 220

  
221
	public UniqueServiceLocator getServiceLocator() {
222
		return serviceLocator;
223
	}
224

  
225
	@Required
226
	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
227
		this.serviceLocator = serviceLocator;
228
	}
229

  
230 221
	public NamedParameterJdbcTemplate getJdbcTemplate() {
231 222
		return jdbcTemplate;
232 223
	}
modules/dnet-openaire-datasource-manager/trunk/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaire-datasource-manager.xml
32 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 33
				<bean class="eu.dnetlib.enabling.datasources.DbBrowsableField"
34 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
					p:text="false" />
35
					p:sql="select a.active as term, count(*) as count from dsm_api a group by a.active order by count desc" />
37 36
			</list>
38 37
		</property>
39 38
	</bean>
......
42 41
		class="eu.dnetlib.enabling.datasources.DatasourceManagerClients">
43 42
		<property name="jdbcTemplate">
44 43
			<bean class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
45
				<property name="dataSource">
44
				<constructor-arg>
46 45
					<bean class="org.springframework.jdbc.datasource.DriverManagerDataSource"
47 46
						p:driverClassName="org.postgresql.Driver" p:url="${dnet.openaire.db.url}"
48 47
						p:username="${dnet.openaire.db.username}" p:password="${dnet.openaire.db.password}" />
49
				</property>
48
				</constructor-arg>
50 49
			</bean>
51 50
		</property>
52 51
	</bean>
modules/dnet-openaire-datasource-manager/trunk/src/main/resources/eu/dnetlib/enabling/datasources/applicationContext-dnet-openaire-datasource-manager.properties
1
dnet.openaire.db.url      = jdbc:postgresql://localhost:5432/dnet_openaire
2
dnet.openaire.db.username =
3
dnet.openaire.db.password =
modules/dnet-modular-repositories-ui/branches/dsm/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoApisEntryPointController.java
13 13
import org.dom4j.Document;
14 14
import org.dom4j.Node;
15 15
import org.dom4j.io.SAXReader;
16
import org.springframework.beans.factory.annotation.Autowired;
16 17
import org.springframework.beans.factory.annotation.Required;
17 18
import org.springframework.ui.ModelMap;
18 19

  
......
21 22
import com.google.common.collect.Sets;
22 23
import com.google.gson.Gson;
23 24

  
24
import eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService;
25
import eu.dnetlib.enabling.datasources.common.Api;
26
import eu.dnetlib.enabling.datasources.common.Datasource;
27
import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager;
25 28
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
26 29
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
27 30
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
......
41 44
	private String validatorAddress;
42 45
	private String validatorServiceAddress;
43 46

  
47
	@Autowired
48
	private LocalDatasourceManager<Datasource<?, ?>, Api<?>> dsManager;
49

  
44 50
	public class RepoHIWorkflow implements Comparable<RepoHIWorkflow> {
45 51

  
46
		private String id;
47
		private String name;
48
		private Set<String> ifaceTypes;
49
		private Set<String> compliances;
52
		private final String id;
53
		private final String name;
54
		private final Set<String> ifaceTypes;
55
		private final Set<String> compliances;
50 56
		private List<Pair<String, String>> fields;
51 57

  
52 58
		/**
......
123 129
			final Set<String> ifcTypes = Sets.newHashSet(Splitter.on(",").omitEmptyStrings().trimResults().split(type));
124 130
			final Set<String> compliances = Sets.newHashSet(Splitter.on(",").omitEmptyStrings().trimResults().split(compliance));
125 131

  
126
			final List<Pair<String, String>> fields = new ArrayList<Pair<String, String>>();
132
			final List<Pair<String, String>> fields = new ArrayList<>();
127 133
			for (final Object o : doc.selectNodes(".//FIELD")) {
128 134
				final Node currentNode = (Node) o;
129 135
				final String key = currentNode.valueOf("@name");
130 136
				final String value = currentNode.getText();
131
				fields.add(new Pair<String, String>(key, value));
137
				fields.add(new Pair<>(key, value));
132 138
			}
133 139
			return new RepoHIWorkflow(id, name, ifcTypes, compliances, fields);
134 140
		} catch (final Exception e) {
......
156 162
		final Gson gson = new Gson();
157 163
		map.addAttribute("availableRepohiWfs", gson.toJson(listRepoHIWorkflows()));
158 164
		map.addAttribute("compatibilityLevels", gson.toJson(repoUIUtils.fetchVocabularyTerms(getCompatibilityLevelsVocabulary())));
159
		map.addAttribute("browseFields", gson.toJson(serviceLocator.getService(DatasourceManagerService.class).listBrowsableFields()));
165
		map.addAttribute("browseFields", gson.toJson(dsManager.listBrowsableFields()));
160 166
		map.addAttribute("validatorAddress", getValidatorAddress());
161 167
		map.addAttribute("validatorServiceAddress", getValidatorServiceAddress());
162 168
	}
modules/dnet-modular-repositories-ui/branches/dsm/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/RepoUIUtils.java
26 26
import eu.dnetlib.data.collector.rmi.CollectorService;
27 27
import eu.dnetlib.data.collector.rmi.ProtocolDescriptor;
28 28
import eu.dnetlib.data.collector.rmi.ProtocolParameter;
29
import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants;
30 29
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
31 30
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
32 31
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
......
41 40
	@Resource
42 41
	private UniqueServiceLocator serviceLocator;
43 42

  
44
	private ClassPathResource getRepoApiQueryTmpl = new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st");
43
	private final ClassPathResource getRepoApiQueryTmpl =
44
			new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st");
45 45

  
46 46
	private static final Log log = LogFactory.getLog(RepoUIUtils.class);
47 47

  
48
	private Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap();
48
	private final Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap();
49 49

  
50 50
	public RepoInterfaceEntry getApi(final String repoId, final String ifaceId) throws Exception {
51 51
		final RepoInterfaceEntry ifc = new RepoInterfaceEntry();
......
64 64

  
65 65
		ifc.setId(doc.valueOf("/api/id"));
66 66
		ifc.setLabel(doc.valueOf("/api/label"));
67
		ifc.setRemovable((doc.valueOf("/api/removable").equalsIgnoreCase("true")) && doc.selectNodes("//metaWF").isEmpty());
67
		ifc.setRemovable(doc.valueOf("/api/removable").equalsIgnoreCase("true") && doc.selectNodes("//metaWF").isEmpty());
68 68
		ifc.setRepoId(doc.valueOf("/api/repo/@id"));
69 69
		ifc.setRepoName(StringEscapeUtils.unescapeHtml(doc.valueOf("/api/repo")));
70 70
		ifc.setRepoCountry(doc.valueOf("/api/repo/@country"));
modules/dnet-modular-repositories-ui/branches/dsm/src/main/java/eu/dnetlib/functionality/modular/ui/repositories/objects/RepoInterfaceEntry.java
1 1
package eu.dnetlib.functionality.modular.ui.repositories.objects;
2 2

  
3
import java.util.ArrayList;
3 4
import java.util.List;
4 5

  
5
import com.google.common.collect.Lists;
6
import eu.dnetlib.enabling.datasources.common.SearchApisEntry;
6 7

  
7
import eu.dnetlib.enabling.datasources.rmi.SearchInterfacesEntry;
8
public class RepoInterfaceEntry extends SearchApisEntry {
8 9

  
9
public class RepoInterfaceEntry extends SearchInterfacesEntry {
10

  
11 10
	private String label;
12 11
	private boolean removable = false;
13 12
	private String collDate = "";
......
19 18
	private String downloadObjId = "";
20 19
	private String repoType;
21 20
	private String email;
22
	private List<SimpleParamEntry> commonParams = Lists.newArrayList();
23
	private List<SimpleParamEntry> accessParams = Lists.newArrayList();
24
	private List<SimpleParamEntry> otherParams = Lists.newArrayList();
25
	private List<RepoMetaWfEntry> metaWFs = Lists.newArrayList();
21
	private List<SimpleParamEntry> commonParams = new ArrayList<>();
22
	private List<SimpleParamEntry> accessParams = new ArrayList<>();
23
	private List<SimpleParamEntry> otherParams = new ArrayList<>();
24
	private List<RepoMetaWfEntry> metaWFs = new ArrayList<>();
26 25

  
27 26
	public String getLabel() {
28 27
		return label;
......
140 139
		return removable;
141 140
	}
142 141

  
143
	public void setRemovable(boolean removable) {
142
	public void setRemovable(final boolean removable) {
144 143
		this.removable = removable;
145 144
	}
146 145

  

Also available in: Unified diff