Environment Variables (GUI)
Environment variables are accessed by external programs configured under the user toolbar buttons. When using these variables, the names must be in uppercase or the PTC RV&S client cannot recognize them.
The following list shows the associated environment variables for each type of window opened:
All
If a window has a server connection it will set the following variables.
MKSSI_WINDOW
MKSSI_HOST
MKSSI_PORT
MKSSI_USER
If there is no active window or no view, then:
MKSSI_WINDOW=none
If there is an active window, then:
MKSSI_WINDOW=[archive|document|item|items|project|projecthistory|sandbox]
Otherwise, the value is set to a window-specific value:
MKSSI_WINDOW=archive
If the active window is a different window, then:
MKSSI_WINDOW=unknown
For example, a Project Modifications window that does not produce any specific environment variables:
MKSSI_WINDOW=unknown
|
For the values none and unknown, no other variables are set.
|
Because PTC RV&S supports multiple connections to the server, you should specify the following environment variables when running a command line operation from the toolbar:
si <command> --host=$MKSSI_HOST --port=$MKSSI_PORT --user=$MKSSI_USER
Document
Same as Items window type, plus the following revision variables:
MKSSI_REVISION_NAME=<revision name>
For example, 1.2.
MKSSI_REVISION_DATE=<revision date>
For example, Mon Mar 26 14:53:35
If the Significant Change Since Item Revision field is true for the corresponding item, then:
MKSSI_REVISION_DELTA=true
|
Variables MKSSI_REVISION_NAME, MKSSI_REVISION_DATE, and MKSSI_REVISION_DELTA export information for the root item. If the item is not revisioned or it has no revision history, then no variables are exported. The window displayed by the > menu option exports the same variables as the Edit Item window.
|
Item
For an open Item Details window:
MKSSI_NISSUE=<1>
MKSSI_ISSUE=<ID of selected item>
MKSSI_ISSUE0=<same ID as MKSSI_ISSUE>
MKSSI_REVISION_NAME=<revision name>
For example, 1.2
MKSSI_REVISION_DATE=<revision date>
For example, Mon Mar 26 14:53:35
If the Significant Change Since Item Revision field is true for the corresponding item, then:
MKSSI_REVISION_DELTA=true
|
If the item is not revisioned or it has no revision history, then no variables are exported.
|
Edit Item
For an open Edit Item window:
MKSSI_ISSUE=<ID of item open for edit>
MKSSI_ISSUE0=<same ID as MKSSI_ISSUE>
MKSSI_REVISION_NAME=<revision name>
For example, 1.2
MKSSI_REVISION_DATE=<revision date>
For example, Mon Mar 26 14:53:35
If the Significant Change Since Item Revision field is true for the corresponding item, then:
MKSSI_REVISION_DELTA=true
|
If the item is not revisioned or it has no revision history, then no variables are exported.
|
Items
For an open Items window:
MKSSI_NISSUE=<number of MKSSI_ISSUE objects>MKSSI_ISSUE[x]=<ID of selected item>
Where the value of [x] starts at 0 and increments with each item selected.
MKSSI_QUERY=<current query for Items window>or
MKSSI_QUERY=<queryCreatorName>:<queryName>or
MKSSI_QUERYDEFINITION=<queryDefinition>
MKSSI_NFIELD=<number of columns in view>
MKSSI_FIELD[x]=<display name of each field displayed as columns
in the view>
Column configuration for an open Items window:
MKSSI_NFIELD=<number of visible fields>
MKSSI_FIELD[x]=<name of each visible field>
Where the value of [x] ranges from 1 to MKSSI_NFIELD.
MKSSI_FIELD[x]_WIDTH=<width of each visible field>
Where the value of [x] ranges from 1 to MKSSI_NFIELD.
MKSSI_SORTFIELD=<name of the field that the view is sorted by>
MKSSI_SORTASCENDING=[true|false]
true if the view is sorted in ascending order; false if the view is sorted in descending order.
Relationships
For an open Relationships window:
MKSSI_NISSUE=<number of MKSSI_ISSUE objects>
MKSSI_ISSUE[x]=<ID of selected item>
Where the value of [x]starts at 0 and increments with each item selected.
MKSSI_REVISION_NAME[x]=<revision name>
For example, 1.2
MKSSI_REVISION_DATE[x]=<revision date>
For example, Mon Mar 26 14:53:35
If the Significant Change Since Item Revision field is true for the corresponding item, then:
MKSSI_REVISION_DELTA[x]=true
|
Variables MKSSI_REVISION_NAME[x], MKSSI_REVISION_DATE[x], and MKSSI_REVISION_DELTA[x] export revision information for the selected item(s) only. The value of [x] starts at 0 and supports gaps if the corresponding MKSSI_ISSUE[x] is not revisioned. If an item is not revisioned or has no revision history, then no revision-specific variables are exported for it.
|
Member History
For an open Member History window:
MKSSI_FILE=<pathname-relative to project/sandbox of archive>
If the window was opened from a Sandbox:
MKSSI_WORKINGFILE=<full-path-to-working-file>
MKSSI_SANDBOX=<full-path-to-sandbox>
MKSSI_PROJECT_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name#Subproject Name>
|
MKSSI_WORKINGFILE is not set if the working file does not exist.
|
If the window was opened from a project:
MKSSI_PROJECT=<server-path-to-project>
MKSSI_PROJECT_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name#Subproject Name>
If the project/Sandbox was a variant:
MKSSI_VARIANT=<variantName>
If the project/Sandbox was a build:
MKSSI_BUILD=<buildNumber>
If revisions were selected:
MKSSI_REVISION=<highest revision in selection>
MKSSI_REVISION[x]=<1.2>
That is, there are n variables from MKSSI_REVISION1 to MKSSI_REVISION[x], containing each selected revision number.
Project
For an open Project window:
MKSSI_FILE=<server-side-project-path>
MKSSI_NMEMBER=<number of MKSSI_MEMBER[x] entries>
MKSSI_NSUBPROJECT=<number of MKSSI_SUBPROJECT[x] entries>
MKSSI_PROJECT_CONFIG_PATH=<project-configuration-path-
in-the form #/Project Name>
If any members are selected, then the following variables apply:
MKSSI_MEMBER[x]=<path-relative-to-project>
MKSSI_MEMBER_PROJECT[x]=<server-side-project/subproject-path>
MKSSI_MEMBER[x]_PROJECT_CONFIG_PATH=<project-configuration-path-
in-the form #/Project Name#Subproject Name>
If any subprojects are selected, then the following variables apply:
MKSSI_SUBPROJECT[x]=<path-relative-to-project>
MKSSI_SUBPROJECT_PROJECT[x]=<server-side-project/subproject-path>
MKSSI_SUBPROJECT[x]_CONFIG_PATH=<subproject-configuration-path-
in-the-form #/Project Name#Subproject Name>
That is, if there are n members selected and m subprojects selected, then you have n occurrences of MKSSI_MEMBER numbered from 1 to n and the number n is also passed in MKSSI_NMEMBER. There are also occurrences of MKSSI_SUBPROJECT numbered from 1 to m, and the number m is passed in MKSSI_NSUBPROJECT.
If a subdirectory is selected, then it is as if that subdirectory is recursively expanded (only the directories, not subprojects) and all members are selected.
Because a given member may not be in the top level project that is open in the view, each variable for MKSSI_MEMBER and MKSS_SUBPROJECT has a corresponding entry for MKSSI_MEMBER_PROJECT[x] and MKSSI_SUBPROJECT_PROJECT[x]. Therefore, each MEMBER/SUBPROJECT variable is relative to its corresponding PROJECT entry, not to the top level indicated in MKSSI_FILE.
For example:
i=1
while [ $i -le $MKSSI_NMEMBER ]
do
eval si command -P\${MKSSI_MEMBER_PROJECT$i}\${MKSSI_MEMBER$i}
let i=i+1
done
|
If set, the environment variables MKSSI_VARIANT and MKSSI_BUILD are also exported when invoking an si command with the options for --devpath and --projectrevision.
|
Project History
For an open Project History window:
MKSSI_FILE=<server-side-project-path>
MKSSI_PROJECT_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name>
|
MKSSI_REVISION[x] is set in the same way as a member history.
|
Sandbox
For an open Sandbox window:
MKSSI_FILE=<full-path-to-sandbox>
MKSSI_NMEMBER=<number of MKSSI_MEMBER objects>
MKSSI_NSUBPROJECT=<number of MKSSI_SUBPROJECT objects>
MKSSI_PROJECT_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name>
If a member is selected in the Sandbox window:
MKSSI_MEMBER[x]_PROJECT_CONFIG_PATH=<project-configuration-path-
in-the-form #/Project Name#Subproject Name>
If a subproject is selected in the Sandbox window:
MKSSI_SUBPROJECT[x]_CONFIG_PATH=<subproject-configuration-path-
in-the-form #/Project Name#Subproject Name>
MKSSI_SUBSANDBOX[x]=<local-Sandbox-path-of-the-currently-selected-
subsandbox-in-the-form C:\Sandbox Location\Project1\project.pj>
MKSSI_SUBSANDBOX[x]_PARENT=<local-Sandbox-path-of-the-parent-for-the-
currently-selected-subsandbox>
|
The variable MKSSI_MEMBER[x]= takes the same settings as for a project window. The corresponding variable MKSSI_MEMBER[x]_SANDBOX is also as described for a project. If applicable, MKSSI_VARIANT and MKSSI_BUILD are also set.
The environment variable for MKSSI_SUBPROJECT[x] is replaced by MKSSI_SUBPROJECT[x]_CONFIG_PATH. The environment variable for MKSSI_SUBPROJECT[x]_SANDBOX is replaced by MKSSI_SUBSANDBOX[x] and MKSSI_SUBSANDBOX[x]_PARENT.
|
Registered Project
For an open Registered Project view:
MKSSI_PROJECT[x]_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name>
MKSSI_SUBPROJECT[x]_CONFIG_PATH=<subproject-configuration-path-
in-the-form #/Project Name#Subproject Name>
Registered Sandbox
For an open Registered Sandbox view:
MKSSI_PROJECT[x]_CONFIG_PATH=<project-configuration-path-in-the-form
#/Project Name>
MKSSI_SUBPROJECT[x]_CONFIG_PATH=<subproject-configuration-path-
in-the-form #/Project Name#Subproject Name>
MKSSI_SUBSANDBOX[x]=<local-Sandbox-path-of-the-currently-selected-
subsandbox-in-the-form C:\Sandbox Location\Project1\project.pj>