On Apr 13, 2007, at 12:16 PM, Michael Schulz wrote:
Hi,
I am looking for a solution to the behaviour mentioned in this ticket
about the imagegallery type: http://svn.nuxeo.org/trac/pub/ticket/693
I thought a quick solution to this could be to create a new
CPSDocumentType ("Photo"), that uses the photo widget, which can store
the original image plus a generated thumbnail. The resizing and
keeping original image data is done in ExtendedWidget and BasicWidget
modules.
After adding this Photo type to the allowed_content_types of the
imagegallery, it is working for images that are uploaded thru the
normal forms. But creating this type thru a zipfile upload is not
working: the object is created, but the resizing and keeping of
original data is not performed. Presumably because this functionality
comes from the widget "machinery", that is not invoked through the
process when uploading a zipfile (createFile.py).
What would be the correct manner to create these objects by scripts?
The same problem arises when trying to create this type through the
remote controller.
TIA, Michael
Hi
I think you'd want to use the computeDependantFields (sic) method of
fields. So instead of
subclassing the Image widget, you could subclass the CPS ImageField,
and have it take care of the
thumbnail. This should catch all these use cases. For example, I've
done this to read ID3 tags from MP3 files.
In mainstream CPS, this is used to apply transforms, like converting
pdf to text for indexing.
--
-----------------------------------------------------------
Michael Schulz
[EMAIL PROTECTED]
in medias res
Gesellschaft für Informationstechnologie mbH
In den Weihermatten 66
79108 Freiburg
Tel +49 (0)761 556959-5
Fax +49 (0)761 556959-6
http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
---------
Georges Racinet, Nuxeo SAS
Open Source Enterprise Content Management (ECM)
Web: http://www.nuxeo.com/ and http://www.nuxeo.org/ - Tel: +33 1 40
33 79 87
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel