
Classes | |
| class | ERXAttachmentExceedsLengthException |
Public Member Functions | |
| abstract T | _process (EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException |
| abstract InputStream | attachmentInputStream (T attachment) throws IOException |
| void | attachmentInserted (T attachment) |
| abstract String | attachmentUrl (T attachment, WORequest request, WOContext context) |
| IERAttachmentProcessorDelegate | delegate () |
| abstract void | deleteAttachment (T attachment) throws IOException |
| T | process (EOEditingContext editingContext, ERPendingAttachment pendingAttachment) throws IOException |
| T | process (EOEditingContext editingContext, File uploadedFile, String recommendedFilePath, String mimeType, int width, int height, String configurationName, String ownerID) throws IOException |
| T | process (EOEditingContext editingContext, File uploadedFile, String recommendedFilePath, String mimeType, String configurationName, String ownerID) throws IOException |
| T | process (EOEditingContext editingContext, File uploadedFile, String recommendedFilePath, String mimeType) throws IOException |
| T | process (EOEditingContext editingContext, File uploadedFile, String recommendedFilePath) throws IOException |
| T | process (EOEditingContext editingContext, File uploadedFile) throws IOException |
| boolean | proxyAsAttachment (T attachment) |
| void | setDelegate (IERAttachmentProcessorDelegate delegate) |
Static Public Member Functions | |
| static synchronized void | addAttachmentProcessorForType (ERAttachmentProcessor<?> processor, String storageType) |
| static< TextendsERAttachment > ERAttachmentProcessor< T > | processorForConfigurationName (String configurationName) |
| static< TextendsERAttachment > ERAttachmentProcessor< T > | processorForType (String storageType) |
| static< TextendsERAttachment > ERAttachmentProcessor< T > | processorForType (T attachment) |
| static synchronized NSMutableDictionary< String, ERAttachmentProcessor<?> > | processors () |
Static Public Attributes | |
| static final Logger | log = Logger.getLogger(ERAttachmentProcessor.class) |
Protected Member Functions | |
| String | proxiedUrl (T attachment, WOContext context) |
Static Protected Member Functions | |
| static String | _parsePathTemplate (ERAttachment attachment, String templatePath, String recommendedFileName) |
Private Attributes | |
| IERAttachmentProcessorDelegate | _delegate |
Static Private Attributes | |
| static NSMutableDictionary < String, ERAttachmentProcessor<?> > | _processors |
| static final String | EXT_VARIABLE = "\\$\\{ext\\}" |
| static final String | FILE_NAME_VARIABLE = "\\$\\{fileName\\}" |
| static final String | HASH_VARIABLE = "\\$\\{hash\\}" |
| static final String | PK_VARIABLE = "\\$\\{pk\\}" |
| static final String | UUID_VARIABLE = "\\$\\{uuid\\}" |
| static String _parsePathTemplate | ( | ERAttachment | attachment, | |
| String | templatePath, | |||
| String | recommendedFileName | |||
| ) | [static, protected] |
Parses a path template with ${ext}, ${fileName}, ${hash}, ${uuid}, and ${pk} variables in it. See the ERAttachment top level documentation for more information.
| attachment | the attachment being processed | |
| templatePath | the template path definition | |
| recommendedFileName | the original file name recommended by the uploading user |
| abstract T _process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile, | |||
| String | recommendedFileName, | |||
| String | mimeType, | |||
| String | configurationName, | |||
| String | ownerID, | |||
| boolean | pendingDelete | |||
| ) | throws IOException [pure virtual] |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the uploaded temporary file (which will be deleted at the end) | |
| recommendedFileName | the filename recommended by the user during import | |
| mimeType | 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 alone |
| IOException | if the processing fails |
| static synchronized void addAttachmentProcessorForType | ( | ERAttachmentProcessor<?> | processor, | |
| String | storageType | |||
| ) | [static] |
Adds a new attachment processor for the given storage type.
| processor | the processor | |
| storageType | the storage type that corresponds to the processor |
| abstract InputStream attachmentInputStream | ( | T | attachment | ) | throws IOException [pure virtual] |
Returns an InputStream to the data of the given attachment.
| attachment | the attachment to retrieve the data for |
| IOException | if the stream cannot be created |
| void attachmentInserted | ( | T | attachment | ) |
Called after an attachment has been inserted (from didInsert).
| attachment | the inserted attachment |
| abstract String attachmentUrl | ( | T | attachment, | |
| WORequest | request, | |||
| WOContext | context | |||
| ) | [pure virtual] |
Returns a URL to the attachment's data.
| attachment | the attachment to generate a URL for | |
| request | the current request | |
| context | the current context |
| IERAttachmentProcessorDelegate delegate | ( | ) |
Returns the attachment processor delegate for this processor.
| abstract void deleteAttachment | ( | T | attachment | ) | throws IOException [pure virtual] |
Deletes the attachment from the data store.
| attachment | the attachment to delete |
| IOException | if the delete fails |
| T process | ( | EOEditingContext | editingContext, | |
| ERPendingAttachment | pendingAttachment | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| pendingAttachment | the ERPendingAttachment that encapsulates the import information |
| IOException | if the processing fails |
| T process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile, | |||
| String | recommendedFilePath, | |||
| String | mimeType, | |||
| int | width, | |||
| int | height, | |||
| String | configurationName, | |||
| String | ownerID | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the uploaded temporary file (which will be deleted at the end) | |
| recommendedFilePath | the filename recommended by the user during import | |
| mimeType | 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) | |
| width | the desired width of the attachment | |
| height | the desired height of the attachment |
| IOException | if the processing fails |
| T process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile, | |||
| String | recommendedFilePath, | |||
| String | mimeType, | |||
| String | configurationName, | |||
| String | ownerID | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the uploaded temporary file (which will be deleted at the end) | |
| recommendedFilePath | the filename recommended by the user during import | |
| mimeType | 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) |
| IOException | if the processing fails |
| T process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile, | |||
| String | recommendedFilePath, | |||
| String | mimeType | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the uploaded temporary file (which will be deleted at the end) | |
| recommendedFilePath | the filename recommended by the user during import | |
| mimeType | the mimeType to use (null = guess based on file extension) |
| IOException | if the processing fails |
| T process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile, | |||
| String | recommendedFilePath | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the uploaded temporary file (which will be deleted at the end) | |
| recommendedFilePath | the filename recommended by the user during import |
| IOException | if the processing fails |
| T process | ( | EOEditingContext | editingContext, | |
| File | uploadedFile | |||
| ) | throws IOException |
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will NOT be deleted after the import process is complete.
| editingContext | the EOEditingContext to create the ERAttachment in | |
| uploadedFile | the file to attach (which will NOT be deleted at the end) |
| IOException | if the processing fails |
| static <TextendsERAttachment> ERAttachmentProcessor<T> processorForConfigurationName | ( | String | configurationName | ) | [static] |
Returns the processor that corresponds to the given configuration name ("s3", "db", "file", etc).
| configurationName | the configuration name to use to lookup the default storage type |
| static <TextendsERAttachment> ERAttachmentProcessor<T> processorForType | ( | String | storageType | ) | [static] |
Returns the processor that corresponds to the given storage type ("s3", "db", "file", etc).
| storageType | the type of processor to lookup |
| static <TextendsERAttachment> ERAttachmentProcessor<T> processorForType | ( | T | attachment | ) | [static] |
Returns the processor that corresponds to the given attachment.
| <T> | the attachment type | |
| attachment | the attachment to lookup a processor for |
| static synchronized NSMutableDictionary<String, ERAttachmentProcessor<?> > processors | ( | ) | [static] |
Returns all of the processors mapped by storageType.
| String proxiedUrl | ( | T | attachment, | |
| WOContext | context | |||
| ) | [protected] |
Returns a URL to the given attachment that routes via the ERAttachmentRequestHandler.
| attachment | the attachment to proxy | |
| context | the context |
| boolean proxyAsAttachment | ( | T | attachment | ) |
Returns whether or not the proxy request handler should return this as an attachment with a Content-Disposition.
| void setDelegate | ( | IERAttachmentProcessorDelegate | delegate | ) |
Sets the attachment processor delegate for this processor.
| delegate | the attachment processor delegate for this processor |
IERAttachmentProcessorDelegate _delegate [private] |
NSMutableDictionary<String, ERAttachmentProcessor<?> > _processors [static, private] |
final String EXT_VARIABLE = "\\$\\{ext\\}" [static, private] |
final String FILE_NAME_VARIABLE = "\\$\\{fileName\\}" [static, private] |
final String HASH_VARIABLE = "\\$\\{hash\\}" [static, private] |
final Logger log = Logger.getLogger(ERAttachmentProcessor.class) [static] |
final String PK_VARIABLE = "\\$\\{pk\\}" [static, private] |
final String UUID_VARIABLE = "\\$\\{uuid\\}" [static, private] |
1.5.8