NAME

BuildForge::Services::DBO::Adaptor


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing adaptors
        $allAdaptors = BuildForge::Services::DBO::Adaptor->findAll($conn);
        $allTemplateNames = BuildForge::Services::DBO::Adaptor->listTemplateIds($conn);
        $oldadaptor = BuildForge::Services::DBO::Adaptor->findById($conn, 'AdaptorName');
        # Getter / setter functions
        $id = $oldadaptor->getInterfaceId();
        $adaptorlevel = $oldadaptor->getLevel();
        $templatename = $oldadaptor->getTemplate();
        $type = $oldadaptor->getType();
        $adaptorxml = $oldadaptor->getDataText();
        
        $oldadaptor->setInterfaceId('NewAdaptorName');
        $oldadaptor->setLevel(4);
        $oldadaptor->setTemplate('ClearQuest');
        $oldadaptor->setType('DEFECT');
        $oldadaptor->setDataText($newadaptorxml);
        $oldadaptor->update();
        
        # Adaptor creation, updating, deletion
        $newadaptor = new BuildForge::Services::DBO::Adaptor($conn);
        $newadaptor->setInterfaceId('New Adaptor');
        $newadaptor->setType('SOURCE');
        $newadaptor->setTemplate('ClearCase');
        $newadaptor->create();
        $newadaptor->setInterfaceId('New Name For Existing Adaptor');
        $newadaptor->update();
        $newadaptor->delete();
        BuildForge::Services::DBO::Adaptor->deleteById($conn, $oldadaptor->getInterfaceId());
                
        $conn->logout;
        $conn->close;


DESCRIPTION

Adaptor is used to create new BuildForge Adaptors and to access existing adaptor information.


METHODS

new BuildForge::Services::DBO::Adaptor(connection, {AdaptorParamsHashRef})

Returns an Adaptor instance.

connection

A connected BuildForge::Services::Connection object.

AdaptorParamsHashRef

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

liveInterfaceId

The name/ID of the adaptor.

type

The type of the adaptor. This may be 'SOURCE', 'DEFECT', 'PACKAGE', or 'TEST'. If not set, the default is 'SOURCE'.

dataText

The actual adaptor XML.

level

The level (access group id) of the access group that this Adaptor belongs to. You must be a member of this access group to view, edit, or use this Adaptor.

BuildForge::Services::DBO::Adaptor->findById(connection, adaptorId)

Returns the Adaptor object that corresponds to the given adaptorId, or undef if no such adaptor exists.

connection

A connected BuildForge::Services::Connection object.

adaptorId

The desired adaptor ID.

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

Returns a reference to an array of all Adaptors in the database that the user has access to.

connection

A connected BuildForge::Services::Connection object.

$adaptor->create()

Creates an entry for the adaptor in the database.

$adaptor->update()

Updates the adaptor in the database to correspond to the current state of the Adaptor object.

$adaptor->delete()

Deletes the adaptor from the database.

BuildForge::Services::DBO::Adaptor->deleteById(connection, adaptorId)

Deletes the adaptor with the given ID from the database.

connection

A connected BuildForge::Services::Connection object.

adaptorId

The adaptor ID to delete (as given by Adaptor->getAdaptorId()).

BuildForge::Services::DBO::Adaptor->listTemplateIds(connection)

Returns a reference to an array containing the names of all possible template IDs.

connection

A connected BuildForge::Services::Connection object.

$adaptor->getInterfaceId()

Returns the adaptor ID / name.

$adaptor->getDataText()

Returns the adaptor XML.

$adaptor->getLevel()

Returns the adaptor's access group ID.

$adaptor->getTemplate()

Returns the adaptor's template name.

$adaptor->getType()

Returns the adaptor's type (which may be 'SOURCE', 'DEFECT', 'PACKAGE', or 'TEST').

$adaptor->setInterfaceId(adaptorId)

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

adaptorId

The new name for the adaptor.

$adaptor->setDataText(xml)

Sets the adaptor's XML. $adaptor->update() must be run before changes are replicated in the database.

xml

The new adaptor XML.

$adaptor->setLevel(accessGroupId)

Sets the new access group to which the adaptor belongs. The access group controls who can view, edit, or use the adaptor. $adaptor->update() must be run before changes are replicated in the database.

accessGroupID

The ID of the new access group (as gotten from AccessGroup->getLevel()).

$adaptor->setTemplate(templateName)

Sets the new template that this adaptor is listed as having. This should come from the list gotten from BuildForge::Services::DBO::Adaptor->listTemplateIds(). $adaptor->update() must be run before changes are replicated in the database.

templateName

The name of the template to use.

$adaptor->setType(type)

Sets the type of the adaptor. $adaptor->update() must be run before changes are replicated in the database.

type

The desired adaptor type. The type may be 'SOURCE', 'DEFECT', 'PACKAGE', or 'TEST'.


COPYRIGHT

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