cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding categories

hsjawanda
Champ in-the-making
Champ in-the-making
Hi all,

I am back with some more questions :-)…

I have been looking at Alfresco's categories, and beyond the basic concept, I am confused about the implementation.

Are category nodes related to non-category (normal) nodes by parent-child relationships?  Or do the category nodes store the NodeRef-s of non-category nodes that fall under that category? Or is it the other way round: non-category nodes store the NodeRef-s of category nodes that apply to them?

How do I programatically associate/assign a category to a plain node? For a while I was thinking that I could do it by adding aspect cm:generalclassifiable to the (plain) node, and adding a List of NodeRef-s to the cm:categories property, but now I am not sure…

Once I have programatically assigned a category to a node, how do I go about finding all the (normal) nodes that fall under a category? Do I use a query like the following one (from http://www.alfresco.org/mediawiki/index.php/Search#Category_Queries)?
PATH:"/cm:generalclassifiable//cm:Software_x0020_Document_x0020_Classification/member"

This query returns all the (normal) nodes classified under "cmSmiley Frustratedoftware Document Classification" or the sub-categories under it?

Thanks.
4 REPLIES 4

andy
Champ on-the-rise
Champ on-the-rise
Hi

You are pretty much correct.

It is  the other way round: non-category nodes store the NodeRef-s of category nodes that apply to them?

You can add add the aspect cm:generalclassifiable to a node and add a list of category node refs in the cm:categories property.

There are no parent-child relationships. The index exposes paths that look like parent child relationships to perform category searches, which is why categories appear as paths. Any property of type Category is assumed to hold node refs to categories and will support categorisation.

You can add your own categories and extend those that exist.

See the category tests for some examples and queries.

Cheers

Andy

dbevacqua
Champ in-the-making
Champ in-the-making
Any clues as to where I might find the category tests referred to aboev?

Thanks.

Dominic.

dbevacqua
Champ in-the-making
Champ in-the-making
Found some in

org.alfresco.repo.search.impl.lucene.LuceneCategoryTest
org.alfresco.repo.search.impl.lucene.LuceneCategoryTest2

strophi
Champ in-the-making
Champ in-the-making
Hi forum,

sorry for warming up this alod thread, but I can't locate these CategoryTest in Alfresco 2.1 Community.
Where have they gone? 😉

thanx in advance
strophi
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.