createContent(contentClass, refDocument [, customParam])
Creates a new HDBModel content
The method knows three different variants, depending on what input should be given to the creation operation.
The full variant 1 takes a HDBModelParams object which can be created via HDBModel.newCreateContentParams(). This object collects all parameters that a creation operation may be given.
Variant 2 is a convenience version where a new content of a given content class should just be created below some reference document in TMLScript.
Variant 3 can be used instead of default action $store if a content should be created based on the data of a WebTML form. The reference document here is taken from the target context of the form. The content class is taken from the contentclass attribute of the form (The operation will fail if none is given). Form fields and uploaded attachments are stored to the new content document.
All parameters for the create operation. The refDocument property is taken as reference document for the create operation, like described for variant 2.
The content class of the content to create.
refDocument (WGAPI object WGContent):
The reference document for the create operation. May be some immediate parent content or storage of the content to create (with no other contents in-between). May be null if the content to create has no parent content.
customParam (any object, optional):
A custom parameter object for the create operation, which may be processed by event scripts.
A WebTML form holding all neccessary data for the create operation.
The created content (WGAPI object WGContent)
|Allowed in script types||