public class RESTContentUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
noCacheTypes |
protected static int |
presignedUrlMaxAge |
Constructor and Description |
---|
RESTContentUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
externalContentRedirect(java.lang.String ticket,
java.lang.String objectId,
java.lang.String fileExtensions,
boolean download,
boolean inline,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Redirects so that an external service serves the content
|
static void |
localContentStream(java.lang.String ticket,
java.lang.String objectId,
java.lang.String fileExtensions,
boolean download,
boolean inline,
boolean overlay,
java.util.Map<java.lang.String,java.lang.String> overlayParameters,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Streams content locally
|
static void |
streamContent(java.lang.String ticket,
java.lang.String objectId,
java.lang.String fileExtensions,
boolean download,
boolean inline,
boolean overlay,
java.util.Map<java.lang.String,java.lang.String> overlayParameters,
boolean presignedUrl,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Streams content from OC in two ways, if the `presignedUrl` param is true, it
will try to redirect to a external content stream via a presigned url,
otherwise content will stream locally
|
@Value(value="${content.presigned.url.max.age}") protected static int presignedUrlMaxAge
@Value(value="${content.getcontent.nocache.types}") protected static java.lang.String noCacheTypes
public static void streamContent(java.lang.String ticket, java.lang.String objectId, java.lang.String fileExtensions, boolean download, boolean inline, boolean overlay, java.util.Map<java.lang.String,java.lang.String> overlayParameters, boolean presignedUrl, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
ticket
- objectId
- object idfileExtensions
- the list of extensions NOTE: the request param is
still called contentType[] we need to update HPI if
that is going to change.download
- if true, downloads file instead of displayinginline
- if true, displays the file with option of
downloading it, else downloads it directlyoverlay
- if true, runs the document through OpenOverlay (of
course using the "restrictions" of OpenOverlay)overlayParameters
- any additional parameters that should be passed as
properties to OpenOverlay TODO: not implemented do
to REST Map issueepresignedUrl
- if true, returns a 302 to a presigned urlreq
- the reqresp
- the resp, contains the contentpublic static void externalContentRedirect(java.lang.String ticket, java.lang.String objectId, java.lang.String fileExtensions, boolean download, boolean inline, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
{String}
- ticket{String}
- objectId{String}
- fileExtensions{boolean}
- download{boolean}
- inline{HttpServletRequest}
- req{HttpServletResponse}
- resppublic static void localContentStream(java.lang.String ticket, java.lang.String objectId, java.lang.String fileExtensions, boolean download, boolean inline, boolean overlay, java.util.Map<java.lang.String,java.lang.String> overlayParameters, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
{String}
- ticket{String}
- objectId{String}
- fileExtensions{boolean}
- download{boolean}
- inline{boolean}
- overlay{Map - String>} overlayParameters
{String}
- noCacheTypes{HttpServletRequest}
- req{HttpServletResponse}
- resp