Add capability for adding/editing 'collections' - These are stored in the normal media file table, but have an additional field 'is_collection' set to TRUE. All normal media files must have 'is_collection' set to false. Whether a 'file' listing in the system is a collection is immutable; the 'is_collection' field cannot be modified.
Non-collection media have a new field in the edit view - 'move to collection' places them in to a collection. They are then moved to the table SUB_ITEMS. Attributes in the old non-sub-item are merged in to the listing for the collection that they are moved in to, with conflicts being resolved by the UI prior to committing the move.
Sub-items in a collection can be edited by hitting a link on a collection's edit page. Their edit page is similar to that of normal media, but they have a more limited set of fields.
Sub-items have an action field in their edit view - 'move to album', which is defaulted to the album that their collection is in. If this is done, the sub-item is made independent of its collection. All relevant metadata from the collection is copied in to the new independent listing.
Sub-items are NOT independently searchable. However, actions that apply to items in general will also be applied to sub-items.
Storage method: For a collection, a folder is created in the folder for the album that the collection is in. This collection folder will be named the PID of the collection. All sub-items of that collection will be placed in that directory and named as a normal item would be named.
Completed Tasks
Add boolean field 'is_collection' to database creation scripts, default to false for all media.
Add new 'SUB_PICTURES' table to the database creation scripts/init constants, with the following attributes:
Columns 'sid' (identifies record), 'pid' (links sub-item with collection), 'filepath', 'filename', 'filesize', 'total_filesize', 'pwidth', 'pheight', 'mtime', 'ctime', and 'title'.
Primary key 'sid'
Foreign key 'pid' -> 'PICTURES'.'pid' (Cascade on delete/update)
Update database with new fields
Add 'Create Collection' button to album page.
Create script/page for creating a new collection. Script should do the following in order:
Prompt user for collection metadata
Create new directory for sub-item storage (/{cat_id}/{alb_id}/{collection_pid}/)
Put in to a new collection listing in database
Remaining Tasks
Add 'Edit Sub-items' action for collections.
Add new item reader specifically for collections.
Add 'Move to Collection' action for normal media files. Use drop-down menu for selecting which collection. Do not show 'Move to Collection' for collections themselves. Include a 'new' option which prompts the user to create a new collection to move in to.
Create script/page for moving existing/uploaded item to be a sub-item. Script should do the following in order:
Attempt to create a new model of attributes for the collection, which is made of the attributes from the new item merged with the original attributes from the collection.
If the above results in conflicts, prompt the user to resolve the conflicts.
Attempt to commit the new model of collection attributes to the database.
Add a new listing for the sub-item in the appropriate table.
Copy the file from the original location to the sub-item storage location (/{cat_id}/{alb_id}/{collection_pid}/{sub_item_name}).
If it exists, copy the old thumbnail to the new location. Otherwise, generate a new thumbnail.
If it exists, remove the original normal item listing from the database.
If it exists, delete the original thumbnail
If it exists, delete the original file.
Add 'Move to Album' action for sub-items. Use drop-down menu for selecting which album (defaulted to album of collection).
Create script/page for moving a sub-item to an independent item. Script should do the following in order:
Create a new item entry, with same attributes as collection.
Move file/thumbnail from collection to normal file storage path.
Delete the old entry from the sub-items table.
Allow upload process to accept files directly in to a collection
Add optional 'To collection' field in upload UI.
Add warning that all sub-images will be deleted when collection is about to be deleted.
Make all sub-images be deleted when their parent collection is deleted.
Add capability for adding/editing 'collections' - These are stored in the normal media file table, but have an additional field 'is_collection' set to TRUE. All normal media files must have 'is_collection' set to false. Whether a 'file' listing in the system is a collection is immutable; the 'is_collection' field cannot be modified.
Non-collection media have a new field in the edit view - 'move to collection' places them in to a collection. They are then moved to the table SUB_ITEMS. Attributes in the old non-sub-item are merged in to the listing for the collection that they are moved in to, with conflicts being resolved by the UI prior to committing the move.
Sub-items in a collection can be edited by hitting a link on a collection's edit page. Their edit page is similar to that of normal media, but they have a more limited set of fields.
Sub-items have an action field in their edit view - 'move to album', which is defaulted to the album that their collection is in. If this is done, the sub-item is made independent of its collection. All relevant metadata from the collection is copied in to the new independent listing.
Sub-items are NOT independently searchable. However, actions that apply to items in general will also be applied to sub-items.
Storage method: For a collection, a folder is created in the folder for the album that the collection is in. This collection folder will be named the PID of the collection. All sub-items of that collection will be placed in that directory and named as a normal item would be named.
Completed Tasks
Remaining Tasks