Import Metadata into Application

Use these scripts to upload a metadata file and to import dimension metadata from it into an Profitability and Cost Management application.

These scripts perform the following operations:

  • Signs in to the environment.
  • Uploads a metadata file.
  • Imports metadata from the uploaded file into an application.
  • Enables the application.
  • Signs out.

Windows Script

Create importMetadata.ps1 by copying this script.

$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$passwordfile="$($inputproperties.passwordfile)"
$serviceURL="$($inputproperties.serviceURL)"
$applicationName="$($inputproperties.applicationName)"
$dataFileName="$($inputproperties.dataFileName)"
$dataFileNameDestination="$($inputproperties.dataFileNameDestination)"

epmautomate login ${username} ${passwordfile} ${serviceURL}
epmautomate uploadfile "${dataFileName}" ${dataFileNameDestination}
epmautomate loaddimdata ${applicationName} dataFileName=${dataFileName}
epmautomate enableapp ${applicationName}
epmautomate logout

Linux/UNIX Script

Create importMetadata.sh by copying this script.

#!/bin/bash
. ./input.properties
export JAVA_HOME=${javahome}
${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}"
${epmautomatescript} uploadfile "${dataFileName}" "${dataFileNameDestination}"
${epmautomatescript} loaddimdata "${applicationName}" "dataFileName=${dataFileName}"
${epmautomatescript} enableapp "${applicationName}"
${epmautomatescript} logout

Creating the input.properties File

To run the importMetadata scripts, create the input.properties file and update it with information for your environment. Save the file in the directory where importMetadata.ps1 or importMetadata.sh is stored.

Windows


username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
applicationName=APPLICATION_NAME
dataFileName=DATA_FILE.txt
dataFileNameDestination=profitinbox
Linux/UNIX
javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
applicationName=APPLICATION_NAME
dataFileName=DATA_FILE.txt
dataFileNameDestination=profitinbox

Table 3-25 input.properties Parameters

Parameter Description
javahome JAVA_HOME location. For Linux/UNIX only.
epmautomatescript Absolute path of EPM Automate executable (epmautomate.sh). For Linux/UNIX only.
username User name of a Service Administrator, who also has the Identity Domain Administrator role.
password Password of the Service Administrator or the name and location of the encrypted password file.
serviceURL URL of the environment from which you want to generate the snapshot.
applicationName Name of the Profitability and Cost Management into which data is to be loaded.
dataFileName Name of the file containing the metadata to be imported.
dataFileNameDestination Upload location for the metadata file.

Running the Scripts

  1. Create importMetadata.ps1 or importMetadata.sh by copying the script from a preceding section.
  2. Create the input.properties file and save it in the directory where the importMetadata script is located. Contents of this file differs depending on your operating system. See Creating the input.properties File.

    Make sure that you have write privileges in this directory. For Windows, you may need to start PowerShell using the Run as Administrator option to be able to run the script.

  3. Launch the script.
    • Windows PowerShell: run importMetadata.ps1.
    • Linux/UNIX: run ./importMetadata.sh.