#160: Overhaul FileUpload Widget
- Contents
- Proposed by
- Alan Runyan
- Seconded by
- Dorneles Treméa
- Proposal type
- User interface
- Repository branch
- UploadReferenceWidget
- State
- draft
Definitions
Motivation
Today in Zope/Plone File-oriented assets are *embedded* into the content object. This makes a variety of problems more difficult to solve than should be:
- Re-using file assets that are embedded into a content object. There is no way to 'browse' to these file assets.
- These file assets may not be first class content citizens therefore they may not have UIDs. Meaning you can not easily reference them.
- Content import/export would be easier if they were decoupled and represented as relationships instead of attributes of the content object.
Plone does very little about directing users on how to store and handle file oriented assets. As side effect of this proposal is to suggest a central place to put file oriented assets. This has numerous benefits itself:
- Gives users a central folder where file oriented assets should be placed (reduces end users thinking process)
- Enables us in the future to incorporate components such as 'Image Repository' since we know where all the file oriented assets should be residing in a default Plone installation
- We could mount this Folder as a separate Database in which we can have a finer grain control over memory usage and performance characteristics
Tomorrow we will need this decoupling.
- Sophisticated deployment techniques such as Entransit Content Deployment or CMFDeployment find it very hard to represent and maintain these 'asset relationships'. These are solvable problems but as the deployment techniques become more complex we will be unnecessarily carrying baggage.
- Content import/export will be much easier to implement especially if content has 2 or more file asset properties in a content type.
- Users expect to be able to re-use *all* content. If I upload a logo into a News Item last month and want to reuse that logo this month. I should be able to do that easily and efficiently.
Assumptions
Proposal
This would introduce a backwards incompatibility issue. The client code would have to be changed anytime Field specific calls are being made. For instance the 'scaling' properties of the ImageFiled would not apply.
Development
- The UploadReferenceWidget development will be moved from Enfold System's public subversion, located at https://svn.enfoldsystems.com/public/UploadReferenceWidget to Archetypes SVN repository into the MoreFieldsAndWidgets folder, located at https://svn.plone.org/svn/archetypes/MoreFieldsAndWidgets/
- The User Interface of the UploadReferenceWidget should be reviewed, some questions:
- Should the 'Reference List' be visible when uploading Files?
- Should you be able to remove the target object from the Widget?
- Determine what a sensible default would be for location of Uploaded assets. Currently the assets are contained in the content object. This widget ensures the assets are uploaded as first-class content objects in the Plone CMS. Where do we put those?
- One suggestion create a BTreeFolder called 'files-and-images' in the root of each Plone site.
- In the future this 'files-and-images' folder could be converted to a 'Image Repository' product from PSOL.
- Identify all of Upload Widget(s) used in Content Types outside of File/Image. The list of affected default content types:
- News Item
- Assign Copyright to the Plone Foundation
Evaluation
- The introduction of this widget should add ZERO conceptual overhead for a end user.
- The software should be bundled into a software release on plone.org and available to the public [DONE]
- A 'demo' of the Widget should be provided (This comes along with the source code) [DONE]
- Identify and set a default policy for 'files-and-images' to be used.
Packaging
This widget would be packaged like ATReferenceBrowserWidget, as a Product or egg. However its superclass is packaged.Migration
This is going to be the largest chunk of work. Here is a plan of attack:
- Identify the location for uploaded assets to be placed instead of inside of content objects, i.e. 'files-and-images' location
- Create this folder in new versions of Plone
- Figure out the structure (if any) for this Folder, files-and-images
- Change the affected content types from using FileField or ImageField to using ReferenceField
- ATContentTypes.content.newsitem.ATNewsItem would need to change from using ImageField
- This means that there needs to be compatibility or a break in compatibility since ImageField supports a different API than ReferenceField.
- Write migration script that yanks out the Image/File data from content types and creates new content instances in files-and-images location
which will then be referenced in the source content types such as News Item. - Wire the migration script into the Plone migration routines
- Bundle the UploadReferenceWidget with the Plone distribution
Integration
This widget is 100% compatible with ReferenceBrowserWidget(s) and ReferenceField.
Implementation
Download UploadReferenceWidget: http://plone.org/products/upload-reference-widget
A specialization of the ATReferenceBrowserWidget. It is a new Widget not a new Field.
Deliverables
A new ReferencableUpload Widget would be implemented [DONE]
ATCT NewsItem would use the ReferencableUpload so that BLOBs can be shared between News Items
Migration Script
Release Copyright to Plone Foundation
Risks
Introducing a new Widget is minimum risk.
Implementing it for ATNewsItems, by default, requires migration.
Progress log
The initial code has been released and is being used in production.
Participants
- Dorneles Treméa
- Alan Runyan
Identified
plip comments
* there is nobody implementing it
* since this does not require any changes in plone it can be done as a seperate product and considered for inclusion into plone core if it is succesfull
* the proposal is missing essential details such as where to store the uploaded file
This has been addressed
It does not require any changes to Plone but I would like for it to be considered the DEFAULT way for uploading 'attachments' or files/images into a content type.
The proposal is still missing detail but this detail is in the product's overview. Also the tests and README is extensive. Will load that back into the proposal.
release BlobFile?
This is done
not necessary
==============
just use a reference widget for the news items instead of image one.
Generally speaking, the best it to make easy the modifying of an existing content type, so you can solve this issue in the proper way.
Must work the way the user works
- Know you are going to use a Image *before* adding the News Item.
- Make a decision on *where* to add the Image
- Upload the image to your decided location
- Go back to where you were going to add the News Item
- Click the 'Reference' button and browse/search for the widget
- Save the reference (hopefully you select the right one!)
Plone is the 'Apple of Content Management'. The above 'user interaction' is miserable. And is certainly not obvious. Being the 'Apple of CMS' we must provide a sleeker implementation. UploadReferenceWidget provides this implementation. The user simply uploads a File, like they normally do and the File/Image is put into a computed location based on the customizers programming. Try it, http://plone.org/products/upload-reference-widget
With regards to "Generally speaking, the best it to make easy the modifying of an existing content type, so you can solve this issue in the proper way." This is what Archetypes or ATSchemaEditorNG is about. This is the 'easy modifying existing content type'.
Re: Must work the way the user works
ATSchemaEditorNG is easy to use, to modify the news content type to use a different widget or field to upload the image?
BTW, I don't disagree using something that does it all, I'm a fan of it :)
Must not understand
Let me give you another example. This time from plone.org.
Each Product content type on plone.org allows you to upload a 'logo'. If you are looking at the Upload Reference Widget you will see Enfold System's logo. Right? So today Enfold System's has about 10-15 product releases on plone.org. Each product release carries a *copy* of our logo. There is ZERO re-use between each of the 10-15 product releases. Let's say I want to change my logo that is being used by these 10-15 product releases. I have to visit each release and upload a new image. That sucks.
I agree
note: FCKEditor (not kupu) can upload an Image as a Image object, and reference it "at the same time", using the "insert an image" button. It uploads the image if needed, and put his url as reference to the image. The image is not embedded in the object, but it is another object.
MIgrations would also have to be added