Revision 49974
Added by Panagiotis Kanakakis over 6 years ago
- Api changes ( log messages, json parameters )
modules/uoa-repository-manager-gui/branches/newAPI/src/main/java/eu/dnetlib/repo/manager/server/services/RepositoryServiceImpl.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.repo.manager.server.services; |
2 | 2 |
|
3 |
import com.fasterxml.jackson.databind.DeserializationConfig; |
|
4 |
import com.fasterxml.jackson.databind.ObjectMapper; |
|
5 |
import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; |
|
3 | 6 |
import com.unboundid.util.Base64; |
4 | 7 |
import eu.dnetlib.domain.data.Repository; |
5 | 8 |
import eu.dnetlib.domain.data.RepositoryInterface; |
... | ... | |
299 | 302 |
LOGGER.debug("Storing repository with name: " + repo.getOfficialName()); |
300 | 303 |
//List<RepositoryInterface> interfacesToRegister = new ArrayList<RepositoryInterface>(); |
301 | 304 |
JSONObject params = new JSONObject(); |
302 |
params.put("datatype",mode); |
|
303 |
params.put("repository",repo); |
|
305 |
params.put("datatype", mode); |
|
306 |
ObjectMapper mapper = new ObjectMapper(); |
|
307 |
String json_repo = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(repo); |
|
308 |
params.put("repository", json_repo); |
|
304 | 309 |
repositoryApi.addRepository(params.toString()); |
305 | 310 |
LOGGER.debug("Repository with name: " + repo.getOfficialName() + " stored!"); |
306 |
} catch (Exception e) { |
|
307 |
LOGGER.error("Error while Storing repository with name: " + repo.getOfficialName(), e); |
|
308 |
e.printStackTrace(); |
|
311 |
}catch (Exception e) { |
|
312 |
LOGGER.error("Error while storing repository with name: " + repo.getOfficialName(), e); |
|
313 |
throw new RepositoryServiceException("Error while storing repository", RepositoryServiceException.ErrorCode.GENERAL_ERROR); |
|
314 |
} |
|
309 | 315 |
} |
310 |
} |
|
311 | 316 |
|
312 | 317 |
@Override |
313 | 318 |
public void updateRepositoryInformation(Repository repo) throws RepositoryServiceException { |
modules/uoa-repository-manager-gui/branches/newAPI/src/main/java/eu/dnetlib/repo/manager/server/services/ValidationServiceImpl.java | ||
---|---|---|
191 | 191 |
} |
192 | 192 |
} |
193 | 193 |
|
194 |
private void loadRulesets() { |
|
195 |
/* try { |
|
196 |
LOGGER.debug("loading rulesets"); |
|
197 |
for (RuleSet ruleSet : getValidationService().getRuleSets()) { |
|
198 |
if (ruleSet.getVisibility() != null && ruleSet.getVisibility().contains(deployEnvironment)) { |
|
199 |
String key = ""; |
|
200 |
if (ruleSet.getGuidelinesAcronym().matches("^openaire[1-9].0_data$")) |
|
201 |
key = Constants.VALIDATION_MODE_DATA; |
|
202 |
else if (ruleSet.getGuidelinesAcronym().matches("^openaire[1-9].0$") || ruleSet.getGuidelinesAcronym().equals("driver")) |
|
203 |
key = Constants.VALIDATION_MODE_LITERATURE; |
|
204 |
else if (ruleSet.getGuidelinesAcronym().matches("^openaire[1-9].0_cris$")) |
|
205 |
key = Constants.VALIDATION_MODE_CRIS; |
|
206 | 194 |
|
207 |
if (rulesetMap.containsKey(key)) |
|
208 |
rulesetMap.get(key).add(ruleSet); |
|
209 |
else { |
|
210 |
List<RuleSet> ruleSets = new ArrayList<RuleSet>(); |
|
211 |
ruleSets.add(ruleSet); |
|
212 |
rulesetMap.put(key, ruleSets); |
|
213 |
} |
|
214 |
} |
|
215 |
} |
|
216 |
} catch (Exception e) { |
|
217 |
LOGGER.error("Error getting rulesets", e); |
|
218 |
emailUtils.reportException(e); |
|
219 |
}*/ |
|
220 |
} |
|
221 |
|
|
222 | 195 |
private ValidatorService getValidationService() { |
223 | 196 |
return this.validatorServiceLocator.getService(); |
224 | 197 |
} |
modules/uoa-repository-manager-gui/branches/newAPI/src/main/webapp/WEB-INF/applicationContext.xml | ||
---|---|---|
27 | 27 |
|
28 | 28 |
<import resource="classpath*:/eu/dnetlib/gwt/**/springContext-widgets.xml"/> |
29 | 29 |
|
30 |
<import resource="classpath*:application-context.xml" /> |
|
31 | 30 |
<import resource="classpath*:/eu/dnetlib/repo/manager/server/config/springContext-repo-manager.xml"/> |
32 | 31 |
<import resource="classpath*:/eu/dnetlib/repos/springContext-repos-dms-cached.xml"/> |
33 | 32 |
<import resource="classpath*:application-context.xml" /> |
Also available in: Unified diff