-
Notifications
You must be signed in to change notification settings - Fork 15
KittoConfigurationDelphi
This document describes Kitto's standard conventions for setting up Delphi, and how to change them for custom setups.
For a quick startup of a new application, you can just:
- Copy the directory structure of HelloKitto or another example application;
- Open the project file and save it under a new name;
- Edit Config.yaml and start creating your own metadata files.
When running the compiled application, beware that it will try to run as a service if under an administrator account. To force the application to run with a visible GUI, pass -a
as a command line argument.
If instead you want a detailed description of what's where and what you can customize, read on.
A Kitto application is made up of a Delphi project that you create and maintain, a Home folder with metadata and resources (such as images or javascript files), and a link to the Kitto sources or precompiled files.
As you can see in the HelloKitto example, a typical folder structure for Delphi XE3 goes like this:
- HelloKitto
- Home
- Metadata
- Models
- Views
- Config.yaml
- Resources
- js
- application.js
- js
- Example.exe (the compiled application)
- Metadata
- Source
- Projects
- DXE3
- HelloKitto.dproj/dpr (project files)
- DXE3
- Lib
- Externals
- Kitto
- Source
- Home
- Kitto
- Home
Your application code goes into Source
and Projects
, and the project file should be configured to output the compiled dcu files into subdirectories of Lib
:
Unit output directory = ..\..\Lib\DXE3\$(Config)\$(Platform)
and the exe file into Home
:
Output directory = ..\..\Home
This folder contains your yaml metadata and support files as well, and is called the Application Home.
The Application Home is assumed to the your executable's directory. You can change this (for example when using a single Kitto executable to serve different applications) in the following ways:
- By passing a
-home
argument on the command line. - By setting the property
TKConfig.AppHomePath
at application startup.
Externals\Kitto\Home
contains the predefined metadata and support files, such as Kitto's default style sheet and images, which are used by your Kitto application at run time and you shouldn't need to touch. This is called the System Home.
As you can see, the application needs to have Kitto inside its directory structure. This is done to allow different applications to use different versions of the library without stepping on each other's toes, and to make the application as much self-contained as possible.
The project should be configured to find Kitto, either in source format:
Search path = ..\..\Externals\Kitto\Source;
..\..\Externals\Kitto\Source\EF;
..\..\Externals\Kitto\Source\!ThirdParty;
..\..\Externals\Kitto\Source\!ThirdParty\TPerlRegEx;
..\..\Externals\Kitto\Source\!ThirdParty\!ExtPascal;
..\..\Externals\Kitto\Source\!ThirdParty\!ExtPascal\ExtJSWrapper
or in pre-compiled format:
Search path = ..\..\Externals\Kitto\Lib\DXE3\$(Config)\$(Platform)
TPerlregEx is not used since Delphi XE.
For the latter version to work, you need to build Externals\Kitto\Projects\DXE3\Kitto.dproj
at least once.
By default, the System Home is the first existing path in the following list (relative to the executable directory):
- ..\Externals\Kitto\Home\
- ....\Externals\Kitto\Home\
- ......\Home\
- %KITTO%\Home\
If none of the paths above exists, then the Application Home is assumed. This allows you to prepare a zero-configuration setup in which the System and Application Home paths are merged in the default Application Home. As explained here, a typical deployment directory looks like this:
- HelloKitto
HelloKitto.exe * Metadata * Resources
If you'd like a centralized setup better, you can change that easily, in one of the following ways:
- You can make Kitto a junction/link so it points to a directory elsewhere. Windows has been supporting file system links for a good while now; you can find a utility to manage them here.
- If you use Subversion, you can define
Kitto
as an external folder that points to a different svn repository. - You can put Kitto elsewhere and change the search path accordingly in the project options. Be warned that this takes care of the
Kitto\Source
directory, but your application will still needKitto/Home
at run time. If you want to moveKitto\Home
elsewhere as well, you will need to do the following at application startup (for example, in a unit's initialization section:
TKConfig.SystemHomePath := 'Path:\To\Kitto\Home\';
That's it. You should now be ready to develop and test your Kitto applications. We suggest that you stick to the standard conventions unless you have good reasons to do otherwise, because they are designed to save you time and effort in the long run.
- Kitto at a glance
- Getting started
- Setup
-
Basic concepts
- Basic Materials
- Controllers
- Features
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information
- Kitto Enterprise