cancel
Showing results for 
Search instead for 
Did you mean: 

display a custom content type?

mbailen
Champ in-the-making
Champ in-the-making
Hi,

I am unable to display the name of a custom content type (custom:mosaic) when listing a document's properties.  I have found examples that allow me to show the mime type, size, and various custom properties.  What show-property line would I need?  Here is a section of code that I tried in my web-client-config-custom.xml (the "type" line fails):

   <config evaluator="node-type" condition="custom:mosaic" >
      <property-sheet>
         <show-property name="type" display-label-id="type" show-in-edit-mode="false" />
         <show-property name="size" display-label-id="size" converter="org.alfresco.faces.ByteSizeConverter" show-in-edit-mode="false" />
         <show-property name="mimetype" display-label-id="mimetype" converter="org.alfresco.faces.MimeTypeConverter" show-in-edit-mode="false" />
      </property-sheet>
   </config>

Should be simple, right?
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
Unfortunately, the type is not a property like other properties in the data model. The type comes from the Node's getType() method.

The last time I had to do this, I extended the DocumentDetailsBean to add a getContentType() method. The method asked the Node for its type, then looked up the human friendly title using the DictionaryService and returned that as a String.

With the new method in the extended bean, I was then able to extend the document-details.jsp with my own version that added something like:
<h:outputText value="#{msg.content_type}" />: <h:outputText value="#{DocumentDetailsBean.contentType}" />
just below the content name.

That was version 2.1. Maybe there's a quicker/better way to do it in 3.x, but I have a hunch you'll have to use the same technique. I don't know why this isn't OOTB. It is often helpful to know what type of object you're dealing with. This customization isn't terrible, but it should at least be configurable or something.

Jeff