ALM Site Administration API Type Library
RestoreProjectEx2 Method
Description
Restores an existing project to a domain.
Syntax
Visual Basic
Public Function RestoreProjectEx2( _
   ByVal DomainName As String, _
   ByVal ProjectName As String, _
   ByVal DbType As Integer, _
   ByVal PhysicalDirectory As String, _
   ByVal DbName As String, _
   ByVal DbServerName As String, _
   ByVal ConnStr As String, _
   ByVal DbUserPass As String, _
   ByVal PrIsActive As Boolean, _
   ByVal PrHasVcsDb As Boolean, _
   ByVal SaqIsActive As Boolean, _
   ByVal UserQuota As Long, _
   ByVal VmRepository As String, _
   ByVal Description As String, _
   ByVal ProjectType As String, _
   ByVal PrIsTemplate As Boolean, _
   ByVal ProjectUID As String, _
   ByVal replaceProject As Boolean, _
   ByVal smartRepositoryEnabled As Boolean _
) 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)
PhysicalDirectory
The location of the project's repository.
DbName
The database name.
DbServerName
The database server name.
ConnStr
The JDBC connection string, for example:
jdbc:inetdae7://stamina:1433?charset=MS1252
DbUserPass
Database user password.
PrIsActive
Activate the project (Y/N).
PrHasVcsDb
Is the project integrated with a version control system (Y/N).
SaqIsActive
Activate Send All Qualified to send defect emails automatically (Y/N).
UserQuota
The maximum number of concurrent user connections. For no limit, set to -1.
VmRepository
No longer in use. Pass empty string ("").
Description
Description of the project.
ProjectType
The project type can be Standard, Template, or a project type created by an extension.
PrIsTemplate
If true, the project is a template.
ProjectUID
The unique ID.
replaceProject
If true, overwrite the existing data.
smartRepositoryEnabled
True to enable smart repository.
Return Type

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

Return Value Details

The properties of the XML return string:

  • PROJECT_ID    -    The ID number of the project.
  • PROJECT_NAME    -    The project name.
  • DESCRIPTION    -    The project description.
  • DOMAIN_ID    -    The domain ID number.
  • DOMAIN_NAME    -    The domain name.
  • DB_NAME    -    The database name.
  • DB_TYPE    -    The database type number: MS SQL (2), Oracle (3).
  • CREATE_FROM_PROJECT    -    The source project of the created project.
  • CREATE_FROM_DOMAIN    -    The source domain of the created project.
  • PHYSICAL_DIRECTORY    -    The physical directory of the project.
  • DB_NATIVE_AUTHENTICATION    -    Indicates if user login is handled by the operating system (MS_SQL Windows Authentication). If 'N', the authentication is handled explicitly using the user name and password.
  • DB_USER    -    The database administrator user name.
  • DB_USER_PASS    -    The database administrator password.
  • DBSERVER_NAME    -    The database server name.
  • DBCONNSTR_FORMAT    -    The database connection string.
  • DB_ENCRYPTED_CONNSTR    -    For internal use.
  • DB_DRIVER_CLASS_NAME    -   The name of the database manager connection class (JDBC driver class). 
  • PR_EXCEPTION_FILE - The pathname of the file that defines errors that the verify process ignores.
  • PROJECT_VERSION    -   The ALM version. 
  • PR_IS_ACTIVE    -    Indicates if the project is active (Y/N).
  • SAQ_IS_ACTIVE    -    Indicates if SEND ALL QUALIFIED is active (Y/N).
  • PR_IS_QPM_AUTO_CALC_ENABLED - Automatic KPI calculation is enabled (Y/N).
  • PR_HAS_VCSDB    -    Indicates if the project includes version control: (Y)es, (N)o, (D)isabled. This field appears only if version control is available.
  • USERS_QUOTA    -    The maximum number of concurrent connections. -1 indicates an unlimited number of connections.
  • PR_LANGUAGE    -    The search language.
  • PROJECT_TYPE - The type of project.
  • IS_TEMPLATE - Indicates whether this is a template project (Y/N).
  • PROJECT_UID - The project ID.
  • PR_SMART_REPOSITORY_ENABLED - One of: NO - not a smart repository; YES - smart repository; PENDING - offline migration completed and waiting for online migration; MIGRATING - online migration in progress.
  • PR_SR_GC_STATUS - Optimized repository garbage collection status.
  • PR_SR_GC_LAST_RUN_TIME - Optimized repository garbage collection last run time.
Example
Private Sub RestoreProjectEx2() 
'The following Visual Basic example restores a project 
' that was saved in the MyProject subdirectory. 
    Dim sDomainName As String 
    Dim sProjectName As String 
    Dim sServerName As String 
                Dim sPhysicalDirectory As String 
                Dim sProjectType As String 
                Dim sProjectUID As String 
    Dim sReply As String 
    On Error GoTo err 
    sDomainName = "MyDomain" 
    sProjectName = "MyProject" 
                sPhysicalDirectory = "C:\TD_Dir\MYDOMAIN\MyProject" 
    sServerName = "http://myserver/qcbin" 
                sProjectType = "Standard" 
                sProjectUID = "a01aa632-e9c7-4e63-9b7f-5241cc5e29cb" 
    sReply = m_SAClient.RestoreProjectEx2( _ 
        sDomainName, sProjectName, SA_ORACLE_DB_TYPE, _ 
        sPhysicalDirectory, sProjectName, _ 
        sServerName, "jdbc:inetora:myserver:1521:myserver", _ 
        sUserPassWord, True, True, True, 20, "", _ 
        "New Project1 for testing", _ 
                                sProjectType, False, sProjectUID, True, True) 
        
    MsgBox sReply 
    Exit Sub 
err: 
    MsgBox "Program failed:" + err.Description 
End Sub 
See Also