clone()
update()
moveTo(index)
delete()
getParent()
getEnvGroupId()
getEntryOrdinal()
getEntryName()
getEntryValue()
getAction()
getMode()
setEntryName(name)
setEntryValue(value)
setAction(action)
setMode(mode)
BuildForge::Services::DBO::EnvironmentEntry
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); $entry = new BuildForge::Services::DBO::EnvironmentEntry($conn);
# Getter / setter functions $environmentGroupId = $entry->getEnvGroupId(); $ordinal = $entry->getEntryOrdinal(); $name = $entry->getEntryName(); $value = $entry->getEntryValue(); $action = $entry->getAction(); $mode = $entry->getMode(); $envGroup = $entry->getParent();
$entry->setEntryName('PROP_NAME'); $entry->setEntryValue('New Value'); $entry->setAction(ENUM_ENVIRONMENTENTRY_ACTION->APPEND); $entry->setMode(ENUM_ENVIRONMENTENTRY_MODE->READ_ONLY); $entry->update(); # Entry creation, modification, and deletion. $envGroup = BuildForge::Services::DBO::Environment->findByName($conn, 'EnvironmentName'); $newentry = new BuildForge::Services::DBO::EnvironmentEntry($conn); $newentry->setEntryName('VARIABLE_NAME'); $newentry->setEntryValue('Value'); $envGroup->addEnvironmentEntry($var);
$newentry->setEntryValue('New Value'); $newentry->update(); $newentry2 = $newentry->clone(); $envGroup->addEnvironmentEntry($newentry2); $newentry->moveTo(2);
$newentry->delete(); $conn->logout; $conn->close;
EnvironmentEntry allows you to create and modify environment variables inside of an Environment.
To create the environment variables in the database, see the Environment->addEnvironmentEntry()
function.
Returns a new instance of an EnvironmentEntry object.
A connected BuildForge::Services::Connection object.
This should be undef or not passed - it is only used internally.
An optional reference to a hash containing any or all of the following fields.
The name of the environment variable.
The value of the environment variable, defaulting to none.
The variable's action. This may be any of:
The default. Will cause the variable to be set to its value.
Will cause the variable to be set to the value if the variable value has not already been set.
Causes the variable value to be appended to the previous value separated by a system-specific path delimiter (':' for Unix systems, ';' for Windows systems).
Causes the variable value to be prepended to the previous value separated by a system-specific path delimiter (':' for Unix systems, ';' for Windows systems).
Sets the variable's value to the empty string. The entryValue will be disregarded.
Deletes the variable from the variable list. This differs from clearing it in that the former will print nothing when the variable is printed and the latter will (normally) print the variable name.
Makes this variable a hidden variable. Hidden variables do not appear in the list of variables output by step results.
Affects what happens when a project is kicked off with the variable in the project's environment. This may be any of:
The default. The variable acts normally.
The project cannot be quickstarted, and when the build is kicked off, the value of the variable must change.
When the project build is being kicked off, the value of the variable cannot be changed.
The project cannot be quickstarted if the variable has no initial value, and when the build is kicked off, the value of the variable cannot be empty.
The variable is not displayed in the project environment variable list on the project start page.
clone()
A copy of the EnvironmentEntry object is returned without affecting the database.
To save the copy to an environment group, $environment->addEnvironmentEntry($copy)
must be run on the copy.
update()
Updates the variable settings in the database.
moveTo(index)
Moves the variable within its parent environment group.
The new location of the variable. 0 moves it to the first position, 1 to the second position, etc.
delete()
Deletes the variable from the database.
getParent()
Returns the BuildForge::Services::DBO::Environment object for the environment group this variable belongs to.
getEnvGroupId()
Returns the environment group ID for the environment group this variable belongs to.
getEntryOrdinal()
Returns the ordinal for the position of the variable in the variable list. 1 means it's the first variable, 2 means it's the second, etc.
getEntryName()
Returns the variable name.
getEntryValue()
Returns the variable value.
getAction()
Returns the variable action which controls how the variable value is set. This may be any of 'SET', 'SET_IF_NOT_SET', 'APPEND', 'PREPEND', 'CLEAR', 'UNSET', or 'HIDDEN'.
getMode()
Returns the variable mode which controls how the variable behaves when it is in an environment group that is connected to a project and a build of that project is kicked off.
setEntryName(name)
Sets the name of the variable. $variable->update()
must be run
before changes are replicated in the database.
The new name for the variable.
setEntryValue(value)
Sets the value of the variable. $variable->update()
must be run
before changes are replicated in the database.
The new variable value.
setAction(action)
Sets the variable action which controls how the variable value is set.
$variable->update()
must be run before changes are replicated in the database.
May be any of:
Will cause the variable to be set to its value.
Will cause the variable to be set to the value if the variable value has not already been set.
Causes the variable value to be appended to the previous value separated by a system-specific path delimiter (':' for Unix systems, ';' for Windows systems).
Causes the variable value to be prepended to the previous value separated by a system-specific path delimiter (':' for Unix systems, ';' for Windows systems).
Sets the variable's value to the empty string. The entryValue will be disregarded.
Deletes the variable from the variable list. This differs from clearing it in that the former will print nothing when the variable is printed and the latter will (normally) print the variable name.
Makes this variable a hidden variable. Hidden variables do not appear in the list of variables output by step results.
setMode(mode)
Sets the variable mode which controls how the variable behaves when it is in an
environment group that is connected to a project and a build of that project is
kicked off. $variable->update()
must be run
before changes are replicated in the database.
May be any of:
The default. The variable acts normally.
The project cannot be quickstarted, and when the build is kicked off, the value of the variable must change.
When the project build is being kicked off, the value of the variable cannot be changed.
The project cannot be quickstarted if the variable has no initial value, and when the build is kicked off, the value of the variable cannot be empty.
The variable is not displayed in the project environment variable list on the project start page.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.