cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing metadata fields in 'details view' of a space

pitt1
Champ in-the-making
Champ in-the-making
I have switched my Alfresco installation to use 'details view' (rather than 'icon view') as the default view of a space.  Now I want to customize the metadata fields that show up in the columns for 'details view'.  Currently, this view shows 'Name', 'Description', 'Created' and 'Modified' dates.  I have my own custom model (using aspects), and most of my documents have a common set of properties on them that I would like to display for 'details view'.  How can I do this?
6 REPLIES 6

gavinc
Champ in-the-making
Champ in-the-making
You'll have to modify our browse.jsp page. Unfortunately, there is not a customisation route for this page so you'll have to modify our page.

To add a column just follow the pattern you'll find in there i.e.

<a:column id="colxx" style="text-align:left">
   <f:facet name="header">
      <a:sortLink id="colxx-sort" label="#{msg.your_label}" value="prefix:your_property" styleClass="header"/>
   </f:facet>
   <h:outputText id="colxx-txt" value="#{r['prefix:your_property']}" />
</a:column>

rcortesr
Star Contributor
Star Contributor
Hi,

I have added one column.
When I execute Alfresco appears the following error:

javax.faces.FacesException: UIComponent is no ValueHolder

caused by:
javax.servlet.ServletException: UIComponent is no ValueHolder

caused by:
javax.servlet.jsp.JspException: UIComponent is no ValueHolder

This is my code:
<%– Numero_Factura for details/icons view modes –%>
<a:column id="col13" style="text-align:left" rendered="#{BrowseBean.browseViewMode == 'details' || BrowseBean.browseViewMode == 'icons'}">
<f:facet name="header">
<a:sortLink id="col13-sort" label="Numero_Factura" value="size" styleClass="header"/>
</f:facet>
<h:outputText id="col13-txt" value="#{r['fac:Numero_Factura']}" />
<a:convertSize />
</a:column>

gavinc
Champ in-the-making
Champ in-the-making
It's probably the <a:convertSize /> tag you have in your column definition, try removing it to see if the error is resolved.

If you need to use the converter it should be a child of hSmiley SurprisedutputText.

fogo
Champ in-the-making
Champ in-the-making
I have followed the same approach here, customizing browse.jsp to show custom meta-data and setting details view as the default.

The problem now is that if you navigate to a space that does not contain my custom content, email templates for example. Obviously none of the custom meta-data values exist and the details display looks quite odd.

So my question is - can you set default view modes differently for different spaces rather that having one global default?

Custom space -> details view mode
Data dictionary -> browse view mode

fogo
Champ in-the-making
Champ in-the-making
If anyone else wants to do this.

- Assign a custom aspect to your space
- override BrowseBean and the spaceChanged method
- in this method check the currentNode for your custom aspect and set the browseView accordingly

rmanocha
Champ in-the-making
Champ in-the-making
<hSmiley SurprisedutputText id="colxx-txt" value="#{r['prefix:your_property']}" />

I am very new to Alfresco and JSF, so excuse me if there is a straigh forward answer for this - I can't find any Smiley Sad.

Could someone please tell me how to define "your_property". I basically want to remove the created and modified date columns and add two colums which display the sum total of all documents (down to the leaf) under the current space and the sum total of all spaces (down to the leaf), again under the current space.

I'd really appreciate some help with this.