Documentation Center

prepare

Function that prepares a publication for viewing.

Description

Function that processes uploaded content into a viewable publication with Table of Contents and Index, resolves references (graphics, conrefs, and so on), and makes the language version live. Most steps write a progress message into the system log.

Parameters

action
prepare
otherpubs
(For use with type=full; default is otherpubs=false.) Directs the program to process the uploaded content for the named pub and lang, then update any other publications on the server that use the same version of that content. Values are "true" and "false". Ignored with step parameter is defined.
resources
(For use with type=full; no default value.) Comma-space delimited list of resources (GUIDs, no extensions) that contain variable definitions and other library content in the named publication.
root
(For use with type=topic or otherpubs=true; no default value.) When updating a publication by editing a single map or a single topic, provide the ID of that resource.
cancel
(For use with type=full; true or false; default is false.) When a prepare function has returned with an error condition, call prepare with cancel=true to delete content in the holding area and unlock the publication.
publish
(For use with type=topic; default is publish=all.) Extent of the topic prepare function; values are "hold", "live", "cancel", "all", or "none".
type
The type of prepare: full or topic. (Default is type=full.) Full prepare performs complete steps as directed by the step parameter and may be used when uploading either partial or complete publication content. Topic prepare is intended for a single topic and its included graphics and performs minimal processing to allow quick feedback to an editor; the topic prepared this way is not fully prepared for publication and distribution.
lang
A language version of a publication.
pub
A publication, which is a logical grouping of information (topics and multimedia) related to a specific subject, containing one or more language versions.
step
(For use with type=full; default is step=all.) One stage of the prepare function; can take one of the these values: "start_prepare" "resolve_refs_early" "build_index" "build_toc" "resolve_refs" "make_live" "update_status" "end_prepare" "all" "unlock".

Example URL

http://<host>:<port>/<context>/web/pub.xql?action=prepare&otherpubs=<value>&resources=<value>&root=<value>&cancel=<value>&publish=<value>&type=<value>&lang=<value>&pub=<value>&step=<value>

Successful Result

This function returns a standard API result element (<result status='SUCCESS' statusCode='0' message='Localized Message' messageKey='message.key'/>). A statusCode of 0 indicates a successful execution. Any other statusCode indicates a failure.

Failed Result

Accessing this API feature requires the "Manage pubs" permission, and the function will throw a permission exception if the permission is not available.