#8: Merging ATPhoto* with ATCT
- Contents
- Proposed by
- Russ Ferriday
- Seconded by
- Jean Francois Roche
- Proposal type
- Architecture
- Repository branch
- photoimagemerge-branch
- State
- being-discussed
Motivation
Proliferation of Image-related types is confusing for users. (Users are asking, "When would I use an ATImage instead of an ATPhoto?")
Creation of specific folder-types to match content-types causes "type explosion".
We want to enable creation of mixed folders containing images, and audio for example, that have sensible behaviour.
Assumptions
This ATCT release will use attribute storage by default (storage in ZODB, Data.fs). This may be reconfigured as usual in the ATContentTypes/config.py.
Proposal
Move all functions of ATPhoto into ATImage by using adapters.
Maintain the Photo Album as a user concept but replace the separate implementation type currently derived from ATFolder with ATFolder itself, extended by a new adapter consisting of the ATPhotoAlbum functionality modified as needed.
Based on discussion with alecm, these changes target an ATCT release 1.2 that will have a dependency on Five, so that we can use adaptors. This ATCT 1.2 release will be usable as an upgrade for ATCT and may also be packaged as part of PloneMultiMedia.
We will also blaze a trail for adapters into ATCT
New folder hierarchy for ATContentTypes
We
needed a better convention than dumping all the CA config, adapters,
views into hard-to-maintain communal *.py files in
ATContentTypes/z3
We discussed this with Stephan
Richter, Jens Klein, and Sascha Vincic and several others at Snowsprint 2006, and recommended the
following layout based on the convention in Zope3. We'll encouraged sprint members to raise a flag if there were any issues. Receiving only positive input, we adopted this hierarchy, that was merged into ATCT trunk on 2006.02.02.
ATContentTypes
|
|
|-- Extensions
| `-- ...
|
|-- adapters # all the CA adapters (plural - like Zope3 tree)
| |-- __init__.py
| |-- document.py
| |-- folder.py
| |-- image.py
| `-- newsitem.py
|
|-- browser # all the CA browsers (singular - like Zope3 tree)| |-- __init__.py| |-- document.py
| |-- folder.py
| `-- image.py
|
|-- content # the ATCT type defs
| |-- __init__.py
| |-- base.py
| |-- document.py
| |-- event.py
| |-- favorite.py
| |-- file.py
| |-- folder.py
| |-- image.py
| |-- link.py
| |-- newsitem.py
| |-- schemata.py
| `-- topic.py
|
...
|
|-- interface # all the CA interfaces (interfaces.py prevents interfaces)| |-- __init__.py| `-- interfaces.py #
|
...
|-- z3 # THIS HAS DISAPPEARED!
Implementation
This started in a branch of ATContentTypes called photomerge, which was renamed under the 'historical' folder after merging into the trunk .
The Zip Export functions provided by ATPhotoAlbum were packaged into a general purpose adapter that can adapt any zippable type.
The merge into trunk of the photomerge branch containing the ZipArchive functionality, on 2006.02.02, led us to create a new development branch photoimagemerge-branch
Configure adaptors onto ATFolder to provide the remaining Album-related functionality that is currently implemented in ATPhotoAlbum. What remains is to add Symbolic_folder, the only stored attribute of ATPhotoAlbum, which is a reference to the photo that represents the folder on the UI. This adapter will store the attribute in ExtendedMetadata.
Create a factory that allows us to instantiate an ATPhotoAlbum by creating an ATFolder and decorating it with the Adapter.
Configure an adapter that provides the ATPhoto functionality and can be added to the current ATImage to give the appearance of an enhanced ATImage.
Change the current ATImage factory to instantiate the adapted ATImage.
Deliverables
Unit tested branch ready for merge into the trunk, and for packaging into PloneMultiMedia
Risks
The team is unfamiliar with Five and Zope3 and the use of adapters.
Progress log
Sat 2006.01.28 22:04 - First checkin - JF used his experience with ATP adapters and advice from Godefroid to make a skeleton and test of a single adaptor for ATFolder. Initial unit tests pass.
Sun 2006.01.29 - rewrite the Zip function into the Component Architecture to make it applicable for other components.
Mon 2006.01.30 - debug and tested the Zip Adapter.
checked in initial unit tests
reorganized the ATContentTypes/z3 folder contents into separate adapter, interface (sorry - needed singular to avoid clash with z2 interface.py), browser folders.
Tue/Wed 2006.01.31..1 - added unit and functional tests. Reorganized the ATContentTypes/z3 tree to facilitate cooperation between teams working on content related components. Completed ZipArchive functionality, and merged with ATCT trunk.
Thu 2006.02.02 - created UML of the Zip Adapter, and an initial document. Started a screencast with Nate.
Participants
Jean François Roche
Russ Ferriday