Page 1 of 1

How to display Blob field in admin UI

Posted: Wed Nov 28, 2012 12:07 pm
by aaron8tang
I create an entity with a blob field, such as:

Code: Select all

   @Column(name = "BIZ_LIC_IMG")
   @Lob
   @AdminPresentation(friendlyName = "Business License Image", order = 5, prominent = true)
   protected Blob bizLicImg;


and the image content is uploaded by customer from front site, and displayed on admin UI, approved by admin user.

How to display Blob field in admin UI?

Re: How to display Blob field in admin UI

Posted: Fri Dec 07, 2012 11:38 am
by jefffischer
This is not something we currently support. However, I have a few comments:

1) I wouldn't try to store the image yourself. It's more efficient and performant to use our static asset service (see this discussion: viewtopic.php?f=11&t=1459&p=3747&hilit=staticassetservice#p3747)
2) I would use an approach that leveraged a standard form item in the admin (e.g. a checkbox) and set an icon for the formItem using the FormItemIcon. The url for the form item icon would point to the asset on the asset server (we have a blog and docs on using the asset server).

An approach would be to extend one of the admin modules that you're interested in and add an operation to the changeSelection method that makes a standard GWT RPC call to a server-side service you provide that returns the url to the image in the asset server for that particular customer. Then, since you have access to the formItem collection in the form, you can grab the appropriate formItem and use its setIcon API to add a FormItemIcon instance with the image url.

Something more direct would require support for this as a new feature in the framework. You're welcome to request such a feature on our JIRA, but there's no guarantee when it would be implemented.

Re: How to display Blob field in admin UI

Posted: Fri Dec 07, 2012 4:03 pm
by aaron8tang
Thanks,Jeff, It's very helpful.