#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 | |
| 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-Offline.#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.
#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 Include.< /td> |
The include is only executed with a valid XML-Offline connection.
Include stmt with ID 4 from includes.xml. #include ".xml_/123, 4" |
|
|
[xml]/path <xml>/path .xml_/path |
Import the script file from the XML offline data folder. The path is resolved relative the XML data folder. |
The include is only evaluted with a valid XML-Offline connection. The file must be encrypted.
Include action 1000 of the current XML offline foloder. #include ".xml_/actions/1000.crpt" |
|
| Database Import | |||
|
[sql]/statement <sql>/statement .sql_/statement |
Import from a data base |
The include is only executed wth a valid database connection. The first result row of the statement
must be a string or CLOB.
Load script 4 from table ‘scripts’. #include ".sql_/select st from scripts where id = 4"
|
|
| SOAP Import | |||
|
[soap]/id <soap>/id .soap_/id |
Import via the SOAP connection |
The include is only evaluted when connected to a SOAP service. Load the script file with the file ID mystuff.cpp. #include ".soap_/mystuff.cpp" |
|
| PubServer Import | |||
| [pubserver]/LibraryIdentifier.h | Import of a Script Library |
The include is only evaluated when connected to a PubServer.
Load the script file with the file ID ProjectLib.h. #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. See here for an introductory example. |
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. |
|
| [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. |
||
| [pubserver]/stdlib.c |
Import cScript-Code of the "CScript standard library".
The include is a shortcur for the following include: #include "[pubserver]/plugin/ com.priint.pubserver.comet.bridge.cscript. CScriptStandardLibrary.c"The import can only be performed if CScriptStandardLibrary is installed on the server. |
||
Alphabetic index HTML hierarchy of classes or Java