Programmer's Guide > Interfaces > CMSSession interface > createObjectFromSubtree method
  
createObjectFromSubtree method
Creates a new CMS object, assigning content from an in-memory document. If the new object is a folder or an empty document, use null values for the start and end parameters. If bursting rules are setup, you may use them to supply or override some of the parameter values.
After successful completion, the given DOM Nodes will be associated with the new CMS object. However, this does not replace the Nodes with a file entity or XInclude reference and so the association will be lost when the containing document is closed unless some additional action is performed.
createObjectFromSubtree(name, folderLogicalId, start, end [, flags [, objType]])
Parameters
Stringname
Specifies the name of the new CMS object. The adapter is allowed to use a variant of this name if, for example, the CMS disallows two objects with the same name in the same folder. The actual name used can be obtained by accessing the name attribute of the returned CMSObject.
StringfolderLogicalId
Specifies the folder to put the object in. This may be the Logical ID of a folder or it may be in an adapter-specific path format.
Nodestart
Specifies the DOM Node representing the first node to be included in the new object.
Nodeend
Specifies the DOM Node representing the last node to be included in the new object. This node should be the same as the start node or a subsequent sibling of it.
intflags
[optional] Specifies the creation options. The value is determined by a bit-wise OR of the CMSCreateFlags constants.
StringobjType
[optional] Specifies the CMS object type for the new object.
Returns
CMSObject. A new object handle.
Throws
CMSException
If an error occurs.