InjectPackage
  • 2 Minutes to read
  • Dark
    Light
  • PDF

InjectPackage

  • Dark
    Light
  • PDF

Article summary

Injects a shared data package that has been created using CreatePackage.  

KeyValue(s)Description
method"InjectPackage"Inject a shared data package into a consumer project.
project"CurrentProjectName"Name of active project.
path"PackagePathAndFile"Path and filename of *.zip file containing package information.
  • "homePath" also required is "path" is used.
  • "path" must not be used if "name" is specified.
homePath"TableDataPath"Path to shared data.   Only required if using "path", otherwise, read from package meta file.
Note:  These are loaded DataJet files (such as *.dat, *.uvl)
If empty, datapath location will be read from package metadata json file.
Example "%REPOS%SOURCE_01"
targetProject"TargetProjectName"Name of project into which the data will be injected (i.e., consumer project).   The project must already exist.
includeProjectMetaData"true"Optional. Default = true
sourceName"SourceIdentifier"If provided, then the context panel property "inj Source" will display the text sourceIdentifier as the source of the injected table:

If not provided, Inj Source will show as "~External~"

{
  "method": "InjectPackage",
  "sourceName": "SalesData_Current",
  ...
  "name": "SalesData_Current",
  ...
  "project": "Injection_Test_Basic"
}
sortMode0Reserved for future use
errorOnMissingDataFilestrue/falseDefault = false.
If true will raise an error if underlying data files are not found in the location specified by "homePath"
name"packagename"The name used to store and retrieve the package from the storage hub.
  • If used, "path" must not be provided.
  • "pull" must be true
pulltrue/falseOptional.  Default = false.
  • If true, will pull the package from the Storage hub
  • If false, package is retrieved using path.
  • Must be true is "name" is used.
templates[]

[

"template1"

"..."

]

Optional.  Default = "*"
List of field templates to inject.  
Use "*" to inject all
tables[]

[

"table1"

"..."

]

Optional.  Default = "*"
List of tables to inject.  
Use "*" to inject all
reports[]

[

"report1"

"..."

]

Optional.  Default = "*"
List of reports to inject.  
Use "*" to inject all
stdReports[]

[

"stdReport1"

"..."

]

Optional.  Default = "*"
List of standardized reports to inject.  
Use "*" to inject all
renames[]

[

{ "from": "sales", "to": "isales" }

{ "from": "...", "to": "..." }

]

From v6.02.09
Specifies aliases of injected table.


Injected Packages are used to give multiple projects and/or servers/realms access to shared data.   The Shared Data package can consist of tables, joins, reports and templates.

Shared data cannot be altered by the consumer project, but can be used to derive new data which then belongs to the consumer project.

See CreatePackage for details on creating a package.

See Introduction to Data Injection for an overview of the Shared Data process.


Helper

Right-click in the JSON panel to bring up the context menu and choose "Wizard":

The InjectPackage wizard will interrogate the Storage Hub for details of available packages.  Selecting a package will populate the helper with details of the package contents.

Choosing "Apply" will add Selected options which will then be added to the method JSON.

Blank Method

{
  "method": "InjectPackage",
  "project": "",
  "path": "",
  "homePath": "",
  "targetProject": "",
  "includeProjectMetaData": false,
  "sourceName": "",
  "sortMode": 0,
  "errorOnMissingDataFiles": false,
  "name": "",
  "pull": false,
  "templates": [],
  "tables": [],
  "reports": [],
  "stdreports": []
  "renames":[]
}


Helper Generated Method

{
  "method": "InjectPackage",
  "name": "AllDemo",
  "includeProjectMetaData": true,
  "errorOnMissingDataFiles": false,
  "pull": true,
  "project": "CONSUMER_Test1",
  "tables": [
    "sales",
    "customer",
    "product",
    "LR01INFO",
    "FromTemplateExport",
    "MultiStatsTable",
    "Segmented segment_Consumer",
    "Segmented segment_Corporate",
    "Segmented segment_Home Office"
  ],
  "templates": [
    "Basic Sales",
    "Basic Customer",
    "Sales Dimensions",
    "Large Sales Dimensions",
    "Low Card Sales"
  ],
  "reports": [
    "12 Month Sales",
    "Sales Dashboard",
    "LR01 Report",
    "Charts By Python",
    "Sales Dimension Report",
    "Highest Lux Index Profile",
    "Crosstab of yearmonth",
    "Interactive",
    "Multi Field Statistics",
    "Large Dashboard"
  ],
  "stdreports": [
    "Styled Standardized Sales Report",
    "Standardized Sales Report"
  ]
}


{
  "method": "InjectPackage",
  "project": "",
  "homePath": "",
  "includeProjectMetaData": true,
  "errorOnMissingDataFiles": false,
  "name": "Demo2023-11-09-16-18-17",
  "pull": true,
  "tables": [
    "sales",
    "customer"
  ],
  "renames": [
    {
      "from": "sales",
      "to": "isales"
    }
    {
      "from": "customer",
      "to": "icustomer"
    }
  ]
}


Error Messages

MessagePossible causes
no declared or recorded homePathWhen using "path", "homePath", pointing to the repository containing the data files must also be included.
'name' can only be declared when 'pull' ing packageWhen using "name", include "pull": true

cannot inject table 'table_name', already exists injecting package failed


Trying to inject a table that already exists into the consumer project






Was this article helpful?