| Line 56... |
Line 56... |
| 56 |
|
56 |
|
| 57 |
objEH.TryORA ( OraSession )
|
57 |
objEH.TryORA ( OraSession )
|
| 58 |
|
58 |
|
| 59 |
OraDatabase.ExecuteSQL _
|
59 |
OraDatabase.ExecuteSQL _
|
| 60 |
"BEGIN pk_Bom.Log_Bom_Trail ( :BOM_ID, 'NODE SPECS FILE GENERATED', :USER_ID, NULL ); END;"
|
60 |
"BEGIN pk_Bom.Log_Bom_Trail ( :BOM_ID, 'NODE SPECS FILE GENERATED', :USER_ID, NULL ); END;"
|
| 61 |
|
- |
|
| 62 |
objEH.CatchORA ( OraSession )
|
61 |
objEH.CatchORA ( OraSession )
|
| 63 |
|
62 |
|
| 64 |
OraDatabase.Parameters.Remove "BOM_ID"
|
63 |
OraDatabase.Parameters.Remove "BOM_ID"
|
| 65 |
OraDatabase.Parameters.Remove "USER_ID"
|
64 |
OraDatabase.Parameters.Remove "USER_ID"
|
| 66 |
|
65 |
|
| - |
|
66 |
' Create a sane path name for the output file
|
| - |
|
67 |
' Need to use the same rules as NodesSpecRelease.wsf to allow for BOM versions with a '/' in the name
|
| - |
|
68 |
'
|
| - |
|
69 |
Dim LocalPath, ZipFile, filesys
|
| 67 |
Dim objZIPObject
|
70 |
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT bn.BOM_NAME, br.BRANCH_NAME, bn.BOM_NAME ||''|| b.BOM_VERSION ||'.'|| b.BOM_LIFECYCLE AS VERSION FROM BOMS B, BRANCHES BR, BOM_NAMES BN WHERE B.BOM_ID = "& Request("bom_id") &" AND B.BRANCH_ID = BR.BRANCH_ID AND B.BOM_NAME_ID = BN.BOM_NAME_ID", cint(0))
|
| 68 |
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT bn.BOM_NAME, br.BRANCH_NAME, bn.BOM_NAME ||''|| b.BOM_VERSION ||'.'|| b.BOM_LIFECYCLE AS VERSION FROM BOMS B, BRANCHES BR, BOM_NAMES BN WHERE B.BOM_ID = "& Request("bom_id") &" AND B.BRANCH_ID = BR.BRANCH_ID AND B.BOM_NAME_ID = BN.BOM_NAME_ID", cint(0))
|
71 |
LocalPath = Request.ServerVariables("APPL_PHYSICAL_PATH") &_
|
| - |
|
72 |
"deployment_manager\nodespecfiles\"&_
|
| - |
|
73 |
NicePath(rsQry("branch_name")) & "\" &_
|
| - |
|
74 |
NicePath(rsQry("version")) & "\"&_
|
| - |
|
75 |
DateReversed(Date)
|
| - |
|
76 |
ZipFile = LocalPath &".zip"
|
| 69 |
|
77 |
|
| - |
|
78 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
| - |
|
79 |
If NOT filesys.FolderExists ( LocalPath ) Then
|
| - |
|
80 |
Response.write "<br>Internal Error: Folder Not Found"
|
| - |
|
81 |
Response.write "<br>LocalPath: "&LocalPath
|
| - |
|
82 |
Response.write "<br>Branch: "&rsQry("branch_name")
|
| - |
|
83 |
Response.write "<br>Version: "&rsQry("version")
|
| - |
|
84 |
Response.write "<br>"
|
| - |
|
85 |
generated = false
|
| - |
|
86 |
Else
|
| - |
|
87 |
Dim objZIPObject
|
| 70 |
Set objZIPObject = Server.CreateObject("aspZip.EasyZIP")
|
88 |
Set objZIPObject = Server.CreateObject("aspZip.EasyZIP")
|
| 71 |
|
89 |
|
| 72 |
objZIPObject.ZipFileName = ""& Request.ServerVariables("APPL_PHYSICAL_PATH") &"deployment_manager\nodespecfiles\"& rsQry("branch_name") &"\"& rsQry("version") &"\"& DateReversed(Date) &".zip"
|
90 |
objZIPObject.ZipFileName = ZipFile
|
| 73 |
objZIPObject.ArgsClear
|
91 |
objZIPObject.ArgsClear
|
| 74 |
objZIPObject.ArgsAdd(""& Request.ServerVariables("APPL_PHYSICAL_PATH") &"deployment_manager\nodespecfiles\"& rsQry("branch_name") &"\"& rsQry("version") &"\"& DateReversed(Date) &"\*.*")
|
92 |
objZIPObject.ArgsAdd(LocalPath &"\*.*")
|
| 75 |
objZIPObject.Zip
|
93 |
objZIPObject.Zip
|
| 76 |
|
94 |
|
| 77 |
Response.Write "Files Zipped=" & objZIPObject.SuccessCNT & " with Error="& objZIPObject.Error
|
95 |
Response.Write "Files Zipped=" & objZIPObject.SuccessCNT & " with Error="& objZIPObject.Error
|
| 78 |
|
- |
|
| 79 |
Response.write "Node Spec Files Generated for: "&objAccessControl.UserEmail&"<br>"
|
96 |
Response.write "<br>Node Spec Files Generated for: "&objAccessControl.UserEmail&"<br>"
|
| - |
|
97 |
If NOT filesys.FileExists ( ZipFile ) Then
|
| 80 |
Response.write "Go to <a href=\\auperaweb08\wwwTRD\manager_suite_DEVELOPMENT\deployment_manager\nodespecfiles>\\auperaweb08\wwwTRD\manager_suite_DEVELOPMENT\deployment_manager\nodespecfiles</a>"
|
98 |
Response.write "<br>Internal Error: File Not Found"
|
| - |
|
99 |
Response.write "<br>LocalPath: " & ZipFile & "<br>"
|
| - |
|
100 |
generated = false
|
| - |
|
101 |
Else
|
| 81 |
Dim myMail, LocalPath
|
102 |
Dim myMail
|
| 82 |
Set myMail=Server.CreateObject("Persits.MailSender")
|
103 |
Set myMail=Server.CreateObject("Persits.MailSender")
|
| 83 |
LocalPath = ""& Request.ServerVariables("APPL_PHYSICAL_PATH") &"deployment_manager\nodespecfiles\"& rsQry("branch_name") &"\"& rsQry("version") &"\"& DateReversed(Date) &".zip"
|
- |
|
| 84 |
|
- |
|
| 85 |
myMail.Host = SMTP_HOST
|
104 |
myMail.Host = SMTP_HOST
|
| 86 |
myMail.Subject="NODESPEC FILES Generated from Deployment Manager"
|
105 |
myMail.Subject="NODESPEC FILES Generated from Deployment Manager"
|
| 87 |
myMail.From="releasem@erggroup.com"
|
106 |
myMail.From="releasem@erggroup.com"
|
| 88 |
myMail.AddAddress objAccessControl.UserEmail
|
107 |
myMail.AddAddress objAccessControl.UserEmail
|
| 89 |
' Attach the file
|
108 |
' Attach the file
|
| 90 |
myMail.AddAttachment LocalPath
|
109 |
myMail.AddAttachment LocalPath &".zip"
|
| 91 |
myMail.Body = "Your requested node spec files .."
|
110 |
myMail.Body = "Your requested node spec files .."
|
| 92 |
myMail.Send
|
111 |
myMail.Send
|
| - |
|
112 |
set myMail = nothing
|
| - |
|
113 |
End If
|
| - |
|
114 |
End If
|
| 93 |
|
115 |
|
| 94 |
set myMail = nothing
|
- |
|
| 95 |
set objWSH = nothing
|
116 |
set objWSH = nothing
|
| 96 |
|
117 |
|
| - |
|
118 |
Set filesys = nothing
|
| 97 |
rsQry.Close
|
119 |
rsQry.Close
|
| 98 |
Set rsQry = nothing
|
120 |
Set rsQry = nothing
|
| 99 |
Else
|
121 |
Else
|
| 100 |
generated = false
|
122 |
generated = false
|
| 101 |
Response.write "Node spec filenames not found in the BOM!!!"
|
123 |
Response.write "<br>Node spec filenames not found in the BOM!!!"
|
| 102 |
|
124 |
|
| 103 |
End If
|
125 |
End If
|
| 104 |
|
126 |
|
| 105 |
Else
|
127 |
Else
|
| 106 |
Response.write "Please specify bom_id. <br>Example:<br> "& SCRIPT_NAME &"?bom_id=1234"
|
128 |
Response.write "Please specify bom_id. <br>Example:<br> "& SCRIPT_NAME &"?bom_id=1234"
|