Specifying custom settings in Config Files for Development: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
(Undo revision 4563 by Moray (talk))
 
(9 intermediate revisions by 3 users not shown)
Line 2: Line 2:
While developing on either the client side or the server side you might want to specify custom settings in the .config files for the client side and the server side.
While developing on either the client side or the server side you might want to specify custom settings in the .config files for the client side and the server side.


For instance, you can change the DebugLevel, the IP Address/Port of your development PetraServerConsole instance, etc.
For instance, you can change the DebugLevel, the IP Address/Port of your development PetraServerConsole instance, etc. Some of this things can be changed in your OpenPetra.build.config.
You can find other examples [[Quicker development/debugging/testing turnaround with customised PetraClient startup|here]] that speed up the development/debugging/testing turnaround.


==Location of auto-generated configuration files==
You can find other examples [[Quicker development/debugging/testing turnaround with customised PetraClient startup|here]] that speed up the development/debugging/testing turnaround. Those changes need to be made in the config files of PetraClient or PetraServer.
 
==Location of ''auto-generated'' configuration files - don't edit those==
* The PetraClient application picks up its configuration file from the <code>\etc\Client.config file</code>.
* The PetraClient application picks up its configuration file from the <code>\etc\Client.config file</code>.
* The PetraServerConsole application picks up its configuration file from the <code>\etc\Server.config file</code>.
* The PetraServerConsole application picks up its configuration file from the <code>\etc\Server.config file</code>.


'''However, ''these files'' get overridden when <code>nant startPetraServer</code> or <code>nant startPetraClient</code> are run!!!'''
'''However, ''these files'' get overwritten when <code>nant startPetraServer</code> or <code>nant startPetraClient</code> are run!!!'''
 
To avoid loosing your changes to these files you need to make the changes to the appropriate .config file in the ''template of that file'', or to OpenPetra.build.config!
 
==Location of ''template'' configuration files==
The folder <code>\inc\template\etc\</code> contains one file for the client configuration, <code>Client.config</code> and several config files for the server configuration, named <code>Server-mysql.config</code>, <code>Server-postgresql.config</code> and <code>Server-sqlite.config</code>. Determine the correct server .config file by choosing the one that relates to the RDBMS you are currently using for development.
 
===Creating custom .config files===
* Follow the instructions [[Building and maintaining customized versions of OpenPetra#Execute_debug_version_by_developer | here]] to create your custom .config files that contain your changes.
* You could run <code>nant initConfigFiles</code> to see the effect of your changes, but startPetraServer and startPetraClient will run initConfigFiles anyway each time.
* Run <code>nant startPetraServer</code> and/or <code>nant startPetraClient</code> to start the appropriate application with the .config file changes applied.
 
==Modify settings in OpenPetra.build.config==
You can overwrite all default settings from <code>inc\nant\OpenPetra.common.xml</code>.


To avoid loosing your changes to these files you need to make the changes to the appropriate .config file in the ''template of that file''!
For example you find these lines in OpenPetra.common.xml:
<property name="Server.Port" value="9000"
          overwrite="false" />
<property name="Server.DebugLevel" value="0"
          overwrite="false" />


This means, you can overwrite these values in your OpenPetra.build.config:
<property name="Server.Port" value="9300"/>
<property name="Server.DebugLevel" value="5"/>


==Location of template configuration files==
See also [[User defined configuration parameters with OpenPetra.build.config]]
The folder <code>\inc\template\etc\</code> contains one file for the client configuration, <code>Client.config</code> and several config files for the server configuration, named <code>Server-mysql.config</code>, <code>Server-postgresql.config</code> and <code>Server-sqlite.config</code>. For editing the correct server file choose the one that relates to the RDBMS you are currently using for development.


===Editing the Config files===
All those values are applied to the config files for the PetraServer and the PetraClient automatically each time when they are started. Those values are also applied to the .my config files, if you keep the variable names in there, eg. ${Server.DebugLevel}
* Edit the Client.Config file and/or the correct Server-*.config file in <code>\inc\template\etc\</code> to make your changes that you want to apply after <code>nant startPetraServer</code> and/or <code>nant startPetraClient</code> are run.
* Then run <code>nant initConfigFiles</code>
* Then run <code>nant startPetraServer</code> and/or <code>nant startPetraClient</code> to start the appropriate application with the .config file changes applied.

Latest revision as of 16:11, 4 Mayıs 2016

Why would one specify custom config file settings for development?

While developing on either the client side or the server side you might want to specify custom settings in the .config files for the client side and the server side.

For instance, you can change the DebugLevel, the IP Address/Port of your development PetraServerConsole instance, etc. Some of this things can be changed in your OpenPetra.build.config.

You can find other examples here that speed up the development/debugging/testing turnaround. Those changes need to be made in the config files of PetraClient or PetraServer.

Location of auto-generated configuration files - don't edit those

  • The PetraClient application picks up its configuration file from the \etc\Client.config file.
  • The PetraServerConsole application picks up its configuration file from the \etc\Server.config file.

However, these files get overwritten when nant startPetraServer or nant startPetraClient are run!!!

To avoid loosing your changes to these files you need to make the changes to the appropriate .config file in the template of that file, or to OpenPetra.build.config!

Location of template configuration files

The folder \inc\template\etc\ contains one file for the client configuration, Client.config and several config files for the server configuration, named Server-mysql.config, Server-postgresql.config and Server-sqlite.config. Determine the correct server .config file by choosing the one that relates to the RDBMS you are currently using for development.

Creating custom .config files

  • Follow the instructions here to create your custom .config files that contain your changes.
  • You could run nant initConfigFiles to see the effect of your changes, but startPetraServer and startPetraClient will run initConfigFiles anyway each time.
  • Run nant startPetraServer and/or nant startPetraClient to start the appropriate application with the .config file changes applied.

Modify settings in OpenPetra.build.config

You can overwrite all default settings from inc\nant\OpenPetra.common.xml.

For example you find these lines in OpenPetra.common.xml:

<property name="Server.Port" value="9000" 
         overwrite="false" />
<property name="Server.DebugLevel" value="0" 
         overwrite="false" />

This means, you can overwrite these values in your OpenPetra.build.config:

<property name="Server.Port" value="9300"/>
<property name="Server.DebugLevel" value="5"/>

See also User defined configuration parameters with OpenPetra.build.config

All those values are applied to the config files for the PetraServer and the PetraClient automatically each time when they are started. Those values are also applied to the .my config files, if you keep the variable names in there, eg. ${Server.DebugLevel}