Subversion Repositories DevTools

Rev

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

Rev 3884 Rev 3885
Line 21... Line 21...
21
Dim newPackage
21
Dim newPackage
22
Dim majorState
22
Dim majorState
23
Dim minorState
23
Dim minorState
24
Dim patchState
24
Dim patchState
25
Dim parBase_view_id
25
Dim parBase_view_id
-
 
26
Dim verNumber
26
 
27
 
27
'------------ Constants Declaration -----------
28
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
'------------ Variable Init -------------------
29
parPv_id = QStrPar("pv_id")
30
parPv_id = QStrPar("pv_id")
30
parBase_view_id = Request("base_view_id")
31
parBase_view_id = Request("base_view_id")
Line 83... Line 84...
83
' or is allowed to be more relaxes. As in COTS and TOOL packages.
84
' or is allowed to be more relaxes. As in COTS and TOOL packages.
84
'
85
'
85
' Read from the database to determine type
86
' Read from the database to determine type
86
' If we cannot determine the project suffix then assume the worst
87
' If we cannot determine the project suffix then assume the worst
87
'
88
'
88
Function HasCotsExtension(aversion)
89
Function HasCotsExtension(aExt)
89
   Dim rsQry, Query_String
90
   Dim rsQry, Query_String
90
   Dim reResult
-
 
91
   HasCotsExtension = FALSE
91
   HasCotsExtension = FALSE
92
 
92
 
93
   ' Extract package suffix .xxxx
-
 
94
   Dim re: Set re = New RegExp
-
 
95
   re.IgnoreCase = true
-
 
96
   re.Pattern = "(\.[a-z]{2,4})$"
-
 
97
   Set reResult = re.Execute(aversion)
-
 
98
   if reResult.Count = 1 Then
93
   if aExt <> "" Then
99
       Query_String = "SELECT EXT_NAME FROM PROJECT_EXTENTIONS pe WHERE " &_
94
       Query_String = "SELECT EXT_NAME FROM PROJECT_EXTENTIONS pe WHERE " &_
100
                      "pe.IS_COTS='Y' AND pe.EXT_NAME='"&_
95
                      "pe.IS_COTS='Y' AND pe.EXT_NAME='" & LCase(aExt) & "'"
101
                       LCase(reResult.Item(0).Submatches(0)) & "'"
-
 
102
       Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT )
96
       Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT )
103
       If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
97
       If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
104
           HasCotsExtension = TRUE
98
           HasCotsExtension = TRUE
105
       End If
99
       End If
106
       rsQry.Close
100
       rsQry.Close
107
   Else
101
   Else
108
       HasCotsExtension = TRUE
102
       HasCotsExtension = TRUE
109
   end If
103
   end If
110
 
-
 
111
   Set rsQry = Nothing
104
   Set rsQry = Nothing
112
   Set re = Nothing
-
 
113
   Set reResult = Nothing
-
 
-
 
105
 
114
End Function
106
End Function
115
 
107
 
116
'-------------------------------------------------------------------------------------------------------------
108
'-------------------------------------------------------------------------------------------------------------
117
'Returns TRUE if the specified version has a patch-build number.
109
'Returns TRUE if the specified version has a patch-build number.
118
Function HasPatchBuildNumber(aversion)
110
Function HasPatchBuildNumber(aversion)
Line 190... Line 182...
190
<%
182
<%
191
'===================== MAIN LINE ============================
183
'===================== MAIN LINE ============================
192
Dim bDisableAuto, bPatchOnly, bIsCots, bIsAuto
184
Dim bDisableAuto, bPatchOnly, bIsCots, bIsAuto
193
 
185
 
194
If NOT newPackage Then
186
If NOT newPackage Then
195
 
-
 
196
    Call GetPackageInfo( parPv_id, objPkgInfo )
187
    Call GetPackageInfo( parPv_id, objPkgInfo )
197
 
188
 
-
 
189
    ' Extract version number without extension
-
 
190
    verNumber = objPkgInfo.Item("pkg_version")
-
 
191
    verNumber = Mid( verNumber,1, Len(verNumber) - Len(objPkgInfo.Item("v_ext")))
