OpenWGA 7.0 - TMLScript reference

HDBModel
Method :

updateContent(hdbParams)
updateContent(content [, updateModule [, customParam]])
updateContent(tmlForm)

On object HDBModel
Usage Updates an existing HDBModel content document
Description

The method knows three different variants, depending on what input should be given to the update operation.

The full variant 1 takes a HDBModelParams object which can be created via HDBModel.newUpdateContentParams(). This object collects all parameters that a creation operation may be given.

Variant 2 is a convenience version where the given content should just be updated, either with modifications done previously or with modifications done in the given update module.

Variant 3 can be used instead of default action $store if a content should be update based on the data of a WebTML form. The document to update here is taken from the target context of the form. Form fields and uploaded attachments are stored to the new content document.
Parameters

Variant 1:

hdbCreateParams (HDBModelParams):

All parameters for the update operation. The refDocument property is taken as the document to update.

Variant 2:

content (WGAPI object WGContent):

The content document to update. 

updateModule (String, optional):

Name of a TMLScript module, whose code should be executed on the update procedure. The code is executed with the content to update in context and may do custom modifications, which automatically get saved. Specify null if you do not want a module to be executed.

customParam (any object, optional):

A custom parameter object for the update operation, which may be processed by event scripts or the update module.

Variant 3:

tmlForm (TMLForm):

A WebTML form holding all neccessary data for the update operation.
Writable False
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events