<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== '| | '| wAddProjectExtension | '| | '===================================================== %> <% Option explicit Response.Expires = 0 %> <% '------------ ACCESS CONTROL ------------------ %> <% '------------ VARIABLE DEFINITION ------------- Dim rsQry Dim sMessage Dim Query_String '------------ CONSTANTS DECLARATION ----------- '------------ VARIABLE INIT ------------------- sMessage = NULL Set objFormCollector = CreateObject("Scripting.Dictionary") '------------ CONDITIONS ---------------------- '---------------------------------------------- function showCheck (val) if val = "Y" Then showCheck = "checked" Else showCheck = "" End If End Function function niceBool (val) if val = "Y" Then niceBool = "Y" Else niceBool = "N" End If End Function Sub checkExt (val) Dim objRegExpr Set objRegExpr = New regexp objRegExpr.Pattern = "^\.[a-z]{2,4}$" objRegExpr.IgnoreCase = False If NOT objRegExpr.Test(val) Then sMessage = "New project extension is not suitable. Must start with a 'dot' and must be between 2 and 4 lowercase characters" End If End Sub Sub performAction Dim rowCount rowCount = -1 ' ' Determine if the named project suffix exists ' Count the rows in the query ' If Request("newext") <> "" Then checkExt(Request("newext")) If not isNull (sMessage) then Exit Sub Query_String = "SELECT EXT_NAME from PROJECT_EXTENTIONS WHERE EXT_NAME = '" & Request("newext") & "'" Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT ) rowCount = rsQry.RecordCount rsQry.Close() Set rsQry = nothing Else sMessage = "No Project Extension specified" Exit Sub End If If Request("ext") <> "" Then ' ' Update an existing entry ' If (rowCount > 0) AND ( Request("ext") <> Request("newext")) Then sMessage = "Cannot rename the project extension to an existing value" Else Query_String = "SELECT * from PROJECT_EXTENTIONS WHERE EXT_NAME = '" & Request("ext") & "'" Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT ) rsQry.Edit rsQry.Fields("EXT_NAME").Value = Request("newext") rsQry.Fields("UCOMMENT").Value = Request("comment") rsQry.Fields("IS_COTS").Value = niceBool(Request("isCots")) rsQry.Fields("IS_VISIBLE").Value = niceBool(Request("isVis")) rsQry.Update rsQry.Close Set rsQry = Nothing Call OpenInParentWindow ("admin_project_suffix.asp?ext="&Request("newext")) Call CloseWindow() End If Else ' ' Insert a new entry into the table ' If rowCount > 0 Then sMessage = "Project extension already exists" ElseIf rowCount < 0 Then sMessage = "No Project Extension specified" Else Query_String = "SELECT * from PROJECT_EXTENTIONS" Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT ) rsQry.AddNew rsQry.Fields("EXT_NAME").Value = Request("newext") rsQry.Fields("UCOMMENT").Value = Request("comment") rsQry.Fields("IS_COTS").Value = niceBool(Request("isCots")) rsQry.Fields("IS_VISIBLE").Value = niceBool(Request("isVis")) rsQry.Update rsQry.Close Set rsQry = Nothing Call OpenInParentWindow ("admin_project_suffix.asp?ext="&Request("newext")) Call CloseWindow() End If End If End Sub %> <% '------------ RUN BEFORE PAGE RENDER ---------- If CBool(Request("action")) Then performAction() End If '---------------------------------------------- %> Release Manager <% '-- FORM START -------------------------------------------------------------------------------------------------------------- objFormComponent.FormName = "FormName" objFormComponent.Action = ScriptName objFormComponent.OnSubmit = "ShowProgress();" Call objFormComponent.FormStart() %> <%=objPMod.ComposeHiddenTags()%> <% Call objFormComponent.FormEnd() '-- FROM END ---------------------------------------------------------------------------------------------------------------- %>
 Add/Update Project Extension
Add a new Project Extension or edit an existing Project Extension.
<%Call Messenger ( sMessage , 1, "100%" )%>
<% Dim extName Dim comment Dim isaCots Dim isVis If Request("ext") <> "" Then %> "> <% Dim rsTemp Query_String = "select * FROM PROJECT_EXTENTIONS " &_ " where ext_name = '"& Request("ext") & "'" Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) extName = rsTemp("EXT_NAME") comment = rsTemp("UCOMMENT") isaCots = niceBool(rsTemp("IS_COTS")) isVis = niceBool(rsTemp("IS_VISIBLE")) rsTemp.Close() Set rsTemp = Nothing Else isaCots = "N" isVis = "Y" End If %>
Project Extension
The project suffix must start with a '.' and contain 2 to 4 lower case characters.
Comment
The comment field will be displayed during the project suffix selection process
Enable Selection >
If selection is not enabled then the Suffix will not be shown and cannot be selected. This is useful for legacy projects where multiple extensions have been used.
Free Form Version >
Free Form Versioning flags packages are allowed to have non-standard version numbers. If the version number is in the standard major.minor.patch-build form then the package can be auto-versioned. If the version number has only a patch-build field then it can rippled.
<% '------------ RUN AFTER PAGE RENDER ----------- Set objFormCollector = Nothing '---------------------------------------------- Call Destroy_All_Objects %>