Skip to main content

Text

BARCODE​

Id: 1​

Retrieve an attribute-value from the datafile and convert it to glyphs that can be displayed by a barcode-font. The barcode-font that is currently supported is LibreBarcode. See Barcode-Library for more information.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType of nodes in the XML-file, below which the attribute is located.
Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group
product
gAttributeKeyThe key of the attribute, where the barcode-number is located. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gStringIdFromWhere should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options:
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
--child-record-- from Child-Record
--string-id--
gParentNodeType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Type of node in the XML-file, below which the current record is located.
gParentStringIdFrom(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Where should the string-id for the dataprovider-queries come from. Options:
None
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gChildReferenceType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The reference-type by which the found child-records are filtered by.
gChildIndex(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The index of the found childrecords.
gBarcodeTypeThe type of the barcode. One of:
ean-8, ean-13
ean-8
gValidateChecksumShould the the barcode's checksum be validated before displaying it?
1: Yes, 0: No
1
gDisplayErrorShould an Error be displayed instead of Barcode-characters, if the checksum- can't be validated or the input can't be converted to barcode-characters?
0: No, 1: Yes
0

ATTRIBUTE VALUE​

Id: 2​

Retrieve an attribute-value from the datafile and output it as the content of the text-placeholder.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType of nodes in the XML-file, below which the attribute is located.
Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group
product
gAttributeKeyThe key of the attribute, where the value is located. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gStringIdFromWhere should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options:
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
--child-record-- from Child-Record
--string-id--
gParentNodeType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Type of node in the XML-file, below which the current record is located.
gParentStringIdFrom(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Where should the string-id for the dataprovider-queries come from. Options:
None
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gChildReferenceType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The reference-type by which the found child-records are filtered by.
gChildIndex(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The index of the found childrecords.
gIndexGet the Nth occurrance of the found values in the datafile. A numeric, 0-based index.0
gAmountDecimalsSpecify how many decimals of a float-value should be displayed. If the value can't be converted to a valid float, no changes are done.All
gStripTrailingZerosShould trailing zeros of float-values be removed? If the value can't be converted to a valid float, no changes are done.
0: No, 1: Yes
0
gDisplayUoMShould a second value from the same value-node be appened to the value (for example:unit of measurements)?
0: No, 1: Yes
0
gUoMAttributeThe property-key of the property-value to be appended to the value, if gDisplayUoM is set to 1.uom
gUoMSeparatorSpecify a custom separator between the attribute-value and its unit of measurement (if gDisplayUoM is set to 1)
gDisplayLabelShould the attribute-label for the current key be displayed in front of the value?
0: No, 1: Yes
0
gAttributeGroupId(Optional) The Id of the attribute-group (if known), when the label is displayed.
gLabelSeparatorA string separating the label and value, when the label is displayed.:
gHtmlTextIs the attribute-value HTML-text and needs to be converted to TaggedText?
0: No, 1: Yes, 2: as Rawtext (without HTML-Tags or -Attributes)
0
gDelimiterParameters<not implemented>

ATTRIBUTE LIST​

Id: 3​

Retrieve multiple attribute-values from the datafile and output them formatted as a list to the text-placeholder. Can retrieve all values of one attribute or all values of all attributes, by providing a commaseparated list of keys.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType of nodes in the XML-file, below which the attribute is located.
Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group
product
gAttributeKeysA commaseparated list of attribute-keys, where values should be retrieved from. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
key1,key2,key3
gStringIdFromWhere should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options:
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
--child-record-- from Child-Record
--string-id--
gParentNodeType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Type of node in the XML-file, below which the current record is located.
gParentStringIdFrom(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Where should the string-id for the dataprovider-queries come from. Options:
None
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gChildReferenceType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The reference-type by which the found child-records are filtered by.
gChildIndex(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The index of the found childrecords.
gAmountDecimalsSpecify how many decimals of a float-value should be displayed. If the value can't be converted to a valid float, no changes are done.All
gStripTrailingZerosShould trailing zeros of float-values be removed? If the value can't be converted to a valid float, no changes are done.
0: No, 1: Yes
0
gDisplayUoMShould a second value from the same value-node be appened to the value (for example:unit of measurements)?
0: No, 1: Yes
0
gUoMAttributeThe property-key of the property-value to be appended to the value, if gDisplayUoM is set to 1.uom
gUoMSeparatorSpecify a custom separator between the attribute-value and its unit of measurement (if gDisplayUoM is set to 1)
gDisplayLabelShould the attribute-label for the current key be displayed in front of the value?
0: No, 1: Yes
0
gLabelSeparatorA string separating the label and value, when the label is displayed.:
gSeparatorA string separating all found values of different attributes. Can be any string; by default these are offered:
Comma: ,
Space:
Line Break (HTML): <nl:>
Line Break (soft) (HTML): <br/>
Hard return (HTML): <p/>
ParaStyle: <ParaStyle:>
,
gMultiValueSeparatorA string separating found values of the same attribute. Can be any string; by default these are offered:
Comma: ,
Space:
Line Break (HTML): <nl:>
Line Break (soft) (HTML): <br/>
Hard return (HTML): <p/>
ParaStyle: <ParaStyle:>
,
gHtmlTextIs the attribute-value HTML-text and needs to be converted to TaggedText?
0: No, 1: Yes
0

MULTIFRAME INLINE​

Id: 4​

Retrieve multiple items of an attribute key and output them as inline-elements with an imageframe and optionally a text-label in the current frame (repeating elements / multiframe-elements). Expects a key to a property of the found nodes at which an url to a webimage is located. Optionally expects a key to a property of the found nodes where a textlabel of the image is located.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType of nodes in the XML-file, below which the attribute is located.
Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group
product
gAttributeKeyThe key of the attribute, where the values are located. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gStringIdFromWhere should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options:
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
--child-record-- from Child-Record
--string-id--
gParentNodeType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Type of node in the XML-file, below which the current record is located.
gParentStringIdFrom(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Where should the string-id for the dataprovider-queries come from. Options:
None
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gChildReferenceType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The reference-type by which the found child-records are filtered by.
gChildIndex(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The index of the found childrecords.
gKeyImageKey of the property for the image (-url or -path) on the found XML-nodes. Typically something like content, url, ...key
gKeyLabelKey of the property for the label on the found XML-nodes. Typically something like label, content, ... If no key is given, no outer frames around the icon-frames are created and no label is displayed.key
gFrameDimensionsWxH of the outer frames in mm as float. If left empty, defaults are used. Default: 13.5x19.0default
gIconDimensionsWxH of the icon frames in mm as float. If left empty, defaults are used. Default: 10.0x10.0default
gLabelStyleParagraphstyle that should be applied to label-texts.
gFileLocationSpecify whether the attribute-values for gAttributeKey are:
--web--: URLs that point to a webimage
--zip--: Relative paths to files in the ticket-folder, thus being part of a zip-payload of the renderpdf-request
--local--: Relative paths that point to files in the folder for static images renderpdf/comet/images
--web--
gURLNameflagAn option to shorten filenames when downloading webimages (see Webimages). Available values:
kOnlyHash: Use hash as filename
kEllipsizeStart: Shorten too long filenames at the beginning
kEllipsizeMiddle: Shorten too long filenames in the middle
kEllipsizeEnd: Shorten too long filenames at the end
kNoHashkEllipsizeEnd: Don't add hash to filename and shorten too long filenames at the end
kNoHash: Don't add hash to filename<empty value>: None
kOnlyHash

ATTRIBUTE DATE​

Id: 5​

Retrieve an attribute-value from the datafile and format it as a date. Specify the input-format of the date and how it should be transformed. If a format with localized date-texts is chosen, a locale needs to be specified as well.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gNodeTypeType of nodes in the XML-file, below which the attribute is located.
Available in default-library: product, sku, asset, attribute_group_definitions, attribute_group
product
gAttributeKeyThe key of the attribute, where the value is located. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gStringIdFromWhere should the string-id for the dataprovider-queries come from. If no value is given, the gRecordStringId is used. Other options:
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
--child-record-- from Child-Record
--string-id--
gParentNodeType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Type of node in the XML-file, below which the current record is located.
gParentStringIdFrom(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
Where should the string-id for the dataprovider-queries come from. Options:
None
--string-id-- from gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gChildReferenceType(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The reference-type by which the found child-records are filtered by.
gChildIndex(Optional, only applies, if --child-record--is selected in gStringIDFrom.)
The index of the found childrecords.
gIndexGet the Nth occurrance of the found values in the datafile. A numeric, 0-based index.0
gDateFormatInThe format of the given date. Available formats (see Dates-library):
ddmmyyyy_localized_ordinal
ddmmyyyy_localized
mmddyyyy_localized
ddmmyyyy
ddmmyyyy_hhmm
ddmmyyyy_hhmmss
dmyy
hhmm
hhmmss
hmm
hmmss
yyyymmddhhmmss
xmldatetime
iso_time_colon
iso_time_hyphen
iso_date
iso_date_time_colon
iso_date_time_hyphen
python_str
If no format is given, XSD-time is used: %Y-%m-%dT%H:%M:%S%z
ddmmyyyy_localized_ordinal
gDateFormatOutThe format to which the given date should be formatted. Available formats (see Dates-library):
ddmmyyyy_localized_ordinal
ddmmyyyy_localized
mmddyyyy_localized
ddmmyyyy
ddmmyyyy_hhmm
ddmmyyyy_hhmmss
dmyy
hhmm
hhmmss
hmm
hmmss
yyyymmddhhmmss
xmldatetime
iso_time_colon
iso_time_hyphen
iso_date
iso_date_time_colon
iso_date_time_hyphen
python_str
ddmmyyyy_localized_ordinal
gLocaleThe locale in which date-texts should be localized to.
gDisplayLabelShould the attribute-label for the current key be displayed in front of the value?
0: No, 1: Yes
0
gAttributeGroupId(Optional) The Id of the attribute-group (if known), when the label is displayed.
gLabelSeparatorA string separating the label and value, when the label is displayed.:

ATTRIBUTE LABEL​

Id: 6​

Retrieve a label of an attribute from the datafile, specified in the structure of type attribute_group_definitions.

ParametersExplanationDefault
gEntityA Dataprovider-Entity to use for dataqueries (see Data Provider)
Available in default-library: data_provider, generic.
data_provider
gAttributeKeyThe key of the attribute, where the label-value is located. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gAttributeGroupIdIf available, the id of the attribute-group, in which the attribute is located. This parameter is optional, but could help executing more precise queries to the datafile. Can be a custom string or specified in parts of the gRecordStringID
--roottable-id-- from gRecordStringID1 (RootTableID)
--col-id-- from gRecordStringID2 (ColumnID)
--row-id-- from gRecordStringID3 (RowID)
gNodeTypeType of nodes in the XML-file, below which the attribute-label is located. Typically attribute_group is expected, but can be modified to match incoming data.attribute_group

TOC Replace Pagenumber​

Id: 201​

Use this placeholder in templates that are established in a table of contents, on a text that should be replaced by the pagenumber of a toc-record. First, the table of contents needs to be established. Then, using the library table_of_contents.py you can generate a toc-object by searching the document for records and trigger the pagenumber-replacement.

(...)
comet.product.establish(toc_productlist, PAGE_TEMPLATE_ID, TEMPLATE_ID, page)
page_range_toc = comet.gDocument.getPages()
last_toc_page_index = page_range_toc[-1].getIndex()

(...)
comet.product.establish(productlist, PAGE_TEMPLATE_ID, TEMPLATE_ID, page_range_toc[-1])
page_range = comet.gDocument.getPages()[last_toc_page_index:]

toc_lib = comet.pyImport("[xml]/library/table_of_contents.py")
toc = toc_lib.TableOfContents({"type":"product","base_attributes":["label","id"]}, page_range, placeholder_range=[200])
toc.replace_pagenumbers(placeholder_id=201, page_range=page_range_toc, hyperlink_type=comet.CTextModel)
ParametersExplanationDefault
tocTextPrefix(Optional) Custom string to insert before the found pagenumber.
tocKeyPrefix(Optional) Key to attribute-value to load from corresponding record and insert before the found pagenumber. Takes precident over tocTextPrefix.
tocTextSuffix(Optional) Custom string to append after the found pagenumber.
tocKeySuffix(Optional) Key to attribute-value to load from corresponding record and append after the found pagenumber. Takes precident over tocTextSuffix.