Definition of the data pool for placeholder.

Definition of the data pool for placeholder. Datat for placeholder can come form various pools:

If a connection to a database or a SOAP service has been established, this source is always preferred. To request or change individual data from databases, use the modules query or soap. For XML file-based data use the xmlquery module. Variables from type DataPool contain the required connection. You can set the values of these variables independently of the current InDesign® connection.

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.

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.

Name Type Default Description
Return DataPool   A new object of type DataPool
DataPool		pool	= datapool::alloc ();
: datapool::release (pool);

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

sql::dbconnection
xml::app_path

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.

Name Type Default Description
Return DataPool   A new object of type DataPool
DataPool		pool	= datapool::alloc ();
: datapool::release (pool);

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::alloc

static int type(DataPool pool = 0)

Type of the (current) database connection.

Name Type Default Description
Return int   kNotConnected
kDBCConnection
kXMLConnection
kSOAPConnection
pool DataPool 0 From which database connection is the type to be derived?

0 - current connection
Otherwise - Defined data pool
#include "internal/types.h"

Version 1.2.2 (16. Nov. 2005)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::login
comet.datapool.getConnection

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.

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-ins

In 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.eval (script, '', '');

Version 4.3, R35590

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

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!

Name Type Default Description
Return int   For ODBC connections, the value previously set with datapool::set_vendor

otherwise : -1
pool DataPool 0 From which data connection should the vendor be determined?

0 - Current data connection

otherwise - Defined data connection

v4.1.8 R30220 (22022022)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

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.

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 connection
vendor int -1 1 : Oracle
2 : Sybase
3 : mySQL
4 : DB2
6 : PostGre
7 : SAP

-1 : Undefined

v4.1.8 R30220 (22022022)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

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.

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).
DataPool		pool	= datapool::alloc ();
datapool::set_dbc (pool, 0);
: datapool::release (pool);

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

sql::dbconnection
datapool::get_dbc
comet.datapool.loginDB
comet.datapool.loginSOAP

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.

Name Type Default Description
Return int   0 or ErrorCode
pool DataPool - Defined datapool
fpath String or char* - File source of the pool
DataPool		pool	= datapool::alloc ();
char			myxmlpath[4069];
document::folder (myxmlpath); strcat (myxmlpath, "/"); strcat (myxmlpath, "xmldata"); datapool::set_files (pool, myxmlpath);
: datapool::release (pool);

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

xml::app_path
datapool::get_files
datapool::login
comet.datapool.loginXML

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.

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

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::set_dbc
comet.datapool.getConnection

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.

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

Version 1.1.7

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::set_files
comet.datapool.getConnection

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.

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:

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?
  • 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.

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.
  • 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.
  [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:
  1. All products that meet the specified conditions will be included in the results list.
  2. Replace with [] : Products that do not match the specified conditions are replaced by their sub-products.
  3. Expand with {} : After products that do not match the specified conditions, the sub-products of these products are added to the results list.
Conditions

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.

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 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:

VALUE FUNCTION REL_OP VALUE ( CONDITIONS ) and or CONDITIONS

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.

= != < > <> like

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*):

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

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;
    List		l1	= list::alloc ();
    int			i;
