Template Scripts for SmartFramework data import/export

Overview

New functionality to export and import the SmartComponent Library framework and repository data in a more developer (merge) friendly way.

Below is a zip file containing all of this new functionality:

 

The following folders are contained in this zip file:

  • Ant

    • Contains three Ant scripts:

      • export-repository-data.xml

        • Exports the SmartDB data

      • import-repository-data.xml

        • Imports the SmartDB data

      • repository-data.xml

        • Contains generic macros

  • Config

    • Contains the following properties file:

      • repository-data.properties

  • Definition

    • Contains all the datasets in json files – currently fifteen

    • Import

      • Contains the Import specific dataset - currently one

 

Configuration

The following properties file holds all the configuration values:

DataVersioningScripts/config/repository-data.properties

 

The rest of this section shows values in this file that can be customized:

 

The base folder for both the Import and Export processes, is specified by the following value:

Repository.Export.Location=C:/Work/RepositoryData

The relative paths for each dataset have been specified under the Datasets section.

 

Below are a list of OpenEdge values:

#
# Internationalization
#
Default.CodePage=UTF-8
Default.CpInternal=${Default.CodePage}
Default.CpStream=${Default.CodePage}
Default.Collation=ICU-UCA
Default.Collation.Casing=Basic
Default.Number.Seperator=44
Default.Decimal.Seperator=46
Default.Database.Creation.CodePage=UTF
Default.Date.Format=dmy

 

There are also run options that can be reconfigured, but bear in mind Consultingwerk have already optimised these values:

# Max number of threads to import or export
# More threads should result in faster import and export and of course more intensive
# Machine utilization
Repository.Export.Max.Threads=10

 

How to Launch

Import

The import routine is launched from an operating system command prompt and runs the following Ant file:

Ant/import-repository-data.xml

 

Sample command line - Local database connection

SET PROGRESS=OpenEdge122_64 SET ANT_HOME=C:\Progress\%PROGRESS%\ant %ANT_HOME%\bin\ant -f Ant/import-repository-data.xml -lib C:\Progress\%PROGRESS%\pct\PCT.jar -Dsmartdb="smartdb" -Dsmartdbdir="C:/Work/SmartComponents4NET/122_64/DB/SmartDB"

Sample command line - Remote database connection

SET PROGRESS=OpenEdge122_64 SET ANT_HOME=C:\Progress\%PROGRESS%\ant %ANT_HOME%\bin\ant -f Ant/import-repository-data.xml -lib C:\Progress\%PROGRESS%\pct\PCT.jar -Dsmartdb="smartdb" -Dsmartdbhost="localhost" -Dsmartdbport="52745"

 

Alternatively you can specify the database details in the properties file described under Configuration. Simply uncomment lines 22 to 25 and pay heed to the comment guidance above those lines.

Sample command line, using a properties file

SET PROGRESS=OpenEdge122_64 SET ANT_HOME=C:\Progress\%PROGRESS%\ant %ANT_HOME%\bin\ant -f Ant/import-repository-data.xml -lib C:\Progress\%PROGRESS%\pct\PCT.jar -propertyfile config/repository-data.properties

 

There is also the following sample script in the zip file that can be used:

Import.cmd

 

Export

The export routine is launched from an operating system command prompt and runs the following Ant file:

Ant/export-repository-data.xml

 

Sample command line - Local database connection

Sample command line - Remote database connection

 

Alternatively you can specify the database details in the properties file described under Configuration. Simply uncomment lines 22 to 25 and pay heed to the comment guidance above those lines.

Sample command line, using a properties file

 

There is also the following sample script in the zip file that can be used:

Export.cmd

 

 

Both Import and Export routines have the following parameters that can be passed into the corresponding ant script:

Parameter

Purpose

Condition

-Dsmartdb

Database Name

Mandatory

Validation error:

You must supply a database name

-Dsmartdbdir

Database location

Mandatory if local Database

Validation error:

You must supply a database connection to the database

-Dsmartdbhost

Remote Database Host

Mandatory if Remote Database

Validation error:

You must supply a database connection to the database

-Dsmartdbport

Remote Database Port

 

If all four parameters are parsed then you will receive the following Validation error:

Cannot use local and remote databases simultaneously

 

Datasets

The following datasets are located in the Definitions folder:

Attachments.json

Files are located in the Attachment folder, and tables used are:

  • eSmartAttachment

    • Grouped by AttachmentGUID

  • eSmartAttachmentRole

    • Grouped by AttachmentRoleGUID

BusinessEntities.json

Files are located in the BusinessEntity folder and corresponding subfolders for export, and tables used are:

  • eSmartBusinessEntity

    • Grouped by BusinessEntityPackage and BusinessEntityName

  • eEntityFieldMapping

    • Grouped by EntityName and EntityFieldMappingGuid

  • eSmartEntityTableMapping

    • Grouped by BusinessEntityPackage, BusinessEntityName and EntityTableMappingGuid

  • eSmartKeyFieldAssignmentType

Comments.json

Files are located in the Comments folder, and tables used are:

eSmartCommentRole

Configuration.json

Files are located in the Configuration folder, and tables used are:

  • eSmartConfigurationValue

  • eSmartUiType

Database.json

Files are located in the Database folder and corresponding subfolders for export, and tables used are:

  • eSmartRelation

    • Grouped by ParentRoleDescription, ChildRoleDescription and RelationGuid

  • eSmartTable

    • Grouped by DatabaseName and TableName

  • eSmartDeletion

    • Grouped by DeletionTable and DeletionGuid

Languages.json

Files are located in the Languages folder, and tables used are:

eSmartLanguage

Menus.json

Files are located in the Menu folder, and tables used are:

  • eSmartMenuStyle

  • eSmartMenuGroup

MenuStyles.json

Files are located in the Menu folder, and tables used are:

eSmartMenuStyle

Messages.json

Files are located in the Message folder and corresponding subfolders for export, and tables used are:

  • eSmartMessage

    • Grouped by MessageGroup, LanguageGuid and MessageNumber

Products.json

Files are located in the Menu folder, and tables used are:

  • eSmartProduct

  • eSmartModule

Repository.json

Files are located in the Repository folder, and tables used are:

  • eSmartAttribute

  • eSmartAttributeGroup

  • eSmartAttributeValue

  • eSmartClassType

  • eSmartLinkType

  • eSmartObjectType

  • eSmartSupportedLink

  • eSmartSupportedInstanceObjType

  • eSmartCustomizationType

  • eSmartKeyFieldAssignmentType

  • eSmartValueList

Scheduler.json

Files are located in the Scheduler folder, and tables used are:

eSmartSchedulerJob

Security.json

Files are located in the Security folder, and tables used are:

  • eSmartSecurityRealm

  • eSmartSecurityToken

  • eSmartToolbarSecurityItem

  • eSmartSecurityAssignment

  • eSmartSecurityObject

Translations.json

Files are located in the Translations folder and corresponding subfolders for export, and tables used are:

  • eSmartTranslation

  • eSmartUITranslation

UserGroupCompany.json

Files are located in the UsersGroupsCompanies folder, and tables used are:

  • eSmartGroup

  • eSmartParentGroup

  • eSmartLoginCompany