DevPartner 2018 Workshop : Maximize Your Traditional Synergy Development with Visual Studio
Exercise 1: Synergy/DE Repository Project Creation
This is the first of a series of
exercises that demonstrate the abilities of developing Traditional Synergy
inside Visual Studio.
This first exercise creates the
initial Synergy Repository project inside Visual Studio and include a number of
pre-existing data layouts into the repository.
To begin the exercise, follow these simple steps:
- Run Visual Studio 2017
- Create a new Visual Studio solution
- From the File menu select New->Project…
- In the “New Project” dialog expand the Other Project Types and highlight the Visual Studio Solutions entry and select the Blank Solution item.
- In the Name entry field type the value DevPartner2018
- The expected/default location is Documents\Visual Studio 2017\Projects
- Ensure you check the “Create directory for solution”
- Click OK
You will now have an empty solution created inside Visual Studio. Now create the Synergy/DE Repository project using the following steps:
- From the File menu select Add->New Project…
- In the “Add New Project” dialog locate and expand the Synergy/DE entry and select the Traditional entry
- Select theSynergy/DE Repository entry
- In the Name entry field type the value OnVinylRepository
- Click OK
The initial repository is empty. We are going to add three structures and their associated fields. The structures are called Country, Shop and Vinyl. There are include files available for the three record definitions which can be found here. Download (when prompted by the browser select “open”) the zip file and copy the three files contained within it to the Documents\Visual Studio 2017\Projects\DevPartner2018 folder.
From within Visual Studio run the Synergy/DE Repository by selecting Tools->Synergy/DE Repository. Once the Repository is running select the Modify->Structures menu entry. This will present an empty list of structures. If it is not empty then you have the environment variables RPSMFIL and RPSTFIL set and you need to remove them and restart Visual Studio and the Synergy/DE Repository. You can check if these values are set in the Synergy configuration files by running the SYNCKINI utility from a command window launched from Visual Studio.
To add the Country structure click the Add button:
- Enter a Structure name of COUNTRY
- Select File type of DBL ISAM
- Enter Country layout into the Description field
- Click the Attributes button
- From the Attributes menu select the Fields entry
- From the Field Functions menu select the Load Fields entry
- In the INCLUDE file entry, enter the path and the name of the country.dbl file you downloaded earlier. It may be easier to use the field’s drill button to locate the file
- In the “Choose File” dialog select “libraries” then navigate to Documents\Visual Studio 2017\Projects\DevPartner2018 folder and select the country.dbl file
- Click OK.The list of fields should be displaying in the Field Definitions list
- Click Close
- From the General menu select the Exit entry
- Click Yes to confirm to save the changes made
The country structure should now appear in the list of structures.
To add the Shop structure click the Add button:
- Enter a Structure name of SHOP
- Select File type of DBL ISAM
- Enter Shop layout into the Description field
- Click the Attributes button
- From the Attributes menu select the Fields entry
- From the Field Functions menu select the Load Fields entry
- In the INCLUDE file entry, enter the path and the name of the shop.dbl file you downloaded
earlier. It may be easier to use the field’s drill button to locate the file
- Click OK. The list of fields should be displaying in the Field Definitions list
- Click Close
- From the General menu select the Exit entry
- Click Yes to confirm to save the changes made
The shop structure should now appear in the list of structures.
To add the Vinyl structure click the Add button:
- Enter a Structure name of VINYL
- Select File type of DBL ISAM
- Enter Vinyl layout into the Description field
- Click the Attributes button
- From the Attributes menu select the Fields entry
- From the Field Functions menu select the Load Fields entry
- In the INCLUDE file entry, enter the path and the name of the vinyl.dbl file you downloaded earlier. It may be easier to use the field’s drill button to locate the file
- Click OK. The list of fields should be displaying in the Field Definitions list
- Click Close
- From the General menu select the Exit entry
- Click Yes to confirm to save the changes made
The vinyl structure should now appear in the list of structures. Click the Close button to return to the top level menu.
The basic repository is now complete. However, we have not saved it to the repository schema file that Visual Studio uses to “build” the repository. From within the repository we can export the information to the required schema file:
- From the Utilities menu select the Generate Repository Schema entry
- The repository main and text file entries will be set, do not alter these values
- We need to set the “Schema file” name. Press the drill button next to the field. Navigate to the OnVinylRepository folder. This folder will be under the solution folder location where you created the initial solution in. Select the repository.scm filename and click the Open button
- Select All from the Option dropdown
- Click OK
- Click Yes to confirm overwriting the existing file
- Click OK to close the confirmation dialog. The process should have generated three structures
You can now close the Repository.
To confirm the correct repository schema was generated, in Visual Studio locate and double click the “repository.scm” file under the OnVinylRepository project. The opened file should contain the definitions from your three structures. When finished reviewing the file, close it.
**If you don’t have the Solution Explorer visible inside Visual Studio, from the View menu select the Solution Explorer entry
Now we can execute the build process:
- From the Build menu select the Build Soluiton entry
- The repository will be built. If you encounter any errors, correct these.