if (gRun != 0) return 0;
result = datapool::get_products (   "selected [pageitemid > 0]",   l1); if (result && result != -1199) { showmessage ("Error %d", result); } else { for (i=0; i < list::length (l1); i++) { showmessage ("%d: %d", i+1, list::get (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;
    List 			prod  	= list::alloc();
    List 			prod2 	= list::alloc();
    List 			prod3 	= list::alloc();
    StringList 		prod4 	= stringlist::alloc ();		// StringList without Class-ID
    StringList 		ppp		= stringlist::alloc (3, 1);	// StringList with Class-ID
    char			strid[4000];
    char			name[4000];
    char			temp[4000];
if (gRun > 1) return 0; // only once
datapool::get_products ("selected ", prod, prod2, prod3, prod4); while (num<list::length(prod)) { id1 = list::get (prod ,num,0); id2 = list::get (prod2,num,0); id3 = list::get (prod3,num,0); stringlist::gettext (prod4, num, "", strid);
strcpy (temp, "get_products %d : \n\n"); strcat (temp, "id1=%d\n"); strcat (temp, "id2=%d\n"); strcat (temp, "id3=%d\n"); strcat (temp, "stringid via stringlist::gettext='%s'\n"); strcat (temp, "stringid via stringlist::get='%s'");
showmessage(temp,   num+1,   id1, id2,id3,   strid,   stringlist::get (prod4, num));
num = num+1; }
num = 0; while (num<stringlist::length(ppp)) { stringlist::gettext (ppp, num, "StringID", strid); stringlist::gettext (ppp, num, "Num", name);
strcpy (temp, "alloc by class 3 : entry %d\n\n"); strcat (temp, "stringid='%s'\n"); strcat (temp, "name='%s'");
showmessage(temp, num+1, strid, name);
num = num+1; }
list::release (prod); list::release (prod2); list::release (prod3); list::release (prod4); return 0; }

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

priint:comet InDesign® Plug-Ins, comet_pdf

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.

Name Type Default Description
Return int*, DBC, SOAP   Database connection or 0 (for XML paths)
type int - connection type

1 : ODBC
2 : XML
3 : SOAP
dsn 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

Version 1.4.1 (15. Juni 2007)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::logout
datapool::set_files
comet.datapool.loginXML
comet.datapool.loginDB
comet.datapool.loginSOAP

static int logout(int type)

Finish current data connection.

Name Type Default Description
Return int   1 Okay
0 : Error
type int - connection type

1 : ODBC
2 : XML
3 : SOAP

Version 1.4.1 (15. Juni 2007)

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

datapool::login
comet.datapool.logout

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.

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.

Version v4.2 R33285, 21. July 2023

priint:comet InDesign® Plug-Ins, comet_pdf

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.

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_template (gFrame); ttid = datapool::get_main_template (tid, &l, &m, &r, &cl, &cm, &cr);
wlog ("", "# Frame %d\n", item::getint (gFrame)); wlog ("", "# Template : %d of %d (%s) with [%d, %d, %d, %d, %d, %d]\n",   tid, ttid,   datapool::get_template_name (tid),   l, m, r, cl, cm, cr);
return 0; }

Version 3.2 R2267, 8. Feb. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

get_template_name
frame::get_page_element
frame::get_template

static char* get_template_name(int pid)

Get a templates name.

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_template (gFrame); ttid = datapool::get_main_template (tid, &l, &m, &r, &cl, &cm, &cr);
wlog ("", "# Frame %d\n", item::getint (gFrame)); wlog ("", "# Template : %d of %d (%s) with [%d, %d, %d, %d, %d, %d]\n",   tid, ttid,   datapool::get_template_name (tid),   l, m, r, cl, cm, cr);
return 0; }

Version 3.2 R2267, 8. Feb. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

get_main_template
frame::get_page_element
frame::get_template

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®).

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
#include "internal/publications.h"
#include "internal/publications.h"
char stHost [] = "http://192.168.0.208:4502"; char stUser [] = "admin"; char stPwd [] = "***";
int main () { PublicationList pl = publication::publicationlist::alloc (); Publication p; int i;
wlog ("", "==== /my folder ====\n"); datapool::aem_get_list (pl, stHost, stUser, stPwd, "/my folder", 0); for (i = 0; i < publication::publicationlist::length (pl); i++) { p = publication::publicationlist::get (pl, i); wlog ("", "Name : %s\n", publication::gets (p, kName)); wlog ("", "Type : %s\n", publication::gets (p, kType)); wlog ("", "Path : %s\n", publication::gets (p, kPath)); wlog ("", "\n"); }
publication::publicationlist::release (pl);
return 0; }

v4.1 R22145, 29. März 2018

priint:comet InDesign® Plug-Ins, comet_pdf

file::aem_put_asset
file::aem_put_asset

Since
Version 1.1.7, Januar 2005

Alphabetic index HTML hierarchy of classes or Java