[request] image showing property

2 posts / 0 new
Last post
Marc
Offline
Joined: 07/08/2009
[request] image showing property

Hi,

I would like to dispose of a kind of image property, that immediately shows the image without having to select an action (as opposed to a BasicBinaryProperty that does not show the contents of its file). Looking at the screenshots of the BlueVox content management application, I see this has been realised there with JSpresso.

I also saw that the class BasicImageViewDescriptor indicates "empty implementation as of now". I do not know if my request would relate to this class.

What do you think? Does this all make sense? Is this a good candidate for a feature request?

Thanks,

Marc

vvandens
Offline
Joined: 05/29/2008
[request] image showing property

Hi Marc,

BasicImageViewDescriptor is the way to go. It allows you to embed an image view in the UI. The image view is backed by a binary property descriptor that containes the image binary data. The trunk HR Sample contains a new photo property that is displayed in an image view. It's now implemented in SJS but here is the generated Spring you can start from (until SJS gets officially released and documented) :

the model (defines a binary property on Employee to store the image data) :

   <!-- make the property descriptor a top-level bean
so that it can be referenced as model -->
<bean id="Employee-photo"
class="org.jspresso.framework.model.descriptor.basic.BasicBinaryPropertyDescriptor">
<property
name="name"
value="photo" />
<property
name="maxLength"
value="1048576" />
<property
name="fileFilter">
<map>
<entry
key="images">
<list>
<value>.jpg</value>
<value>.bmp</value>
</list>
</entry>
</map>
</property>
</bean>

<bean
id="Employee"
class="org.jspresso.framework.model.descriptor.entity.basic.BasicEntityDescriptor">
...
<property name="propertyDescriptors">
<list>
<ref bean="Employee-photo"/>
...


the view

  <!-- describe your imge view
backed by the photo property -->
<bean
id="Employee-photo.pane"
parent="decoratedView"
class="org.jspresso.framework.view.descriptor.basic.BasicImageViewDescriptor" >
<property
name="actionMap"
ref="binaryPropertyActionMap" />
<property
name="modelDescriptor"
ref="Employee-photo" />
</bean>

  <!-- use the photo image view
in a composite view backed by the Employee -->
<bean
id="Employee.pane"
class="org.jspresso.framework.view.descriptor.basic.BasicSplitViewDescriptor" >
<property
name="leftTopViewDescriptor"
ref="Employee.component.pane" />
<property
name="rightBottomViewDescriptor"
ref="Employee-photo.pane" />
<property
name="orientation"
value="HORIZONTAL" />
</bean>

 

HTH,

Vincent