API Business Services - Mass import publication trigger

This trigger is triggered when a publication worker is considered complete, i.e. when a massimportitem is transformed into an asset instance. Note that a worker can run in several stages, even with a server or plugin restart in between: normally, the trigger will only be executed once, when all the items in the associated job have been processed.

Selection

When the hook is selected, the structure indicated in ObjectContext is:

  • either the structure representing a collaborative space (collaborativespace)

  • or the structure representing a job, when the job is not part of the space (massimportjob).

The processID is ProcessID.MASSIMPORT_PUBLICATION.

There is never any notion of service (execution being asynchronous): serviceId is always null.

Process context

Object types

The getObjectTypes() method will only return asset types, never massimportitem.

Space and/or job instances

Additional properties include:

  • with the primaryJob key, the primary job (instance of wsnoheto.engine.IObjectReadOnly, in a modified and saved state)

  • with the space key, the space (instance of wsnoheto.engine.IObjectReadOnly, in a modified and saved state)

Surfer

This is the surfer used to process space, job, items and asset creations.

Process object

Old object and new object

Each instance represents a possible item/asset pair. Old object is the item, new object is the asset. If asset is null, creation has failed (it may also mean that the item was not in an approved status). These instances are in a modified and saved state.

The modified state is true if reindexing is involved: true means that the asset has been modified and false means it has been created.

There are never any modified properties.

Additional properties

  • metadataWarns (a com.google.gson.JsonObject)

  • metadataErrors (a com.google.gson.JsonObject)

  • fieldErrors (a Map<String, Object>)

  • itemStatus (a String) the status of item/asset

    • CANCELLED
      The massimportitem instance is not in a state that allows asset creation

    • PROCESSING
      The massimportitem instance was in a state that allowed asset creation, but something went wrong during processing.

    • PROCESSED
      The massimportitem instance has been processed and an asset has been created (or modified), but an error has prevented the item's status from being changed to imported (published).

    • COMPLETED
      The massimportitem instance has been processed and an asset is created (or modified), and the item status is imported (published).

Â