Re: ImageDataResource, VideoDataResource, AudioDataResource, OtherDataResource

Posted by Wai on
URL: http://ofbiz.116.s1.nabble.com/ImageDataResource-VideoDataResource-AudioDataResource-OtherDataResource-tp4354343p4373608.html

Hello,

I don't understand what useful functional purpose it would serve to separate these different types of blobs into the separate entities when DataResource.mimeTypeId/Content.mimeTypeId would help to distinguish one type of blob from another.

The complication with having separate entities for each type of uploaded binary files types is one of management.

For a scenario where a user stores a photo to the content component (which ends up storing the image data into DataResource and ImageDataResource).  Now, when the user decides later to change the content to another type of file (eg. a video file) for the same contentId, then ofbiz would have to make the necessary changes of destroying the entry in ImageDataResource and store the uploaded video data to VideoDataResource for the same DataResource.dataResourceId/Content.dataResourceId.  This is rather complicated for maintenance purposes.

I propose to only use ImageDataResource for storing any kind of blob content and rely on Content.mimeTypeId and/or DataResource.mimeTypeId to identify the format of the blob.  Hence deprecating VideoDataResource,AudioDataResource,OtherDataResource.

Any insight/comment is appreciated.

Thanks,
Wai