Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
180 lines (168 sloc) 6.16 KB

Architecture Guild

This project automates common maintenance tasks associated with Sparx Enterprise Architect tool.

Features

Following maintenance tasks are currently featured:

  1. Create scheduled backup of project (.eap) file or project maintained in a relational database
  2. Create scheduled HTML publish of a project file (or a package within the project) to a specific folder location
  3. Create scheduled HTML publish of a project file (or a package within the project) to SharePoint site

Note: Glossary maintained in the project also gets published as part of the HTML publish task.

Pre-Requisites

Make sure .NET Core 2.x is installed on the target machine.

Release Binaries

The console application along with the runtime binaries can be found under "artifacts -> release -> netcoreapp2.0" folder. A debug version of the application is also available under "artifacts -> debug" folder.

Running the project

Make sure to modify the appsettings.json file before running the command!

dotnet [path]\Guild.ConsoleApp.dll

Configuring the Application

Each task needs to be configured independently by modifying the "appsettings.json" file. You need to include only the tasks that are needed in your environment.

Schedule Project Backup

To schedule backup of the project, modify the appsettings.json file as below:

{
   "Modules": [
      "Guild.Modules.BackupToDiskModule, Guild.Modules"
   ],
   "BackupToDisk": {
      "SourceFileName": [specify the database connection string or the full path to the project file including file name],
      "TargetLocation": [specify the path where backup should be stored],
      "TargetFileName": [specify the backup file name],
      "DateFormat": [specify date format if backup file name should include the date stampt],
      "RunOn": [specify the days when the backup should run],
      "NumberOfFilesToKeep": [specify the maximum number of backups to keep]
   }
}

Example:

{
   "Modules": [
      "Guild.Modules.BackupToDiskModule, Guild.Modules"
   ],
   "BackupToDisk": {
      "SourceFileName": "C:\Sparx\Models\MyModel.eap",
      "TargetLocation": "C:\Sparx\Archives",
      "TargetFileName": ".eap",
      "DateFormat": "yyyyMMdd",
      "RunOn": "Mon, Tue, Wed, Thu, Fri",
      "NumberOfFilesToKeep": 6
   }
}

Publish Project as HTML

To schedule publishing of the project as HTML pages, modify the appsettings.json file as below:

{
   "Modules": [
      "Guild.Modules.PublishAsHtmlToDiskModule, Guild.Modules"
   ],
   "PublishAsHtmlToDisk": {
      "SourceFileName": [specify the database connection string or the full path to the project file including file name],
      "TargetLocation": [specify the path where exported html pages should be stored],
      "PackageGuid": [specify package guid if you want to export only a specific package rather than the entire project],
      "RunOn": [specify the days when the backup should run],
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   }
}

Example:

{
   "Modules": [
      "Guild.Modules.PublishAsHtmlToDiskModule, Guild.Modules"
   ],
   "PublishAsHtmlToDisk": {
      "SourceFileName": "C:\Sparx\Models\MyModel.eap",
      "TargetLocation": "C:\Sparx\Html",
      "PackageGuid": "",
      "RunOn": "Mon, Tue, Wed, Thu, Fri",
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   }
}

Publish Project to SharePoint Site

To export the project as html and publish the same to a SharePoint site, modify the appsettings.config file as below (code tested against SharePoint 2010 only):

{
   "Modules": [
      "Guild.Modules.PublishAsHtmlToSharePointModule, Guild.Modules"
   ],
   "PublishAsHtmlToSharePoint": {
      "SourceFileName": [specify the database connection string or the full path to the project file including file name],
      "PackageGuid": [specify package guid if you want to publish only a specific package rather than the entire project],
      "SiteUrl": [specify the SharePoint site url],
      "ListName": [specify the name of the SharePoint list where pages will be published to],
      "EmptyRecycleBin": [true to empty recycle bin after publish, false otherwise],
      "RunOn": [specify the days when the backup should run],
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   }
}

Example:

{
   "Modules": [
      "Guild.Modules.PublishAsHtmlToSharePointModule, Guild.Modules"
   ],
   "PublishAsHtmlToSharePoint": {
      "SourceFileName": "C:\Sparx\Model\MyModel.eap",
      "PackageGuid": "",
      "SiteUrl": "http://MySPSite",
      "ListName": "HtmlReport",
      "EmptyRecycleBin": "false",
      "RunOn": "Wed, Fri",
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   }
}

Multiple Configurations

The appsettings.config file can contain multiple configurations as below:

{
   "Modules": [
      "Guild.Modules.BackupToDiskModule, Guild.Modules",
      "Guild.Modules.PublishAsHtmlToDiskModule, Guild.Modules",
      "Guild.Modules.PublishAsHtmlToSharePointModule, Guild.Modules"
   ],
   "BackupToDisk": {
      "SourceFileName": "C:\Sparx\Models\MyModel.eap",
      "TargetLocation": "C:\Sparx\Archives",
      "TargetFileName": ".eap",
      "DateFormat": "yyyyMMdd",
      "RunOn": "Mon, Tue, Wed, Thu, Fri",
      "NumberOfFilesToKeep": 6
   },
   "PublishAsHtmlToDisk": {
      "SourceFileName": "C:\Sparx\Models\MyModel.eap",
      "TargetLocation": "C:\Sparx\Html",
      "PackageGuid": "{E19F36DD-CA4A-4a07-9C0E-ED6564063078}",
      "RunOn": "Mon, Tue, Wed, Thu, Fri",
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   },
   "PublishAsHtmlToSharePoint": {
      "SourceFileName": "C:\Sparx\Model\MyModel.eap",
      "PackageGuid": "{E19F36DD-CA4A-4a07-9C0E-ED6564063078}",
      "SiteUrl": "http://MySPSite",
      "ListName": "HtmlReport",
      "EmptyRecycleBin": "false",
      "RunOn": "Wed, Fri",
      "ImageFormat": "PNG",
      "Style": "<default>",
      "FileExtension": ".htm"
   }
}

License

Copyright (c) Raju Joseph. All rights reserved.

Licensed under the MIT License.