cancel
Showing results for 
Search instead for 
Did you mean: 

Showing categories in content detail list (browse.jsp)

kenneth_thorman
Champ in-the-making
Champ in-the-making
Hi

We would like to show the categories that has been linked to the content/documents in the detail view list.
I am aware of the potential problems arising if there are many categories.

Specifically we have a category that named Status and under this we have 2 subcategories named Pending and Approved.

I would like to display the chosen Status category in a Status column in the details list view.

TIA

Regards
Kenneth Thorman
5 REPLIES 5

kenneth_thorman
Champ in-the-making
Champ in-the-making
A small update.

Getting some inspiration from

http://forums.alfresco.com/en/viewtopic.php?f=3&t=6755&p=21850&hilit=category+browse#p21850
http://forums.alfresco.com/en/viewtopic.php?f=3&t=6540&p=21849&hilit=category+browse#p21849

and

the possibilities in Freemarker templates



<html><head></head>
<body>
<#– Table of docs in a specific folder –>
<h3>${space.name} documents</h3>
<table cellpadding=2 border=0 style="BORDER: 1px;">
    <tr>
        <td></td>
        <td><b>Name</b></td>
        <td><b>Title</b></td>
        <td><b>Last Modified</b></td>
        <td><b>Categories</b></td>
    </tr>
        <#assign query = ".//*[subtypeOf('cm:content')]">
        <#list space.childrenByXPath[query] as child>
           <tr>
               <td><a href="/alfresco${child.url}" target="new"><img src="/alfresco${child.icon16}" border=0></a></td>
               <td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td>
               <td><a href="/alfresco${child.url}" target="new">${child.properties.title}</a></td>
               <td>${child.properties["cm:modified"]?string("dd-MMM-yyyy hh:mm")}</td>
               <td>
                   <#list child.properties["cm:categories"] as prop>
                   ${prop.name}<br/>
                   </#list>
               </td>
            </tr>
        </#list>
</table>
</body>
</html>

specifically

<#list child.properties["cm:categories"] as prop>
${prop.name}<br/>
</#list>


This seems to work part of the way.

<a:column id="categories" style="text-align:left">
<f:facet name="header">
<a:sortLink id="categories-sort" label="Categories" value="cm:categories" styleClass="header" />
</f:facet>
<hSmiley SurprisedutputText id="categories-txt" value="#{r.properties['cm:categories']}" />
</a:column>

Now I just need to iterate the categories. I am not familiar with the JSF format for iterating, and have been looking at the alfresco tags docs and JSF in general.
Anyone?

Regards
Kenneth Thorman

kenneth_thorman
Champ in-the-making
Champ in-the-making
I have posted another thread here http://forums.alfresco.com/en/viewtopic.php?f=5&t=6802&p=58715#p58715

That contains all of the relevant configuration information of the alfresco instance.

Regards
Kenneth Thorman

witho
Champ on-the-rise
Champ on-the-rise
Hi,

Would you solve your issue???

I am facing the same problem and y have manged to show the categories NodeRef in my browse.jsp but no their name.

I will apreciate some help.

Thanks

nl_ubik
Champ in-the-making
Champ in-the-making
Hello,

I have the same problem as you. I display the nodeRef value but can't find how to display the name of the corresponding category within add a redender in BrowseBean.java.

r.properties["categories"][0]
has just an id property but not a name.

Someone can help me to display the name of the category ?

Thanks

nl_ubik
Champ in-the-making
Champ in-the-making
No one can help me ?

Thanks