public class StreamContent
extends org.springframework.extensions.webscripts.AbstractWebScript
implements org.springframework.context.ResourceLoaderAware
Modifier and Type | Field and Description |
---|---|
protected org.alfresco.service.cmr.repository.ContentService |
contentService |
protected org.alfresco.service.cmr.repository.MimetypeService |
mimetypeService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected org.alfresco.service.cmr.security.PermissionService |
permissionService
Services
|
protected org.springframework.core.io.ResourceLoader |
resourceLoader |
Constructor and Description |
---|
StreamContent() |
Modifier and Type | Method and Description |
---|---|
void |
execute(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res) |
protected java.util.Map |
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.Status status)
Deprecated.
|
protected java.util.Map |
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.Status status,
org.springframework.extensions.webscripts.Cache cache)
Execute custom Java logic
|
protected java.util.Map |
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptStatus status)
Deprecated.
|
protected void |
renderFormatTemplate(java.lang.String format,
java.util.Map model,
java.io.Writer writer)
Render a template (of given format) to the Web Script Response
|
protected void |
setAttachment(org.springframework.extensions.webscripts.WebScriptResponse res,
boolean attach,
java.lang.String attachFileName)
Set attachment header
|
void |
setContentService(org.alfresco.service.cmr.repository.ContentService contentService) |
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
protected void |
setResponseCache(org.springframework.extensions.webscripts.WebScriptResponse res,
java.util.Date modified,
java.lang.String eTag,
java.util.Map model)
Set the cache settings on the response
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
boolean attach)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
boolean attach,
java.util.Map model)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
boolean attach,
java.lang.String attachFileName)
Streams content back to client from a given File.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
boolean attach,
java.lang.String attachFileName,
java.util.Map model)
Streams content back to client from a given File.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
java.lang.Long modifiedTime,
boolean attach,
java.lang.String attachFileName)
Streams content back to client from a given File.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.io.File file,
java.lang.Long modifiedTime,
boolean attach,
java.lang.String attachFileName,
java.util.Map model)
Streams content back to client from a given File.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach)
Streams the content on a given node's content property to the response of the web script.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
java.util.Map model)
Streams the content on a given node's content property to the response of the web script.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
java.lang.String attachFileName)
Streams the content on a given node's content property to the response of the web script.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
java.lang.String attachFileName,
java.util.Map model)
Streams the content on a given node's content property to the response of the web script.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String resourcePath,
boolean attach)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String resourcePath,
boolean attach,
java.util.Map model)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String resourcePath,
boolean attach,
java.lang.String attachFileName)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String resourcePath,
boolean attach,
java.lang.String attachFileName,
java.util.Map model)
Streams content back to client from a given resource path.
|
protected void |
streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.ContentReader reader,
boolean attach,
java.util.Date modified,
java.lang.String eTag,
java.lang.String attachFileName)
Stream content implementation
|
protected void |
streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.ContentReader reader,
boolean attach,
java.util.Date modified,
java.lang.String eTag,
java.lang.String attachFileName,
java.util.Map model)
Stream content implementation
|
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
protected org.alfresco.service.cmr.security.PermissionService permissionService
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.service.cmr.repository.ContentService contentService
protected org.alfresco.service.cmr.repository.MimetypeService mimetypeService
protected org.springframework.core.io.ResourceLoader resourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService
- public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
permissionService
- public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- public void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
contentService
- public void execute(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res) throws java.io.IOException
execute
in interface org.springframework.extensions.webscripts.WebScript
java.io.IOException
org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse)
protected java.util.Map executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptStatus status)
req
- Web Script requeststatus
- Web Script statusprotected java.util.Map executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status)
req
- Web Script requeststatus
- Web Script statusprotected java.util.Map executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
req
- Web Script requeststatus
- Web Script statuscache
- Web Script cacheprotected final void renderFormatTemplate(java.lang.String format, java.util.Map model, java.io.Writer writer)
format
- template format (null, default format)model
- data model to renderwriter
- where to outputprotected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName propertyQName, boolean attach) throws java.io.IOException
req
- Requestres
- ResponsenodeRef
- The node referencepropertyQName
- The content property nameattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName propertyQName, boolean attach, java.util.Map model) throws java.io.IOException
req
- Requestres
- ResponsenodeRef
- The node referencepropertyQName
- The content property nameattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName propertyQName, boolean attach, java.lang.String attachFileName) throws java.io.IOException
req
- Requestres
- ResponsenodeRef
- The node referencepropertyQName
- The content property nameattach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName propertyQName, boolean attach, java.lang.String attachFileName, java.util.Map model) throws java.io.IOException
req
- Requestres
- ResponsenodeRef
- The node referencepropertyQName
- The content property nameattach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String resourcePath, boolean attach) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The classpath resource path the content is required forattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String resourcePath, boolean attach, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The classpath resource path the content is required forattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String resourcePath, boolean attach, java.lang.String attachFileName) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The classpath resource path the content is required for.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String resourcePath, boolean attach, java.lang.String attachFileName, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The classpath resource path the content is required for.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, boolean attach) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The resource path the content is required forattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, boolean attach, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responseresourcePath
- The resource path the content is required forattach
- Indicates whether the content should be streamed as an attachment or notjava.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, boolean attach, java.lang.String attachFileName) throws java.io.IOException
req
- The requestres
- The responsefile
- The file whose content is to be streamed.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, boolean attach, java.lang.String attachFileName, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responsefile
- The file whose content is to be streamed.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, java.lang.Long modifiedTime, boolean attach, java.lang.String attachFileName) throws java.io.IOException
req
- The requestres
- The responsefile
- The file whose content is to be streamed.modifiedTime
- The modified datetime to use for the streamed content. If null the
file's timestamp will be used.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, java.io.File file, java.lang.Long modifiedTime, boolean attach, java.lang.String attachFileName, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responsefile
- The file whose content is to be streamed.modifiedTime
- The modified datetime to use for the streamed content. If null the
file's timestamp will be used.attach
- Indicates whether the content should be streamed as an attachment or notattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.ContentReader reader, boolean attach, java.util.Date modified, java.lang.String eTag, java.lang.String attachFileName) throws java.io.IOException
req
- The requestres
- The responsereader
- The readerattach
- Indicates whether the content should be streamed as an attachment or notmodified
- Modified date of contenteTag
- ETag to useattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, org.alfresco.service.cmr.repository.ContentReader reader, boolean attach, java.util.Date modified, java.lang.String eTag, java.lang.String attachFileName, java.util.Map model) throws java.io.IOException
req
- The requestres
- The responsereader
- The readerattach
- Indicates whether the content should be streamed as an attachment or notmodified
- Modified date of contenteTag
- ETag to useattachFileName
- Optional file name to use when attach is true
java.io.IOException
protected void setResponseCache(org.springframework.extensions.webscripts.WebScriptResponse res, java.util.Date modified, java.lang.String eTag, java.util.Map model)
res
- modified
- eTag
- protected void setAttachment(org.springframework.extensions.webscripts.WebScriptResponse res, boolean attach, java.lang.String attachFileName)
res
- attach
- attachFileName
- Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.