SAClient Type Library - Application Lifecyle Management Site Administration API
ImportProject Method
The logical group of projects in the ALM database.
The name of the project in the ALM database.

The type of database. Use the following constants or their values:

The database server name.
The database administrator user name.
The database administrator password.
Storage on disk of Oracle database tables. If not Oracle, pass empty string ("").
Temporary storage location on disk for Oracle. If not Oracle, pass empty string ("").
No longer in use. Pass zero (0).
No longer in use. Pass zero (0).

One or more of the values:

Of the SA_COPY_PROJECT_OPTIONS Enumeration.

To specify both ACTIVATE and CREATE_VERSION_CONTROL, OR the options together:

(SA_ACTIVATE_NEW_PROJECT Or SA_CREATE_VERSION_CONTROL_DB)

The full path name of the file into which to export the project data. The file has a QCP extension.
Description
Creates a new project and retrieves project properties.
Syntax
Visual Basic
Public Sub ImportProject( _
   ByVal DomainName As String, _
   ByVal ProjectName As String, _
   ByVal DbType As Integer, _
   ByVal DbServerName As String, _
   ByVal AdminUser As String, _
   ByVal AdminPassword As String, _
   ByVal TableSpace As String, _
   ByVal TempTableSpace As String, _
   ByVal TableSpaceSize As Long, _
   ByVal TempTableSpaceSize As Long, _
   ByVal CreationOptions As Long, _
   ByVal FileName As String _
) 
Parameters
DomainName
The logical group of projects in the ALM database.
ProjectName
The name of the project in the ALM database.
DbType

The type of database. Use the following constants or their values:

  • SA_MSSQL_DB_TYPE (value: 2)
  • SA_ORACLE_DB_TYPE (value: 3)
DbServerName
The database server name.
AdminUser
The database administrator user name.
AdminPassword
The database administrator password.
TableSpace
Storage on disk of Oracle database tables. If not Oracle, pass empty string ("").
TempTableSpace
Temporary storage location on disk for Oracle. If not Oracle, pass empty string ("").
TableSpaceSize
No longer in use. Pass zero (0).
TempTableSpaceSize
No longer in use. Pass zero (0).
CreationOptions

One or more of the values:

  • SA_PROJECT_CREATION_NONE
  • SA_ACTIVATE_NEW_PROJECT
  • SA_CREATE_VERSION_CONTROL_DB

Of the SA_COPY_PROJECT_OPTIONS Enumeration.

To specify both ACTIVATE and CREATE_VERSION_CONTROL, OR the options together:

(SA_ACTIVATE_NEW_PROJECT Or SA_CREATE_VERSION_CONTROL_DB)

FileName
The full path name of the file into which to export the project data. The file has a QCP extension.
Return Type

On success, returns an XML string containing the project properties.

Return Value Details

The properties of the XML return string:

Return Value Example
<?xml version="1.0"?>
<CreateProject>
    <PROJECT_ID>78</PROJECT_ID>
    <PROJECT_NAME>test2</PROJECT_NAME>
    <DESCRIPTION>Created on 2007-07-02 10:12:30</DESCRIPTION>
    <DOMAIN_ID>26</DOMAIN_ID>
    <DOMAIN_NAME>DEFAULT2</DOMAIN_NAME>
    <DB_NAME>default2_test2_db</DB_NAME>
    <DB_TYPE>2</DB_TYPE>
    <CREATE_FROM_PROJECT>Empty Database</CREATE_FROM_PROJECT>
    <CREATE_FROM_DOMAIN>Templates</CREATE_FROM_DOMAIN>
    <PHYSICAL_DIRECTORY>
       C:\Program Files\Mercury\Quality Center\repository\qc\DEFAULT2_26\test2\
    </PHYSICAL_DIRECTORY>
    <DB_NATIVE_AUTHENTICATION>N</DB_NATIVE_AUTHENTICATION>
    <DB_USER>td</DB_USER>
    <DB_USER_PASS>TWO:59-132-191-0-59-132</DB_USER_PASS>
    <DBSERVER_NAME>dbServer06.devlab.ad</DBSERVER_NAME>
    <DB_CONNSTR_FORMAT>jdbc:serverfarm:sqlserver://dbServer06.devlab.ad:1433
    </DB_CONNSTR_FORMAT>
    <DB_ENCRYPTED_CONNSTR>jdbc:serverfarm:sqlserver://dbServer06.devlab.ad:1433
    </DB_ENCRYPTED_CONNSTR>
    <DB_DRIVER_CLASS_NAME>com.mycom.jdbc.sqlserver.SQLServerDriver
    </DB_DRIVER_CLASS_NAME>
    <PROJECT_VERSION>9.2</PROJECT_VERSION>
    <PR_IS_ACTIVE>N</PR_IS_ACTIVE>
    <SAQ_IS_ACTIVE>N</SAQ_IS_ACTIVE>
    <PR_HAS_VCSDB>N</PR_HAS_VCSDB>
    <USERS_QUOTA>-1</USERS_QUOTA>
    <PR_REPOSITORY_IN_DB>Y</PR_REPOSITORY_IN_DB>
    <PR_LANGUAGE>English</PR_LANGUAGE>
</CreateProject>
Example
Private Sub CreateProject()

'The following Visual Basic example creates a
' new project in an existing domain.
    Dim sDomainName As String
    Dim sProjectName As String
    Dim sServerName As String
    Dim CreateOptions As Long
    Dim sReply As String

    On Error GoTo err
    sDomainName = "MyNewDomain"
    sProjectName = "MyNewProject"
    sServerName = "http://myserver/sabin"

    CreateOptions = SA_ACTIVATE_NEW_PROJECT
    sReply = m_SAClient.CreateProject _
        (sDomainName, sProjectName, SA_ORACLE_DB_TYPE, _
        sServerName, "admin", "swordfish", _
        "", "", 0, 0, _
        CreateOptions)
    MsgBox sReply
    Exit Sub

err:
    MsgBox "Program failed:" + err.Description
End Sub
See Also

SAapi Object  | SAapi Members