cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Question, just not clear to me.

mark2k6
Champ in-the-making
Champ in-the-making
I've been looking over the Java docs and I have a basic question that I think will get me started in the right direction.

If I wanted to create a node that is a space in a specific location using a path how would I do this.

Path: /company home/Projects/Billing
New space name: timesheet

I know I use nodeService.createNode(), but the arguments aren't clear to me. 

Thanks for the help in advance.
3 REPLIES 3

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

It's actually better to use the FileFolderService's create method

create

FileInfo create(NodeRef parentNodeRef, java.lang.String name,                QName typeQName) throws FileExistsException

    Create a file or folder; or any valid node of type derived from file or folder

    Parameters:
        parentNodeRef - the parent node. The parent must be a valid container.
        name - the name of the node
        typeQName - the type to create
    Returns:
        Returns the new node's file information
    Throws:
        FileExistsException

parentNodeRef = NodeRef of the Billing space
name = the name of the space you want to create
type = the QName for cm:folder

Cheers,

–Aladdin

libman
Champ in-the-making
Champ in-the-making
I have the same problem. How can I get the reference of a space (like my home) to create the file in.

Thanks

libman
Champ in-the-making
Champ in-the-making
For getting the reference:
this.navigator.getCurrentNode().getNodeRef()