Installation

Description

Features

Domain Attachment

CDN Storage Providers (via Karman)

Image Resizing (imgscalr)

Content Type Validation

GORM Bindings / Hibernate User Types Support

Configuration

Selfie utilizes karman for dealing with asset storage. Karman is a standardized interface for sending files up to CDN's as well as local file stores. It is also capable of serving local files.
In order to upload files, we must first designate a storage provider for these files. This can be done in the `attachmentOptions` static map in each GORM domain with which you have an Attachment,
or this can be defined in your @[email protected]

The providerOptions section will pass straight through to karmans StorageProvider.create() factory. The provider specifies the storage provider to use while the other options are specific to each provider.

In the above example we are using the karman local storage provider. This is all well and good, but we also need to be able to serve these files from a URL. Depending on your environment this can get a bit tricky.
One option is to use nginx to serve the directory and point the baseUrl to the appropriate endpoint. Another option is to use the built in endpoint provided by the karman plugin:

This will provide access to files within the `storage` folder via the storage url mapping.

Usage

The plugin uses an embedded GORM domain class to provide an elegant DSL for uploading and attaching files to your domains. So make sure you define your `static embedded= (+)` when using the Attachment class.