Hi Nicolas,

Assuming all your categories have been created through the administration panel, here is how you progammatically set a category for a container. In fact, you add the container's ObjectKey to the category object:

final String categoryKey = "myKey";
final Category category = Category.getCategory(categoryKey );

if (category != null) {
        cat.addChildObjectKey(theContainer.
                         getContentContainer().getObjectKey());
}

Regards

Xavier





Le 18:50 21.07.2005, vous avez écrit:
Hi again

I try to understand how the "document detail" works and how the
containers have automatically the category.
In fact I want to set automatically a category to a container but I
don't know how to do that.

Is anyone has an idea?

Thanks

Nicolas

------------------=[ xlawrence at jahia dot com ]=--------------------
Computer Science Engineer, Master's Degree

Jahia : A collaborative source CMS and Portal Server
www.jahia.org Community and product web site
www.jahia.com Commercial services company
www.collaborativesource.org Jahia's collaborative license
Jahia Solutions
Rue de la gare 45
Ch-1260 Nyon, Switzerland
Phone: +41 22 361 34 24
Fax : +41 22 361 36 40

Reply via email to