AnsweredAssumed Answered

Cannot create a custom classification

Question asked by martijnburger on Nov 19, 2015
Latest reply on Nov 26, 2015 by martijnburger
I have added the following custom aspect to my content model:

<aspect name="my:locationDocumentClassification">
    <title>My Location Document Classification</title>
        <property name="my:locationDocumentCategory">
            <title>Location Document Categories</title>
            <index enabled="true">

Now I want to be able to populate a set of categories to the classification. I am using the following Webscript to populate the categories:

    protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
//        NodeRef newRootCat = categoryService.createRootCategory(
//                ContentModel.ASPECT_GEN_CLASSIFIABLE,
//                "testroot");
//        LOGGER.log(Level.INFO, "Created: {0}", newRootCat.toString());
//        NodeRef newCategory = categoryService.createCategory(newRootCat, "testcat");
//        LOGGER.log(Level.INFO, "Created: {0}", newCategory.toString());
//        NodeRef locationDocumentClassification = categoryService.createClassification(
//                "locationDocumentClassification");
//        LOGGER.log(Level.INFO, "Created: {0}", locationDocumentClassification.toString());
        NodeRef locationDocumentRootCat = categoryService.createRootCategory(
        LOGGER.log(Level.INFO, "Created: {0}", locationDocumentRootCat.toString());
        NodeRef klantDocCat = categoryService.createCategory(locationDocumentRootCat, "testcat");
        LOGGER.log(Level.INFO, "Created: {0}", klantDocCat.toString());
        return new HashMap<>();

When I execute the code, I get the following error:

10170041 Wrapped Exception (with status template): 10170014 Missing classification: {}locationDocumentClassification

The first two commented out statements in the code is the example code from Alfresco, which works fine. The third commented out statement is me trying to create a classification first to see if that works. The error that I get when I uncomment the createClassification statement:

java.lang.UnsupportedOperationException         at

So no luck there. I hope there is anyone out there who can see the problem. I read all the posts and forums I could find about this, but could not figure out an answer.

I am using Alfresco 5.0d community edition.