How To: Load the TPDM Descriptors Using Bulk Load Client Utility

How To: Load the TPDM Descriptors Using Bulk Load Client Utility

This article describes the steps needed to populate an Ed-Fi ODS with TPDM descriptors, using the Ed-Fi Bulk Load Client utility.

If you need to load TPDM Sample XML data as well as descriptors, How To: Load the TPDM Sample XML Data using Bulk Load Client Utility will walk you through the steps to load descriptors plus XML Sample data.

The steps can be summarized as:

Step 1. Build the Ed-Fi Bulk Load Client

  • Ensure that you have an instance of the Ed-Fi ODS / API running locally that has been set up following the v1.1Installing ODS/API and TPDM from source code (ODS/API v5.1).

  • Within Visual Studio, Open Ed-Fi-ODS\Utilities\DataLoading\LoadTools.sln.

  • Select Build > Build Solution.

  • You can verify that the console application has been built by browsing to Ed-Fi-ODS\Utilities\DataLoading\EdFi.BulkLoadClient.Console\bin\Debug\net48\EdFi.BulkLoadClient.Console.exe

Step 2. Download Scripts and Descriptor Data

  • Download and Extract Ed-Fi-TPDMDataLoad.zip to a local folder. We recommend C:\Ed-Fi-TPDMDataLoad.
    Ed-Fi-TPDMDataLoad.zip contains all the scripts and directory structure used in this how-to article.

  • Download the Descriptors to Ed-Fi-TPDMDataLoad\Bootstrap.

  • Copy all XSD schema files from Ed-Fi-ODS\Application\EdFi.Ods.Standard\Artifacts\Schemas and Ed-Fi-ODS-Implementation\Application\EdFi.Ods.Extensions.TPDM\Artifacts\Schemas to Ed-Fi-TPDMDataLoad\Schemas.

Step 3. Create a Populated Sandbox

  • Open Ed-Fi-ODS-Implementation\Application\EdFi.Ods.Admin.Web\AdminCredential.config.

  • Add a minimal sandbox by inserting the below line in the <sandboxes> element.

    <sandbox name="Minimal TPDM Sandbox" key="emptyKey" secret="emptysecret" type="Sample" refresh="false" />
  • Add the TPDM namespace prefix by inserting the below line in the <namespaceprefixes> element.

    <namespacePrefix name="uri://tpdm.ed-fi.org" />
  • Restart the Sandbox Administration website.

Step 4. Update Claim Set to Load Descriptors and Education Organizations

  • Execute the following SQL against the EdFi_Admin database using any database query tool. Use the version appropriate to your database.

    EnableBootstrapClaimset.sql

    -- Sql Server UPDATE a SET a.ClaimSetName = 'Bootstrap Descriptors and EdOrgs' FROM dbo.Applications a INNER JOIN dbo.ApiClients ac ON a.ApplicationId = ac.Application_ApplicationId WHERE ac.Name = 'Minimal TPDM Sandbox' -- Postgres do $$ begin update dbo.Applications set ClaimSetName = 'Bootstrap Descriptors and EdOrgs' from dbo.Applications a inner join dbo.ApiClients ac on a.ApplicationId = ac.Application_ApplicationId where ac.Name = 'Minimal TPDM Sandbox'; end $$

Step 5. Run the Bootstrap Script to Load Descriptors

  • Open a PowerShell session.

  • Navigate to Ed-Fi-TPDMDataLoad directory (e.g., C:\Ed-Fi-TPDMDataLoad).

  • Execute LoadBootstrapData.ps1.

    The script will run the Bulk Load Client loading data from the Bootstrap folder to the TPDM Populated Sandbox Database.

Step 6. Update Claim Set to Previous Value

  • Execute the following SQL against the EdFi_Admin database using any database query tool. Use the version appropriate to your database. This will allow for bulk loading of sample data as well as using the API normally

    EnableSandboxClaimsetAndEducationOrganization.sql

    -- Sql Server DECLARE @apiClientId INT DECLARE @applicationId INT SELECT @apiClientId = ApiClientId, @applicationId = Application_ApplicationId FROM dbo.ApiClients WHERE Name = 'Minimal TPDM Sandbox' UPDATE dbo.Applications SET ClaimSetName = 'Ed-Fi Sandbox' WHERE ApplicationId = @applicationId -- Postgres do $$ declare ApiClientId int; declare AppId int; begin select a.ApiClientId, a.Application_ApplicationId into ApiClientId, AppId from dbo.ApiClients a where Name = 'Minimal TPDM Sandbox'; update dbo.Applications set ClaimSetName = 'Ed-Fi Sandbox' where ApplicationId = AppId; end $$
Downloads

The following link contains the scripts and directory setup used in this how-to article.

The following GitHub links contain the as-shipped TPDM Descriptor XML.

Descriptors