Repository navigation
UserGuide_Common
This is a English page.
Click here for Japanese version of this file.
Updated in July 2026
- Managers, SEs and developers considering application development with Open Touryo
- SEs and developers who develop applications with Open Touryo
This document summarizes the points that all users of Open Touryo should know.
Company names and product names in this document are trademarks or registered trademarks of their respective companies.
1. Prerequisites for using the framework
2. Overall structure of the framework
3. Development infrastructure programs
4. Setting up test and sample programs
The targets are net48 and net10.0 or later applications developed with Microsoft Visual Studio 2026, Microsoft Visual C# and Microsoft Visual Basic.
Table 1 Systems used for developing the .NET application framework "Open Touryo"
| Category | Product name | Abbreviation in documents | |
|---|---|---|---|
| Development environment | Microsoft Visual Studio 2026 | VS | |
| Microsoft Visual C# | C# | ||
| Microsoft Visual Basic | VB | ||
| Runtime environment | Runtime | net48, net10.0 | |
| Data access provider | Microsoft.Data.SqlClient | SQL Server client | |
| System.Data.OleDb | .NET Framework Data Provider for OLE DB | ||
| System.Data.Odbc | .NET Framework Data Provider for ODBC | ||
| Oracle.ManagedDataAccess | Managed Oracle Data Provider for .NET (ODP.NET) | ||
| MySql.Data | MySQL Connector/NET | ||
| Npgsql | .NET data provider for PostgreSQL | ||
| (Others can be added as appropriate, as long as they follow the ADO.NET interfaces) | |||
| WWW browser | Modern browsers | - |
This chapter describes the overall structure of the framework. The overall structure of the framework is as follows.
Figure 2 Overall structure of the framework
<Legend>
- .NET foundation: Modules provided as .NET components
- Foundation components: General-purpose foundation components
- Framework: Framework classes related to the application structure
- Business framework: Common business components that are project-specific (customizable)
- Business application: Modules that implement the business logic of business applications
Next, the processing flow of each layer and notes on usage are described.
This section describes the structure of the B layer and D layer frameworks. The processing flow of the B and D layers is as follows.
Figure 2.1 Processing flow of the B and D layer frameworks
The UOC methods in the above sequence diagram are described below.
Table 2.1 Description of the UOC methods in the sequence diagram
| No. | Class / method | Processing | Content |
|---|---|---|---|
| 1 | Business code parent class 2 (see the "Leaders edition" for how to implement) | ||
| 1-1 | Pre- and post-processing of B layer business processing | ||
| 1-1-1 | UOC_ConnectionOpen method | DB initialization | DB connection, blockade check, isolation level setting, transaction start, etc. |
| 1-1-2 | UOC_PreAction method | Start processing | Measuring processing time, outputting access logs, etc. |
| 1-1-3 | UOC_DoAction method | Method dispatching | Automatic dispatching to the business processing method |
| 1-1-4 | UOC_AfterAction method | End processing | Measuring processing time, outputting access logs, etc. |
| 1-1-5 | UOC_AfterTransaction method | End processing 2 | Post-processing after transaction completion (COMMIT). Measuring processing time, outputting access logs, etc. |
| 1-1-6 | UOC_ABEND method | Exception handling | Exception replacement, access log output, error log output, etc. |
| 2 | Business code class (see the "Developers edition" for how to implement) | ||
| 2-1 | B layer business processing | ||
| 2-1-1 | UOC_(method name) method | Business processing | |
| 3 | Data access parent class 2 (see the "Leaders edition" for how to implement) | ||
| 3-1 | Pre- and post-processing of D layer data access processing | ||
| 3-1-1 | UOC_PreQuery method | Start processing | Measuring processing time, etc. |
| 3-1-2 | UOC_AfterQuery method | End processing | Measuring processing time, SQL trace log output, error log output, exception replacement, etc. |
| 4 | Data access class (see the "Developers edition" for how to implement) | ||
| 4-1 | D layer data access processing | ||
| 4-1-1 | Any method can be implemented (when using the common Dao or the automatically generated Dao, use the default methods) | Data access processing |
See the "Leaders edition" for how to implement the "business code parent class 2" and "data access parent class 2", and the "Developers edition" for how to implement the "business code class" and "data access class".
This section describes the structure of the P layer framework.
The processing flow of the P layer is as follows.
Figure 2.2 Processing flow of the P layer framework
The UOC methods in the above sequence diagram are described below.
Table 2.2.1 Description of the UOC methods in the sequence diagram
| No. | Class / method | Processing | Content |
|---|---|---|---|
| 1 | Screen code parent class 2 (see the "Leaders edition" for how to implement) | ||
| 1-1 | Initial processing (page load processing) | ||
| 1-1-1 | UOC_CMNFormInit method | Initial processing | Custom authentication, authority check, blockade check, cache invalidation setting, page title setting, access log output, etc. |
| 1-1-2 | UOC_CMNFormInit_PostBack method | Initial processing (postback) | Custom authentication, authority check, blockade check, cache invalidation setting, page title setting, access log output, etc. |
| 1-2 | Pre- and post-processing of P layer event processing | ||
| 1-2-1 | UOC_PreAction method | Start processing | Measuring processing time, outputting access logs, etc. |
| 1-2-2 | UOC_AfterAction method | End processing | Measuring processing time, outputting access logs, etc. |
| 1-2-3 | UOC_Screen_Transition method | Screen transition processing | Defines the screen transition method. |
| 1-2-4 | UOC_ABEND method | Exception handling | Message editing, common message display, access log and error log output, etc. |
| 1-2-5 | UOC_Finally method | Finally processing | Defines processing as necessary. |
| 2 | Screen code class (see the "Developers edition" for how to implement) | ||
| 2-1 | Initial processing (page load processing) | ||
| 2-1-1 | UOC_FormInit method | Initial processing | Initial processing of each screen |
| 2-1-2 | UOC_FormInit_PostBack method | Initial processing (postback) | Initial processing of each screen |
| 2-2 | P layer event processing | ||
| 2-2-2 | UOC_btnXXXX_Click method | Event processing of each control |
See the "Leaders edition" for how to implement the "screen code parent class 2", and the "Developers edition" for how to implement the "screen code class".
The P layer is created by combining master pages and content pages as follows. Nested master pages are also supported.
Figure 2.2.2 Structure of the P layer design part
The event handlers of controls on master pages and user controls can be implemented not only on the master page or user control side but also on the content page side.
The "screen code class", which is the code-behind of a content page, inherits the "screen code parent class 1" and "screen code parent class 2".
Figure 2.2.3 Structure of the P layer (implementation part)
-
Event processing of controls on a master page (or Web user control)
To share the "common event processing of controls on a master page (or Web user control)", such as the [Sub A] to [Sub E] link buttons and the [Guide] button, [Topic] button, [Personal settings] button and [Logout] button on the master page (or Web user control) in Figure 2.2.2, implement the processing in the UOC methods of the "master page", "Web user control" and "screen code parent class 2". This allows the processing to be shared across the whole system.
The "individual event processing of controls on a master page (or Web user control)", such as the [Search], [Cancel], [Select], [Add], [Update] and [Delete] buttons on the master page, can vary in behavior for each content page by implementing the processing individually in the UOC methods of the "screen code class".
To share the "common event processing of controls on a master page (or Web user control)", such as the [Tab 1] to [Tab 6] link buttons on the master page, per unit such as a subsystem, implement the processing in UOC methods by, for example, adding a "screen code parent class 3" between the "screen code parent class 2" and the "screen code class". -
Event processing of controls on a content page
The "individual event processing of controls on a content page" is implemented individually in the UOC methods of the "screen code class". -
How to implement event handlers
Control event processing can be classified into the following nine types. How to implement each event handler is summarized in the user guides (separate volumes).
Table 2.2.3-1 How to implement various event handlers
| No. | Event content | Control location | UOC method implementation location | User guide reference |
|---|---|---|---|---|
| 1 | Common 1 | Master page | "Screen code parent class 2" | Leaders edition |
| 2 | Common 2 | Master page | "Screen code parent class 3" | Leaders edition |
| 3 | Common 3 | Master page | Master page | Leaders edition |
| 4 | Common 4 | Web user control | "Screen code parent class 2" | Leaders edition |
| 5 | Common 5 | Web user control | "Screen code parent class 3" | Leaders edition |
| 6 | Common 6 | Web user control | Web user control | Leaders edition |
| 7 | Individual 1 | Master page | "Screen code class" | Developers edition |
| 8 | Individual 2 | Web user control | "Screen code class" | - |
| 9 | Individual 3 | Content page | "Screen code class" | Developers edition |
-
Common arguments of event handlers
Event handlers (UOC methods of control events) can use the "FxEventArgs" object of the "FxEventArgs" class as a common argument. The "FxEventArgs" class holds the following property information. This property information can be used freely in the P layer event processing function of this framework.
Table 2.2.3-2 Properties of the common argument of event handlers
| No. | Property | Target control / event | Description |
|---|---|---|---|
| 1 | ButtonID | All controls / all events | Name of the control associated with the event handler |
| 2 | InnerButtonID | Repeater / item command | Control placed inside a repeater (etc.) |
| 3 | MethodName | All controls / all events | Name of the event handler (method) used when late-binding to the event handler |
| 4 | X | Image button / click event | X coordinate of the pressed image button |
| 5 | Y | Image button / click event | Y coordinate of the pressed image button |
| 6 | PostBackValue | - Image map - Repeater (etc.) - Click event - Item command |
The postback value set for the hotspot of the pressed image map, or the command name (etc.) of a control placed inside a repeater (etc.) |
When implementing P layer event processing, implement controls and event handlers (UOC methods of control events) according to the following naming standards.
● Control names
- [Prefix] + any string
Table 2.2.4-1 Examples of control names
| No. | Control type | Example prefix | Example control name |
|---|---|---|---|
| 1 | Button control | btn | btnButton |
| 2 | LinkButton control | lbn | lbnLinkButton |
| 3 | ImageButton control | ibn | ibnImageButton |
| 4 | ImageMap control | imp | impImageMap |
| 5 | TextBox control | txt | txtTextBox |
| 6 | DropDownList control | ddl | ddlDropDownList |
| 7 | ListBox control | lbx | lbxListBox |
| 8 | RadioButton control | rbn | rbnRadioButton |
| 9 | RadioButtonList control | rbl | rblRadioButtonList |
| 10 | CheckBoxList control | cbl | cblCheckBoxListControl |
| 11 | Repeater control | rpt | rptRepeater |
| 12 | GridView control | gvw | gvwGridView |
| 13 | ListView control | lvw | lvwListView |
The prefix can be defined as any string with an external parameter. ※ See the "Leaders edition" for how to set the prefix.
● Event handler names of control events
・ Event handler names of controls on a content page
- UOC_(control name)_(event name)
Table 2.2.4-2 Examples of event handler names
| No. | Control type | Event name | Example event handler name |
|---|---|---|---|
| 1 | Button control | Click | UOC_btnButton_Click |
| 2 | LinkButton control | Click | UOC_lbnLinkButton_Click |
| 3 | ImageButton control | Click | UOC_ibnImageButton_Click |
| 4 | ImageMap control | Click | UOC_impImageMap_Click |
| 5 | TextBox control | TextChanged | UOC_txtTextBox_TextChanged |
| 6 | DropDownList control | SelectedIndexChanged | UOC_ddlDropDownList_SelectedIndexChanged |
| 7 | ListBox control | SelectedIndexChanged | UOC_lbxListBox_SelectedIndexChanged |
| 8 | RadioButton control | CheckedChanged | UOC_rbnRadioButton_CheckedChanged |
| 9 | RadioButtonList control | SelectedIndexChanged | UOC_rblRadioButtonList_SelectedIndexChanged |
| 10 | CheckBoxList control | SelectedIndexChanged | UOC_cblCheckBoxList_SelectedIndexChanged |
| 11 | Repeater control | ItemCommand | UOC_rptRepeater_ItemCommand |
| 12 | GridView control | RowCommand SelectedIndexChanged RowUpdating RowDeleting PageIndexChanging Sorting |
UOC_gvwGridView_RowCommand UOC_gvwGridView_SelectedIndexChanged UOC_gvwGridView_RowUpdating UOC_gvwGridView_RowDeleting UOC_gvwGridView_PageIndexChanging UOC_gvwGridView_Sorting |
| 13 | ListView control | ItemUpdating ItemDeleting ItemCommand Sorting PagePropertiesChanged |
UOC_lvwListView_ItemUpdating UOC_lvwListView_ItemDeleting UOC_lvwListView_OnItemCommand UOC_lvwListView_Sorting UOC_lvwListView_PagePropertiesChanged |
・ Event handler names of controls on a master page
- Implementation location: screen code parent classes 2 and 3, screen code class …
UOC_(master page file name)_(control name)_(event name) - Implementation location: master page …
UOC_(control name)_(event name)
Table 2.2.4-3 Event handler names of controls on a master page (implementation location: screen code parent classes 2 and 3, screen code class. Master page name: mp.master)
| No. | Control type | Event name | Example event handler name |
|---|---|---|---|
| 1 | Button control | Click | UOC_mp_btnButton_Click |
| 2 | LinkButton control | Click | UOC_mp_lbnLinkButton_Click |
| 3 | ImageButton control | Click | UOC_mp_ibnImageButton_Click |
| 4 | ImageMap control | Click | UOC_mp_impImageMap_Click |
| 5 | TextBox control | TextChanged | UOC_mp_txtTextBox_TextChanged |
| 6 | DropDownList control | SelectedIndexChanged | UOC_mp_ddlDropDownList_SelectedIndexChanged |
| 7 | ListBox control | SelectedIndexChanged | UOC_mp_lbxListBox_SelectedIndexChanged |
| 8 | RadioButton control | CheckedChanged | UOC_mp_rbnRadioButton_CheckedChanged |
| 9 | RadioButtonList control | SelectedIndexChanged | UOC_mp_rblRadioButtonList_SelectedIndexChanged |
| 10 | CheckBoxList control | SelectedIndexChanged | UOC_mp_cblCheckBoxList_SelectedIndexChanged |
| 11 | Repeater control | ItemCommand | UOC_mp_rptRepeater_ItemCommand |
| 12 | GridView control | RowCommand, etc. | UOC_mp_gvwGridView_RowCommand, etc. (append the event name) |
| 13 | ListView control | ItemUpdating, etc. | UOC_mp_lvwListView_ItemUpdating, etc. (append the event name) |
Table 2.2.4-3 (continued) Event handler names of controls on a master page (implementation location: master page)
| No. | Control type | Event name | Example event handler name |
|---|---|---|---|
| 1 | Button control | Click | UOC_btnButton_Click |
| 2 to 13 | (Same as the content page) | (Same as left) | UOC_(control name)_(event name) |
・ Event handler names of controls on a Web user control
- Implementation location: screen code parent classes 2 and 3, screen code class …
UOC_(Web user control ID)_(control name)_(event name) - Implementation location: user control …
UOC_(control name)_(event name)
Table 2.2.4-4 Event handler names of controls on a Web user control (implementation location: screen code parent classes 2 and 3, screen code class. Web user control ID: uc1)
| No. | Control type | Event name | Example event handler name |
|---|---|---|---|
| 1 | Button control | Click | UOC_uc1_btnButton_Click |
| 2 | LinkButton control | Click | UOC_uc1_lbnLinkButton_Click |
| 3 | ImageButton control | Click | UOC_uc1_ibnImageButton_Click |
| 4 | ImageMap control | Click | UOC_uc1_impImageMap_Click |
| 5 | TextBox control | TextChanged | UOC_uc1_txtTextBox_TextChanged |
| 6 | DropDownList control | SelectedIndexChanged | UOC_uc1_ddlDropDownList_SelectedIndexChanged |
| 7 | ListBox control | SelectedIndexChanged | UOC_uc1_lbxListBox_SelectedIndexChanged |
| 8 | RadioButton control | CheckedChanged | UOC_uc1_rbnRadioButton_CheckedChanged |
| 9 | RadioButtonList control | SelectedIndexChanged | UOC_uc1_rblRadioButtonList_SelectedIndexChanged |
| 10 | CheckBoxList control | SelectedIndexChanged | UOC_uc1_cblCheckBoxList_SelectedIndexChanged |
| 11 | Repeater control | ItemCommand | UOC_uc1_rptRepeater_ItemCommand |
| 12 | GridView control | RowCommand, etc. | UOC_uc1_gvwGridView_RowCommand, etc. (append the event name) |
| 13 | ListView control | ItemUpdating, etc. | UOC_uc1_lvwListView_ItemUpdating, etc. (append the event name) |
Table 2.2.4-4 (continued) Event handler names of controls on a Web user control (implementation location: user control)
| No. | Control type | Event name | Example event handler name |
|---|---|---|---|
| 1 | Button control | Click | UOC_btnButton_Click |
| 2 to 13 | (Same as the content page) | (Same as left) | UOC_(control name)_(event name) |
By implementing controls and event handlers according to the above naming standards, the P layer event processing function of this framework can be used. Note that control names must not be duplicated across content pages, master pages and Web user controls (duplication is not a problem for ASP.NET itself, but the "event processing function" of the P layer framework does not allow duplication). ※
● Signature of event handlers of control events
The signature of an event handler of a control event is protected string eventHandlerName(FxEventArgs fxEventArgs).
As an exception, the method signatures of the event handlers for the RowUpdating, RowDeleting, PageIndexChanging and Sorting events of the GridView control take the original EventArgs as another event argument. In this case the signature of the event handler is protected string eventHandlerName(FxEventArgs fxEventArgs, EventArgs e).
※ Note that if the access modifier of an event handler is private, or the method signature of the argument part differs, the event handler may not be called properly.
This section describes the basis (basic concept) of exception handling in the whole framework.
This section shows the processing flow of exception handling using a sequence diagram. When an exception is thrown in the lowest layer of the program, it propagates to the top layer in the following flow. In practice, however, the processing flow is designed individually for each "exception type" prepared by the framework.
Figure 2.3.1 Processing flow of exception handling
This section describes the classification of the "exception types" used in exception handling.
The main classification that determines the "exception type" is "exceptions for user-defined errors" and "exceptions for runtime errors". Of these, "exceptions for user-defined errors" are further divided into "business-continuable error" exceptions and "business-non-continuable error" exceptions. The figure below shows the corresponding "exception type names" and "exception data type names".
Figure 2.3.2 Classification of "exception types"
This framework does not add "exception types" for "user-defined errors". Instead, the kind of "business exception" and "system exception" is identified from the values of the "error message ID" field of the "business exception" and the "error message ID" field of the "system exception". Each "exception type" is summarized in the following table.
Table 2.3.2-1 Description of "exception types"
| No. | Exception category | Exception type | Description |
|---|---|---|---|
| 1 | User-defined error | Business exception | Throws and handles exceptions for errors from which the business can continue. For example, the retryable errors listed below are thrown using the "business exception" type and the business continues. - Single-item check and related check errors - Zero search results, zero updated rows (timestamp mismatch) - Duplicate key on insert, deadlock and lock timeout - Other cases where only the target event is blocked (online / batch exclusion) (e.g. only reference processing is allowed and update processing is blocked) |
| 2 | User-defined error | System exception | Throws and handles exceptions for errors from which the business cannot continue. For example, the errors listed below that are detected by the application but cannot be retried or should not be retried are thrown using the "system exception" type and the business is stopped. - When the system is blocked (system stopped according to holidays, operation schedule or time schedule) - Business data inconsistencies, interface inconsistencies, etc. that cannot be retried - Business data inconsistencies, interface inconsistencies, etc. that should not be retried |
| 3 | Runtime error | Framework exception | Throws and handles exceptions detected by the framework. It has a message ID, but is otherwise treated the same as "other general exceptions" below. |
| 4 | Runtime error | Other general exceptions | Exceptions that are not specially detected by the UP (User Program), such as runtime errors. After such an exception occurs, unless special measures such as exception replacement are taken, retry is not possible and the business must be stopped. |
Table 2.3.2-2 "Exception types" and fields
| No. | Exception type | Field name (Japanese) | Field name | Description |
|---|---|---|---|---|
| 1 | Business exception | Since it inherits System.Exception, it also holds the fields of "other general exceptions". | ||
| 1-1 | Message ID | messageID | An ID that uniquely identifies the kind of message can be set, held and obtained. If a message template is defined in an external medium, it can be used as a key to look up that template. | |
| 1-2 | Message | Message | A message explaining the cause of the error can be set, held and obtained. If a message template is defined in an external medium, this part can be used as a variable string embedded in the template. | |
| 1-3 | Error information | Information | Error information (check results) at the time a "business exception" occurs, such as a check error, can be set, held and obtained. Since it is a string, use a "return value class" to return complex information. | |
| 2 | System exception | Since it inherits System.Exception, it also holds the fields of "other general exceptions". | ||
| 2-1 | Message ID | messageID | An ID that uniquely identifies the kind of message can be set, held and obtained. If a message template is defined in an external medium, it can be used as a key to look up that template. | |
| 2-2 | Message | Message | A message explaining the cause of the error can be set, held and obtained. If a message template is defined in an external medium, this part can be used as a variable string embedded in the template. | |
| 3 | Framework exception | Since it inherits System.Exception, it also holds the fields of "other general exceptions". | ||
| 3-1 | Message ID | messageID | An ID that uniquely identifies the kind of message can be set, held and obtained. | |
| 3-2 | Message | Message | A message explaining the cause of the error can be set, held and obtained. | |
| 3-3 | Inner exception | InnerException | When replacing a runtime error, the original exception information is stored here. | |
| 4 | Other general exceptions | Only the general fields of the System.Exception class are used. |
Table 2.3.2-3 "Exception types" and "processing per exception type" (business exception)
| No. | Processing category | Description |
|---|---|---|
| 1-1 | B layer processing | Catches the "business exception" in a catch code block and executes the following. - Rolls back the transaction. - Calls the corresponding "UOC method for exception handling" (implement log output, etc. here). - Does not rethrow the exception, and returns the "return value" as a normal return value. - Closes the connection. |
| 1-2 | Return value to the P layer | Information from the "return value parent class 1", in which the "error flag", "error message ID", "error message" and "error information" are set, through the "return value parent class 2" set by the user up to the "return value class". |
| 1-3 | P layer processing | When the B layer throws a "business exception", a normal return value is returned to the P layer, so the occurrence of the "business exception" is detected by checking the return value and end processing is implemented (log output, generating a user message [2], displaying a message dialog, showing input check errors in red, returning to the start screen of the business, etc.). When the P layer throws a "business exception", it catches the "business exception" in a catch code block and calls the corresponding "UOC method for exception handling" (log output, generating a user message [3], displaying a message dialog, etc.). The former can be used when complex control is required, and the latter when displaying a message box is enough. |
Table 2.3.2-4 "Exception types" and "processing per exception type" (system exception / framework exception and other general exceptions)
| No. | Processing category | Description |
|---|---|---|
| 2-1 | B layer processing | Catches the "system exception" in a catch code block and executes the following. - Rolls back the transaction. - Calls the corresponding "UOC method for exception handling" (implement log output, etc. here). - Rethrows the exception. - Closes the connection. |
| 2-2 | Return value to the P layer | The rethrown "system exception" in which the "error message ID" and "error message" are set. |
| 2-3 | P layer processing | Catches the "system exception" in a catch code block, calls the corresponding "UOC method for exception handling" and rethrows the exception. Finally, common processing implemented in the "Application_Error" event handler of "Global.asax", an "error screen", etc. generates a user message [4] based on the "error message ID" and "error message" and displays the error screen. |
| 3-1 | (Framework exception / other general exceptions) B layer processing | Catches the "framework exception" and "other general exceptions" in a catch code block, rolls back the transaction, calls the corresponding "UOC method for exception handling", rethrows the exception and closes the connection. |
| 3-2 | Return value to the P layer | The rethrown "framework exception" and "other general exceptions". |
| 3-3 | P layer processing | Catches the "framework exception" and "other general exceptions" in a catch code block, calls the corresponding "UOC method for exception handling" and rethrows the exception. Finally, common processing implemented in the "Application_Error" event handler of "Global.asax", an "error screen", etc. generates a user message and displays the error screen. |
For the complete set of development infrastructure programs, see the "Resources" and "Sources (C#)" sheets of the attached "Content list (Content_list.xlsx)".
See the "Infrastructure project list" sheet of the attached "Content list (Content_list.xlsx)".
This section describes the configuration files and external files of the development infrastructure. The configuration files and external files are as follows. How to configure each file is summarized in the user guides (separate volumes).
Table 3.2 Configuration files and external files
| No. | File name (Japanese) | File name | Description | Required / optional | Reference |
|---|---|---|---|---|---|
| 1 | ― | web.config | Placed in the root of the Web application. | ― | ― |
| 2 | ― | app.config [5] | Defines various settings for the framework and the application. Optional (basically placed in the same root of the Web application as web.config). | Required | ― |
| 3 | Log output XML definition file | xxxx.xml | Defines various settings for log output by log4net (NLog). Optional (can be specified with a parameter of app.config). | Required (when using logs) | ― |
| 4 | SQL definition file | xxxxx.sql | File that defines the static parameterized queries executed by the application. Optional (can be specified with a parameter of app.config). | Required (DB applications) | Developers edition |
| xxxxx.xml | File that defines the dynamic parameterized queries executed by the application. Optional (can be specified with a parameter of app.config). | Dynamic parameterized query edition | |||
| 5 | Shared information XML definition file | SPDefinition.xml ※[file name] can be changed in the definition | Used by the shared information acquisition function. Optional (can be specified with a parameter of app.config). | Optional | Individual functions edition |
| 6 | Message XML definition file | MSGDefinition.xml | Used by the message acquisition function. Optional (can be specified with a parameter of app.config). | Optional | Individual functions edition |
| 7 | Transaction XML definition file | TCDefinition.xml | Used by the transaction control function. Optional (can be specified with a parameter of app.config). | Optional | Individual functions edition |
| 8 | Screen transition XML definition file | SCDefinition.xml | Used by the screen transition control function. Optional (can be specified with a parameter of app.config). | Optional | Individual functions edition |
| 9 | Communication control XML definition file | TMInProcessDefinition.xml | Used by the communication control function to identify the DLL name and class name to call from the service logical name. Optional (can be specified with a parameter of app.config). | Optional | Individual functions edition |
| TMProtocolDefinition.xml | Used by the communication control function to identify the protocol to call from the service logical name. Optional (can be specified with a parameter of app.config). | Individual functions edition |
This chapter describes how to set up the test and sample programs.
For the test programs and sample programs in the provided set (the ~\root folder), see the "Sample project list" sheet of the attached "Content list (Content_list.xlsx)".
The setup procedure up to running the test programs and sample programs is shown below. To confirm and understand the specific steps here, it is a good idea to work through the attached tutorials.
-
First, prepare the necessary development environment. Usually, Visual Studio and the data providers to be used must be installed.
-
Build the database.
- Create the tables for the test programs and sample programs. The test programs and sample programs execute CRUD data access processing on the Shippers table of the NorthWind database [6]. Therefore, the Shippers table must be newly created.
- <DDL SQL files (creating the Shippers table)> … SQL Server:
C:\files\resource\Sql\sqlserver, Oracle:…\oracle, MySQL:…\mysql, PostgreSQL:…\pstgrs. Run the DDL SQL in "TestTable.txt" in the above folders to create the Shippers table.
- <DDL SQL files (creating the Shippers table)> … SQL Server:
- Prepare the queries for the test programs and sample programs. DML SQL is provided for "SQL Server", "Oracle", "MySQL" and "PostgreSQL" to match the corresponding data providers.
- … The same folders as above. Move (or copy) the DML SQL files in the above folders to the "C:\files\resource\Sql" folder. If there are files used by the automatically generated Dao, move them as well.
- Create the tables for the test programs and sample programs. The test programs and sample programs execute CRUD data access processing on the Shippers table of the NorthWind database [6]. Therefore, the Shippers table must be newly created.
-
Place under IIS. In the latest version, the "development Web server" rather than IIS is the standard configuration. Therefore, when using the "development Web server" as standard, step (4) below is unnecessary.
- Set folder permissions. Folder permissions must be set to match the permission settings under the "C:\Inetpub\wwwroot" folder. The Web application folders to be placed under IIS are the service interface (
~\Frameworks\Infrastructure\ServiceInterface\ASPNETWebService), the ASP.NET Web application (~\Samples\WebApp_sample\WebForms_Sample) and the ASP.NET Mobile Web application (~\Samples\WebApp_sample\ProjectXM_sample) [7]. Permissions are set, for example, by once "copying" the above folders under "C:\Inetpub\wwwroot" and then "moving" them (possible only within the same drive). - Set the Web application folders as virtual directories of IIS [8][9]. Set the alias of the virtual directory to the same name as the folder (service interface: ASPNETWebService, ASP.NET: WebForms_Sample, MVC_Sample).
- In the IIS management console, check that the virtual directory has been created as an application and that ASP.NET version 2.0 or 4.0 is enabled as the runtime on the [ASP.NET] tab.
- To return to the IIS settings, open the (existing) "Web site" from local IIS and overwrite the sln file.
- Set folder permissions. Folder permissions must be set to match the permission settings under the "C:\Inetpub\wwwroot" folder. The Web application folders to be placed under IIS are the service interface (
-
When upgrading. To upgrade a Visual Studio project, open the target sln file in the VS to upgrade to and upgrade each project with the Visual Studio conversion wizard. After upgrading, change the .NET version and ASP.NET version to appropriate ones as necessary.
-
Things to check before building. Since the work is actually done while building, you will go back and forth with step (6). It is a good idea to delete unused samples and tools at this point.
- Check the reference settings [10]. Add "references" to the necessary components, delete "references" to unnecessary components (delete unusable projects, classes and code blocks [13][14]) or change them to appropriate versions, and then rebuild the solution. Note that the DPQuery_Tool and DaoGen_Tool tools need all the data providers and the corresponding Dam to build, but if you delete the "references", you can get the build to pass by uncommenting the dummy types in the "DummyDaps.cs" file.
- For Web sites, check the web.config file [15].
-
Build the projects. Double-click the batch files directly under "~\root\programs(C# or VB)" in the order of the number prefixed to them to build the projects (when running from a command prompt, cd to the location of the batch files first). The build batches describe the build sequence in detail, so read them in numerical order to confirm their contents [16][17].
- Path to devenv.exe … The path to devenv.exe in the build batches must be switched (note
Program Files(x86)in 64-bit environments). - Debug and Release builds … The provided build batches do a Debug build by default. To run a Release build, add the "/Release" option to the build batch.
- Build options … Depending on the environment, the platform target (Any CPU, x86, x64, etc.) may need to be reviewed.
- Digital signature … For ClickOnce and XBAP, if a password is requested when importing the digital certificate used for signing, enter "seigi" if necessary and build.
- Path to devenv.exe … The path to devenv.exe in the build batches must be switched (note
-
Check settings before running. When the build completes normally, make the following settings before starting a debug run.
- Adjust the connection string settings (the connectionStrings section of web.config) to the environment.
- Delete (comment out) the impersonation settings (the identity section of web.config), or adjust them to the environment.
- Start the "ASP.NET State Service". The default session mode is "StateServer", so run "aspnet_state-stat.bat" to start it (you may change it to "InProc", but "StateServer" is recommended).
- Set the start page to "~/Aspx/start/menu.aspx" and start debugging the Web site.
-
If errors occur. If the framework or the test and sample programs produce errors, check the following possibilities.
- When running on IIS, there may be no permission for the metabase (solved with aspnet_regiis -i / -u + -i / -ga [18]). There may be no permission for external files (
C:\files\resource\Logneeds an ACL with read/write permission for the ASPNET account, andSql/test/xmlneed read permission). - The settings of web.config and app.config may not match the environment [19].
- The environment settings of the data provider (DB client) or DB server may be wrong. Be especially careful when using a data provider other than sqlClient. It is a good idea to isolate the problem by checking whether you can connect to the DB with the plain data provider, not via the framework.
- When running on IIS, there may be no permission for the metabase (solved with aspnet_regiis -i / -u + -i / -ga [18]). There may be no permission for external files (
The setup procedure for a new Web site is shown below.
-
When using IIS. This step is necessary only when creating a new Web site (HTTP).
- Set permissions (by "copy + move". Possible only within the same drive).
- Set the virtual directory (from the IIS management console).
- Set the ASP.NET version (enable runtime 2.0 or 4.0 on the [ASP.NET] tab).
- Create the VS Web site ([File] ⇒ [New] ⇒ [Web Site], the [ASP.NET Web Site] template, select "HTTP" for [Location] and select the created virtual directory of local IIS).
-
When not using IIS. This step is necessary only when creating a new Web site (file system) (select "File System" for [Location]).
-
Copy Infrastructure to an appropriate relative path. As necessary, copy the "~\root\programs(C# or VB)\Frameworks\Infrastructure" folder to an appropriate relative path from the folder of the new Web site. When using IIS, create a virtual directory for the service interface infrastructure (ASPNETWebService).
-
Copy the necessary files from a Web site. Copy the files necessary for the new Web site from the Web site of the test and sample programs (ProjectX_sample, ProjectXM_sample).
-
The necessary files are as follows (keep the folder structure as is).
Table 5 Files necessary for a new Web site
| No. | Folder | Files |
|---|---|---|
| 1 | Root folder | web.config, app.config, Global.asax |
| 2 | CSS | style.css |
| 3 | Framework | |
| 3-1 | Framework/Img | information.ico, warning.ico, error.ico [21], question.ico [22], loading.gif [23] |
| 3-2 | Framework/Js | common.js [24] |
| 4 | Aspx | |
| 4-1 | Aspx/Common | ErrorScreen.aspx, ErrorScreen.aspx.cs [27] |
| 4-2 | Aspx/FrameWork | DialogFrame.htm, DialogLoader.htm [28], myOKMessageDialog.aspx(.cs) [29], myYesNoMessageDialog.aspx(.cs) [30] |
| 4-3 | Aspx/start | menu.aspx(.cs) [31], login.aspx(.cs) [32], logout.aspx(.cs) [33] |
| 5 | Bin | Assemblies that are referenced or used by reflection |
-
Rename (replace strings) as necessary. It is a good idea to use a file search and batch replace tool (Grep and Replace). Rename the "Touryo" namespace strings contained in the files in Infrastructure, and the strings in the virtual paths of the old Web site names (WebForms_Sample, MVC_Sample), to match the new Web site name.
-
Rebuild the projects. After renaming, a rebuild and an update of the Bin folder are necessary (reference the debug build during development and the release build in production. Store in the GAC as necessary).
-
Debug the new Web site. Set the start page to "~/Aspx/start/menu.aspx", start debugging, and once menu.aspx is displayed, start development by following the subsequent procedures.
All users of Open Touryo need to know the commonly usable APIs provided by Open Touryo. For details, see the attached
- "Individual functions edition", chapter 1: "Common API"
- Function list (Content_list.xlsx)
- API reference manual (1a_API_Reference_Manual.zip)
The limitations are summarized below. See the "Individual functions edition" for each function.
-
Session
- Always use sessions when using the P layer framework of Open Touryo.
- When using the "session timeout detection function", use the
BaseController.FxSessionAbandon()method to delete the session timeout detection cookie and then release the session. However, if a postback is executed on the same screen after executingFxSessionAbandon(), an error occurs due to the "illegal operation prevention function", so after releasing the session, transition to the menu screen, etc. by a GET.
-
Others
- See the "Better use and FAQ edition".
- Use the "message acquisition function" if necessary.
- Use the "message acquisition function" if necessary.
- Use the "message acquisition function" if necessary.
- In this document, app.config is defined as the file that defines the appSettings section. For an ASP.NET Web application, it refers to a separate file referenced from web.config (
<appSettings file="app.config">). For Windows Forms / WPF / WPF browser / console applications, it refers to the app.config used to create the application configuration file ([executable name].exe.config). - Some test and sample programs use tables other than the Shippers table in the NorthWind database, tables in the sample schema of each DB, or their own tables.
- For VB, if there is no project under
~\root\programs\VB\Frameworks\Infrastructure\~, reference the assembly of the C# version. - Corresponds to "Internet Information Services" in "Administrative Tools".
- If the "Run scripts such as ASP" check box is turned on in the wizard, it is automatically set as an IIS application.
- Mainly the reference settings to data providers and the corresponding Dam (data providers and Dam that cannot be redistributed must be deleted).
- If there are DLLs that were split in the .NET of the upgrade target, such as System.Xaml.dll, reference settings must be added as necessary.
- When unused data providers and the corresponding Dam are deleted, comment out the code blocks in related classes (MyBaseLogic, MyFcBaseLogic, etc.).
- See the "Leaders edition" for details on web.config settings.
- Each project under
~\root\programs\C#\Frameworks\Infrastructure\(excluding ServiceInterface), and the WSIFType_sample and WSServer_sample projects under~\root\programs\C#\Samples\WS_sample\. - The Web sites
~\Frameworks\Infrastructure\ServiceInterface\ASPNETWebService,~\Samples\WebApp_sample\WebForms_Sampleand~\Samples\WebApp_sample\MVC_Sample. - ASP.NET IIS Registration Tool (Aspnet_regiis.exe): http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
- See the "Leaders edition" for details on app.config settings.
- Icon for the OK message dialog.
- Icon for the Yes/No message dialog.
- Icon for waiting for a response.
- JavaScript file implementing functions such as dialog display and modeless screen display.
- Error screen for development.
- Modal dialog display.
- OK message dialog.
- Yes/No message dialog.
- Menu screen.
- Login screen (supports Forms authentication).
- Logout screen (supports Forms authentication).
-End-
Copyright © 2007,2017, Hitachi Solutions, Ltd.