aheusingfeld/photooapp — Issue #2: Create PhotoImporterService
Author: aheusingfeld
Created: 2011-10-24 15:41:22+00:00
State: open

The PhotoImporterService must be able to import a photo when a java.util.File and a username (String) is specified as input.

"Import" is defined as the following steps:
1. Create a "Photo" instance
2. read the photo file's metadata into the "Photo" instance
2.1 get all EXIF and GPS data
2.2 write filename to the "title" field
3. create a new "Folder" instance if there is no existing Folder for the current image based on the currently configured FolderCreationStrategy
4. associate the "Photo" instance with the specific "Folder" instance
5. store the original photo file to the filesystem destination defined by the "Folder" instance
5.1 throw an exception if storing fails
6. create a copy of the original photo file called preview image and rescale it to max. 1024px width or 1024px height
7. store the preview image file to the filesystem destination defined by the "Folder" instance
7.1 throw an exception if storing fails
8. create a copy of the original photo file called thumbnail image and rescale it to max. 250px width or 250px height
9. store the preview image file to the filesystem destination defined by the "Folder" instance
9.1 throw an exception if storing fails
10. create "Tag" instances from the "Photo" instances metadata
10.1 year+monthname
10.2 split filename by "_"
11. create a notification and send it to the "user" the image was imported for

It's not the PhotoImporterService's task to
- authenticate the user