comet.publication¶
The comet.publication module provides factory functions fetching information about publications from the remote Publishing Server connection.
See also
- Class
CPublication
Instances of CPublication objects
Methods¶
- comet.publication.collectDocuments(publicationID, levels=-1)¶
Collect all documents of a publication in levels sub levels.
- Parameters:
- Returns:
The documents as publication objects.
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter publicationID is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getProperty(name, documentID=None)¶
Get a property of a publication or a document.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.setProperty(name, value, documentID=None)¶
Set a property of a publication or a document.
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.checkoutByID(documentID, ID1=2, ID2=0, ID3=0, convert=0)¶
Check out a document using the document ID.
This function defines the environment variables required for publication scripts and executes Panelstatement 111 (Checkout)
Please note: this function allows to checkout documents independent of the Publication panel, this means: most of the values usually defined for publication nodes in the panel (such as status, info1, info2 etc.) are not available, if checkout is triggered by calling this function.
Usually these values aren’t required for checkout scripts either; the checkout script included in the standard delivery for examples refers to the ID attributes of publication nodes only, i.e. ID1, ID2, ID3 and StringID, the latter being used as the publication nodes document ID.
Documents, which are managed in the priint:planner use the ID1 attribute for the document-type, possible values are
1 for publication nodes
2 for document nodes
3 for spread nodes
Therefore, using the default values (ID1 = 2, ID2 = 0, ID3 = 0) for the numeric IDs usually should work - at least for priint:planner publication documents.
If you intent to use this functions to checkout other documents (i.e. documents not managed with priint:planner or documents not provided by the standard CometPublication PlugIn), you must double-check these values, shortly spoken: all IDs must match the values of the corresponing publication node, if it was loaded / shown in the publication panel.
If the document is already checked out, it will just be opened from the file system resp. be brought to front.
Please note also: In InDesign® Server the function implementation is empty
- Parameters:
documentID (str) – ID of the document in the publication system
ID1 (int) – Numeric ID1 of the document, usually used for the document type
ID2 (int) – Numeric ID2 of the document
ID3 (int) – Numeric ID3 of the document
convert (int) –
How to handle documents created with outdated versions.
0: Automatically convert
1: Do not convert
2: Show dialog and ask
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign®
- CScript:
- comet.publication.checkinByID(documentID, ID1=2, ID2=0, ID3=0)¶
Check in a document using the document ID.
This function defines the environment variables required for publication scripts and executes Panelstatement 115 (Checkin)
Please note: this function allows to checkin documents independent of the Publication panel, this means: most of the values usually defined for publication nodes in the panel (such as status, info1, info2 etc.) are not available, if checkin is triggered by calling this function.
Usually these values aren’t required for checkin scripts either; the statement included in the standard delivery for examples refers to the global variable gDocumentID only, which is available independet from the publication panel. ID attributes of publication nodes only, i.e. ID1, ID2, ID3 and StringID, the latter being used as the publication nodes document ID.
Documents, which are managed in the priint:planner use the ID1 attribute for the document-type, possible values are
1 for publication nodes
2 for document nodes
3 for spread nodes
Therefore, using the default values (ID1 = 2, ID2 = 0, ID3 = 0) for the numeric IDs usually should work - at least for priint:planner publication documents.
If you intent to use this functions to checkin other documents (i.e. documents not managed with priint:planner or documents not provided by the standard CometPublication PlugIn), you must double-check these values, shortly speaken: all IDs must match the values of the corresponing publication node, if it was loaded / shown in the publication panel.
Please note also: In InDesign® Server the function implementation is empty
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign®
- CScript:
- comet.publication.revertByID(documentID, ID1=2, ID2=0, ID3=0)¶
Revert a checked out document defined by its documentID. Local changes made to the document will be lost.
Documents, which are managed in the priint:planner use the ID1 attribute for the document-type, possible values are
1 for publication nodes
2 for document nodes
3 for spread nodes
Therefore, using the default values (ID1 = 2, ID2 = 0, ID3 = 0) for the numeric IDs usually should work - at least for priint:planner publication documents.
If you intent to use this functions to checkin other documents (i.e. documents not managed with priint:planner or documents not provided by the standard CometPublication PlugIn), you must double-check these values, shortly speaken: all IDs must match the values of the corresponing publication node, if it was loaded / shown in the publication panel.
Please note also: In InDesign® Server the function implementation is empty
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign®
- CScript:
- comet.publication.getAllParameters()¶
Get all defined publication parameters.
- Returns:
The found elements
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getAllPublicationTypes()¶
Get all defined publication types.
- Returns:
The found elements
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getAllWorkflowStates()¶
Get all defined workflow states.
- Returns:
The found elements
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getPublications(parentID='')¶
Get the sub elements of a publication, or all root elements.
- Parameters:
parentID (str) –
The ID of the publication to fetch children for.
Empty str: Fetch the root elements
- Returns:
The found elements
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getParameters(documentID)¶
Get the parameters of a document.
- Parameters:
documentID (str) – The ID of the document
- Returns:
The parameters as key/values in a dict
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getWorkflowStates(documentID)¶
Get the workflow states of a document.
- Parameters:
documentID (str) – The ID of the document
- Returns:
The states for the document
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getWorkflowStatus(documentID)¶
Get the current workflow status of a document.
- Parameters:
documentID (str) – The ID of the document
- Returns:
The current state of the document
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter documentID is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.getProductPlanning(documentID, entityID='', searchStr='', mappingFlag=0)¶
Get a list of products scheduled for the provided document.
- Parameters:
documentID (str) – The ID of the document
entityID (str) – Limit to products of this entity type
searchStr (str) – Limit to products matching the given search criteria
mappingFlag (int) –
Flag for mapping
0 : Use IDs of the planned Bucket
1 : Use IDs of the Planning record
2 : Use IDs of planned Bucket and ID of the Planning record as parent
- Returns:
List of planned products
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter documentID is empty
When parameter mappingFlag has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.fromXMLStringList(xml)¶
Create a list of str from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLFloatList(xml)¶
Create a list of float from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLIntList(xml)¶
Create a list of ints from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLKeyValueList(xml)¶
Create a dict of [str, str] from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLElement(xml)¶
Create a CElement object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.fromXMLElementList(xml)¶
Create a list of CElement from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.fromXMLIDType(xml)¶
Create a CIDType object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLIDTypeList(xml)¶
Create a list of CIDType from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLParameter(xml)¶
Create a CParameter object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLParameterList(xml)¶
Create a list of CParameter from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLPlanning(xml)¶
Create a CPlanning object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLPlanningList(xml)¶
Create a list of CPlanning from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLProduct(xml)¶
Create a CProduct object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.fromXMLProductList(xml)¶
Create a list of CProduct from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.fromXMLPublication(xml)¶
Create a CPublication object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLPublicationList(xml)¶
Create a list of CPublication from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLPublicationType(xml)¶
Create a CPublicationType object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLPublicationTypeList(xml)¶
Create a list of CPublicationType from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLWorkflowStatus(xml)¶
Create a CWorkflowStatus object from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.fromXMLWorkflowStatusList(xml)¶
Create a list of CWorkflowStatus from an XML string
- Parameters:
xml (str) – The XML representation of this object
- Returns:
The constructed object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter xml is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLStringList(input, rootElementName='strings')¶
Generate the XML structure of a list of strings.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLFloatList(input, rootElementName='floats')¶
Generate the XML structure of a list of floats.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLIntList(input, rootElementName='integers')¶
Generate the XML structure of a list of ints.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLKeyValueList(input, rootElementName='keyvalues')¶
Generate the XML structure of a a key value dict
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLElement(element, rootElementName='element')¶
Generate the XML structure of a CElement object
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.toXMLElementList(input, rootElementName='elements')¶
Generate the XML structure of a list of CElement
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.toXMLIDType(IDType, rootElementName='recordid')¶
Generate the XML structure of this object.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLIDTypeList(input, rootElementName='recordids')¶
Generate the XML structure of a list of CIDType.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLParameter(parameter, rootElementName='parameter')¶
Generate the XML structure of a CParameter.
- Parameters:
parameter (CParameter) – The parameter
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLParameterList(input, rootElementName='parameters')¶
Generate the XML structure of a list of CParameter.
- Parameters:
input (list[CParameter]) – The parameters
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLPlanning(planning, rootElementName='planning')¶
Generate the XML structure of a CPlanning object
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLPlanningList(input, rootElementName='plannings')¶
Generate the XML structure of a list of CPlanning.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLProduct(product, rootElementName='product')¶
Generate the XML structure of a CProduct object
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.toXMLProductList(input, rootElementName='products')¶
Generate the XML structure of a list of CProduct.
- Parameters:
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf®
- CScript:
- comet.publication.toXMLPublication(publication, rootElementName='publication')¶
Generate the XML structure of a CPublication object
- Parameters:
publication (CPublication) – The publication
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLPublicationList(input, rootElementName='publications')¶
Generate the XML structure of a list of CPublication.
- Parameters:
input (list[CPublication]) – The publications
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLPublicationType(publicationType, rootElementName='publicationtype')¶
Generate the XML structure of a CPublicationType object
- Parameters:
publicationType (CPublicationType) – The publication type
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLPublicationTypeList(input, rootElementName='publicationtypes')¶
Generate the XML structure of a list of CPublication.
- Parameters:
input (list[CPublicationType]) – The publication types
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLWorkflowStatus(workflowStatus, rootElementName='workflowstatus')¶
Generate the XML structure of a CWorkflowStatus object
- Parameters:
workflowStatus (CWorkflowStatus) – The workflow status
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- comet.publication.toXMLWorkflowStatusList(input, rootElementName='workflowstates')¶
Generate the XML structure of a list of CWorkflowStatus.
- Parameters:
input (list[CWorkflowStatus]) – The workflow states
rootElementName (str) – Name of the root element
- Returns:
The XML string representation of this object
- Return type:
- Raises:
TypeError – When parameter types are invalid
When parameter input contains invalid values
When parameter rootElementName is empty
- Available:
InDesign® comet_pdf® Illustrator®
- CScript: