Publishing Engine Programmer's Guide > PTC Arbortext Publishing > The Publishing Framework > The Outer Layer of the Publishing Framework > The Entry Point Functions > The compose_for_type Function
  
The compose_for_type Function
The primary entry point for each publishing type is:
compose::compose_for_type(doc, params)
doc
is the document being published
params
is the parameter array
This routine usually loads parameters and then calls the inner layer of the publishing framework.
The function implements persistent parameters for interactive operations; these parameters persist from operation to operation during a Arbortext Editor session. For example, if a user selects a particular stylesheet for publishing a document to PDF, that stylesheet will become the new default choice when the user publishes a PDF a second time.
It creates persistent parameters by determining whether the params array is empty. If it is, the function loads the parameters used in the last interactive operation for this document and publishing type into params. If this is the first interactive publishing operation of its type since the document was opened, nothing is loaded.
After loading parameters, compose_for_type calls the inner layer of the publishing framework, compose::compose_for_type (note, in this case, type is literal in the function name). The compose_for_type function passes the name of the content pipeline, the parameter array, and the names of four callback functions.
When compose::compose_for_type returns, the publishing operation is usually complete and most compose_for_type functions simply return at that point.