icfnext / cq-component-maven-plugin

Other
22 stars 35 forks source link

Updates to support / enforce proper Image Resource structure #19

Closed pmichelotti closed 8 years ago

pmichelotti commented 9 years ago

Submitted for your consideration ---

I've made updates to support / enforce the resource structure which the OOB Image / DownloadResource classes expect when using the Html5SmartImage annotation for both Touch and Classic UI. This, coupled with supporting updates in bedrock, give us the ability to do

@DialogField(tab = 2)
@Html5SmartImage
@ImageInject @Optional
Image myImage

and have it work as expected. The above will create a situation where the image is stored in a child resource named "myImage". This will be where fileReference, fileName, and other image related properties are stored as well. In the case where a user uploads a file directly via the widget it will be stored in a child of the "myImage" resource named "file," which is the name that DownloadResource is expecting to find when looking for image file content.