Arbortext Command Language > Hooks > compositionframeworkhook
  
compositionframeworkhook
compositionframeworkhook
Function prototype:
hook(doc, type, where, params[])
This hook is called at several points during the publishing operation. Each time the publishing framework calls the hook, it passes a different where value based on the point in processing. The hook function should check the where value.
The hook will be called for both Arbortext Editor and Arbortext PE 伺服器 publishing. For Arbortext PE 伺服器 publishing, the hook needs to be installed on both the client and server if the publishing operation runs a pipeline on the Arbortext PE 伺服器.
The publishing framework will invoke the hook function before compose_for_type() ACL functions start executing, after each operation compose_for_type() runs, and before compose_for_type() returns to its caller. Your hook function can return 0 to allow compose_for_type() to continue executing or return a negative value to terminate the publishing operation. It can modify any or all values in the publishing parameter array, thereby controlling the future flow of execution in compose_for_type().
For DITA publishing, at least two pipelines will run, and the hook will be called several times during each pipeline run. Some run only on the client, others can run on either the client or the server. The DITA createPrds pipeline (a pre-process pipeline) always runs on Arbortext Editor client. The regular or post-process pipeline may run on the client or on the Arbortext PE 伺服器. Install a compositionframeworkhook on both to avoid problems with pipeline handling. Creating a hook function that can be installed on both client and server assures the appropriate action is performed, whether the processing is taking place on the client or on the server.
* 
It’s possible the behavior of this hook can change from release to release. You should check your publishing framework hook code with each release of Arbortext software.
For more information on publishing framework processing and the compose_for_type() functions, refer to The Publishing Framework chapter of the Programmer's Guide to Arbortext Publishing Engine.
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is compositionframeworkhook.
Arguments
doc is the document identifier of the document being published.
type is the name of the pipeline or type of published output as represented by its .ccf base file name.
createPrds
dlmresolver
foDoc
htmlfile
htmlhelp
pdf
profile
rtf
rtfDoc
styler
web
xsl
xslfo
The complete list of pipeline .ccf files is located in Arbortext-path\composer.
where is the point in processing where the hook is called. It is a literal string value that is passed by the publishing framework to the hook function each time the framework calls it. For each string, there is a corresponding ACL variable that specifies the point of operation.
Arbortext-path\packages\tools\composer.acl contains the set of HK_variable-name ACL variables with defined values you can use for a where string specification. You can determine where the hook function is called by finding the variable associated with one of the where values and searching for it in compose.acl.
For example, the first call to the publishing framework hook function is when the publishing framework starts. The where value is initial, which corresponds to the variable HK_CFTI_INITIAL.
global HK_CFTI_DIALOG_CB = "dialog_cb_complete"
global HK_CFTI_DITA_MAP = "dita_map_init_complete"
global HK_CFTI_DITA_POST = "dita_postproc_complete"
global HK_CFTI_DITA_TOPIC = "dita_topic_init_complete"
global HK_CFTI_FINAL = "final"
global HK_CFTI_INITIAL = "initial"
global HK_CFTI_PARAMETER_CB = "parameter_cb_complete"
global HK_CFTI_PE_DONE = "pe_done"
global HK_CFTI_PE_INIT = "pe_init"
global HK_CFTI_PE_POSTPROC = "pe_postproc"
global HK_CFTI_PE_SENT = "pe_sent"
global HK_CFTI_PIPE_DONE = "pipeline_done"
global HK_CFTI_PIPE_INIT = "pipeline_init_complete"
global HK_CFTI_PREPROC_CB = "preprocessing_complete"
global HK_CFTI_PREPROC_HOOK = "preproc_hook_complete"
global HK_CFTI_PROFILE = "profile_init_complete"
The complete list of variables and where values is located in compose.acl. Search for HK_.
params[] is the parameter array that holds the parameters and values to be used by the pipeline.
Related Topics
add_hook function
remove_hook function