Skip to content

Commit

Permalink
OAIPMH server / Fix base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Jan 9, 2024
1 parent 4c4943e commit 17a700d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private Element dispatchI(Element request, ServiceContext context) {
SettingInfo si = context.getBean(SettingInfo.class);

try {
url = si.getSiteUrl() + context.getBaseUrl() + "/" + Jeeves.Prefix.SERVICE + "/en/" + context.getService();
url = si.getSiteUrl() + context.getBaseUrl() + "/" + Jeeves.Prefix.SERVICE + "/" + context.getService();
params = OaiPmhFactory.extractParams(request);

AbstractRequest req = OaiPmhFactory.parse(context.getApplicationContext(), params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public AbstractResponse execute(AbstractRequest request, ServiceContext context)
IdentifyResponse res = new IdentifyResponse();
SettingInfo si = context.getBean(SettingInfo.class);

String baseUrl = si.getSiteUrl() + context.getBaseUrl() + "/" + Jeeves.Prefix.SERVICE + "/en/" + context.getService();
String baseUrl = si.getSiteUrl() + context.getBaseUrl() + "/" + Jeeves.Prefix.SERVICE + "/" + context.getService();

res.setRepositoryName(si.getSiteName());
res.setBaseUrl(baseUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Locale;

@RequestMapping(value = {
"/{portal}/api/oaipmh"
Expand Down Expand Up @@ -74,8 +73,9 @@ public Element dispatch(
@RequestParam(required = false) final String resumptionToken,
final HttpServletRequest request
) {
Locale locale = languageUtils.parseAcceptLanguage(request.getLocales());
ServiceContext serviceContext = ApiUtils.createServiceContext(request, locale.getISO3Country());
ServiceContext serviceContext = ApiUtils.createServiceContext(request);
// Set the service name, used in OaiPmhDispatcher to build the oaiphm endpoint URL
serviceContext.setService("api/oaipmh");

Element params = new Element("params");
if (StringUtils.isNotEmpty(verb)) {
Expand Down

0 comments on commit 17a700d

Please sign in to comment.