findAll(connection)
create()
clone()
update()
removeFilterPattern(pattern)
delete()
getFilterId()
getFilterName()
getLevel()
getPattern(pattern)
getPatterns()
setFilterName(filterName)
setLevel(accessGroupId)
BuildForge::Services::DBO::Filter
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing filters $allFilters = BuildForge::Services::DBO::Filter->findAll($conn); $oldfilter = BuildForge::Services::DBO::Filter->findById($conn, $filterId);
# Getter / setter functions $id = $oldfilter->getFilterId(); $name = $oldfilter->getFilterName(); $accessGroupId = $oldfilter->getLevel(); $pattern1 = $oldfilter->getPattern(1); $pattern2 = $oldfilter->getPattern('VARIABLE_NAME'); $patterns = $oldfilter->getPatterns(); $oldfilter->setFilterName('New Name'); $level = BuildForge::Services::DBO::AccessGroup->findByName($conn, 'MyAccessGroup'); $oldfilter->setLevel($level->getLevel()); $oldfilter->update(); # Filter creation, modification, deletion $newfilter = new BuildForge::Services::DBO::Filter($conn); $newfilter->setFilterName('New Filter'); $newfilter->create(); $newfilter2 = $newfilter->clone(); $newfilter2->setFilterName('Duplicate'); $newfilter2->create(); $newfilter->setFilterName('New Name For New Filter'); $newfilter->update();
$var = new BuildForge::Services::DBO::FilterPattern($conn); $var->setPattern('VARIABLE_NAME'); $newfilter->addFilterPattern($var); $newfilter->copyFilterPattern(0, 1); $newfilter->moveFilterPattern(1, 0); $newfilter->removeFilterPattern(1); $newfilter->removeFilterPattern($var); $newfilter->delete(); $conn->logout; $conn->close;
Filter allows you to create, modify, and delete filter groups.
Returns a new instance of a Filter object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name of the filter group.
The access group ID (from $accessGroup->getLevel())
of the access group the
filter belongs to. Users who do not belong to this access group will not
be able to view, edit, or use the filter.
findAll(connection)
Returns a reference to an array of all the BuildForge::Services::DBO::Filter
objects the user has access to in the database. These objects will not
contain their FilterPattern subobjects. To get the patterns, use
BuildForge::Services::DBO::Filter->findById()
with the filter's ID.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::Filter object corresponding to the given filter group ID, or undef if no such filter group exists.
A connected BuildForge::Services::Connection object.
The ID of the desired filter group (from $filter->getFilterId()).
create()
Creates the filter group within the database.
clone()
Returns a copy of the BuildForge::Services::DBO::Filter object and all of its FilterPattern patterns. The copy will not exist in the database unless it is created with $filter->create().
update()
Updates the database with the new filter group settings.
Adds a filter pattern to the filter group within the database.
The BuildForge::Services::DBO::FilterPattern object to be added.
The optional location at which to add the pattern within the list. 0 adds it to the front of the list, 1 adds it after the first pattern, etc. Leaving it unset adds the pattern to the end of the pattern list.
Moves a filter pattern within the list of patterns in the database.
The index of the pattern to move. 0 moves the first pattern, 1 moves the second, etc.
The index of the new location for the pattern. 0 moves it to the first position, 1 to the second, etc.
Copies a filter pattern within the filter group in the database.
The index of the pattern to be copied. 0 copies the first pattern, 1 copies the second, etc.
The index of the location for the new pattern copy. 0 copies it to the first position, 1 to the second, etc.
removeFilterPattern(pattern)
Removes a filter pattern from the pattern list in the database.
This may be an index, in which case the pattern at that position is deleted (0 deletes the first pattern, 1 the second, etc.), or a BuildForge::Services::DBO::FilterPattern object, in which case that filter pattern is the one deleted.
delete()
Deletes the filter and all of its patterns from the database.
getFilterId()
Returns the ID of the filter group.
getFilterName()
Returns the name of the filter group.
getLevel()
Returns the access group ID of the access group the filter belongs to. Users who are not in this access group cannot view, edit, or use the filter group.
getPattern(pattern)
Returns the BuildForge::Services::DBO::FilterPattern object that corresponds to the requested pattern.
This may be an index, in which case that pattern is the one returned (0 for the first pattern, 1 for the second, etc.), or a pattern name, in which case the first pattern with that name in the filter group is returned.
getPatterns()
Returns a reference to an array of BuildForge::Services::DBO::FilterPattern objects for all patterns in the filter group.
setFilterName(filterName)
Sets the filter group's name. $filter->update()
must be run
before changes are replicated in the database.
The new name for the filter group.
setLevel(accessGroupId)
Sets the filter group's access group. Users who do not belong to this access group will not
be able to view, edit, or use the filter. $filter->update()
must be run
before changes are replicated in the database.
The access group ID (from $accessGroup->getLevel())
for the desired access group.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.