Optimizing the configuration
For a simple installation of Portofino the basic configuration is sufficient, but to enable certain advanced features or to better tune the application to your needs we encourage you to use the settings described below.
Remember to restart the application server after you have changed the configuration file.
The default name of an application is "My Application". To change it, add the following line to the configuration file:
model.application.name=Your Application Name
The basic configuration instructs Portofino to create a connection to the database every time a page is requested. This approach works but has poor performance and should be avoided especially in production environments. A better approach is to ask the application server to create and manage a pool of database connections and then configure Portofino to use it.
Create the connection pool following the instructions of your application server. You can give the pool any name (e.g., "portofinodb") and use the same jdbc parameters (driver class, connection url, etc) you have used in the initial configuration. Then change the database settings to the following two lines:
Portofino can record every change you make to the model in a log file. This file can later be used to recreate your application on another database. It works almost like a database dump, except changes are recorded incrementally, rather than as snapshots. Portofino can put this file unsed version tracking.
To enable these feature, create a working directory (e.g., /some/working/directory) and a module directory inside it (e.g., /some/working/directory/mymodule). Then add the following properties to your configuration file:
If you plan to use versioning it is very important that you do so from the very beginning of the project, or versining will not be able to function properly.
Also make sure that the user that runs the application server can read and write the directories you have provided.
If you plan to use blobs in your application, you have to enable the version tracking (see the previous section). The blobs will be created in the directory
model.users.enabled, which is false by default, tells Portofino to handle user login and logout.
The second property, model.users.anonymous.enabled, which is true by default, tells Portofino whether anonymous users can access the application. If set to false, Portofino redirects anonymous users to the login page.
To enable user management with mandatory login, add the following lines to your configuration file:
User management relies on certain classes and relationships (User, UserGrp and User_UserGrp) to be present in your model. If they are not present, the system will turn user management off even if model.users.enabled is set to true.
This is recommended for all production systems.
If, at a later stage, you will want to upgrade your database to a new version of Portofino, you'll have to set the property to true.
Previous: Running the installer
Next: Running multiple instances