- 3 Minutes to read
- Print
- DarkLight
- PDF
CreatePackage
- 3 Minutes to read
- Print
- DarkLight
- PDF
Creates a zip package that can be used to inject shared data definitions into consumer projects.
Key | Value(s) | Description |
---|---|---|
method | "CreatePackage" | Creates a zip package that can be used to inject shared data definitions into consumer projects. |
path | "Path or filename" | Required, unless "name" is used. [Path & Filename] to the package file. |
name | Optional. Default = "" If used, "push" must be true. Cannot be used if "path" is specified. Only one of "name" or "path" can be used. | |
push | true/false | Optional. Default = false. Required if using "name" rather than "path" If Storage Hub has been configured, will add the package to the storage hub. If storage hub has not been configured, use "path" instead. |
includeProjectMetaData | true/false | Optional. Default = true. If true, metadata definitions (i.e., categories, codes, descriptions etc) will be included in the package. |
targetProject | "ProjectName" | Required. The name of the source project containing the objects from which to create the data package. |
tables[] | [ "table1", "table2", "table3", "*" ] | Optional. Default = "" The tables to include in the package. To include all tables, use "*" |
reports[] | [ "report1", "report2", "report3", "*" ] | Optional. Default = "" The reports to include in the package. To include all reports, use "*" |
stdReports[] | [ "stdReport1", "stdReport2", "stdReport3", "*" ] | Optional. Default = "" The standardized reports to include in the package. To include all standardized reports, use "*" |
autoLock | true/false | Added in v5.8.15 Optional. Default = true. If true, flags targetProject as protected. (Note: is it not possible to drop protected projects. Use Projects | Manage Projects to change project protection) |
project | "CurrentProjectName" | |
includeCampaignConfiguration | true/false | Added in v6.11.11.01 Optional. Default = false If true, includes campaign information in package file. When package is injected, consumer project will be campaign enabled. The last package that is injected into the consumer project is the campaign configuration that will be used. |
Package files can be identified by filename, or by package name.
Filename
- filename - a full path and filename for the package zip file must be provided.
- When CREATING:
- use "path" key to specify the path, or [path and filename] when creating the package, e.g., "%DATAPATH%NewPackageFileName.zip"
- When INJECTING:
- use "path" key to specify the filename when injecting the package (see InjectPackage)
- use "homePath" key to point to the underlying data files, e.g., "%REPOS%/SourceProject_A"
- Existing files of the same name will be overwritten.
- Assuming the file is output to %DATAPATH%, the resulting package file can be found in Admin | Remote Files
- When CREATING:
Package Name
- package name- usually packages are stored in the storage hub and accessed via the package helperwizard.
- To store a package in the hub, use the "name" key and set "push" to true.
- To use a package created using the name method, use the "name" key in InjectPackage
Notes
- Dependencies are always written into the package file.
- Joins are automatically included between any tables that are in the package.
Package Contents
The following objects are included in a package file:
- tables and fields
- field templates
- reports (free-flow and standardized)
- metadata
Note that datasets and collections are not included in packages.
Project | Create Package
If the Storage Hub has been configured, Packages for the current project can be created using Project | Create Package. This will create a package of specified name and automatically push it to the hub. To see the CreatePackage method generated when creating the package, use one of the following methods:
- Script Editor | File | Import Definitions. Select the CreatePackage method and add to the active script.
- Press Script Editor | Record before selecting Project | Create Package. The CreatePackage method will be added to the active script.
For a more detailed look at working with injected data, see Introduction to Data Injection
Example using explicit "path" to package file (filename)
Use CreatePackage to create package file:
{
"method": "CreatePackage",
"path": "%DATAPATH%/06_Packages/dj-localhost_CONSUMER_Test1_20241105_145735_1.zip",
"push": false,
"system": false,
"targetProject": "CONSUMER_Test1",
"includeProjectMetadata": true,
"autoLock": false,
"tables": [
"*"
],
"reports": [
"*"
],
"template": [
"*"
],
"createMetafile": true,
"project": "CONSUMER_Test1"
}
Use InjectPackage to import package file by filename:
{
"method": "InjectPackage",
"path": "%DATAPATH%/06_Packages/dj-localhost_CONSUMER_Test1_20241105_145735_1.zip",
"homePath": "%REPOS%CONSUMER_Test1",
"targetProject": "Injection_Test_Basic",
"includeProjectMetaData": true,
"sourceName": "Test Consumer Project",
"sortMode": 0,
"errorOnMissingDataFiles": false,
"pull": false,
"project": "CONSUMER_Test1"
}
Named package files
Use CreatePackage with the "name" property to create a package from CONSUMER_Test1:
{
"method": "CreatePackage",
"name": "Consumer_Package1",
"push": true,
"system": false,
"targetProject": "CONSUMER_Test1",
"includeProjectMetadata": true,
"autoLock": false,
"createMetafile": true,
"project": "CONSUMER_Test1"
}
Then use InjectPackage to inject the data into project Injection_Test_Basic:
{
"method": "InjectPackage",
"name": "Consumer_Package1",
"targetProject": "Injection_Test_Basic",
"includeProjectMetaData": true,
"sourceName": "Test Consumer Project",
"sortMode": 0,
"errorOnMissingDataFiles": false,
"pull": true,
"project": "CONSUMER_Test1"
}
Example created using Project | Create Package
{
"method": "CreatePackage",
"includeProjectMetadata": true,
"createMetafile": true,
"autoLock": false,
"push": true,
"name": "BProject22024-10-31-13-57-26",
"targetProject": "BProject2",
"project": "BProject2"
}