Re: RichDocument attachments and Lingaplone
"Martin Aspeli" <[email protected]> Tue, 09 May 2006 17:47:08 +0100
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 09 May 2006 16:00:25 +0100, Harald Friessnegger <harald.friessnegger-H84adUgip2a/3pe1ocb+swC/[email protected]> wrote: > sometimes it's necessary to be able to add new imageattachments or > fileattachments to translations of a richdocument. > > by default, the two fields displayImages and displayAttachments are > languageIndependent which really is okay for most cases. > however i think that conceptually it's a little wrong to couple the > uploading of attachments to the field that defines if the attachments > shall > be shown in a box at the end of richdocument_view. > i'm sure there is a good reason for this (that i don't know about yet). Well :) They're done that way because it was much easier to write it that way (otherwise I would've had to re-do all of base_edit for my own type). So totally, it's conceptually wrong, but it's convenient. > to be able to add attachments to translations i create a custom type that > subclasses richdocument and register the formcontroller actions by using > the nice methods martin provided in RichDocument.Extensions.utils > i copy the two fields from RichDocument.schema and set > languageIndependent > to False. Right. I don't really care greatly one way or the other. If people who use RD with LinguaPlone can agree, then I'm happy for these to become language-dependent. > now i get the managementcontrols widgets in the edit view of the > translated > object. unfortunately the linguaplone controllerpagetemplate > translate_item.cpt and the script translate_edit.cpy it calls after > successful validation do not play well with richdocument at the moment. > (uploading an imageattachments takes me to the objects view telling me > that > "my changes have been saved" - which simply is not true ;-) Right. I don't really have capacity to debug this now, but there's no reason why it couldn't work. > i think linguaplone has the limitation that it does not support custom > editforms at the moment. but in this case maybe registering the > addidional > scripts richdocument provides to handle the data of the attachment > managementcontrols somewhere in this chain too could do the job. I'm not using a custom edit form in RD, I'm using atct_edit (which is the same as base_edit for all intents and purposes). I register custom form controller actions to act on those buttons. It should be possible to use the utility methods in utils.py to register similar actions on translate_item.cpt, though I haven't tried it. > please tell me what you think about this. > > is there a need for lingaplone to support custom edit_forms? I doubt it. > should richdocument register fc actions to play well with linguaplone's > edit > view in case displayImages or displayAttachments is set not to be > languageIndependent? It could very well. If you want to make a branch in svn and try this out, I'd be happy to take a look at it. > should richdocument decouple displayAttachments and attachment > managementcontrol? Yes, it's just hard work :) The other issue that comes up re RD and LinguaPlone is that when you translate, do you want the images to be copied from source to target or not? Do you want to change images as part of the translation or not? If we need to copy images, then we may need to create a custom implementation of the translation method in ITranslatable interface. I have no idea whether that will cause problems with things like portal_factory, though. Again, exploration/patches in a branch (!) very welcome. Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642