NAME

BuildForge::Services::DBO::Selector


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing selectors
        $allSelectors = BuildForge::Services::DBO::Selector->findAll($conn);
        $oldselector = BuildForge::Services::DBO::Selector->findById($conn, 'SelectorName');
        # Getter / setter functions
        $id = $oldselector->getSelectorId();
        $name = $oldselector->getSelectorName();
        $accessGroupId = $oldselector->getLevel();
        $allProperties = $oldselector->getProperties();
        $property = $oldselector->getProperty('BF_JOBS');
        
        $oldselector->setSelectorId('New Name');
        $oldselector->setSelectorName('Another New Name');
        $oldselector->setLevel($accessGroupId);
        $oldselector->update();
        
        # Selector creation, modification, deletion
        $newselector = new BuildForge::Services::DBO::Selector($conn);
        $newselector->setSelectorName('New Selector');
        $newselector->setLevel($accessGroupId);
        $newselector->create();
        
        $newselector2 = $newselector->clone();
        $newselector2->setSelectorName('Duplicate');
        $newselector2->create();
        
        $newselector->setSelectorName('New Name For New Selector');
        $newselector->update();
        $property = new BuildForge::Services::DBO::SelectorProperty($conn);
        $property->setPropertyName('PROP_NAME');
        $property->setOperator(ENUM_SELECTORPROPERTY_OPERATOR->EQ);
        $property->setPropertyValue('Value');
        $newselector->addProperty($property);
        $newselector->removeProperty($property);
        $newselector->removeProperty($property->getPropertyName());
        
        $newselector->delete();
                
        $conn->logout;
        $conn->close;


DESCRIPTION

Selector allows you to create, modify, and delete BuildForge selectors.


METHODS

new BuildForge::Services::DBO::Selector(connection, {SelectorParamsHashRef})

Returns a new instance of a Selector object.

connection

A connected BuildForge::Services::Connection object.

SelectorParamsHashRef

An optional reference to a hash containing any or all of the following fields.

selectorId

The name / ID of the selector.

level

The access group ID (from $accessGroup->getLevel()) of the access group that the selector belongs to. If a user does not belong to this access group, they cannot view, edit, or use the selector.

BuildForge::Services::DBO::Selector->findAll(connection)

Returns a reference to an array of BuildForge::Services::DBO::Selector objects corresponding to all selectors in the database that the user has access to. These objects will not contain their SelectorProperty subobjects. To get the properties, use BuildForge::Services::DBO::Selector->findById() with the selector's ID.

connection

A connected BuildForge::Services::Connection object.

BuildForge::Services::DBO::Selector->findById(connection, selectorId)

Returns the BuildForge::Services::DBO::Selector object corresponding to the given selector ID, or undef if no such object exists.

connection

A connected BuildForge::Services::Connection object.

selectorId

The selector ID / name of the desired selector (from $selector->getSelectorId()).

$selector->create()

Creates the selector object inside the database.

$selector->clone()

Returns a copy of the BuildForge::Services::DBO::Selector object. This copy will not exist in the database until $copy->create() is called.

$selector->update()

Updates the selector record within the database.

$selector->addProperty(property)

Adds the given property to the selector within the database.

property

The BuildForge::Services::DBO::SelectorProperty object to be added.

$selector->removeProperty(property)

Removes the given property from the selector within the database.

property

The BuildForge::Services::DBO::SelectorProperty object to be deleted or the property name. If there is more than one property with the same name, the first one added to the selector will be deleted.

$selector->delete()

Deletes the selector and all its properties from the database.

$selector->getSelectorId()

Returns the name / ID of the selector. Alias for $selector->getSelectorName().

$selector->getSelectorName()

Returns the name / ID of the selector.

$selector->getLevel()

Returns the access group ID for the access group that controls the selector. Users not in the access group cannot view, edit, or use the selector.

$selector->getProperties()

Returns a reference to an array of BuildForge::Services::DBO::SelectorProperty objects corresponding to all selector properties within the selector.

$selector->getProperty(propertyName)

Returns the BuildForge::Services::DBO::SelectorProperty object corresponding to the given name. If there is more than one property with the same name, the first one added to the selector will be deleted.

propertyName

The name of the desired selector property.

$selector->setSelectorId(selectorId)

Sets the selector ID / name. Alias for $selector->setSelectorName(). $selector->update() must be run before changes are replicated in the database.

selectorId

The new ID / name for the selector.

$selector->setSelectorName(selectorId)

Sets the selector ID / name. $selector->update() must be run before changes are replicated in the database.

selectorId

The new ID / name for the selector.

$selector->setLevel(accessGroupId)

Sets the access group that the selector belongs to. Users who don't belong to this access group can't view, edit, or use this selector. $selector->update() must be run before changes are replicated in the database.

accessGroupId

The ID of the access group, from $accessGroup->getLevel().


COPYRIGHT

Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.