cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying image in content properties page

sal
Champ in-the-making
Champ in-the-making
Hi all,

we are processing scanned documents with part of their text parsed via OCR.

In the edit properties page for scanned content we are trying to show the scanned in image to provide visual feedback to users entering/validating the OCR results.

We thought of using the SpaceIconPickerGenerator but we can't figure out how the SpaceIconPickerGenerator resolves to actual images.

We did the following:

Added an aspect (works OK)

   <aspects>
      <aspect name="ch:ocrDoc">
         <title>OCR test</title>
         <properties>
            <property name="ch:ocrText1">
               <type>d:text</type>
            </property>
            <property name="ch:ocrImage1">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>


Added an evaluator for the property sheet
Get "No icons found" in the page
and
WARN  [common.renderer.ImagePickerRadioRenderer] Failed to retrieve icons: javax.faces.el.PropertyNotFoundException: Bean: org.alfresco.web.bean.content.EditContentPropertiesDialog, property: icons


   <config evaluator="aspect-name" condition="ch:ocrDoc">
      <property-sheet>
         <show-property name="ch:ocrText1" />
         <show-property name="ch:ocrImage1" show-in-view-mode="true"
            display-label-id="icon"
            component-generator="SpaceIconPickerGenerator"
            ignore-if-missing="false" />
      </property-sheet>
   </config>


   <config evaluator="string-compare" condition="???? icons">
      <icons>
         <icon name="ch-icon-default" path="/images/icons/space-icon-default.gif" />
         <icon name="ch-icon-star" path="/images/icons/space-icon-star.gif" />
         <icon name="ch-icon-doc" path="/images/icons/space-icon-doc.gif" />
      </icons>
   </config>
1 REPLY 1

gavinc
Champ in-the-making
Champ in-the-making
The component used to display the icons looks for a method called getIcons() on the managed bean configured for the dialog. This method should return a list of UIListItem objects representing the icons to display. Have a look at CreateSpaceWizard.getIcons for an example of this.

In your case this method needs to be on EditContentPropertiesDialog, ideally you should override the dialog configuration for editProperties and supply the name of your subclass of EditContentPropertiesDialog.

The configuration block you mention in your post will not be read in your scenario. Your getIcons method could however read a new config block from your web-client-config-custom.xml, again see CreateSpaceWizard for an example.

Hope this helps.