Revision 58384
Added by Michele Artini about 4 years ago
RepoInternalController.java | ||
---|---|---|
81 | 81 |
@Value("${repo.ui.mdstore.sync.button}") |
82 | 82 |
private String syncButton; |
83 | 83 |
|
84 |
@Value("${repo.ui.mdstore.sync.desc}") |
|
84 |
@Value("${repo.ui.mdstore.sync.remote.desc}")
|
|
85 | 85 |
private String syncDesc; |
86 | 86 |
|
87 |
@Value("${repo.ui.mdstore.sync.api.baseUrl}") |
|
87 |
@Value("${repo.ui.mdstore.sync.remote.api.baseUrl}")
|
|
88 | 88 |
private String syncApiBaseUrl; |
89 | 89 |
|
90 |
@Value("${repo.ui.mdstore.sync.is.baseUrl}") |
|
90 |
@Value("${repo.ui.mdstore.sync.remote.is.baseUrl}")
|
|
91 | 91 |
private String syncISBaseUrl; |
92 | 92 |
|
93 |
@Value("${repo.ui.mdstore.sync.local.mongodb.url}") |
|
94 |
private String mongoUrl; |
|
95 |
|
|
93 | 96 |
@Value("${services.mdstore.mongodb.db}") |
94 | 97 |
private String mongoDb; |
95 | 98 |
|
96 |
@Value("${services.mdstore.mongodb.host}") |
|
97 |
private String mongoHost; |
|
98 |
|
|
99 |
@Value("${services.mdstore.mongodb.port}") |
|
100 |
private int mongoPort; |
|
101 |
|
|
102 | 99 |
private static final Log log = LogFactory.getLog(RepoInternalController.class); |
103 | 100 |
|
104 | 101 |
@RequestMapping(value = "/ui/browseRepoField.do") |
... | ... | |
246 | 243 |
map.addAttribute("syncDesc", syncDesc); |
247 | 244 |
map.addAttribute("syncISBaseUrl", syncISBaseUrl); |
248 | 245 |
map.addAttribute("mongoDB", mongoDb); |
249 |
map.addAttribute("mongoUrl", String.format("mongodb://%s:%s", mongoHost, mongoPort));
|
|
246 |
map.addAttribute("mongoUrl", mongoUrl);
|
|
250 | 247 |
} |
251 | 248 |
} |
252 | 249 |
|
... | ... | |
312 | 309 |
log.info(" - repo id: " + api.getDatasource()); |
313 | 310 |
log.info(" - api id: " + api.getId()); |
314 | 311 |
log.info(" - rest call: " + url); |
312 |
log.info(" - json: " + new Gson().toJson(api)); |
|
315 | 313 |
|
316 | 314 |
final RestTemplate restTemplate = new RestTemplate(); |
317 | 315 |
|
318 |
final String res = restTemplate.postForObject(url, api, String.class);
|
|
316 |
restTemplate.postForObject(url, api, Void.class);
|
|
319 | 317 |
|
320 |
response.setContentType("application/json;charset=UTF-8"); |
|
321 |
|
|
322 |
IOUtils.write(res, response.getOutputStream()); |
|
318 |
listRemoteApis(api.getDatasource(), response); |
|
323 | 319 |
} |
324 | 320 |
|
325 | 321 |
@ExceptionHandler(Exception.class) |
Also available in: Unified diff
remoteMdstore API creation in other infrastructure