cancel
Showing results for 
Search instead for 
Did you mean: 

Get list of Alfresco categories from WCMQS

alfteam
Champ in-the-making
Champ in-the-making
Hi,

I'm creating my custom web-site based on WCMQS.

I need to retrieve all available categories as a list from Alfersco repository. If somebody changes or adds new category I need to see changes in category list on my page.

Is there any way to retrieve a list of existing categories/subcategories from webscript? Can somebody give an example?

Thanks.
2 REPLIES 2

boneill
Star Contributor
Star Contributor
WCMQS gives a good example of how to do this for sections.  When you say categories, do you mean repository taxonomy categories.  If so you can write your own webscript to get a category list.  I am not sure if alfrsco has made the categories available via the js library but if not you can always write the webscirpt as a java backed webscript.  Once you have the node list of categories in the model you can then use a similar approach wcmqs uses forcreating dynamic menu based.  see top.get.html.ftl for example using sections:

<#macro outputMenu sections>
    <ul>
      <#list sections as section>
            <#if ! section.excludeFromNav>
             <li><a href="${url.context}${section.path}"><#if section.title?? && section.title?length gt 0>${section.title}<#else>${section.name}</#if></a>
                <@outputMenu sections=section.sections/>   
             </li>
          </#if>   
      </#list>
   </ul>
</#macro>

<div id="myslidemenu" class="jqueryslidemenu">
    <ul class="primary-menu">
      <li><a href="${url.context}/" accesskey="1">${msg('nav.home')}</a></li>
      <#list webSite.sections as section>
          <#if ! section.excludeFromNav>
             <li><a href="${url.context}${section.path}" accesskey="${section_index+2}"><#if section.title?? && section.title?length gt 0>${section.title}<#else>${section.name}</#if></a>
                <@outputMenu sections=section.sections/>   
             </li>
          </#if>   
      </#list>
   </ul>
</div>

alfteam
Champ in-the-making
Champ in-the-making
Brian, thanks for reply!

When I say categories I mean categories managed from administration console in ALfresco.

In my web-site I'd like to have something like category tree in Share but I need list in my case.