class datapool
Definition of the data pool for placeholder.
Documentation
Definition of the data pool for placeholder. Datat for placeholder can come form various pools:
- XML files
- Database (ODBC)
- Oracle (OCI), Mac only
- SOAP resp. PublishingServer
If you have set up a database connection in InDesign®, a call by datapool::set_dbc (pool, 0) hides all calls to the connected database. For example, the function document::place_items would therefore not attempt to read your required data (the description of the templates) from the database, but from the currently defined XML file instead. If you change this setting too by using datapool::set_files (pool, "neuer Pfad"), the templates will be retrieved from this path.
-
Name Type Default Description Return DataPool A new object of type DataPool DataPoolDatatype for the definition of the data source for placeholder. Data for placeholder can be derived from various sources: pool = datapool::allocCreate a new variable from the datapool data type. The variable will be automatically filled with the current settings in InDesign®. The database connection contains the value of sql::dbconnection. The file connection contains the value xml::app_path. The variable must be deleted again using ... (); : datapool::releaseDelete a variable of the datapool type. Following the call of this function, the value of the variable may not longer be accessed. (pool);
- Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- sql::dbconnection
xml::app_path -
Name Type Default Description Return DataPool A new object of type DataPool DataPoolDatatype for the definition of the data source for placeholder. Data for placeholder can be derived from various sources: pool = datapool::allocCreate a new variable from the datapool data type. The variable will be automatically filled with the current settings in InDesign®. The database connection contains the value of sql::dbconnection. The file connection contains the value xml::app_path. The variable must be deleted again using ... (); : datapool::releaseDelete a variable of the datapool type. Following the call of this function, the value of the variable may not longer be accessed. (pool);
- Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::alloc
-
Name Type Default Description Return int kNotConnected
kDBCConnection
kXMLConnection
kSOAPConnectionpool DataPool 0 From which database connection is the type to be derived?
0 - current connection
Otherwise - Defined data pool - Preconditions
- #include "internal/types.h"
- Since
- Version 1.2.2 (16. Nov. 2005)
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::login
comet.datapool.getConnection
-
Name Type Default Description Return String Name of the given data connection The return value is read only, do NOT CHANGE. The result will be overridden on following calls to the function. See here to learn more about functions returning r/o values.
pool DataPool 0 Valid data connection
0 or empty : Current data connection of the plug-insIn the example, the call is used in a Javascript.
var gScript = "int main () \ {\ \ strcpy (gOutput, datapool::get_label (0));\ return 0;\ }\ "; var conLabel = app.comet.evalString eval(String cscript, String argument, String resultPath, /* comet_pdf only */ (script, '', '');
- Since
- Version 4.3, R35590
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
-
Name Type Default Description Return int For ODBC connections, the value previously set with datapool::set_vendor
otherwise : -1pool DataPool 0 From which data connection should the vendor be determined?
0 - Current data connection
otherwise - Defined data connection - Since
- v4.1.8 R30220 (22022022)
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
-
Name Type Default Description Return int 0 : For ODBC connections
otherwise : noDatabaseErr (= 400)pool DataPool 0 In which data connection should the manufacturer be set?
0 - Current data connection
otherwise - Defined data connectionvendor int -1 1 : Oracle
2 : Sybase
3 : mySQL
4 : DB2
6 : PostGre
7 : SAP
-1 : Undefined - Since
- v4.1.8 R30220 (22022022)
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
-
Name Type Default Description Return int 0 or ErrorCode pool DataPool - Defined datapool dbc int*, DBC or SOAP - Database connection or 0 For the database connection only 0 or the currently valid connection (sql::dbconnection, soap::connection). DataPoolDatatype for the definition of the data source for placeholder. Data for placeholder can be derived from various sources: pool = datapool::allocCreate a new variable from the datapool data type. The variable will be automatically filled with the current settings in InDesign®. The database connection contains the value of sql::dbconnection. The file connection contains the value xml::app_path. The variable must be deleted again using ... (); datapool::set_dbcSet the database connection of the datapool. The command has the particular function of suppressing the storing and writing of data to/from the database, even though the database connection has been created via InDesign®. For the database connection only 0 or the currently valid connection (sql::dbconnection) may be ... (pool, 0); : datapool::releaseDelete a variable of the datapool type. Following the call of this function, the value of the variable may not longer be accessed. (pool);
- Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- sql::dbconnection
datapool::get_dbccomet.datapool.loginDB
comet.datapool.loginSOAP
-
Name Type Default Description Return int 0 or ErrorCode pool DataPool - Defined datapool fpath String or char* - File source of the pool DataPoolDatatype for the definition of the data source for placeholder. Data for placeholder can be derived from various sources: pool = datapool::allocCreate a new variable from the datapool data type. The variable will be automatically filled with the current settings in InDesign®. The database connection contains the value of sql::dbconnection. The file connection contains the value xml::app_path. The variable must be deleted again using ... (); char myxmlpath[4069]; document::folderFolder of the given document without path delimiter (: or /) at the end. For the entry a string is expected which has sufficient reserved memory (mind. 1024) in order to handle the result. The function will not provide any result for new unsaved ... (myxmlpath); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (myxmlpath, "/"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (myxmlpath, "xmldata"); datapool::set_filesSet the file source of the datapool. For the file pool a folder must be specified, which corresponds to the definitions of WERK II. (pool, myxmlpath); : datapool::releaseDelete a variable of the datapool type. Following the call of this function, the value of the variable may not longer be accessed. (pool);
- Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- xml::app_path
datapool::get_files
datapool::logincomet.datapool.loginXML
-
Name Type Default Description Return int*, DBC oder SOAP Database connection of the pool. On basis of datapool::alloc this value is the current database connection and corresponds to teh result of the function sql::dbconnection bzw. soap::connection pool Datapool - Defined datapool - Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::set_dbc
comet.datapool.getConnection
-
Name Type Default Description Return String or char* (Depends on parameter result) File connection of the pool. Based on datapool::alloc this value is the current database connection and corresponds to the result of xml::app_path. Same as parameter result pool DataPool - Defined datapool result String or char* - Reserved memory for the result - Since
- Version 1.1.7
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::set_files
comet.datapool.getConnection
- Arrows that run around a part mean that this part is optional.
- Rounded green frames are so-called Terminal Symbols. The text within these frames is expected to be written in exactly this way in the statements.
- Violet rectangular frames are so-called Non-Terminals and their meanings can be found in the corresponding descriptions.
- list : All products in the list
- watched : Eye-marked products
- selected : Selected products. Please note that the list selection is fluid and normally always adapted to the current document selection!
- clean : Reorganize all document pages from the current frame position. This selector only has a meaning in the document::build_products command.
- with doubles allowed : The same product may appear more than once in the results list
- with no doubles : Results list entries must unique. If a product is already included in the list, it will not be added again. Duplicate products in the basic selection of the Product Pool are not removed of course.
- All products that meet the specified conditions will be included in the results list.
- Replace with [] : Products that do not match the specified conditions are replaced by their sub-products.
- Expand with {} : After products that do not match the specified conditions, the sub-products of these products are added to the results list.
- with no doubles: New products are only added if they are not yet included in the list.
- with doubles allowed: (Default) Products are inserted without checking for already existing entries.
-
Only Level 2
selected first [ pageitemid > 0 ] rlevel 2
-
Search max. Levels 2
selected first [ pageitemid > 0 ] until rlevel 2
-
All Down to Level 2
selected all [ pageitemid > 0 ] until rlevel 2
-
No (Do not check and/or load sub-products)
selected
- ||
- lower
- upper
- trim : Remove all whitespace at the beginning and end
- instr (a, b) : Is b contained in a? The result is an int
- substr (start, len)
- atoi : Convert a string into a number. The result is an int
-
Name Type Default Description Return int 0 or ErrorCode statement String or char* - siehe oben l1 List - Allocated list for the IDs of the detected objects. l2 List 0 Allocated list for the ID2s of the detected objects. l3 List 0 Allocated list for the ID3s of the detected objects s1 List 0 Allocated string list for the StringIDs of the detected objects flags int 0 Unused checkTemplates int 0 Shall be checked if the products have defined templates?
0 : No, no check necessary
1 : Yes, please check. Products without a defined template in the Product Pool are then will not be added to the results lists.Here is an example for a statement, with which all products and sub-products of the current selection (marked, not watched!) can be collected. In this the object will automatically be dived into if the template of the object has not been defined. The attempt will be ended with a nesting depth of 10. From the resulting list all entries the IDs of which <= 0 will be removed.
selected [pageitemid > 0 ? level < 10] id2 > 2
Get the IDs of the selected products having a template defined.
int main () { int result; ListList of integers. The data type List can be used synonymically for int*. It serves to improve the readability of scripts and can be used at all positions where a list can be used. l1 = list::allocGet the object list of the panel which contains the objects of the desired classid. If no corresponding panel is found, 0 is returned. Otherwise the list will be filled with the desired IDs of the loaded objects. The result list must be deleted again using list::release. [ab v3.3 R3136] ... (); int i; if (gRunIn placeholder scripts the constant specifies the call situation (load, write, ... ) of the script. In paneland Front Row actions the constant describes the frame index of the call. != 0) return 0; result = datapool::get_productsBased on the current selection of panel Product Pool, one or more lists of product IDs are determined. Needed sub-entries are loaded automatically. For loading sub-entries the same statements are used like in the Product Pool. The order in the results lists corresponds to the order in the ... ( "selected [pageitemid > 0]", l1); if (result && result != -1199) { showmessageDisplay the standard dialog with a message. ("Error %d", result); } else { for (i=0; i < list::lengthAscertain the number of elements of a list (l1); i++) { showmessageDisplay the standard dialog with a message. ("%d: %d", i+1, list::getGet the i-te element of the list. List positions are 0-based, meaning the first element has the position 0, the last the position-1. (l1, i)); } } return 0; }
The third example demonstrates the differences between class-id based stringlists and string lists without any class id allocated. Mark some entries of the product panel with an eye, and select some other entries of the list by hiliting.
int main () { int id1, id2, id3; int num = 0; ListList of integers. The data type List can be used synonymically for int*. It serves to improve the readability of scripts and can be used at all positions where a list can be used. prod = list::allocGet the object list of the panel which contains the objects of the desired classid. If no corresponding panel is found, 0 is returned. Otherwise the list will be filled with the desired IDs of the loaded objects. The result list must be deleted again using list::release. [ab v3.3 R3136] ...(); ListList of integers. The data type List can be used synonymically for int*. It serves to improve the readability of scripts and can be used at all positions where a list can be used. prod2 = list::allocGet the object list of the panel which contains the objects of the desired classid. If no corresponding panel is found, 0 is returned. Otherwise the list will be filled with the desired IDs of the loaded objects. The result list must be deleted again using list::release. [ab v3.3 R3136] ...(); ListList of integers. The data type List can be used synonymically for int*. It serves to improve the readability of scripts and can be used at all positions where a list can be used. prod3 = list::allocGet the object list of the panel which contains the objects of the desired classid. If no corresponding panel is found, 0 is returned. Otherwise the list will be filled with the desired IDs of the loaded objects. The result list must be deleted again using list::release. [ab v3.3 R3136] ...(); StringList"StringList" prod4 = stringlist::allocGet the string IDs of the panels which contain the objects of the desired classid. If no corresponding panel is found, 0 is returned. Other the list will be filled with the desired StringIDs of the loaded objects. The result list must again be deleted using ... (); // StringList without Class-ID StringList"StringList" ppp = stringlist::allocGet the string IDs of the panels which contain the objects of the desired classid. If no corresponding panel is found, 0 is returned. Other the list will be filled with the desired StringIDs of the loaded objects. The result list must again be deleted using ... (3, 1); // StringList with Class-ID char strid[4000]; char name[4000]; char temp[4000]; if (gRunIn placeholder scripts the constant specifies the call situation (load, write, ... ) of the script. In paneland Front Row actions the constant describes the frame index of the call. > 1) return 0; // only once datapool::get_productsBased on the current selection of panel Product Pool, one or more lists of product IDs are determined. Needed sub-entries are loaded automatically. For loading sub-entries the same statements are used like in the Product Pool. The order in the results lists corresponds to the order in the ... ("selected ", prod, prod2, prod3, prod4); while (num<list::lengthAscertain the number of elements of a list(prod)) { id1 = list::getGet the i-te element of the list. List positions are 0-based, meaning the first element has the position 0, the last the position-1. (prod ,num,0); id2 = list::getGet the i-te element of the list. List positions are 0-based, meaning the first element has the position 0, the last the position-1. (prod2,num,0); id3 = list::getGet the i-te element of the list. List positions are 0-based, meaning the first element has the position 0, the last the position-1. (prod3,num,0); stringlist::gettextGet the value of an element of a list element. The requestable attribute are dependent on the class ID of the list. The table of valid value can be found here. (prod4, num, "", strid); strcpyCopy the contents of a char*-string into another, the contents of s2 will be copied into s1. (temp, "get_products %d : \n\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "id1=%d\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "id2=%d\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "id3=%d\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "stringid via stringlist::gettext='%s'\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "stringid via stringlist::get='%s'"); showmessageDisplay the standard dialog with a message.(temp, num+1, id1, id2,id3, strid, stringlist::getGet the i-th element of the list. List positions are 0-based, the first element has the position 0, the final the position length-1. (prod4, num)); num = num+1; } num = 0; while (num<stringlist::lengthAscertain the number of elements of a list.(ppp)) { stringlist::gettextGet the value of an element of a list element. The requestable attribute are dependent on the class ID of the list. The table of valid value can be found here. (ppp, num, "StringID", strid); stringlist::gettextGet the value of an element of a list element. The requestable attribute are dependent on the class ID of the list. The table of valid value can be found here. (ppp, num, "Num", name); strcpyCopy the contents of a char*-string into another, the contents of s2 will be copied into s1. (temp, "alloc by class 3 : entry %d\n\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "stringid='%s'\n"); strcatConcatenation of char*-strings, append s2 to s1. The target string s1 must be long enough to accommodate the second string s2. (temp, "name='%s'"); showmessageDisplay the standard dialog with a message.(temp, num+1, strid, name); num = num+1; } list::releaseDelete a created list again using list::alloc (prod); list::releaseDelete a created list again using list::alloc (prod2); list::releaseDelete a created list again using list::alloc (prod3); list::releaseDelete a created list again using list::alloc (prod4); return 0; }
- Since
- Version 1.2.1 (21 September 2005)
s1 since Version 1.4.1 R380, 21. Juni 2007
Parameter flags and checkTemplates since v4.2 R33730, 31. Okt 2023 - Available
- priint:comet InDesign® Plug-Ins, comet_pdf
-
Name Type Default Description Return int*, DBC, SOAP Database connection or 0 (for XML paths) type int - connection type
1 : ODBC
2 : XML
3 : SOAPdsn String or char* - depends on connection type
ODBC : DSN
XML : path
SOAP : Host.user String or char* 0 User name, ignored for XML connections password String or char* 0 password, ignored for XML connections dbOrLang String or char* 0 database name (ODBC) or language (SOAP), ignored for XML connections client String or char* 0 Mandant / Client lazy int 1 Do only (re)connect, if the login data defers from the current connetion charset int 0 Used Charset
0 : System character set
1 : Unicode
2 : Unicode 32Bit
3 : UTF-8 - Since
- Version 1.4.1 (15. Juni 2007)
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::logout
datapool::set_filescomet.datapool.loginXML
comet.datapool.loginDB
comet.datapool.loginSOAP
-
Name Type Default Description Return int 1 Okay
0 : Errortype int - connection type
1 : ODBC
2 : XML
3 : SOAP - Since
- Version 1.4.1 (15. Juni 2007)
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator
- See Also
- datapool::login
comet.datapool.logout
-
Name Type Default Description Return int Previous value of the setting state int -1 0 : Show all dialogs again
1 : Suppress script and query errors
2 : Do not warn missing and incorrect placeholder actions
3 : 1 and 2
otherwise : Get current setting
The setting is reset when the current data connection is terminated. - Since
- Version v4.2 R33285, 21. July 2023
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf
-
Name Type Default Description Return int ID of main template or 0 in case of some errors pid int - template ID l, u, r, cl, cu, cr jeweils int* 0 IDs of sub templates. (0 or pointer to an integer variable)
Templates without page restrictions
l : 0
u : TemplateID
r: 0
cl: 0
cu : Continuing template or 0
cl: 0
Page specific templates
l : left pages
u : 0
r: right pages
cl: continuing template for left pages or 0
cu : 0
cl: continuing template for right pages or 0
Get the template that inserted a frame into the document and collect its sub entries.
int main () { char ename [2000]; int tid; int ttid, l, m, r, cl, cm, cr; tid = frame::get_templateFind the template that inserted a frame into the document. (gFrameCurrent frame for which the script is executed. In action scripts of frame placeholders this value equals gItem. In text placeholders the variable contains a reference to the text frame of the current text model. If no frame is valid, the value is 0.); ttid = datapool::get_main_templateGet the main template and (optionally) the sub templates of a template. (tid, &l, &m, &r, &cl, &cm, &cr); wlogWrite a log file message. Please also note the hints for writing logs. ("", "# Frame %d\n", item::getintUID of the reference. Information on UIDs can be found here. (gFrameCurrent frame for which the script is executed. In action scripts of frame placeholders this value equals gItem. In text placeholders the variable contains a reference to the text frame of the current text model. If no frame is valid, the value is 0.)); wlogWrite a log file message. Please also note the hints for writing logs. ("", "# Template : %d of %d (%s) with [%d, %d, %d, %d, %d, %d]\n", tid, ttid, datapool::get_template_nameGet a templates name. (tid), l, m, r, cl, cm, cr); return 0; }
- Since
- Version 3.2 R2267, 8. Feb. 2011
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf
- See Also
- get_template_name
frame::get_page_element
frame::get_template -
Name Type Default Description Return char* Name of template. The return value is read only, do NOT CHANGE. The result will be overridden on following calls to the function. See here to learn more about functions returning r/o char* values.
pid int - ID of template Get the template that inserted a frame into the document and collect its sub entries.
int main () { char ename [2000]; int tid; int ttid, l, m, r, cl, cm, cr; tid = frame::get_templateFind the template that inserted a frame into the document. (gFrameCurrent frame for which the script is executed. In action scripts of frame placeholders this value equals gItem. In text placeholders the variable contains a reference to the text frame of the current text model. If no frame is valid, the value is 0.); ttid = datapool::get_main_templateGet the main template and (optionally) the sub templates of a template. (tid, &l, &m, &r, &cl, &cm, &cr); wlogWrite a log file message. Please also note the hints for writing logs. ("", "# Frame %d\n", item::getintUID of the reference. Information on UIDs can be found here. (gFrameCurrent frame for which the script is executed. In action scripts of frame placeholders this value equals gItem. In text placeholders the variable contains a reference to the text frame of the current text model. If no frame is valid, the value is 0.)); wlogWrite a log file message. Please also note the hints for writing logs. ("", "# Template : %d of %d (%s) with [%d, %d, %d, %d, %d, %d]\n", tid, ttid, datapool::get_template_nameGet a templates name. (tid), l, m, r, cl, cm, cr); return 0; }
- Since
- Version 3.2 R2267, 8. Feb. 2011
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf
- See Also
- get_main_template
frame::get_page_element
frame::get_template -
Name Type Default Description Return int 0 or ErrorCode pli PublicationList - Destination list for the list of contents. List must be allocated before using publication::publicationlist::alloc. If the table of contents could be read successfully, the list is emptied automatically before refilling.
You can read the entries of the list using publication::gets:
kName : Name of entry
kType : Type of entry, "assets/folder" oder "assets/asset"
kPath : Path of entry inside the asset component of AEM®
url String oder char* - URL of AEM® user String oder char* - User name to login into AEM® password String oder char* - Paasword of user assetpath String oder char* - Complete path of asset in the asset component of the AEM®. Non-existent folders are created automatically. Existing folders remain unchanged.
0 or empty : root folder ("/")inclRenditions int 0 Insert renditions into the result list?
0 : No
1 : Yes - Preconditions
- #include "internal/publications.h"
- Since
- v4.1 R22145, 29. März 2018
- Available
- priint:comet InDesign® Plug-Ins, comet_pdf
- See Also
- file::aem_put_asset
file::aem_put_asset
alloc
static DataPool alloc()
Create a new variable from the datapool data type. The variable will be automatically filled with the current settings in InDesign®. The database connection contains the value of sql::dbconnection. The file connection contains the value xml::app_path. The variable must be deleted again using datapool::release.
release
static int release(DataPool pool)
Delete a variable of the datapool type. Following the call of this function, the value of the variable may not longer be accessed.
type
static int type(DataPool pool = 0)
Type of the (current) database connection.
get_label
static String get_label(DataPool pool = 0)
Determine the (unique) name of a data connection. The name corresponds to the description that is also used in the priint:comet panels.
get_vendor
static int get_vendor(DataPool pool = 0)
Database vendor of the data connection. For ODBC connections, the value previously set with datapool::set_vendor is returned. Otherwise, the function returns the value -1.
Please note that the vendor is not automatically set in ODBC connections either!
set_vendor
static int set_vendor(DataPool pool = 0, int vendor = -1)
Set the database vendor of the data connection. The function only has an effect with ODBC connections, otherwise the call is ignored.
set_dbc
static int set_dbc(DataPool pool, int* dbc)
Set the database connection of the datapool. The command has the particular function of suppressing the storing and writing of data to/from the database, even though the database connection has been created via InDesign®. For the database connection only 0 or the currently valid connection (sql::dbconnection) may be used.
set_files
static int set_files(DataPool pool, char* fpath)
Set the file source of the datapool. For the file pool a folder must be specified, which corresponds to the definitions of WERK II.
You will find the correct definition of the file pool and its place in the folder structure from the document of the functions which use a datapool.
get_dbc
static int* get_dbc(DataPool pool)
Ascertain the database connection of the datapool. On basis of datapool::alloc this value is the current database connection of Indesign® and corresponds to the result of the function sql::dbconnection.
get_files
static char* get_files(DataPool pool, char* result)
Ascertain the database connection of the datapool. On basis of datapool::alloc this value is the current database connection and corresponds to the result of xml::app_path.
get_products
static int get_products(
char* statement,
List l1,
List l2 = 0,
List l3 = 0,
StringList s1 = 0,
int flags = 0,
int checkTemplates = 0)
Based on the current selection of panel Product Pool, one or more lists of product IDs are determined. Needed sub-entries are loaded automatically. For loading sub-entries the same statements are used like in the Product Pool. The order in the results lists corresponds to the order in the Product Pool.
The Product Pool panel must be open for the function.
Loading Sub-Entries
The statement given in statement can be used to recursively expand products or replace them with their sub-products. The newly added products are exactly the same products that (would) appear in the product Pool, if you open an entry there.
The instructions for loading the subentries can be made in two versions. The so-called EBNF notation is used for the descriptions of the respective syntax:
Version 1
This historical syntax of statements has been used successfully for many years and will continue to be supported. For newer implementations, we recommend using the Version 2 of the instructions.

The following table describes the individual Version 1 parts of the parameter statement. If the parameter is empty, all eye-makred products are included in the results list(s).
Part | Default | Description |
Panel | Empty | This information is no longer relevant. The Product Pool (Products) is used as to be the base always. The ItemPool specification is no longer supported since v3.0 of the priint:comet plug-ins. |
Base | watched |
>Initial Products Which visible objects from the Product Pool should be collected initially? Additional Options [Since v3.3 R3303, 26.11.2012] You can also specify whether the list should contain doublers or not. If nothing is specified, doublers are allowed. |
[Expand] {Expand} |
Empty | This part of the statement is the most important - and usually also the most difficult:You specify the criteria (conditions) according to which sub-products are to be included in the results list.
Sub-products of a product are exactly the products that you (would) see when you open the product in the Product Pool. The following generally applies: Conditions can be written in the usual syntax such as in SQL or xmlquery, e.g. id1 > 0 and level > 0. A list of the defined product attributes can be found here. Thereby the attributes are replaced by the current values of the products found. Condition1 ? Condition2 If the condition contains two parts separated by ?, the first part is tested first. If a product matches, Condition2 is ignored (and the product is included in the results list). However, if a product does not match, the second condition is also checked. If the Condition2 matches the product, it is actually replaced resp expanded. Otherwise the product will be removed from the list (with [...]) or taken over unchanged (with {...}) So the second condition thus serves as a termination criterion, as the product tree may form circles. |
Proof | Epty | After all products (and sub-products) have been finished, this condition can be used to check whether the object should remain in the list at all. If a product does not match the condition, the product is removed from the results list again. |
Version 2
This syntax is supported since of v.4.3 R36020 and is used also in the Build-Up dialog of the Product Pool.

Optionally (and only omitted from the EBNF for reasons of space), one of the following phrases can be added at the end in exactly this spelling:
Symbole | Description |
selected | watched |
Which selection of Product Pool should be used? selected : Normal list sxelection watched : Eye marker |
first | all |
If the Conditions match, the entry is transferred to the target list.
Should further possible subentries be searched for? first : No, no further sub-searches all : Yes, check possible subentries |
Condition | Check whether the product fulfills the given conditions. Here is the syntax for conditions. |
until | If until is given, all accessible intermediate levels are visited. Otherwise it is dived to given last level without checking the Condition and only the last level entries are checked. |
level | rlevel |
0-based lowest level of diving: level : Absolute depth in product Pool rlevel : Relative to the selected product or its highest selected parent product |
As mentioned above, the Buld-Up dialog of the Product Pool use Version 2 of the search instruction to determine the products. Here are examples of the queries used there:
Conditions
Conditions check the Properties of the Products and can be true or false. Conditions can be combined with and and or. Here is a description of the syntax of a condition:
and and or do have the usual priority and before or, so A or B and C means A or (B and C). For better readability, however, we recommend using the second notation.
REL_OP := Comparison Operators
Functions
The values of the Product Properties can be edited using simple functions. Please note that functions are only valid for the specified data types!
For integer values (int) the usual basic arithmetic operations are defined:
+, -, *, /
The following functions are defined for strings (char*):
Product Properties
The following table descripts all supported product properties for the entries of panel Product Pool.
Name | Type/Value | Description |
id | int | ID of the object, consisting of 3 numbers and an (optional) string |
id2 | ||
id3 | ||
stringid | char* | |
pageitemid | int | The id of the template given in the object |
docid | int | The id of the document given in the object |
masterpage | char* | The name of the parent page given in the object |
grid | char* | The name of the grid given in the object |
gridid | int | The id of the grid given in the object |
element | char* | The name of the page element given in the object |
elementid | int | The sequence of the page element given in the object |
needsrequest | int [0, 1] | Are the placements of the object complete? |
defined | int [0, 1] | Are the placements valid for the current data connection? |
level | int | Absolute level in the product tree, top level is 0 |
relative_level | [since v3.2.3 R2440] Releative level in the product tree according the top most selcted parent in the tree | |
substatement | int | ID of the panel statement for loading the sub-objects |
classid | int | ClassID of the object |
row1 | char* | Text in the first column of the panel |
row2 | char* | Text in the second column of the panel |
pre_ruleid | int | Pre-handler of the object |
pre_ruleparams | char* | Parameter for the pre-handler |
post_ruleid | int | Post-handler of the object |
post_ruleparams | char* | Parameter for the post-handler |
adparams | char* | Parameter for the placement of advertising banners |
login
static int* login(
int type,
char* dsn,
char* user = 0,
char* password = 0,
char* dbOrLang = 0,
char* client = 0,
int lazy = 1,
int charset = 0)
Create or change a database connection. Login/Logout is only necessary for InDesign® Server batches, they retreive batch and user data from different sources.
logout
static int logout(int type)
Finish current data connection.
suppress_warnings
static int suppress_warnings(int state = -1)
For internal use only Suppress warning dialogs.
Suppressing warnings can lead to errors in the document content and should not be used in productin environments under any circumstances! The function is for test purposes only and should only be used when the placeholder content does not need to be updated.
In the priint:comet plugins there are currently warning dialogs and notices in exactly 1510 places. Please note that the function only suppresses dialogs for missing or incorrect scripts and queries (xmlquery, SQL, soapquery). All other warnings and hints remain active.
get_main_template
static int get_main_template(
int pid,
int* l = 0,
int* u = 0,
int* r = 0,
int* cl = 0,
int* cu = 0,
int* cr = 0)
Get the main template and (optionally) the sub templates of a template.
get_template_name
static char* get_template_name(int pid)
Get a templates name.
aem_get_list
static int aem_get_list(
PublicationList pli,
char* url,
char* user,
char* password,
char* assetpath = 0,
int inclRenditions = 0)
EXPERIMENTAL! Get the list of contents of a folder of an AEM® (Adobe Experience Manager®).
#include "internal/publications.h"
char stHost [] = "http://192.168.0.208:4502";
char stUser [] = "admin";
char stPwd [] = "***";
int main ()
{
PublicationListList of publication objects pl = publication::publicationlist::allocCreate a new, empty PublicationList object. ();
PublicationPublication or Publication Document. Objects of this type are returned by functions of the publication cscript module. Use publication::gets or publication::get to request properties from Publication objects. p;
int i;
wlogWrite a log file message. Please also note the hints for writing logs. ("", "==== /my folder ====\n");
datapool::aem_get_listEXPERIMENTAL! Get the list of contents of a folder of an AEM® (Adobe Experience Manager®). (pl, stHost, stUser, stPwd, "/my folder", 0);
for (i = 0; i < publication::publicationlist::lengthGet the length of a publication list (pl); i++)
{
p = publication::publicationlist::getGet the nth Publication from this PublicationList. Index must be within { 0 .. list length - 1 }. (pl, i);
wlogWrite a log file message. Please also note the hints for writing logs. ("", "Name : %s\n", publication::getsGet a String property of a Publication object. (p, kNamekName == 6));
wlogWrite a log file message. Please also note the hints for writing logs. ("", "Type : %s\n", publication::getsGet a String property of a Publication object. (p, kTypekType == 8));
wlogWrite a log file message. Please also note the hints for writing logs. ("", "Path : %s\n", publication::getsGet a String property of a Publication object. (p, kPathkPath == 13));
wlogWrite a log file message. Please also note the hints for writing logs. ("", "\n");
}
publication::publicationlist::releaseRelease a PublicationList. (pl);
return 0;
}
Alphabetic index HTML hierarchy of classes or Java
© Copyright 2003-2024 WERK II GmbH Duisburg |
This documentation is part of the priint:comet InDesign®, InDesign Server® and Illustrator® plug-in and of the comet_pdf packages and is subject to the same license terms as priint:comet itself. The documentation may neither be passed on nor installed on public servers without the consent of WERK II GmbH. The documentation describes the priint:comet scripting language cScript and provides support for solving technical problems when using the priint:comet plugins. The documentation is not a manual for the priint:comet plugins. A manual of the priint:comet plugins can be found here. The documentation has been prepared with the greatest possible care. In case of errors or hints, please do not hesitate to contact our support. However, faulty or incomplete functional descriptions shall in no case result in an obligation on the part of WERK II GmbH to adapt the described item. This copyright notice may not be removed or altered. |