Alfresco Share · Event chain on document upload

Behaviours programming in Alfresco is a well known mechanism. You can find relevant information on it at Alfresco Developer Series by Jeff Potts. However, there is no analysis on actual flow of events fired by a user operation performed in Alfresco Share.

Following diagram shows the event flow for the upload document operation on Alfresco Share version 4.2.e.

alfresco-behaviour-cd

As shown, there are events that occur in foreground (user thread) while other events are fired by Alfresco in the background.

Below the detail of each of the listed blocks is shown. Unfired events are crossed and red.

FOREGROUND

1. Create node

beforeCreateNode: documentLibrary | contains | document.odt | content
onCreateNode: document.odt
beforeUpdateNode
onUpdateProperties: [name, node-dbid, store-identifier, node-uuid, modified, locale, created, store-protocol, creator, modifier]

onUpdateNode

After creating the node, beforeUpdateNode and onUpdateNode are not fired on basic properties setting.

2. Create content

beforeUpdateNode
onUpdateProperties: [content]

onUpdateNode

beforeUpdateNode
onContentPropertyUpdate: content | contentUrl=store://2014/2/27/20/2/79030875-1fca-4739-9369-ecb6685000dc.bin|mimetype=application/vnd.oasis.opendocument.text|size=134673|encoding=UTF-8|locale=es_ES_
onContentUpdate: true
onUpdateProperties: [content]

onUpdateNode

Content creation includes two updating blocks, the first one updates nothing while the second one sets node content.

3. Create version

beforeUpdateNode
onUpdateProperties
onUpdateNode

beforeUpdateNode
onUpdateProperties: [autoVersionOnUpdateProps, autoVersion, initialVersion]
onUpdateNode

beforeCreateVersion
onCreateVersion: {versionType=MAJOR}
beforeUpdateNode
onUpdateProperties: [versionLabel]
onUpdateNode
afterCreateVersion: 1.0

A major version is created.

4. Update properties

beforeUpdateNode
onUpdateProperties: [title, author, modified, description]
onUpdateNode

beforeUpdateNode
onUpdateProperties
onUpdateNode

These properties are not included on version 1.0. User modifications on this values will not be tracked on future versions.

BACKGROUND

5. Update properties

beforeCreateNode [document.odt | rendition | 9d228152-d13e-462e-a7c6-997c41ebbe88 | thumbnail
beforeUpdateNode
onUpdateProperties: [lastThumbnailModification]

onUpdateNode

Thumbnail modification on document is set.

6. Create node (temporal rendition)

onCreateNode doclib
beforeUpdateNode
onUpdateProperties: [name, node-dbid, store-identifier, node-uuid, modified, locale, created, contentPropertyName, store-protocol, creator, modifier]
onUpdateNode

Temporal node for thumbnail generation.

7. Create content (temporal rendition)

beforeUpdateNode
onContentPropertyUpdate: content | null->contentUrl=store://2014/2/27/20/2/23dd7b70-c999-42f8-bff2-9de38fb54e66.bin|mimetype=image/png|size=2068|encoding=UTF-8|locale=es_ES_
onContentUpdate: true
onUpdateProperties: [content]

onUpdateNode

8. Create node (thumbnail)

beforeCreateNode documento.odt | rendition | doclib | thumbnail
onCreateNode 9c899bdb-6f4f-46af-a06d-f2792dbb0f89
beforeUpdateNode
onUpdateProperties: [isContentIndexed, name, node-dbid, store-identifier, node-uuid, modified, locale, created, store-protocol, creator, isIndexed, modifier]

onUpdateNode

Definitive thumbnail node is created.

9. Create content (thumbnail)

beforeUpdateNode
onContentPropertyUpdate: content | null->contentUrl=store://2014/2/27/20/2/23dd7b70-c999-42f8-bff2-9de38fb54e66.bin|mimetype=image/png|size=2068|encoding=UTF-8|locale=es_ES_
onContentUpdate: true
onUpdateProperties: [name, contentPropertyName, content]

onUpdateNode

10. Delete node (temporal rendition)

beforeUpdateNode
onUpdateProperties
onUpdateNode

beforeDeleteNode
onDeleteNode: false

11. Update properties

beforeUpdateNode
onUpdateProperties
onUpdateNode

beforeUpdateNode
onUpdateProperties
onUpdateNode

beforeUpdateNode
onUpdateProperties: [thumbnailName]

onUpdateNode

Final remarks

  • onUpdate event should be used with caution
  • Version 1.0 does not include all the data shown to the user

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s