Re: ERAttachment... to-many and thumbs
Re: ERAttachment... to-many and thumbs
- Subject: Re: ERAttachment... to-many and thumbs
- From: Kieran Kelleher <email@hidden>
- Date: Mon, 22 Nov 2010 13:04:28 -0500
Rather than working directly with ERAttachment, just make your own attachment wrapper entity (MyAttachment) with relationships to original ERAttachment and a thumbnail attachment.
MyAttachment --- original ----> ERAttachment
MyAttachment --- thumbnail ----> ERAttachment (fits in say 160 x 160 px bounds)
You can even have a third one for "Large Screen Display", especially if originals are very resolution pics typical of modern digital cameras
MyAttachment --- large ----> ERAttachment (fits in say 1024 x 768 px bounds)
You can trigger the thumbnail addition and/or update in willInsert and/or willUpdate of the MyAttachment entity.
Make you own thumbnail using the utility methods in ERAttachmentProcessor class.
Of course if the original is not an image, then thumbnail and large don't need to be created ....... you can check for that by seeing if the mime type of the original matches "image/*" pattern (where * is any group of characters)
HTH, Kieran
On Nov 22, 2010, at 11:49 AM, Francesco Romano wrote:
> Hi.
> I have two questions about ERAttachment.
> 1) Thumbnails are not available, yet, but.. what do I have to do to add support to them? I don't understand how to implement them "inside" erattachment
> 2) I'd like to have a many-to-many relationship between my entity and erattachment. I don't have problems in modeling, but.. how can I manage them using D2W and rules? (I'm creating two apps: an admin app using D2W Modern look, and a "front-end" app without D2W. I have problem in the D2W side...)
>
> Thank for any help
> Francesco Romano
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden