Attachment manager
Default implementation
DefaultAttachmentManager
stores binary files on file system. Path to storage on file system has to be configured. Default storage path is under user home directory (System.getProperty("user.home")/idm_data
).
System.getProperty("user.home")/idm_data
) - it's not recommended to use this location in production. Warning about default storage location usage is written into logs, when attachment is saved.
When binary file is saved, then uuid content identifier (contentId
) is generated and used as file name on filesystem with .bin
extension. Content path in storage is prepared from actual date with pattern yyyy/MM/dd/uuid.bin
. So content will be saved on path e.g. <storagePath>/2017/12/01/e963dd20-0a10-4052-8355-1425d021299a.bin
.
Temporary files and attachments
Attachment manager is responsible for maintaining temporary files and temporary attachments. Temporary files are used e.g. by report renderers, when output data are created and downloaded. Temporary attachments are used for uploading new files into CzechIdM - e.g. for extended attributes with persistent type ATTACHMENT
. Attachment is uploaded as temporary and when original form is submitted (owner's form), then the temporary attachment is moved under currently persisted owner (~renamed). When owner is deleted, all attachments are deleted too, but when owner's form is not submitted, then attachments remains marked as temporary.
Old temporary files and temporary attachments created by this manager are purged automatically (see temporary file time to live configuration).
Path to temporary files on file system has to be configured too (same as above). Default temp path is under storage path configured above (getStoragePath()/temp
). When storage path above is configured, then this configuration can be leaved empty - folder /temp
will be created automatically in storage path.
Configuration
All configuration properties are described in backend congifuration.
Future development
- Add filter - find attachment by name, description, type … etc.
- Attachment frontend agenda
- Support authorization policies
- Store binary data in DMS (e.g. Alfresco ECM or other DMS using CMIS), for fulltext search in binary data, replications, better cluster support, etc.
- Save attachment templates e.g. by owner type only (ownerId is required now)