OxyGen Code Generator Overview. 4   Table of Contents. 4
Previous Topic: Exploring the Code Generated in Prior Sessions. 4   Next Topic: Publishing the Generated Code. 4

 

Creating Code Generation Projects

Open OxyGen Code Management Studio.

  1. In the Connect to Server dialog specify the Server Name, the Authentication mode, user credentials (if SQL Server Authentication is selected), and then click the Connect button.

The Database Explorer tree control is populated with the databases for the specified server. Accessible databases are depicted by an enabled cylinder () while the databases that are not accessible are depicted by a disabled cylinder ().

NoteNote

In Windows Vista, some of the databases may be not accessible if Windows Authentication is selected and the application does not run under an administrator role.

  1. Click the Workspace\New Project menu item. The Add Workspace Project dialog box is displayed as shown in “Figure 48: Add Workspace Project dialog box”.

Figure 48: Add Workspace Project dialog box

  1. Type the name of the new project and click OK.
  2. The new project and a new configuration are created. The configuration panel is displayed as shown in “Figure 49: Configuration panel”

Figure 49: Configuration panel

5.       Click the Database Objects tab page and specify the tables, views and stored procedures primarily used to generate the source code.


 

 

6.        Click the Component tab page and specify code components and specify the desired component package to be generated. The Component tab page is shown in “Figure 50: Components configuration panel”

Figure 50: Components configuration panel

 


 

7.       Click the Solution and Projects tab page and specify code components and specify the Visual Studio solution and project formats, the solution name and the project names for the generated source code.

 The Component tab page is shown in “Figure 51:  Solution and Projects configuration panel”

Figure 51:  Solution and Projects configuration panel


 

8.       Click the Data Activities tab page and specify code components and specify the desired stored procedures categories to be generated. The Retrieve Stored Procedures is preselected and compulsory. The Component tab page is shown in “Figure 52:  Data Activities configuration panel”

 

Figure 52:  Data Activities configuration panel


 

9.       Click the Paging and Caching tab page to specify caching and data paging options. The Paging tab page is shown in “Figure 53:  Paging and Caching configuration panel”

Figure 53:  Paging and Caching configuration panel


 

10.    Click the Stored Procedures tab page to specify the SQL logins from which the Stored Procedures execute right is granted. The Stored Procedures tab page is shown in “Figure 54:  Stored Procedures configuration panel”

Figure 54:  Stored Procedures configuration panel


 

11.    Click the Generated Code tab page to specify C# Code Settings such as generation of comments and generation of empty partial classes. The Generated Code tab page is shown in “Figure 55:  Generated Code configuration panel”

 

Figure 55:  Generated Code configuration panel


 

12.    Click the Data Access Layer tab page to specify the data access layer settings for the generated source code. You can specify additional interfaces, class attributes, method attributes and member attributes. The Data Access Layer tab page is shown in “Figure 56:  Data Access Layer configuration panel”

Figure 56:  Data Access Layer configuration panel


 

13.    Click the Business Layer tab page to specify the business layer root namespace, the assembly name, the intercepts settings, the base class name, interfaces and attributes for the generated source code. The Business Layer tab page is shown in “Figure 57:  Business Layer configuration panel”

Figure 57:  Business Layer configuration panel


 

14.    Click the Service Layer tab page to specify the services root namespace, intercepts options and the service interface class name for the generated source code. The Service Layer tab page is shown in “Figure 58:  Service Layer configuration panel”

Figure 58:  Service Layer configuration panel


 

15.    Click the Web Services tab page to specify the Web Services attributes and the intercepts options for the generated source code. The Web Services tab page is shown in “Figure 59:  Web Services configuration panel”

Figure 59:  Web Services configuration panel


 

16.    Click the WCF Services tab page to specify the WCF Services attributes, the intercepts options and binding and behavior options for the generated source code. The WCF Services tab page is shown in “Figure 60:  WCF Services configuration panel”

 

Figure 60:  WCF Services configuration panel


 

17.    Click the Publish tab page to select the publishing settings for the generated source code. The Publish tab page is shown in “Figure 61:  Publish configuration panel”.  You can specify the folder where all generated code will be published or specify folders for all components separately.

 

Figure 61:  Publish configuration panel

If you want to publish only a specific component, check this component and click the Customize button.

The example of the Custom Code Publishing for the Business Layer is shown in “Figure 62: Custom Code Publishing. Business Layer component”

Figure 62: Custom Code Publishing. Business Layer component

Here you can specify the publishing folder and what kind of files you want to publish.

If you previously published files to the specified folder, the publication mechanism replaces all files in the Generated subfolders.  The content of the Custom subfolders is not replaced and deleted.  The generator will not replace or delete methods in any file contained by the Intercepts subfolder and inject additional methods that are not already defined, into the matching files within this subfolder.


 

18.    Click the Code Generation Actions tab page to specify the pre code and post code generation actions. The Code Generation Actions tab page is shown in “Figure 63:  Code Generation Actions configuration panel”

Figure 63:  Code Generation Actions configuration panel

OxyGen Code Generator Overview. 4   Table of Contents. 4
Previous Topic: Exploring the Code Generated in Prior Sessions. 4   Next Topic: Publishing the Generated Code. 4