#include from various data sources.

Includes can exist of non-local files too. Corresponding to the current data link Includes can also be loaded from XML data, databases or via SOAP connections. The following applies : Includes from inactive database connection will be ignored. This ensures that scripts can function under various data links.

The example shows the Includes, which are necessary in order to be able to use the implementations of the action 10000.

#include "internal/text.h"
#include "[xml]/actions/10000.crpt" #include "[soap]/actions/10000.crpt" #include "[sql]/select stmt from actions where id = 10000"

The table describes the possible Includes.
Syntax Description Comments Example
Local files
path Import of local files. Paths can be specified in the cscript standard write format. Include will be executed in all data links, but relative paths are only supported under XML #include "$DESKTOP/mystuff.c"

#include "stuff.c"
Internal files
internal/name Import internal definition files Include will be executed in all data links. Following internal Includes are in existence.
  • internal/frameinfos.h
  • internal/panels.h
  • internal/products.h
  • internal/publications.h
  • internal/table.h
  • internal/text.h
  • internal/textattributes.h
  • internal/types.h
#include "internal/text.h"
XML files
[xml]/pID sID
<xml>/pID sID
.xml_/pID sID

[xml]/pID sName
<xml>/pID sName
.xml_/pID sName
Import via the XML file panelstatements.xml. At first, the panel statement will be loaded with the ID pID.
The found command will then be executed. The first result column of this command must be a string. In the where-condition of the command must contain exactly one '?', this '?' will be replaced by sID or sName. The name may be enclosed with quotation marks but this is not necessary.
The string that is found is the result of the Includes.
Include will only be executed where there is a valid XML data link. #include ".xml_/123, 4"
with Panel statement 123
"includes.xml" select stmt node includes.include where id = ?.

Result of the Includes is stmt from includes.xml with the ID 4.
[xml]/path
<xml>/path
.xml_/path
Import the coded script file from the XML data folder. The path is specified relative the XML data folder. Include will only be executed where there is a valid XML data link. The file must be coded. #include ".xml_/actions/1000.crpt"
Database import
[sql]/statement
<sql>/statement
.sql_/statement
Import from a data base Include will only be executed where there is a valid database connection. The first result row of the statement must be a string or CLOB. #include ".sql_/select stmt from includes where id = 12"
SOAP import
[soap]/id
<soap>/id
.soap_/id
Import via the SOAP connection Include will only be executed where there is a valid SOAP connection. #include ".soap_/mystuff.cpp"
PubServer import
[pubserver]/LibraryIdentifier.h Import of a Script Library Include is only available when connected to a PubServer. #include "[pubserver]/ProjectLib.h"
[pubserver]/plugin/PluginName.c Import of cScript-Code for calling Java methods of a PubServer Plugin directly from the cScript. PluginName is the registration name of the Java Plugin.

For more information about calling Java methods from cScript see here.
Include is only available when connected to a PubServer.

Take care to use the extension .c here.

To get an on the fly documentation of the available cScript functions inside the Java plug-in please follow this steps: Write the include path into the field Script / File ID of panel Placeholder Options and replace the extension .c by .h:



Clicking the disc symbol will download the file. The containing folder is opened on your desktop automatically. Inside the file you will find all available functions and and (hopefully) some descriptions of this functions.
see here
[pubserver]/plugins.c Import of cScript-Code for calling Java methods of all available PubServer Plugins.

Please note: plugins.c is just a meta include, which contains include directives for all available Java plug-ins.
#include "[pubserver]/plugins.c"
[pubserver]/stdlib.c Import cScript-Code of the "CScript standard library". This is a shortcut for

#include "[pubserver]/plugin/
com.priint.pubserver.comet.bridge.cscript.
CScriptStandardLibrary.c"


This import can only be executed, if the CScriptStandardLibrary is deployed on the server.
#include "[pubserver]/stdlib.c"

Since

Available
priint:comet InDesign® Plug-Ins, comet_pdf

Alphabetic index HTML hierarchy of classes or Java