public class ERFileAttachmentProcessor extends ERAttachmentProcessor<ERFileAttachment>
Name | Description |
---|---|
er.attachment.[configurationName].file.proxy | er.attachment.[configurationName].file.proxy |
er.attachment.file.proxy | er.attachment.file.proxy |
er.attachment.[configurationName].file.overwrite | er.attachment.[configurationName].file.overwrite |
er.attachment.file.overwrite | er.attachment.file.overwrite |
er.attachment.[configurationName].file.filesystemPath | er.attachment.[configurationName].file.filesystemPath |
er.attachment.file.filesystemPath | er.attachment.file.filesystemPath |
er.attachment.[configurationName].file.webPath | er.attachment.[configurationName].file.webPath |
er.attachment.file.webPath | er.attachment.file.webPath |
ERAttachmentProcessor.ERXAttachmentExceedsLengthException
log
Constructor and Description |
---|
ERFileAttachmentProcessor() |
Modifier and Type | Method and Description |
---|---|
ERFileAttachment |
_process(EOEditingContext editingContext,
File uploadedFile,
String recommendedFileName,
String mimeType,
String configurationName,
String ownerID,
boolean pendingDelete)
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that
represents it.
|
InputStream |
attachmentInputStream(ERFileAttachment attachment)
Returns an InputStream to the data of the given attachment.
|
String |
attachmentUrl(ERFileAttachment attachment,
WORequest request,
WOContext context)
Returns a URL to the attachment's data.
|
void |
deleteAttachment(ERFileAttachment attachment)
Deletes the attachment from the data store.
|
_parsePathTemplate, addAttachmentProcessorForType, attachmentInserted, delegate, process, process, process, process, process, process, processorForConfigurationName, processorForType, processorForType, processors, proxiedUrl, proxyAsAttachment, setDelegate
public ERFileAttachment _process(EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException
ERAttachmentProcessor
_process
in class ERAttachmentProcessor<ERFileAttachment>
editingContext
- the EOEditingContext to create the ERAttachment inuploadedFile
- the uploaded temporary file (which will be deleted at the end)recommendedFileName
- the filename recommended by the user during importmimeType
- the mimeType to use (null = guess based on file extension)configurationName
- the name of the configuration settings to use for this processor (see top level docs)ownerID
- an arbitrary string that represents the ID of the "owner" of this thumbnail (Person.primaryKey, for instance)pendingDelete
- if true, the uploadedFile will be deleted after import; if false, it will be left aloneIOException
- if the processing failspublic InputStream attachmentInputStream(ERFileAttachment attachment) throws IOException
ERAttachmentProcessor
attachmentInputStream
in class ERAttachmentProcessor<ERFileAttachment>
attachment
- the attachment to retrieve the data forIOException
- if the stream cannot be createdpublic String attachmentUrl(ERFileAttachment attachment, WORequest request, WOContext context)
ERAttachmentProcessor
attachmentUrl
in class ERAttachmentProcessor<ERFileAttachment>
attachment
- the attachment to generate a URL forrequest
- the current requestcontext
- the current contextpublic void deleteAttachment(ERFileAttachment attachment) throws IOException
ERAttachmentProcessor
deleteAttachment
in class ERAttachmentProcessor<ERFileAttachment>
attachment
- the attachment to deleteIOException
- if the delete failsCopyright © 2002 – 2024 Project Wonder.