Explanation of Directory Structure and Rules: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
Line 6: Line 6:
See also [[OpenPETRA_Project_Structure_and_Namespace_Descriptions|OpenPETRA Project Structure and Namespace Descriptions]]!
See also [[OpenPETRA_Project_Structure_and_Namespace_Descriptions|OpenPETRA Project Structure and Namespace Descriptions]]!


= C# Source code =
= C# Source Code =
All C# Source code is in the <code>csharp</code> directory.
All C# Source code is found in the subdirectories of the <code>csharp</code> directory.


Some Third-Party tools and dlls are in <code>csharp/ThirdParty</code>. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.
== ThirdParty ==
Some Third-Party tools and DLL's are found in subdirectories of the <code>csharp/ThirdParty</code>. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.


== Ict.Common ==
The directory <code>csharp/ICT/Common</code> contains some general libraries, eg. connecting to different types of databases, a printing system, String Helper functions, etc.


== Ict.Petra.Shared ==
== ICT.Common ==
The code in directory <code>csharp/ICT/Petra/Shared</code> is intended to be shared between Server and Client. This means, that no access to the database is available in these files, since they must be run on the client as well, which does not have access to the database.
The directory <code>csharp/ICT/Common</code> contains some general libraries, e.g. for connecting to different Relational Database Systems, a printing system, String Helper functions, etc.


<code>csharp/ICT/Petra/Shared/Interfaces</code> is a special directory, which has Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using <code>nant generateGlue</glue>.
 
== ICT.PetraTools ==
This contains several tools for generating code, some NAnt extensions for executing operations on the database, and much more. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra, except for the <code>Ict.Tools.PatchTool.exe</code>.
 
 
== ICT.Testing ==
Various Unit Tests and Integration Tests are found in subdirectories of this directory. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra.
 
 
== ICT.Petra ==
The subdirectories under the <code>csharp/ICT.Petra</code> directory contain most of the C# source code that make up the OpenPetra application. The only other directories that contain such source code are the <code>csharp/ICT/Common</code> and <code>csharp/ThirdParty</code> directories.
 
