Class UrlAliasController
- java.lang.Object
-
- de.digitalcollections.cudami.frontend.website.controller.UrlAliasController
-
@Controller public class UrlAliasController extends Object
-
-
Constructor Summary
Constructors Constructor Description UrlAliasController(de.digitalcollections.cudami.client.CudamiClient cudamiClient, CudamiConfig cudamiConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringfallback(javax.servlet.http.HttpServletRequest request, String slug)Forwards to Identifiable specific endpoint if SLUG is a primary url alias.protected LocalegetLocaleFromPrimaryUrlAliases(de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases localizedUrlAliases)
-
-
-
Constructor Detail
-
UrlAliasController
public UrlAliasController(de.digitalcollections.cudami.client.CudamiClient cudamiClient, CudamiConfig cudamiConfig)
-
-
Method Detail
-
fallback
@GetMapping("/{slug:[a-zA-Z0-9-]+}") public String fallback(javax.servlet.http.HttpServletRequest request, @PathVariable String slug) throws de.digitalcollections.model.exception.ResourceNotFoundException, de.digitalcollections.model.exception.TechnicalExceptionForwards 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)
-
-