@Component public class ImageTransformationManager extends Object implements UriTransformationManager<TransformedImageResponse>
Constructor and Description |
---|
ImageTransformationManager() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected com.sdl.context.config.ContextConfiguration |
getContextConfiguration() |
protected ImageTransformationProcessor |
getImageProcessor() |
TransformedImageResponse |
processTransformation(String undecodedPathInfo)
Process the provided image transformation path information and return a transformed image.
|
void |
setContextConfiguration(com.sdl.context.config.ContextConfiguration contextConfiguration) |
protected void |
setImageFactory(ImageFactory imageFactory) |
protected void |
setImageProcessor(ImageTransformationProcessor imageProcessor) |
protected void |
setImageTransformationProcessor(ImageTransformationProcessor imageTransformationProcessor) |
@PostConstruct public void afterPropertiesSet()
public TransformedImageResponse processTransformation(String undecodedPathInfo)
This method requires the URL characters (including request parameters) that follow the servlet path in a URL. It needs the exact characters requested by the browser, i.e. none of them should be decoded.
So if the browser requested the following URL (where the context is "app" and the servlet path is "t")
"http://tr.com/app/t/scale/200x200/localhost:9090/img/%25D1%258B%2521%25E2%2584%2596%253B%2525%253D.png?a=1&b=2"
Then this method would expect
"/scale/200x200/localhost:9090/img/%25D1%258B%2521%25E2%2584%2596%253B%2525%253D.png?a=1"
Note: the Java request.getPathInfo() method is unsuitable as it only provides a decoded form of the URL and it doesn't include the servlet params. i.e. if you called request.getPathInfo() for the previous request you'd only get "/scale/200x200/localhost:9090/img/%D1%8B%21%E2%84%96%3B%25%3D.png".
processTransformation
in interface UriTransformationManager<TransformedImageResponse>
undecodedPathInfo
- the undecoded path plus the request parametersprotected void setImageProcessor(ImageTransformationProcessor imageProcessor)
protected ImageTransformationProcessor getImageProcessor()
public void setContextConfiguration(com.sdl.context.config.ContextConfiguration contextConfiguration)
protected com.sdl.context.config.ContextConfiguration getContextConfiguration()
protected void setImageTransformationProcessor(ImageTransformationProcessor imageTransformationProcessor)
protected void setImageFactory(ImageFactory imageFactory)
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries