The config element
config element is always root element in a .cphrase file. Its DTD-based definition is:
<!ELEMENT config (table|view|report|cascade)*> <!ATTLIST config id CDATA #REQUIRED db CDATA #REQUIRED language CDATA #IMPLIED version CDATA #IMPLIED description CDATA #IMPLIED>
id is the identifier of the configuration. The folder and .cphrase and .py files associated with this configuration will all use this identifier.
db specifies how to connect to the underlying database. In stand-alone
mode the actual database may not be built yet. If so, then launching NLIs will result in an error message
reminding the administrator to build an SQLite database. The specific format of the db attribute is a text
string that always starts with either
sqlserver: followed by a connection string. In the case of SQLite, the connection string is simply the name of the
database file. For example,
db="sqlite:personal.db" specifies the local SQLite database.
To help, we have two databases running on a remote server that you should be able to connect to via the following database connection strings.
mysql:user=readonly,password=db123,database=world,host=188.8.131.52,port=3306 postgresql:dbname=northwind host=184.108.40.206 user=readonly password=db123 port=5432
Note that if you are uncomfortable having the password as clear text in the connection string of the
you may access passwords via environmental variables. Thus the following would work:
mysql:user=readonly,password=$WORLD_PW,database=world,host=220.127.116.11,port=3306 postgresql:dbname=northwind host=18.104.22.168 user=readonly password=$NW_PW port=5432As long as the environmental variables are set. The recommended way to set these in the
.bashrcof your log-in on the C-Phrase host. For example if the
export WORLD_PW=db123 export NW_PW=db123
Now that you have confirmed that you can access these databases, to connect to your own database, you must have
a user account with a password on the remote database. You must also ensure that your database server allows for
remote connections from your running server.
Assuming this is achieved, configurations for remote databases
require a connection string like the two example above to be supplied. These connection strings can be fairly complex,
but they always start with the database engine (either
followed by a psycopg2,
language is an optional comma separated list of languages with the first language
being the dominant one. Its default value is
language="english". Since C-Phrase currently only
supports Swedish and English, this could in its most complex form be
which would mean that both English and Swedish would be covered, but paraphrases and messages would be in
version This is the original version of C-Phrase the configuration was built with. This is helpful for future upgrade routines that might be run over configurations if we run into backward compatibility problems.
config element, sub-elements represent tables,
reports and then string processing directives in
Virtual Config element
To support multi-tenancy, C-Phrase includes Virtual Configs.