cancel
Showing results for 
Search instead for 
Did you mean: 

Include category in document library custom view

juschroeg
Champ in-the-making
Champ in-the-making
Dear all,

first of all my apologies, if this might be an obvious question. I am new to Alfresco and try my best to fit it to our needs.
I created a custom aspect mainly following this <a href="http://www.avadaj.com/2012/07/12/adding-custom-aspects-to-alfresco-4-0/">instruction</a> and then went on to work on a custom table render, that will display my new labels.(adapting the share-documentlibrary-config)

As the category label is displayed in the detailled view, I figured I should be able to include it in my custom table (based on the dublin-core render).
This is my customized dublin-core render so far:

<view-renderer id="dublin_core" iconClass="table" label="Projekttabelle" index="80" widget="Alfresco.DocumentListTableViewRenderer">
               <dependencies>
                  <js src="components/documentlibrary/documentlist-view-detailed.js" />
                  <js src="components/documentlibrary/documentlist-view-table.js" />
                  <css src="components/documentlibrary/documentlist-view-table.css" />
               </dependencies>
               <json-config>
                  {
                     "actions": {
                        "show": "true"
                     },
                     "indicators": {
                        "show": "true"
                     },
                     "selector": {
                        "show": "true"
                     },
                     "thumbnail": {
                        "show": "true"
                     },
                     "propertyColumns": [
                        {
                           "property": "name",
                           "label": "table.dublincore.label.name",
                           "width": "300"
                        },
                        {
                           "property": "cm:title",
                           "label": "table.dublincore.label.title"
                        },
                        {
                           "property": "cu:year",
                           "label": "Jahr"
                        },
                        {
                           "property": "cu:contactperson",
                           "label": "Ansprechpartner"
                        },
                        {
                           "property": "cm:description",
                           "label": "table.dublincore.label.description"
                        },
                        {
                           "property": "cu:publishable",
                           "label": "Veröffentlichung erlaubt"
                        }
                     ]
                  }
               </json-config>
            </view-renderer>


Can anybody help me to figure out the right reference to include the categories here?
My trial & error approach brought me here, with this, the number of categories assigned to the document is shown:

                        {
                           "property": "cm:categories",
                           "label": "Kategorie",
                        }

Not very useful for my purpose though.
Thanks for your comments,

Julian
1 REPLY 1

juschroeg
Champ in-the-making
Champ in-the-making
For me the solution was pretty simple in the end.

Just include

                        {
                           "property": "categories",
                           "label": "Branche"
                        },

in your custom render within the share-documentlibrary-config.xml and your custom view will feature not only the (sub-)category's names, but also lets you filter by category by just clicking one cagtegory within the newly created table column.
Note: this is just a mockup, remember to place your labels in the respective properties file to enable multiple language support.