Subversion Repositories DevTools

Rev

Rev 255 | Rev 5934 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 255 Rev 4466
Line 1... Line 1...
1
#! perl
1
#! perl
2
########################################################################
2
########################################################################
3
# Copyright ( C ) 2006 ERG Limited, All rights reserved
3
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
4
#
4
#
5
# Module name   : jats.sh
5
# Module name   : JatsRmApi
6
# Module type   : Makefile system
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
7
# Compiler(s)   : n/a
8
# Environment(s): jats
8
# Environment(s): jats
9
#
9
#
10
# Description   : Provides common access function to the Release Manager
10
# Description   : Provides common access function to:
-
 
11
#                       The Release Manager
11
#                 and Deployment Manager Databases
12
#                       The Deployment Manager Databases
-
 
13
#                       The ClearQuest Database    
12
#
14
#
13
#                 Note: The interface provided is constrained
15
#                 Note: The interface provided is constrained
14
#                       by the existing usage.
16
#                       by the existing usage.
15
#
17
#
16
#                       This is an attempt to provide common accessor
18
#                       This is an attempt to provide common accessor
Line 44... Line 46...
44
            connectRM
46
            connectRM
45
            disconnectRM
47
            disconnectRM
46
 
48
 
47
            connectDM
49
            connectDM
48
            disconnectDM
50
            disconnectDM
-
 
51
 
-
 
52
            connectCQ
-
 
53
            disconnectCQ
49
            );
54
            );
50
 
55
 
51
#
56
#
52
#   Globals to contain connection information
57
#   Globals to contain connection information
53
#
58
#
Line 57... Line 62...
57
 
62
 
58
our $GBE_DM_LOCATION;
63
our $GBE_DM_LOCATION;
59
our $GBE_DM_USERNAME;
64
our $GBE_DM_USERNAME;
60
our $GBE_DM_PASSWORD;
65
our $GBE_DM_PASSWORD;
61
 
66
 
-
 
67
our $GBE_CQ_LOCATION;
-
 
68
our $GBE_CQ_USERNAME;
-
 
69
our $GBE_CQ_PASSWORD;
62
 
70
 
63
#-------------------------------------------------------------------------------
71
#-------------------------------------------------------------------------------
64
# Function        : ValidateRef
72
# Function        : ValidateRef
65
#
73
#
66
# Description     : Ensure that the user has passed a valid reference
74
# Description     : Ensure that the user has passed a valid reference
Line 88... Line 96...
88
#
96
#
89
# Inputs          : $fname  - Caller function
97
# Inputs          : $fname  - Caller function
90
#                   @rest   - 3 EnvVars to process
98
#                   @rest   - 3 EnvVars to process
91
#
99
#
92
# Returns         : An array of 3 variables
100
# Returns         : An array of 3 variables
93
#                   location, usernane, password
101
#                   location, username, password
94
#
102
#
95
sub GetConnData
103
sub GetConnData
96
{
104
{
97
    my ($fname, @rest) = @_;
105
    my ($fname, @rest) = @_;
98
    my @result;
106
    my @result;
Line 139... Line 147...
139
{
147
{
140
    my ($gref, $opt_verbose) = @_;
148
    my ($gref, $opt_verbose) = @_;
141
    connectDB('connectDM', $gref, $opt_verbose, 'GBE_DM_LOCATION', 'GBE_DM_USERNAME', 'GBE_DM_PASSWORD');
149
    connectDB('connectDM', $gref, $opt_verbose, 'GBE_DM_LOCATION', 'GBE_DM_USERNAME', 'GBE_DM_PASSWORD');
142
}
150
}
143
 
151
 
-
 
152
sub connectCQ
-
 
153
{
-
 
154
    my ($gref, $opt_verbose) = @_;
-
 
155
    connectDB('connectCQ', $gref, $opt_verbose, 'GBE_CQ_LOCATION', 'GBE_CQ_USERNAME', 'GBE_CQ_PASSWORD');
-
 
156
}
-
 
157
 
-
 
158
 
144
sub connectDB
159
sub connectDB
145
{
160
{
146
    my ($fname, $gref, $opt_verbose, @parms) = @_;
161
    my ($fname, $gref, $opt_verbose, @parms) = @_;
147
 
162
 
148
    #
163
    #
Line 171... Line 186...
171
}
186
}
172
 
187
 
173
#-------------------------------------------------------------------------------
188
#-------------------------------------------------------------------------------
174
# Function        : disconnectRM
189
# Function        : disconnectRM
175
# Function        : disconnectDM
190
# Function        : disconnectDM
-
 
191
# Function        : disconnectCQ
176
#
192
#
177
# Description     : Disconnect from the DM/RM database
193
# Description     : Disconnect from the DM/RM/CQ database
178
#
194
#
179
# Inputs          : gref        - Reference to a scalar that will hold
195
# Inputs          : gref        - Reference to a scalar that will hold
180
#                                 the database connection class data
196
#                                 the database connection class data
181
#
197
#
182
#                                 If not 'undef' this function will disconnect
198
#                                 If not 'undef' this function will disconnect
Line 192... Line 208...
192
sub disconnectDM
208
sub disconnectDM
193
{
209
{
194
    disconnectDB( 'disconnectDM', @_);
210
    disconnectDB( 'disconnectDM', @_);
195
}
211
}
196
 
212
 
-
 
213
sub disconnectCQ
-
 
214
{
-
 
215
    disconnectDB( 'disconnectCQ', @_);
-
 
216
}
-
 
217
 
197
sub disconnectDB
218
sub disconnectDB
198
{
219
{
199
    my ($fname, $gref) = @_;
220
    my ($fname, $gref) = @_;
200
 
221
 
201
    #
222
    #