oai explorer api
This commit is contained in:
parent
9718799731
commit
54cbe69dd3
|
@ -24,6 +24,12 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>dnet-oai-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- temporary override of hibernate-core to fix a bug in 6.2.x -->
|
||||
<dependency>
|
||||
|
|
|
@ -9,10 +9,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import eu.dnetlib.common.clients.DnetServiceClientFactory;
|
||||
import eu.dnetlib.common.clients.VocabularyClient;
|
||||
import eu.dnetlib.common.oai.OaiClient;
|
||||
import eu.dnetlib.common.oai.OaiResponse;
|
||||
import eu.dnetlib.domain.common.KeyValue;
|
||||
import eu.dnetlib.domain.vocabulary.VocabularyTerm;
|
||||
import eu.dnetlib.services.dsm.service.ProtocolService;
|
||||
|
@ -60,4 +63,42 @@ public class OtherController extends AbstractDsmController {
|
|||
return map;
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/info")
|
||||
public OaiResponse<?> oaiExplorerInfo(@RequestParam final String baseUrl) throws Exception {
|
||||
return new OaiClient().info(baseUrl);
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/sets")
|
||||
public OaiResponse<?> oaiExplorerSets(@RequestParam final String baseUrl, @RequestParam(required = false) final String token) throws Exception {
|
||||
return new OaiClient().listSets(baseUrl, token);
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/mdformats")
|
||||
public OaiResponse<?> oaiExplorerMdFormats(@RequestParam final String baseUrl) throws Exception {
|
||||
return new OaiClient().listMetadataFormats(baseUrl);
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/records")
|
||||
public OaiResponse<?> oaiExplorerRecords(@RequestParam final String baseUrl,
|
||||
@RequestParam(defaultValue = "oai_dc") final String format,
|
||||
@RequestParam(required = false) final String set,
|
||||
@RequestParam(required = false) final String token) throws Exception {
|
||||
return new OaiClient().listRecords(baseUrl, format, set, token);
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/identifiers")
|
||||
public OaiResponse<?> oaiExplorerIdentifiers(@RequestParam final String baseUrl,
|
||||
@RequestParam(defaultValue = "oai_dc") final String format,
|
||||
@RequestParam(required = false) final String set,
|
||||
@RequestParam(required = false) final String token) throws Exception {
|
||||
return new OaiClient().listIdentifiers(baseUrl, format, set, token);
|
||||
}
|
||||
|
||||
@GetMapping("/oai-explorer/record")
|
||||
public OaiResponse<?> oaiExplorerSingleRecord(@RequestParam final String baseUrl,
|
||||
@RequestParam(defaultValue = "oai_dc") final String format,
|
||||
@RequestParam final String id) throws Exception {
|
||||
return new OaiClient().getRecord(baseUrl, format, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue