This kind of inheritance would certainly allow the code to be better
structured and organized, but still we would need the flexibility to
select the kind of processing that should be applied to the files
uploaded through the config array, bakers would need to extend
imageUpload (or whatever) if they need any extra functionality not
covered by the class, and I think we could end up with a bunch of
imageUpload, videoUpload, docUpload, spreadsheetUpload, ... classes.
Thoughts?

On 13 jul, 13:11, Tijs Teulings <[EMAIL PROTECTED]> wrote:
> On 13-jul-2007, at 12:47, Gorka wrote:
>
>
>
>
>
>
>
> >> Or maybe even 'MiUploadBehavior extends UploadBehavior', and a  
> >> call to
> >> beforeSave{mime}{Type} is made if the method exists etc..
>
> > Though this might enforce convention over configuration approach, I
> > see two possible issues with it. First, some file types have several
> > mime types -or better, mime names- they can fit ('image/jpg', 'image/
> > jpeg' for example). On the other hand, you might want different
> > treatments applied for files of the same type, say extract and record
> > on DB the text from this PDF, but just zip and store the other one.
>
> > When defining validation rules, we can define custom functions or use
> > the ones implemented in Cake by setting the validation config array.
> > Maybe we could use something similar to that?
>
> Mimetype based super classes would indeed be a bit troublesome i  
> think. I like the ImageUploadBehavior extends UploadBehavior idea a  
> lot! You could still configure what constitutes an image or a  
> document in the UploadBehaviour based on mimetypes and maybe even set  
> some default methods to call. Then if you could override a default  
> method of, for instance, extractText with convertToPdf in the  
> controller you would have a very powerful set of functionality.
>
> Tijs- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to