cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a fm:forum type node

sgomez
Champ in-the-making
Champ in-the-making
Hi,

I am following the example outlined in the Alfresco 3.1 Javascript API (http://wiki.alfresco.com/wiki/3.1_JavaScript_API) on writing a webscript for creating discussions for a content node.  The problem is that the nodes I am creating as "fm:forum" type are being created as "cm:content" type.  I am using the code below to create my nodes: 


    contentNode = search.findNode(nodeId);
    if (contentNode != null) {
        contentNode.addAspect("fm:discussable");  //add discussable aspect
        forumNode = parentNode.createNode("discussion", "fm:forum", "fm:discussion");  //creates the forum node with name "discussion" and type "fm:forum"
    }

The nodes are "cm:content" types when I use my webscript above.  When I create discussions via Alfresco's UI,  the resulting nodes are of "fm:forum" type.  Is there anything I am missing?
1 REPLY 1

sgomez
Champ in-the-making
Champ in-the-making
I want to add that the Primary path for a forum node created via Alfresco's OOTB ui shows that the discussions node is of "forum" type, while the nodes created with my javascript webscripts are of content type.

Primary path for Nodes created with javascript webscript:
Primary Path: /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/applicatio... people.jpg/{http://www.alfresco.org/model/content/1.0}discussion


Primary path for Nodes created with Alfresco OOTB UI:
Primary Path: /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/applicatio... people.jpg/{http://www.alfresco.org/model/forum/1.0}discussion