-
 
192
 
198
    bIsCots = HasCotsExtension(objPkgInfo.Item("pkg_version"))
193
    bIsCots = HasCotsExtension(objPkgInfo.Item("v_ext"))
199
    'Disable the "Auto" build option if the package is a COTS package and the version doesn't have a patch-build number.
194
    'Disable the "Auto" build option if the package is a COTS package and the version doesn't have a patch-build number.
200
    bDisableAuto = bIsCots and not HasPatchBuildNumber(objPkgInfo.Item("pkg_version"))
195
    bDisableAuto = bIsCots and not HasPatchBuildNumber(objPkgInfo.Item("pkg_version"))
201
    'Enable only the "Patch Change" option if the package is a COTS package and the version has a patch-build number.
196
    'Enable only the "Patch Change" option if the package is a COTS package and the version has a patch-build number.
202
    bPatchOnly = bIsCots and not HasWellFormedVersion(objPkgInfo.Item("pkg_version")) and HasPatchBuildNumber(objPkgInfo.Item("pkg_version"))
197
    bPatchOnly = bIsCots and not HasWellFormedVersion(objPkgInfo.Item("pkg_version")) and HasPatchBuildNumber(objPkgInfo.Item("pkg_version"))
203
 
198
 
Line 206... Line 201...
206
       bIsAuto = FALSE
201
       bIsAuto = FALSE
207
    'else default to Auto
202
    'else default to Auto
208
    Else
203
    Else
209
       bIsAuto = TRUE
204
       bIsAuto = TRUE
210
    End If
205
    End If
211
End If
206
Else
212
 
-
 
213
' If New Package and First version
207
    ' If New Package and First version
214
If newPackage Then
-
 
215
    parPage_title = "NEW PACKAGE and FIRST VERSION"
208
    parPage_title = "NEW PACKAGE and FIRST VERSION"
216
    bIsCots = FALSE
209
    bIsCots = FALSE
217
    bDisableAuto = FALSE
210
    bDisableAuto = FALSE
218
    bPatchOnly = FALSE
211
    bPatchOnly = FALSE
219
    bIsAuto = TRUE
212
    bIsAuto = TRUE
220
    majorState = "checked"
213
    majorState = "checked"
221
    minorState = ""
214
    minorState = ""
222
    patchState = ""
215
    patchState = ""
-
 
216
    verNumber = "1.0.0000"
223
End If
217
End If
224
 
218
 
225
'============================================================
219
'============================================================
226
%>
220
%>
227
<script language="JavaScript" type="text/JavaScript">
221
<script language="JavaScript" type="text/JavaScript">
228
<!--
222
<!--
229
var savedVersion;
223
var savedVersion;
230
 
224
 
231
window.onload = function(e)
225
window.onload = function(e)
232
{
226
{
-
 
227
   document.getElementById('inputVersionNumber').value = "<%=verNumber%>";
-
 
228
 
233
   var isAutobuild = document.NEWversion.build_type[0].checked;
229
   var isAutobuild = document.NEWversion.build_type[0].checked;
234
   if (!isAutobuild)
230
   if (!isAutobuild)
235
   {
231
   {
236
      changeToManualVersionNumberAssignment();
232
      changeToManualVersionNumberAssignment();
237
   }
233
   }
Line 260... Line 256...
260
//
256
//
261
// Purpose: Show the relevent sections of the form
257
// Purpose: Show the relevent sections of the form
262
//
258
//
263
function changeToManualVersionNumberAssignment()
259
function changeToManualVersionNumberAssignment()
264
{
260
{
265
   var f;
-
 
266
   document.getElementById('change_type').style.display = 'none';
261
   document.getElementById('change_type').style.display = 'none';
267
   document.getElementById('pkgver').style.display = 'table-row';
262
   document.getElementById('pkgver').style.display = 'table-row';
268
   document.getElementById('inputVersionNumber').disabled = false;
263
   document.getElementById('inputVersionNumber').disabled = false;
269
   document.getElementById('inputVersionNumber').value = savedVersion;
264
   document.getElementById('inputVersionNumber').value = savedVersion;
270
}
265
}