Class UrlAliasController
java.lang.Object
de.digitalcollections.cudami.frontend.website.controller.UrlAliasController
-
Constructor Summary
ConstructorsConstructorDescriptionUrlAliasController(de.digitalcollections.cudami.client.CudamiClient cudamiClient, CudamiConfig cudamiConfig) -
Method Summary
Modifier and TypeMethodDescriptionForwards to Identifiable specific endpoint if SLUG is a primary url alias.protected LocalegetLocaleFromPrimaryUrlAliases(de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases localizedUrlAliases)
-
Constructor Details
-
UrlAliasController
public UrlAliasController(de.digitalcollections.cudami.client.CudamiClient cudamiClient, CudamiConfig cudamiConfig)
-
-
Method Details
-
fallback
@GetMapping("/{slug:[a-zA-Z0-9-]+}") public String fallback(jakarta.servlet.http.HttpServletRequest request, @PathVariable String slug) throws de.digitalcollections.model.exception.ResourceNotFoundException, de.digitalcollections.model.exception.TechnicalException Forwards to Identifiable specific endpoint if SLUG is a primary url alias. Redirects to primary SLUG if given SLUG is not a primaray url alias.- Parameters:
request- current http requestslug- human readable relative URL to an identifiable- Returns:
- target webpage or redirect to primary slug
- Throws:
de.digitalcollections.model.exception.ResourceNotFoundException- if slug is unknownde.digitalcollections.model.exception.TechnicalException- if backend system error
-
getLocaleFromPrimaryUrlAliases
protected Locale getLocaleFromPrimaryUrlAliases(de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases localizedUrlAliases)
-