=== ICT.Petra.Shared ===
The code in directory <code>csharp/ICT/Petra/Shared</code> is intended to be shared between Server and Client. This means that no access to the database is available through Classes in these files since the Classes can be used on the client side as well, and the Client side does not have direct access to the OpenPetra database.
 
 
<code>csharp/ICT/Petra/Shared/lib/data</code> contains Typed DataTables which match the definitions of the database tables. A Class exists for each OpenPetra database table. A programmer uses Typed DataTables to hold data relating to database tables in memory (details can be found [[Overview openPETRA architecture#Typed_DataTables | here]]); these Classes can't be used to access the database, though (that's what the [[Overview openPETRA architecture#DataAccess_Objects | DataAccess Classes]] are for). The Typed DataTables C# Classes are generated automatically, using the <code>nant generateORMdata</code> command. This directory contains generated code for all OpenPetra Modules.
 
<code>csharp/ICT/Petra/Shared/Interfaces</code> contains C# Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using the <code>nant generateGlue</code> command. This directory contains generated code for all OpenPetra Modules.


<code>csharp/ICT/Petra/Shared/lib/RemotingSinks</code> contains code that is used to encrypt the communication between Server and Client, using a public/private key mechanism.
<code>csharp/ICT/Petra/Shared/lib/RemotingSinks</code> contains code that is used to encrypt the communication between Server and Client, using a public/private key mechanism.


Then we have for each module a subdirectory, eg. <code>csharp/ICT/Petra/Shared/MPartner</code>, which contains Constants, and routines that can be useful on both the Server and the Client.


There is a data directory for each module, which contains generated code for matching the database tables to C# classes, and for defining typed datasets, eg. <code>csharp/ICT/Petra/Shared/lib/MPartner/data</code>. More documentation on this will follow soon.
A subdirectory exists for each OpenPetra Module, e.g. <code>csharp/ICT/Petra/Shared/''MPartner''</code>, which contains C# files that define shared Constants and contain shared routines for that OpenPetra Module. These can be used on both the Server and the Client side.
 
Under each OpenPetra Module subdirectory there is a 'data' directory which contains definitions of Typed DataSets for that OpenPetra Module, e.g. <code>csharp/ICT/Petra/Shared/lib/''MPartner''/data</code>. These C# Classes are generated automatically, using the <code>nant generateORMdata</code> command. More documentation on this will follow.
 
 
<code>csharp/ICT/Petra/Shared/MReporting</code> is not a true mapping to an existing OpenPetra Module that the user knows of. It contains reporting functions that are used across all OpenPetra Modules. These can be used on both the Server and the Client side.
 
 
=== ICT.Petra.Server ===
<code>csharp/ICT/Petra/Server/app</code> contains code that is necessary for the basic operation of the OpenPetra Server, e.g. Client connection, loading and maintaining AppDomains for each connecting Client, connecting to the database, etc.
 
The main PetraServerConsole.exe is compiled from a project in <code>csharp/ICT/Petra/PetraServerConsole</code>.


<code>csharp/ICT/Petra/Shared/MReporting</code> is another special directory specific to reporting functions that are used across all modules.
<code>csharp/ICT/Petra/Server/lib/data</code> contains generated C# Classes for accessing the database, so-called 'DataAccess Classes'. Details about the DataAccess Classes can be found [[Overview openPETRA architecture#DataAccess_Objects | here]] and information on how to use them can be found [[Using OpenPetra's DataAccess Objects | here]].


== Ict.Petra.Server ==
<code>csharp/ICT/Petra/Server/sql</code> contains a couple of more complex SQL queries which are much easier to read this way than encoded in strings inside the C# code.
<code>csharp/ICT/Petra/Server/app</code> contains code that is necessary for the basic operation of the Server, eg. starting and maintaining app domains for each connecting client, connect to the database, etc.


The main PetraServerConsole.exe is compiled from a project in <code>csharp/ICT/Petra/Server/app/PetraServerConsole</code>.
A subdirectory exists for each OpenPetra Module, e.g. <code>csharp/ICT/Petra/Server/lib/''MPartner''</code>, which contains C# files that contain most of the Business Logic of OpenPetra.


<code>csharp/ICT/Petra/Server/lib</code> contains most of the business logic.
'''TODO''': We have not yet tidied up the Client-Server Connector Classes for all the OpenPetra modules. For the MFinance, MPartner and MReporting module we have a 'connect' subdirectory, e.g. <code>csharp/ICT/Petra/Server/lib/MFinance/''connect''</code>. This should contain generated code for the Server that provides the services to the Client.


There is a data directory for each module, which contains generated code for accessing the database, eg. <code>csharp/ICT/Petra/Server/lib/MPartner/data</code>. More documentation on this will follow soon.


<code>csharp/ICT/Petra/Server/sql</code> contains a couple of more complex SQL queries, that are much easier to read this way than encoded in strings inside the c# code.
=== ICT.Petra.Client ===
<code>csharp\ICT\Petra\Client\app\</code> contains code that is necessary for the basic operation of the OpenPetra Client.


TODO: we have not tidied up the connectors yet for all the modules. For the MFinance module we have a directory <code>csharp/ICT/Petra/Server/lib/MFinance/connect</code>. This should contain generated code for the server that provides the services to the client.
The main PetraClient.exe is compiled from a project in <code>csharp/ICT/Petra/PetraClient</code>


== Ict.Petra.Client ==
There are the directories <code>CommonForms</code>, <code>CommonControls</code> and <code>CommonDialogs</code>. They hold C# Classes which are used in many other windows of the OpenPetra Client.
We have also an app directory, and the main Client executable is in <code>csharp\ICT\Petra\Client\app\PetraClient</code>.


There are the folders CommonForms, CommonControls, and CommonDialogs, which are used in the other windows.
There are directories for each OpenPetra Module, e.g. <code>MFinance</code>, <code>MPartner</code>, etc.
<code>MCommon</code> is not a true mapping to an existing OpenPetra Module that the user knows of. It contains code that is used across several OpenPetra modules.


<code>lib</code> contains directories for each Module. <code>lib/MCommon</code> contains code that is used across several modules.
Each OpenPetra Module directory has a subdirectory <code>Gui</code> which contains *.yaml files. These YAML Files are turned into generated C# Classes with the command <code>nant generateSolution</code>. <code>*.ManualCode.cs</code> files are holding C# code for everything that cannot be generated automatically.


Each module has a subdirectory <code>gui</code> which contains yaml files, they are generated with <code>nant generateWinforms</code>. There are also ManualCode files for everything that cannot be generated automatically.


== Server Admin ==
=== ICT.Petra.ServerAdmin ===
This is a tool for shutting down the server, and also allows the administrator to check who is currently logged in etc.
This is a tool for connecting to the OpenPetra Server. It is used for shutting down the OpenPetra Server and it allows the OpenPetra Server administrator to check which users are currently logged in, among other things.


== Server Plugins ==
At the moment, we have a few plugins for authentication against another service, eg. phpBB.


== Client Plugins ==
=== ICT.Petra.ServerPlugins ===
We have for example a plugin for importing german bank files.
At the moment, we have a few plug-ins for authentication against another service, eg. phpBB.


== PetraTools ==
This contains several tools for generating code, some NAnt extensions for executing operations on the database, and much more.


== Testing ==
=== ICT.Petra.ClientPlugins ===
We want to have Unit tests and integration tests in this directory.
We have for example a plug-in for importing German bank files.

Revision as of 10:55, 30 August 2011

Introduction

This article describes the existing folder structure of the source code, and gives a short description of the contents and purposes.

We will soon have more detailed documentation of the source code, generated from the in-code comments.

See also OpenPETRA Project Structure and Namespace Descriptions!

C# Source Code

All C# Source code is found in the subdirectories of the csharp directory.

ThirdParty

Some Third-Party tools and DLL's are found in subdirectories of the csharp/ThirdParty. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.


ICT.Common

The directory csharp/ICT/Common contains some general libraries, e.g. for connecting to different Relational Database Systems, a printing system, String Helper functions, etc.


ICT.PetraTools

This contains several tools for generating code, some NAnt extensions for executing operations on the database, and much more. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra, except for the Ict.Tools.PatchTool.exe.


ICT.Testing

Various Unit Tests and Integration Tests are found in subdirectories of this directory. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra.


ICT.Petra

The subdirectories under the csharp/ICT.Petra directory contain most of the C# source code that make up the OpenPetra application. The only other directories that contain such source code are the csharp/ICT/Common and csharp/ThirdParty directories.

ICT.Petra.Shared

The code in directory csharp/ICT/Petra/Shared is intended to be shared between Server and Client. This means that no access to the database is available through Classes in these files since the Classes can be used on the client side as well, and the Client side does not have direct access to the OpenPetra database.


csharp/ICT/Petra/Shared/lib/data contains Typed DataTables which match the definitions of the database tables. A Class exists for each OpenPetra database table. A programmer uses Typed DataTables to hold data relating to database tables in memory (details can be found here); these Classes can't be used to access the database, though (that's what the DataAccess Classes are for). The Typed DataTables C# Classes are generated automatically, using the nant generateORMdata command. This directory contains generated code for all OpenPetra Modules.

csharp/ICT/Petra/Shared/Interfaces contains C# Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using the nant generateGlue command. This directory contains generated code for all OpenPetra Modules.

csharp/ICT/Petra/Shared/lib/RemotingSinks contains code that is used to encrypt the communication between Server and Client, using a public/private key mechanism.


A subdirectory exists for each OpenPetra Module, e.g. csharp/ICT/Petra/Shared/MPartner, which contains C# files that define shared Constants and contain shared routines for that OpenPetra Module. These can be used on both the Server and the Client side.

Under each OpenPetra Module subdirectory there is a 'data' directory which contains definitions of Typed DataSets for that OpenPetra Module, e.g. csharp/ICT/Petra/Shared/lib/MPartner/data. These C# Classes are generated automatically, using the nant generateORMdata command. More documentation on this will follow.


csharp/ICT/Petra/Shared/MReporting is not a true mapping to an existing OpenPetra Module that the user knows of. It contains reporting functions that are used across all OpenPetra Modules. These can be used on both the Server and the Client side.


ICT.Petra.Server

csharp/ICT/Petra/Server/app contains code that is necessary for the basic operation of the OpenPetra Server, e.g. Client connection, loading and maintaining AppDomains for each connecting Client, connecting to the database, etc.

The main PetraServerConsole.exe is compiled from a project in csharp/ICT/Petra/PetraServerConsole.

csharp/ICT/Petra/Server/lib/data contains generated C# Classes for accessing the database, so-called 'DataAccess Classes'. Details about the DataAccess Classes can be found here and information on how to use them can be found here.

csharp/ICT/Petra/Server/sql contains a couple of more complex SQL queries which are much easier to read this way than encoded in strings inside the C# code.

A subdirectory exists for each OpenPetra Module, e.g. csharp/ICT/Petra/Server/lib/MPartner, which contains C# files that contain most of the Business Logic of OpenPetra.

TODO: We have not yet tidied up the Client-Server Connector Classes for all the OpenPetra modules. For the MFinance, MPartner and MReporting module we have a 'connect' subdirectory, e.g. csharp/ICT/Petra/Server/lib/MFinance/connect. This should contain generated code for the Server that provides the services to the Client.


ICT.Petra.Client

csharp\ICT\Petra\Client\app\ contains code that is necessary for the basic operation of the OpenPetra Client.

The main PetraClient.exe is compiled from a project in csharp/ICT/Petra/PetraClient

There are the directories CommonForms, CommonControls and CommonDialogs. They hold C# Classes which are used in many other windows of the OpenPetra Client.

There are directories for each OpenPetra Module, e.g. MFinance, MPartner, etc. MCommon is not a true mapping to an existing OpenPetra Module that the user knows of. It contains code that is used across several OpenPetra modules.

Each OpenPetra Module directory has a subdirectory Gui which contains *.yaml files. These YAML Files are turned into generated C# Classes with the command nant generateSolution. *.ManualCode.cs files are holding C# code for everything that cannot be generated automatically.


ICT.Petra.ServerAdmin

This is a tool for connecting to the OpenPetra Server. It is used for shutting down the OpenPetra Server and it allows the OpenPetra Server administrator to check which users are currently logged in, among other things.


ICT.Petra.ServerPlugins

At the moment, we have a few plug-ins for authentication against another service, eg. phpBB.


ICT.Petra.ClientPlugins

We have for example a plug-in for importing German bank files.