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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type 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 |
| gAttributeKey | The 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) | |
| gStringIdFrom | Where 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. | |
| gBarcodeType | The type of the barcode. One of:ean-8, ean-13 | ean-8 |
| gValidateChecksum | Should the the barcode's checksum be validated before displaying it? 1: Yes, 0: No | 1 |
| gDisplayError | Should 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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type 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 |
| gAttributeKey | The 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) | |
| gStringIdFrom | Where 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. | |
| gIndex | Get the Nth occurrance of the found values in the datafile. A numeric, 0-based index. | 0 |
| gAmountDecimals | Specify 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 |
| gStripTrailingZeros | Should 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 |
| gDisplayUoM | Should a second value from the same value-node be appened to the value (for example:unit of measurements)? 0: No, 1: Yes | 0 |
| gUoMAttribute | The property-key of the property-value to be appended to the value, if gDisplayUoM is set to 1. | uom |
| gUoMSeparator | Specify a custom separator between the attribute-value and its unit of measurement (if gDisplayUoM is set to 1) | |
| gDisplayLabel | Should 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. | |
| gLabelSeparator | A string separating the label and value, when the label is displayed. | : |
| gHtmlText | Is 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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type 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 |
| gAttributeKeys | A 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 |
| gStringIdFrom | Where 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. | |
| gAmountDecimals | Specify 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 |
| gStripTrailingZeros | Should 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 |
| gDisplayUoM | Should a second value from the same value-node be appened to the value (for example:unit of measurements)? 0: No, 1: Yes | 0 |
| gUoMAttribute | The property-key of the property-value to be appended to the value, if gDisplayUoM is set to 1. | uom |
| gUoMSeparator | Specify a custom separator between the attribute-value and its unit of measurement (if gDisplayUoM is set to 1) | |
| gDisplayLabel | Should the attribute-label for the current key be displayed in front of the value? 0: No, 1: Yes | 0 |
| gLabelSeparator | A string separating the label and value, when the label is displayed. | : |
| gSeparator | A 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:> | , |
| gMultiValueSeparator | A 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:> | , |
| gHtmlText | Is 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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type 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 |
| gAttributeKey | The 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) | |
| gStringIdFrom | Where 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. | |
| gKeyImage | Key of the property for the image (-url or -path) on the found XML-nodes. Typically something like content, url, ... | key |
| gKeyLabel | Key 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 |
| gFrameDimensions | WxH of the outer frames in mm as float. If left empty, defaults are used. Default: 13.5x19.0 | default |
| gIconDimensions | WxH of the icon frames in mm as float. If left empty, defaults are used. Default: 10.0x10.0 | default |
| gLabelStyle | Paragraphstyle that should be applied to label-texts. | |
| gFileLocation | Specify 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-- |
| gURLNameflag | An option to shorten filenames when downloading webimages (see Webimages). Available values:kOnlyHash: Use hash as filename kEllipsizeStart: Shorten too long filenames at the beginningkEllipsizeMiddle: Shorten too long filenames in the middlekEllipsizeEnd: Shorten too long filenames at the endkNoHashkEllipsizeEnd: Don't add hash to filename and shorten too long filenames at the endkNoHash: Don't add hash to filename | 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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gNodeType | Type 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 |
| gAttributeKey | The 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) | |
| gStringIdFrom | Where 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. | |
| gIndex | Get the Nth occurrance of the found values in the datafile. A numeric, 0-based index. | 0 |
| gDateFormatIn | The format of the given date. Available formats (see Dates-library):ddmmyyyy_localized_ordinalddmmyyyy_localizedmmddyyyy_localizedddmmyyyyddmmyyyy_hhmmddmmyyyy_hhmmssdmyyhhmmhhmmsshmmhmmssyyyymmddhhmmssxmldatetimeiso_time_coloniso_time_hypheniso_dateiso_date_time_coloniso_date_time_hyphenpython_strIf no format is given, XSD-time is used: %Y-%m-%dT%H:%M:%S%z | ddmmyyyy_localized_ordinal |
| gDateFormatOut | The format to which the given date should be formatted. Available formats (see Dates-library):ddmmyyyy_localized_ordinalddmmyyyy_localizedmmddyyyy_localizedddmmyyyyddmmyyyy_hhmmddmmyyyy_hhmmssdmyyhhmmhhmmsshmmhmmssyyyymmddhhmmssxmldatetimeiso_time_coloniso_time_hypheniso_dateiso_date_time_coloniso_date_time_hyphenpython_str | ddmmyyyy_localized_ordinal |
| gLocale | The locale in which date-texts should be localized to. | |
| gDisplayLabel | Should 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. | |
| gLabelSeparator | A 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.
| Parameters | Explanation | Default |
|---|---|---|
| gEntity | A Dataprovider-Entity to use for dataqueries (see Data Provider) Available in default-library: data_provider, generic. | data_provider |
| gAttributeKey | The 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) | |
| gAttributeGroupId | If 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) | |
| gNodeType | Type 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)
| Parameters | Explanation | Default |
|---|---|---|
| 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. |