ALM Site Administration API Type Library
DeactivateProject Method
Description
Deactivates a project and retrieves project properties.
Syntax
Visual Basic
Public Function DeactivateProject( _
   ByVal DomainName As String, _
   ByVal ProjectName As String _
) As String
Parameters
DomainName
The domain name.
ProjectName
The project name.
Return Type

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

Remarks
Always call DisconnectProject before calling DeactivateProject. Failure to do so may leave users connected to the project you are deactivating.
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.
Return Value Example
<?xml version="1.0"?>
<SetProjectsProperties>
<TDXItem>
     <PROJECT_ID>3</PROJECT_ID>
     <PROJECT_NAME>ota_doc</PROJECT_NAME>
     <DESCRIPTION>Created on 2009-12-06 00:54:50</DESCRIPTION>
     <DOMAIN_ID>1</DOMAIN_ID>
     <DOMAIN_NAME>DEFAULT</DOMAIN_NAME>
     <DB_NAME>default_ota_doc_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:\Documents and Settings\All Users\
          Application Data\HP\QC\repository\qc\Default\ota_doc\
     </PHYSICAL_DIRECTORY>
     <DB_NATIVE_AUTHENTICATION>N</DB_NATIVE_AUTHENTICATION>
     <DB_USER>td</DB_USER>
     <DB_USER_PASS>TWO:12-345-678-9-ab-cde</DB_USER_PASS>
     <DBSERVER_NAME>server06</DBSERVER_NAME>
     <DB_CONNSTR_FORMAT>
          jdbc:mercury:sqlserver://server06:1433
     </DB_CONNSTR_FORMAT>
     <DB_ENCRYPTED_CONNSTR>
          jdbc:mercury:sqlserver://server06:1433
     </DB_ENCRYPTED_CONNSTR>
     <DB_DRIVER_CLASS_NAME>
          com.mercury.jdbc.sqlserver.SQLServerDriver
     </DB_DRIVER_CLASS_NAME>
     <PR_EXCEPTION_FILE></PR_EXCEPTION_FILE>
     <PROJECT_VERSION>11.00</PROJECT_VERSION>
     <PR_IS_ACTIVE>N</PR_IS_ACTIVE>
     <SAQ_IS_ACTIVE>N</SAQ_IS_ACTIVE>
     <PR_IS_QPM_AUTO_CALC_ENABLED>N</PR_IS_QPM_AUTO_CALC_ENABLED>
     <PR_HAS_VCSDB>Y</PR_HAS_VCSDB>
     <USERS_QUOTA>-1</USERS_QUOTA>
     <PR_LANGUAGE>English</PR_LANGUAGE>
     <PROJECT_TYPE>Standard</PROJECT_TYPE>
     <IS_TEMPLATE>N</IS_TEMPLATE>
     <PROJECT_UID>12345678-9abc-def1-2345-6789abcef123</PROJECT_UID>
     <PR_SMART_REPOSITORY_ENABLED>DONE</PR_SMART_REPOSITORY_ENABLED>
</TDXItem>
</SetProjectsProperties>
Example
Private Sub CreateProjectCopy()
    
'The following Visual Basic example creates a new project
' in an existing domain by copying the customization
' requirements and users from an existing project.

    Dim sDomainName As String
    Dim sNewProjectName As String
    Dim sProjectName As String
    Dim sServerName As String
    Dim CreateOptions As Long
    Dim CopyOptions As Long
    Dim sReply As String

    On Error GoTo err
    sDomainName = "MyNewDomain"
    sNewProjectName = "MyBrandNewProject"
    sProjectName = "MyNewProject"
    sServerName = "http://myserver/qcbin"

'Disconnect all users from Project
    Call m_SAClient.DisconnectProject _
        (sDomainName, sProjectName)

' Deactivate source project
    Call m_SAClient.DeactivateProject _
        (sDomainName, sProjectName)

' Copy from source project to new project
    CreateOptions = SA_ACTIVATE_NEW_PROJECT
    CopyOptions = SA_COPY_PROJECT_CUSTOMIZATION _
        + SA_COPY_PROJECT_REQUIREMENTS _
        + SA_COPY_PROJECT_USERS_AND_GROUPS
        
    sReply = m_SAClient.CreateProjectCopy _
        (sDomainName, sNewProjectName, SA_ORACLE_DB_TYPE, _
        sDomainName, sProjectName, _
        sServerName, "admin", "swordfish", _
        "", "", 0, 0, _
        CopyOptions, CreateOptions)
    
' Reactivate source project
    Call m_SAClient.ActivateProject _
        (sDomainName, sProjectName)
    MsgBox sReply
    Exit Sub

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