The solution is built using .NET Core 3.1, a CosmosDb database and a RDBMS database. You should be able to develop and run the solution on Windows, macOS or Linux.
You can optionally choose to create a new CosmosDb database in Azure if you have access to do this or use Microsoft's CosmosDb emulator which can be downloaded here.
If you use the emulator ensure that you have started it before trying to launch your local STAX editor solution and that it has been configured correctly and in either case a database has been set up. This will be covered later in the configuration section.
Setup a database for Orchard Core to store content. Any database with a .NET ADO provider is supported. For example, setup a Azure SQL Database.
Optionally, you can run a local Sqlite database with no initial setup necessary. This is the easiest option however there have been instances where errors have occurred in a MSSQL which do not happen with Sqlite, especially with regards to migrations and index initiallisation.
If you choose to use a SQL Server or Azure SQL database, ensure that the connection string enables multiple active result sets (MARS), by including MultipleActiveResultSets=True
. If you go through the set-up process again (after deleting App_Data
), you'll need to clear down the Azure SQL / SQL Server database, otherwise you'll get the error invalid serial number for shell descriptor
.
Restore a copy of the Skills Framework Database. Ideally this should be some version of a MSSQL database either hosted locally or in Azure as the database copy will be taken from there as .bacpac file.
This is mainly a read only database from the view of the STAX editor but there is some potential for updates being made so a specific individual instance for your set up is best.
Clone the GitHub repo and open the solution DFC.ServiceTaxonomyEditor.sln
in your favourite .NET Core supporting IDE, such as Visual Studio, Visual Code or Rider.
Set DFC.ServiceTaxonomy.Editor
as the startup project.
Copy the appsettings.Development_template.json
file in the editor project to appsettings.Development.json
, inserting the appropriate values for the CosmosDb and Skills Framework Databse. (The template contains appropriate values if you've followed this readme.)
Note that you do not need to set up the "published" and "preview" containers in the CosmosDB in advance as these will be created when running the project for the first time if they are not there.
The EventGrid settings are not required for a local set up unless you wish to test something in this area, the PublishedEvents key can be set to false to disable this.
{
"ConnectionStrings": {
"SkillsFrameworkDB": "Server=(localdb)\\mssqllocaldb;Database=dfc-dev-onetskillsframework;Trusted_Connection=True;"
},
"ContentApiPrefix": "http://localhost:7071/api/execute",
"PreviewContentApiPrefix": "http://localhost:7081/api/execute",
"CosmosDb": {
"endpoints": {
"preview": {
"ConnectionString": "AccountEndpoint=xxxx;AccountKey=xxxx==",
"DatabaseName": "stax-db",
"ContainerName": "preview"
},
"published": {
"ConnectionString": "AccountEndpoint=xxxx;AccountKey=xxxx==",
"DatabaseName": "stax-db",
"ContainerName": "published"
}
}
},
"EventGrid": {
"PublishEvents": "true",
"Topics": [
{
"ContentType": "*",
"TopicEndpoint": "<Insert your own topic endpoint here>",
"AegSasKey": "<Insert your topic's key here>"
}
]
},
"Pages": {
"PublishedAppPrefix": "shell URI",
"PreviewAppPrefix": "draft shell URI",
"PublishedJobProfileAppPrefix": "shell URI",
"PreviewJobProfileAppPrefix": "draft shell URI"
},
"JobProfiles": {
"PublishedAppPrefix": "shell URI",
"PreviewAppPrefix": "draft shell URI"
},
"GraphSyncSettings": {
"MaxVisualiserNodeDepth": 10
},
"OrchardCore": {
"OrchardCore_Media_Azure": {
"ConnectionString": "",
"ContainerName": "",
"BasePath": "",
"CreateContainer": false
}
},
"AzureAdSettings": {
"ClientId": "__ClientId__",
"ClientSecret": "__ClientSecret__",
"Authority": "__Authority__",
"SubscriptionId": "__SubscriptionId__",
"CdnProfileName": "__CdnProfileName__",
"CdnEndpointName": "__CdnEndpointName__",
"ResourceGroupName": "__ResourceGroupName__",
"KeyVaultAddress": "__KeyVaultAddress__"
},
"ServiceBusSettings": {
"ServiceBusConnectionString": "__ServiceBus-ConnectionString__",
"ServiceBusTopicName": "__ServiceBus-TopicName__",
"ServiceBusTopicNameForDraft": "__ServiceBus-TopicName-For-Draft__"
},
"DigitalAssetsCdn": "",
"SlackMessagePublishingConfiguration": {
"PublishToSlack": false
}
}
Run or debug the DFC.ServiceTaxonomy.Editor
project, which should launch the Setup page. Populate the page as follows, and click Finish Setup. (This runs the site using a local Sqlite database.)
Note: this step will become unnecessary as the solution evolves.
You should then be directed to the log in page. Enter the username and password you've just set up. If you have the memory of a goldfish, delete the DFC.ServiceTaxonomy.Editor\App_Data folder and start again.
Content types and content can be imported via recipes. Several of these can be found in the DFC.ServiceTaxonomy.Editor/Recipes directory. Please refer to the okContent Import/Export document for more information.
The integration tests are run as part of a release.
To run the integration tests locally, copy the appsettings.Development_template.json
file in the DFC.ServiceTaxonomy.IntegrationTests
folder to appsettings.Development.json
, ensuring the settings file contains the correct config for the 'Published' graph.
If enabled, the Stax Editor publishes events to a configured topic. A topic can be setup in an Azure subscription, or an event grid emulator (unofficial) can be used.
The Orchard Core libraries are managed via the nuget manager and details on how to upgrade these are outlined here