Package org.mycore.iview2.frontend
Class MCRTileCombineServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.mycore.frontend.servlets.MCRServlet
org.mycore.iview2.frontend.MCRTileCombineServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
Combines tiles of an image in specific resolutions.
- Author:
- Thomas Scheffler (yagee)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
key of request attribute forBufferedImage
.protected static final String
key of request attribute for iview2-File
.Fields inherited from class org.mycore.frontend.servlets.MCRServlet
ATTR_MYCORE_SESSION, CURRENT_THREAD_NAME_KEY, INITIAL_SERVLET_NAME_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static BufferedImage
attachFooter
(BufferedImage combinedImage, BufferedImage footer) attachesfooter
tocombinedImage
.void
init()
Initializes this instance.protected void
render
(MCRServletJob job, Exception ex) Transmits combined file or sends thumbnail.protected void
think
(MCRServletJob job) prepares render process and gets IView2 file and combines tiles.Methods inherited from class org.mycore.frontend.servlets.MCRServlet
allowCrossDomainRequests, buildRedirectURL, cleanupMCRSession, doGet, doGet, doGetPost, doPost, doPost, getErrorI18N, getLastModified, getLayoutService, getProperty, getReferer, getServletBaseURL, getSession, handleException, initializeMCRSession, reportException, toReferrer, toReferrer
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
IMAGE_KEY
key of request attribute forBufferedImage
. -
THUMBNAIL_KEY
key of request attribute for iview2-File
.
-
-
Constructor Details
-
MCRTileCombineServlet
public MCRTileCombineServlet()
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletExceptionInitializes this instance. Use parameterorg.mycore.iview2.frontend.MCRFooterInterface
to specify implementation ofMCRFooterInterface
(can be omitted).- Overrides:
init
in classMCRServlet
- Throws:
jakarta.servlet.ServletException
-
think
prepares render process and gets IView2 file and combines tiles. The image dimensions and path are determined fromHttpServletRequest.getPathInfo()
:/{zoomAlias}/{derivateID}/{absoluteImagePath}
wherezoomAlias
is mapped like this:Mapping of zoomAlias to actual zoom level zoomAlias zoom level 'MIN' 1 'MID' 2 'MAX' 3 default and all others 0 init()
how to attach a footer to every generated image.- Overrides:
think
in classMCRServlet
- Throws:
IOException
JDOMException
URISyntaxException
- See Also:
-
render
Transmits combined file or sends thumbnail. UsesServletRequest.getAttribute(String)
to retrieve information generated bythink(MCRServletJob)
.description of HttpServletRequest
attributeskeyName type description THUMBNAIL_KEY
File
.iview2 File with all tiles in it IMAGE_KEY
BufferedImage
generated image if zoomLevel != 0
and no implementation ofMCRFooterInterface
defined- Overrides:
render
in classMCRServlet
- Parameters:
job
- same instance as of think(MCRServlet job)ex
- any exception thrown by think(MCRServletJob) or transaction commit- Throws:
Exception
- if render could not handleex
to produce a nice user page
-