OpenWGA 7.9 - TMLScript reference

Method :

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

On object HDBModel
Usage Updates an existing HDBModel content document

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.

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 | TMLContext) (optional):

The content document to update. If not present the content of the current context is used.

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