Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added obsolete flag and deployment directory suggestions

  • Loading branch information...
commit af245a1ac765cf1acb45f7995b41bda0debbabdf 1 parent 550c83d
@ryanguill authored
View
184 archive/action.cfm
@@ -3,7 +3,7 @@
<cfif structKeyExists(url,"action")>
<cfswitch expression="#url.action#">
- <cfcase value="downloadArchive,removeCertification">
+ <cfcase value="downloadArchive,removeCertification,markAsObsolete,unmarkAsObsolete">
<cfloop collection="#url#" item="variables.item">
<cfset form[item] = url[item] />
</cfloop>
@@ -50,6 +50,11 @@
<cfset variables.dir = session.tempFormVars["buildArchiveForm"]["dir"] />
<cfset variables.files = session.tempFormVars["buildArchiveForm"]["fileList"] />
+
+ <cfset variables.newLine = chr(10) />
+
+ <cfset variables.deployDirSuggestions = replaceNoCase(form.deployDirSuggestions,variables.newline,",","all") />
+
<cfset variables.filesHashes = structNew() />
<!--- create the archiveID --->
@@ -103,7 +108,9 @@
<cfset variables.manifest.buildByUserEmail = session.login.getEmail() />
<cfset variables.manifest.buildOn = now() />
<cfset variables.manifest.buildDir = variables.dir />
+ <cfset variables.manifest.deployDirSuggestions = variables.deployDirSuggestions />
<cfset variables.manifest.backupOfArchiveID = '' />
+ <cfset variables.manifest.isObsolete = false />
<cfset variables.manifest.archiveSHAHash = variables.archiveSHAHash />
<cfset variables.manifest.certifications = queryNew("certificationid,archiveid,archiveshahash,userid,userfullname,useremail,certificationtypename,certificationnotes,certificationhash,certificationon,certificationsystemname",
"VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,Date,VarChar") />
@@ -143,9 +150,11 @@
<cfinvokeargument name="buildbyuserfullname" value="#session.login.getFullname()#" /> <!---Type:String Hint: - VARCHAR (100) --->
<cfinvokeargument name="buildbyuseremail" value="#session.login.getEmail()#" /> <!---Type:String Hint: - VARCHAR (255) --->
<cfinvokeargument name="builddir" value="#variables.dir#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="deployDirSuggestions" value="#variables.deployDirSuggestions#" /> <!---Type:String Hint: - VARCHAR (5000) --->
<cfinvokeargument name="filecount" value="#arrayLen(variables.files)#" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isnativebuild" value="1" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isbackuparchive" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="isObsolete" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="backupforarchiveid" value="" /> <!---Type:String Hint: - CHAR (35) --->
</cfinvoke>
@@ -168,6 +177,42 @@
<cfset structClear(session.tempFormVars.buildStep2Form) />
<cfset saveDataToManifest(variables.zipFilePath,variables.archiveID) />
+
+ <cfif form.markPreviousArchiveAsObsolete AND isValid("UUID",form.previousArchiveID)>
+ <cfinvoke component="#application.daos.cascade#" method="getArchiveByArchiveID" returnvariable="variables.previousArchive">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#form.previousArchiveID#" /> <!---Type:string --->
+ </cfinvoke>
+
+ <cfif variables.previousArchive.recordCount>
+ <cfinvoke component="#application.daos.cascade#" method="setArchiveIsObsolete">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#variables.previousArchive.archiveID#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="isObsolete" value="1" />
+ </cfinvoke>
+
+ <cfset variables.zipFilePath = application.config.archiveDirectory & application.settings.pathSeperator & variables.previousArchive.archiveID & ".zip" />
+ <cfset variables.archiveSHAHash = application.objs.global.getFileSHAHash(variables.zipFilePath) />
+
+ <cfinvoke component="#application.daos.cascade#" method="insertArchiveLog">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveid" value="#variables.previousArchive.archiveid#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="archiveshahash" value="#variables.archiveshahash#" /> <!---Type:String Hint: - CHAR (40) --->
+ <cfinvokeargument name="buildsystemname" value="#variables.previousArchive.buildSystemName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logSystemName" value="#application.config.serverName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logaction" value="OBSOLETEARCHIVE" /> <!---Type:String Hint: - VARCHAR (50) --->
+ <cfinvokeargument name="deployflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backupcreatedflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backuparchiveid" value="" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="userid" value="#session.login.getUserID()#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="logmessage" value="#variables.previousArchive.archiveID# (#lcase(left(variables.archiveSHAHash,application.settings.showFirstXCharsOfSHA))#) version: #variables.previousArchive.versionName# made obsolete by archive #variables.archiveID# version #form.versionNumber#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="logDateTime" value="#now()#" />
+ </cfinvoke>
+
+ <cfset saveDataToManifest(variables.zipFilePath,variables.previousArchive.archiveID) />
+
+ </cfif>
+ </cfif>
<cflocation url="#application.settings.appBasedir#/archive/archive.cfm?archiveID=#variables.archiveID#" />
@@ -375,8 +420,10 @@
<cfset variables.manifest.buildByUserEmail = '' />
<cfset variables.manifest.buildOn = now() />
<cfset variables.manifest.buildDir = variables.deployDir />
+ <cfset variables.manifest.deployDirSuggestions = variables.deployDir />
<cfset variables.manifest.backupOfArchiveID = form.archiveID />
<cfset variables.manifest.archiveSHAHash = variables.archiveSHAHash />
+ <cfset variables.manifest.isObsolete = 0 />
<cfwddx action="cfml2wddx" input="#variables.manifest#" output="variables.manifestWDDX" />
@@ -407,9 +454,11 @@
<cfinvokeargument name="buildbyuserfullname" value="#session.login.getFullname()#" /> <!---Type:String Hint: - VARCHAR (100) --->
<cfinvokeargument name="buildbyuseremail" value="#session.login.getEmail()#" /> <!---Type:String Hint: - VARCHAR (255) --->
<cfinvokeargument name="builddir" value="#variables.deploydir#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="deployDirSuggestions" value="#variables.deployDirSuggestions#" /> <!---Type:String Hint: - VARCHAR (5000) --->
<cfinvokeargument name="filecount" value="#arrayLen(variables.files)#" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isnativebuild" value="1" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isbackuparchive" value="1" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="isObsolete" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="backupforarchiveid" value="#form.archiveID#" /> <!---Type:String Hint: - CHAR (35) --->
</cfinvoke>
@@ -785,6 +834,9 @@
</cfinvoke>
</cfif>
+ <cfparam name="variables.manifest.deployDirSuggestions" default="" />
+ <cfparam name="variables.manifest.isObsolete" default="0" />
+
<cfif session.messenger.hasAlerts()>
<cffile action="delete" file="#variables.tempZipFileResult.serverDirectory##application.settings.pathSeperator##variables.tempZipFileResult.serverFile#" />
@@ -869,9 +921,11 @@
<cfinvokeargument name="buildbyuserfullname" value="#variables.manifest.buildByUserFullname#" /> <!---Type:String Hint: - VARCHAR (100) --->
<cfinvokeargument name="buildbyuseremail" value="#variables.manifest.buildByUserEmail#" /> <!---Type:String Hint: - VARCHAR (255) --->
<cfinvokeargument name="builddir" value="#variables.manifest.buildDir#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="deployDirSuggestions" value="#variables.manifest.deployDirSuggestions#" /> <!---Type:String Hint: - VARCHAR (5000) --->
<cfinvokeargument name="filecount" value="#variables.fileCounter#" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isnativebuild" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="isbackuparchive" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="isObsolete" value="#variables.manifest.isObsolete#" /> <!---Type:Numeric Hint: - INTEGER (10) --->
<cfinvokeargument name="backupforarchiveid" value="" /> <!---Type:String Hint: - CHAR (35) --->
</cfinvoke>
@@ -1239,6 +1293,128 @@
</cfcase>
+
+ <cfcase value="markAsObsolete">
+
+ <cfif NOT structKeyExists(form,"archiveID") OR NOT isValid("UUID",form.archiveID)>
+ <cfinvoke component="#session.messenger#" method="setAlert" returnvariable="variables.setAlert">
+ <cfinvokeargument name="alertingTemplate" value="#application.settings.appBaseDir#/archive/action.cfm" />
+ <cfinvokeargument name="messageType" value="Error" />
+ <cfinvokeargument name="messageText" value="archiveID is required." />
+ </cfinvoke>
+ </cfif>
+
+ <cfif session.messenger.hasAlerts()>
+ <cflocation url="#application.settings.appBaseDir#/archive/browse.cfm" />
+ </cfif>
+
+ <cfinvoke component="#application.daos.cascade#" method="getArchiveByArchiveID" returnvariable="variables.archive">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#form.archiveID#" /> <!---Type:string --->
+ </cfinvoke>
+
+ <cfif NOT variables.archive.recordCount>
+ <cfinvoke component="#session.messenger#" method="setAlert" returnvariable="variables.setAlert">
+ <cfinvokeargument name="alertingTemplate" value="#application.settings.appBaseDir#/archive/action.cfm" />
+ <cfinvokeargument name="messageType" value="Error" />
+ <cfinvokeargument name="messageText" value="archiveID #form.archiveID# is not valid." />
+ </cfinvoke>
+ </cfif>
+
+ <cfif session.messenger.hasAlerts()>
+ <cflocation url="#application.settings.appBaseDir#/archive/browse.cfm" />
+ </cfif>
+
+ <cfinvoke component="#application.daos.cascade#" method="setArchiveIsObsolete">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#variables.archive.archiveID#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="isObsolete" value="1" />
+ </cfinvoke>
+
+ <cfset variables.zipFilePath = application.config.archiveDirectory & application.settings.pathSeperator & variables.archive.archiveID & ".zip" />
+ <cfset variables.archiveSHAHash = application.objs.global.getFileSHAHash(variables.zipFilePath) />
+
+ <cfinvoke component="#application.daos.cascade#" method="insertArchiveLog">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveid" value="#variables.archive.archiveid#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="archiveshahash" value="#variables.archiveshahash#" /> <!---Type:String Hint: - CHAR (40) --->
+ <cfinvokeargument name="buildsystemname" value="#variables.archive.buildSystemName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logSystemName" value="#application.config.serverName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logaction" value="OBSOLETEARCHIVE" /> <!---Type:String Hint: - VARCHAR (50) --->
+ <cfinvokeargument name="deployflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backupcreatedflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backuparchiveid" value="" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="userid" value="#session.login.getUserID()#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="logmessage" value="#variables.archive.archiveID# (#lcase(left(variables.archiveSHAHash,application.settings.showFirstXCharsOfSHA))#) version: #variables.archive.versionName# set as obsolete by #session.login.getUsername()#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="logDateTime" value="#now()#" />
+ </cfinvoke>
+
+ <cfset saveDataToManifest(variables.zipFilePath,variables.archive.archiveID) />
+
+ <cflocation url="#application.settings.appBaseDir#/archive/archive.cfm?archiveID=#form.archiveID#" />
+
+ </cfcase>
+
+ <cfcase value="unmarkAsObsolete">
+
+ <cfif NOT structKeyExists(form,"archiveID") OR NOT isValid("UUID",form.archiveID)>
+ <cfinvoke component="#session.messenger#" method="setAlert" returnvariable="variables.setAlert">
+ <cfinvokeargument name="alertingTemplate" value="#application.settings.appBaseDir#/archive/action.cfm" />
+ <cfinvokeargument name="messageType" value="Error" />
+ <cfinvokeargument name="messageText" value="archiveID is required." />
+ </cfinvoke>
+ </cfif>
+
+ <cfif session.messenger.hasAlerts()>
+ <cflocation url="#application.settings.appBaseDir#/archive/browse.cfm" />
+ </cfif>
+
+ <cfinvoke component="#application.daos.cascade#" method="getArchiveByArchiveID" returnvariable="variables.archive">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#form.archiveID#" /> <!---Type:string --->
+ </cfinvoke>
+
+ <cfif NOT variables.archive.recordCount>
+ <cfinvoke component="#session.messenger#" method="setAlert" returnvariable="variables.setAlert">
+ <cfinvokeargument name="alertingTemplate" value="#application.settings.appBaseDir#/archive/action.cfm" />
+ <cfinvokeargument name="messageType" value="Error" />
+ <cfinvokeargument name="messageText" value="archiveID #form.archiveID# is not valid." />
+ </cfinvoke>
+ </cfif>
+
+ <cfif session.messenger.hasAlerts()>
+ <cflocation url="#application.settings.appBaseDir#/archive/browse.cfm" />
+ </cfif>
+
+ <cfinvoke component="#application.daos.cascade#" method="setArchiveIsObsolete">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#variables.archive.archiveID#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="isObsolete" value="0" />
+ </cfinvoke>
+
+ <cfset variables.zipFilePath = application.config.archiveDirectory & application.settings.pathSeperator & variables.archive.archiveID & ".zip" />
+ <cfset variables.archiveSHAHash = application.objs.global.getFileSHAHash(variables.zipFilePath) />
+
+ <cfinvoke component="#application.daos.cascade#" method="insertArchiveLog">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveid" value="#variables.archive.archiveid#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="archiveshahash" value="#variables.archiveshahash#" /> <!---Type:String Hint: - CHAR (40) --->
+ <cfinvokeargument name="buildsystemname" value="#variables.archive.buildSystemName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logSystemName" value="#application.config.serverName#" /> <!---Type:String Hint: - VARCHAR (255) --->
+ <cfinvokeargument name="logaction" value="DE-OBSOLETEARCHIVE" /> <!---Type:String Hint: - VARCHAR (50) --->
+ <cfinvokeargument name="deployflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backupcreatedflag" value="0" /> <!---Type:Numeric Hint: - INTEGER (10) --->
+ <cfinvokeargument name="backuparchiveid" value="" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="userid" value="#session.login.getUserID()#" /> <!---Type:String Hint: - CHAR (35) --->
+ <cfinvokeargument name="logmessage" value="#variables.archive.archiveID# (#lcase(left(variables.archiveSHAHash,application.settings.showFirstXCharsOfSHA))#) version: #variables.archive.versionName# obsolete designation removed by #session.login.getUsername()#" /> <!---Type:String Hint: - VARCHAR (1000) --->
+ <cfinvokeargument name="logDateTime" value="#now()#" />
+ </cfinvoke>
+
+ <cfset saveDataToManifest(variables.zipFilePath,variables.archive.archiveID) />
+
+ <cflocation url="#application.settings.appBaseDir#/archive/archive.cfm?archiveID=#form.archiveID#" />
+
+ </cfcase>
<cfdefaultcase>
<cflocation url="#application.settings.appBaseDir#/" />
@@ -1274,6 +1450,12 @@
<cfset local.manifest = application.objs.global.getZipManifest(arguments.zipFilePath) />
<!--- get the certifications, deployments and log to append to the manifest --->
+ <cfinvoke component="#application.daos.cascade#" method="getArchiveByArchiveID" returnvariable="local.archiveData">
+ <cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
+ <cfinvokeargument name="archiveID" value="#arguments.archiveID#" /> <!---Type:string --->
+ </cfinvoke>
+
+ <cfset local.manifest.isObsolete = local.archiveData.isObsolete />
<cfinvoke component="#application.daos.cascade#" method="getArchiveCertificationsForArchiveID" returnvariable="local.certifications">
<cfinvokeargument name="dsn" value="#application.config.dsn#" /> <!---Type:string --->
View
8 archive/archive.cfm
@@ -193,6 +193,14 @@
<cfelse>
<a href="#application.settings.appBaseDir#/archive/archive.cfm?archiveID=#variables.archive.archiveID#&action=deleteArchive" class="bigButton">Delete Archive</a>
</cfif>
+
+ </td>
+ <td width="200" class="noBorder">
+ <cfif variables.archive.isObsolete>
+ <a href="#application.settings.appBaseDir#/archive/action.cfm?archiveID=#variables.archive.archiveID#&action=unmarkAsObsolete" class="bigButton">Unmark as Obsolete</a>
+ <cfelse>
+ <a href="#application.settings.appBaseDir#/archive/action.cfm?archiveID=#variables.archive.archiveID#&action=markAsObsolete" class="bigButton">Mark as Obsolete</a>
+ </cfif>
</td>
</tr>
</table>
View
2  archive/browse.cfm
@@ -25,9 +25,11 @@
<cfinvokeargument name="buildonAfter" value="1970-01-01" /> <!---Type:date Hint: pass 1970-01-01 to ignore --->
<cfinvokeargument name="buildonBefore" value="1970-01-01" /> <!---Type:date Hint: pass 1970-01-01 to ignore --->
<cfinvokeargument name="builddir" value="-1" /> <!---Type:String Hint: pass -1 to ignore. --->
+ <cfinvokeargument name="deployDirSuggestions" value="-1" /> <!---Type:String Hint: pass -1 to ignore. --->
<cfinvokeargument name="filecount" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="isnativebuild" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="isbackuparchive" value="0" /> <!---Type:numeric Hint: pass -1 to ignore. --->
+ <cfinvokeargument name="isObsolete" value="0" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="backupForArchiveID" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
</cfinvoke>
View
28 archive/build-step-2.cfm
@@ -42,8 +42,10 @@
<cfparam name="session.tempFormVars.buildStep2Form.author" default="" />
<cfparam name="session.tempFormVars.buildStep2Form.changeReason" default="" />
<cfparam name="session.tempFormVars.buildStep2Form.changeDescription" default="" />
+ <cfparam name="session.tempFormVars.buildStep2Form.deployDirSuggestions" default="" />
<cfset variables.basedOnPreviousArchive = false />
+ <cfset variables.previousArchiveID = "" />
<cfif isValid("UUID",session.tempFormVars.buildArchiveForm.previousArchiveID)>
<cfinvoke component="#application.daos.cascade#" method="getArchiveByArchiveID" returnvariable="variables.archive">
@@ -53,6 +55,7 @@
<cfif variables.archive.recordCount>
<cfset variables.basedOnPreviousArchive = true />
+ <cfset variables.previousArchiveID = session.tempFormVars.buildArchiveForm.previousArchiveID />
<cfset session.tempFormVars.buildStep2Form.applicationName = variables.archive.applicationName />
<cfset session.tempFormVars.buildStep2Form.versionNumber = "" />
@@ -62,6 +65,7 @@
<cfset session.tempFormVars.buildStep2Form.author = variables.archive.author />
<cfset session.tempFormVars.buildStep2Form.changeReason = variables.archive.changeReason />
<cfset session.tempFormVars.buildStep2Form.changeDescription = variables.archive.changeDescription />
+ <cfset session.tempFormVars.buildStep2Form.deployDirSuggestions = variables.archive.deployDirSuggestions />
</cfif>
</cfif>
@@ -214,10 +218,34 @@
</td>
</tr>
<tr>
+ <th valign="top">
+ Deployment Directory Suggestions: (one per line)
+ </th>
+ <td>
+ <textarea name="deployDirSuggestions" id="deployDirSuggestions" cols="100" rows="10">#session.tempFormVars.buildStep2Form.deployDirSuggestions#</textarea>
+ </td>
+ </tr>
+ <cfif variables.basedOnPreviousArchive>
+ <tr>
+ <th>
+ Mark Previous Version as Obsolete?
+ </th>
+ <td>
+ <select name="markPreviousArchiveAsObsolete">
+ <option value="true">Yes</option>
+ <option value="false">No</option>
+ </select>
+ </td>
+ </tr>
+ <cfelse>
+ <input type="hidden" name="markPreviousArchiveAsObsolete" value="false" />
+ </cfif>
+ <tr>
<th>
</th>
<td>
+ <input type="hidden" name="previousArchiveID" value="#variables.previousArchiveID#" />
<input type="hidden" name="action" value="buildArchive2" />
<input type="submit" value="Create Archive" />
</td>
View
11 archive/deploy-step-2.cfm
@@ -52,6 +52,10 @@
<cfparam name="url.createDeployDir" default="false">
+ <cfif url.deployDir EQ "deployDir_custom">
+ <cfset url.deployDir = trim(url.customDeployDir) />
+ </cfif>
+
<cfif NOT directoryExists(url.deployDir) AND NOT url.createDeployDir>
<cfinvoke component="#session.messenger#" method="setAlert" returnvariable="variables.setAlert">
<cfinvokeargument name="alertingTemplate" value="#application.settings.appBaseDir#/archive/deploy-step-2.cfm" />
@@ -119,6 +123,9 @@
</div>
<div class="contentSection">
+
+ <h1>Deploy Dir: #variables.deployDir#</h1>
+
<h2 class="sectionTitle">File Deployement Details (#variables.files.recordCount# file<cfif variables.files.recordCount NEQ 1>s</cfif>)</h2>
<table class="dataTable" width="100%">
@@ -168,9 +175,9 @@
<th width="200">
Deploy Directory:
</th>
- <td>
+ <td <cfif directoryExists(variables.deployDir)>class="pass"<cfelse>class="fail"</cfif>>
#variables.deployDir#
- (<a href="#application.settings.appBaseDir#/archive/deploy.cfm?archiveID=#variables.archive.archiveID#&deployDir=#url.deployDir#">Change</a>)
+ (<a href="#application.settings.appBaseDir#/archive/deploy.cfm?archiveID=#variables.archive.archiveID#&deployDir=#url.deployDir#" style="color:white;">Change</a>)
<cfif NOT directoryExists(variables.deployDir) AND url.createDeployDir>
<em>This directory does not already exist, but will be created.</em>
<cfelse>
View
96 archive/deploy.cfm
@@ -49,28 +49,7 @@
</cfif>
- <cfset variables.buildDirExists = true />
- <cfparam name="variables.deployDir" default="#variables.archive.buildDir#" />
- <cfif NOT directoryExists(variables.archive.buildDir)>
- <cfset variables.buildDirExists = false />
- <cfset variables.deployDir = expandPath("/") />
- </cfif>
-
- <cfif right(variables.deployDir,1) EQ application.settings.pathSeperator>
- <cfset variables.deployDir = left(variables.deployDir,len(variables.deployDir)-1) />
- </cfif>
-
- <cfset variables.userDefinedDir = false />
- <cfif structKeyExists(url,"deployDir") AND len(trim(url.deployDir))>
- <cfif right(url.deployDir,1) EQ application.settings.pathSeperator>
- <cfset url.deployDir = left(url.deployDir,len(url.deployDir)-1) />
- </cfif>
- <cfif url.deployDir NEQ variables.deployDir>
- <cfset variables.deployDir = url.deployDir />
- <cfset variables.userDefinedDir = true />
- </cfif>
- </cfif>
<cfparam name="url.createDeployDir" default="false" />
@@ -128,7 +107,7 @@
<form action="deploy-step-2.cfm" method="get">
<table width="100%" class="formTable">
- <tr>
+ <!---<tr>
<th>
Deploy Directory:
</th>
@@ -146,12 +125,81 @@
</cfif>
</cfif>
</td>
+ </tr>--->
+ <tr>
+ <th valign="top">
+ Deploy Directory:
+ </th>
+ <td>
+ <table width="100%">
+ <cfset variables.dirFound = false />
+ <cfset variables.selected = false />
+
+ <cfloop from="1" to="#listLen(variables.archive.deployDirSuggestions)#" index="variables.i">
+ <cfset variables.tempDir = trim(listGetAt(variables.archive.deployDirSuggestions,variables.i)) />
+ <cfset variables.tempDirExists = directoryExists(variables.tempDir)>
+
+ <cfif variables.tempDirExists AND NOT variables.dirFound>
+ <cfset variables.dirFound = true />
+ <cfset variables.selected = true />
+ </cfif>
+
+ <tr>
+ <td class="<cfif variables.tempDirExists>pass<cfelse>fail</cfif>">
+ <input type="radio" value="#variables.tempDir#" name="deployDir" id="deployDir_#variables.i#" <cfif variables.selected>checked="true"</cfif>>
+ <label for="deployDir_#variables.i#">#variables.tempDir#</label><br />
+ </td>
+ <td class="<cfif variables.tempDirExists>pass<cfelse>fail</cfif>">
+ Suggested Deploy Dir #variables.i#
+ </td>
+ </tr>
+ <cfset variables.selected = false />
+ </cfloop>
+ <cfif NOT listContains(variables.archive.deployDirSuggestions,variables.archive.buildDir)>
+ <cfset variables.tempDirExists = directoryExists(variables.archive.buildDir) />
+
+ <cfif variables.tempDirExists AND NOT variables.dirFound>
+ <cfset variables.dirFound = true />
+ <cfset variables.selected = true />
+ </cfif>
+
+ <tr>
+ <td class="<cfif variables.tempDirExists>pass<cfelse>fail</cfif>">
+ <input type="radio" value="#variables.archive.buildDir#" name="deployDir" id="deployDir_0" <cfif variables.selected>checked="true"</cfif>>
+ <label for="deployDir_0">#variables.archive.buildDir#</label>
+ </td>
+ <td class="<cfif variables.tempDirExists>pass<cfelse>fail</cfif>">
+ Build Dir
+ </td>
+ </tr>
+ <cfset variables.selected = false />
+ </cfif>
+ <cfset variables.webroot = expandPath("/") />
+
+ <cfif NOT variables.dirFound>
+ <cfset variables.selected = true />
+ </cfif>
+
+ <tr>
+ <td>
+ <input type="radio" value="deployDir_custom" name="deployDir" id="deployDir_custom" <cfif variables.selected>checked="True"</cfif>>
+ <input type="text" name="customDeployDir" value="#variables.webroot#" size="70" />
+ </td>
+ <td>
+ Custom Deploy Dir
+ </td>
+ </tr>
+
+ </table>
+
+
+ </td>
</tr>
<tr>
<th>
&nbsp;
</th>
- <td colspan="2">
+ <td>
<input type="checkbox" value="true" name="createDeployDir" id="createDeployDir" <cfif url.createDeployDir>checked="true"</cfif>>
<lable for="createDeployDir">Create Deploy Dir If It Doesn't Already Exist</label>
</td>
@@ -160,7 +208,7 @@
<th>
&nbsp;
</th>
- <td colspan="2">
+ <td>
<input type="checkbox" value="true" name="skipBackupArchive" id="skipBackupArchive">
Skip Backup Archive
<em>Do this at your own risk! Not recommended!</em>
View
4 archive/inc/_archiveInfo.cfm
@@ -40,8 +40,8 @@
<th>
Version:
</th>
- <td>
- #variables.archive.versionName#
+ <td class="<cfif variables.archive.isObsolete>fail</cfif>">
+ #variables.archive.versionName# <cfif variables.archive.isObsolete><em>(obsolete)</em</cfif>
</td>
</tr>
<tr>
View
46 com/guill/dao/cascadeDao.cfc
@@ -25,9 +25,11 @@
, archives.buildbyuseremail /* - VARCHAR (255)*/
, archives.buildon /* - TIMESTAMP (26)*/
, archives.builddir /* - VARCHAR (1000)*/
+ , archives.deployDirSuggestions /* - VARCHAR (5000)*/
, archives.filecount /* - INTEGER (10)*/
, archives.isnativebuild /* - INTEGER (10)*/
, archives.isbackuparchive /* - INTEGER (10)*/
+ , archives.isObsolete /* - INTEGER (10)*/
, archives.backupforarchiveid /* - CHAR (35)*/
FROM archives
@@ -64,9 +66,11 @@
<cfargument name="buildonAfter" type="date" required="true" hint="pass 1970-01-01 to ignore" />
<cfargument name="buildonBefore" type="date" required="true" hint="pass 1970-01-01 to ignore" />
<cfargument name="builddir" type="String" required="true" hint="pass -1 to ignore." />
+ <cfargument name="deployDirSuggestions" type="String" required="true" hint="pass -1 to ignore." />
<cfargument name="filecount" type="numeric" required="true" hint="pass -1 to ignore." />
<cfargument name="isnativebuild" type="numeric" required="true" hint=" pass -1 to ignore." />
<cfargument name="isbackuparchive" type="numeric" required="true" hint="pass -1 to ignore." />
+ <cfargument name="isObsolete" type="numeric" required="true" hint="pass -1 to ignore." />
<cfargument name="backupForArchiveID" type="string" required="true" hint="pass -1 to ignore" />
<cfset var qSearchArchives = "" />
@@ -91,9 +95,11 @@
, archives.buildbyuseremail /* - VARCHAR (255)*/
, archives.buildon /* - TIMESTAMP (26)*/
, archives.builddir /* - VARCHAR (1000)*/
+ , archives.deployDirSuggestions /* - VARCHAR (5000)*/
, archives.filecount /* - INTEGER (10)*/
, archives.isnativebuild /* - INTEGER (10)*/
, archives.isbackuparchive /* - INTEGER (10)*/
+ , archives.isObsolete /* - INTEGER (10)*/
, archives.backupforarchiveid /* - CHAR (35)*/
FROM archives
@@ -152,6 +158,9 @@
<cfif arguments.builddir NEQ -1>
AND builddir LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.builddir#%" /> /* - VARCHAR (1000)*/
</cfif>
+ <cfif arguments.deployDirSuggestions NEQ -1>
+ AND deployDirSuggestions LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.deployDirSuggestions#%" /> /* - VARCHAR (5000)*/
+ </cfif>
<cfif arguments.filecount NEQ -1>
AND filecount = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.filecount#" /> /* - INTEGER (10)*/
</cfif>
@@ -161,6 +170,9 @@
<cfif arguments.isbackuparchive NEQ -1>
AND isbackuparchive = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isbackuparchive#" /> /* - INTEGER (10)*/
</cfif>
+ <cfif arguments.isObsolete NEQ -1>
+ AND isObsolete = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isbackuparchive#" /> /* - INTEGER (10)*/
+ </cfif>
<cfif arguments.backupforarchiveid NEQ -1>
AND backupforarchiveid LIKE <cfqueryparam cfsqltype="cf_sql_char" value="%#arguments.backupforarchiveid#%" /> /* - CHAR (35)*/
</cfif>
@@ -202,9 +214,11 @@
, archives.buildbyuseremail /* - VARCHAR (255)*/
, archives.buildon /* - TIMESTAMP (26)*/
, archives.builddir /* - VARCHAR (1000)*/
+ , archives.deployDirSuggestions /* - VARCHAR (5000)*/
, archives.filecount /* - INTEGER (10)*/
, archives.isnativebuild /* - INTEGER (10)*/
, archives.isbackuparchive /* - INTEGER (10)*/
+ , archives.isObsolete /* - INTEGER (10)*/
, archives.backupforarchiveid /* - CHAR (35)*/
FROM archives
@@ -248,9 +262,11 @@
, archives.buildbyuseremail /* - VARCHAR (255)*/
, archives.buildon /* - TIMESTAMP (26)*/
, archives.builddir /* - VARCHAR (1000)*/
+ , archives.deployDirSuggestions /* - VARCHAR (5000)*/
, archives.filecount /* - INTEGER (10)*/
, archives.isnativebuild /* - INTEGER (10)*/
, archives.isbackuparchive /* - INTEGER (10)*/
+ , archives.isObsolete /* - INTEGER (10)*/
, archives.backupforarchiveid /* - CHAR (35)*/
FROM archives
@@ -286,9 +302,11 @@
<cfargument name="buildbyuserfullname" type="String" required="true" hint=" - VARCHAR (100)" />
<cfargument name="buildbyuseremail" type="String" required="true" hint=" - VARCHAR (255)" />
<cfargument name="builddir" type="String" required="true" hint=" - VARCHAR (1000)" />
+ <cfargument name="deployDirSuggestions" type="String" required="true" hint=" - VARCHAR (5000)" />
<cfargument name="filecount" type="Numeric" required="true" hint=" - INTEGER (10)" />
<cfargument name="isnativebuild" type="Numeric" required="true" hint=" - INTEGER (10)" />
<cfargument name="isbackuparchive" type="Numeric" required="true" hint=" - INTEGER (10)" />
+ <cfargument name="isObsolete" type="Numeric" required="true" hint=" - INTEGER (10)" />
<cfargument name="backupforarchiveid" type="String" required="true" hint=" - CHAR (35)" />
<cfset var qCreateArchive = "" />
@@ -314,10 +332,12 @@
, buildbyuseremail /* - VARCHAR (255)*/
, buildon /* - TIMESTAMP (26)*/
, builddir /* - VARCHAR (1000)*/
+ , deployDirSuggestions /* - VARCHAR (5000)*/
, filecount /* - INTEGER (10)*/
, isnativebuild /* - INTEGER (10)*/
, isbackuparchive /* - INTEGER (10)*/
- , backupforarchiveid /* - CHAR (35)*/
+ , isObsolete /* - INTEGER (10)*/
+ , backupforarchiveid /* - CHAR (35)*/
)
VALUES
(
@@ -338,9 +358,11 @@
, <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.buildbyuseremail#" /> /* buildbyuseremail */
, <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#" /> /* buildon */
, <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.builddir#" /> /* builddir */
+ , <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.deployDirSuggestions#" /> /* deployDirSuggestions */
, <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.filecount#" /> /* filecount */
, <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isnativebuild#" /> /* isnativebuild */
, <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isbackuparchive#" /> /* isbackuparchive */
+ , <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isObsolete#" /> /* isObsolete */
, <cfqueryparam cfsqltype="cf_sql_char" value="#arguments.backupforarchiveid#" /> /* backupforarchiveid */
)
</cfquery>
@@ -373,6 +395,28 @@
<cfreturn True />
</cffunction>
+
+ <cffunction name="setArchiveIsObsolete" access="public" returntype="boolean" output="false" hint="">
+ <cfargument name="dsn" type="string" required="True" />
+ <cfargument name="archiveID" type="string" required="true" />
+ <cfargument name="isObsolete" type="boolean" required="true" />
+
+ <cfset var qMarkAsObsolete = "" />
+ <cftry>
+ <cfquery name="qDeleteArchive" datasource="#arguments.dsn#">
+ UPDATE archives
+ SET isObsolete = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.isObsolete#" />
+ WHERE
+ archiveid = <cfqueryparam cfsqltype="cf_sql_char" value="#arguments.archiveid#" /> /* - CHAR (35)*/
+ </cfquery>
+ <cfcatch>
+ <cfthrow message="Query failed. Message: #cfcatch.Message# Detail: #cfcatch.Detail#" />
+ <cfrethrow />
+ </cfcatch>
+ </cftry>
+
+ <cfreturn True />
+ </cffunction>
<!--- I dont think we will need this actually, I dont think there will ever be a reason to update an archive -
View
2  com/guill/dao/installDao.cfc
@@ -156,9 +156,11 @@
, buildByUserEmail varchar(255) NOT NULL
, buildOn timestamp NOT NULL
, buildDir varchar(1000) NOT NULL
+ , deployDirSuggestions varchar(5000) NOT NULL
, fileCount integer NOT NULL
, isNativeBuild integer NOT NULL
, isBackupArchive integer NOT NULL
+ , isObsolete integer NOT NULL
, backupForArchiveID char(35) NOT NULL
, PRIMARY KEY (archiveID)
View
2  com/remoteService.cfc
@@ -270,9 +270,11 @@
<cfinvokeargument name="buildonAfter" value="1970-01-01" /> <!---Type:date Hint: pass 1970-01-01 to ignore --->
<cfinvokeargument name="buildonBefore" value="1970-01-01" /> <!---Type:date Hint: pass 1970-01-01 to ignore --->
<cfinvokeargument name="builddir" value="-1" /> <!---Type:String Hint: pass -1 to ignore. --->
+ <cfinvokeargument name="deployDirSuggestions" value="-1" /> <!---Type:String Hint: pass -1 to ignore. --->
<cfinvokeargument name="filecount" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="isnativebuild" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="isbackuparchive" value="0" /> <!---Type:numeric Hint: pass -1 to ignore. --->
+ <cfinvokeargument name="isObsolete" value="0" /> <!---Type:numeric Hint: pass -1 to ignore. --->
<cfinvokeargument name="backupForArchiveID" value="-1" /> <!---Type:numeric Hint: pass -1 to ignore. --->
</cfinvoke>
View
12 inc/nav.cfm
@@ -85,11 +85,13 @@
<cfinvoke component="#application.objs.remoteService#" method="getRemoteServers" returnvariable="variables.remoteServers" />
<!---<cfset variables.remoteServersList = valueList(variables.remoteServers.serverName) />--->
<h3 class="title">Remote Server Listing:</h3>
- <ul>
- <cfloop query="variables.remoteServers">
- <li><cftooltip tooltip="#variables.remoteServers.serverName#"><a href="#application.settings.appBaseDir#/remote/server.cfm?serverid=#variables.remoteServers.serverID#">#left(variables.remoteServers.serverName,20)#<cfif len(variables.remoteServers.serverName) GT 20>...</cfif></a></cftooltip></li>
- </cfloop>
- </ul>
+ <cfif variables.remoteServers.recordCount>
+ <ul>
+ <cfloop query="variables.remoteServers">
+ <li><cftooltip tooltip="#variables.remoteServers.serverName#"><a href="#application.settings.appBaseDir#/remote/server.cfm?serverid=#variables.remoteServers.serverID#">#left(variables.remoteServers.serverName,20)#<cfif len(variables.remoteServers.serverName) GT 20>...</cfif></a></cftooltip></li>
+ </cfloop>
+ </ul>
+ </cfif>
</div>
</cfif>
Please sign in to comment.
Something went wrong with that request. Please try again.