📄 dbquery.tcl
字号:
# DBQUERY.TCL - Setup procedures for implementing Database Query Permission # wizard page## Copyright 1999 Wind River Systems, Inc## modification history# --------------------# 03f,22may02,bwd SPR 77766: increased the width for more text to be# displayed# 03e,13may02,wmd Fix SPR 77291, fix detail button to mention use with a# docking station.# 03d,24apr02,j_w Fixed SPR 76126: able to specify DISK_SERIAL as host id# 03c,05mar02,bwd Modified SETUP to be non-tornado centric# 03b,07may01,j_w Update text messages# 03a,02may01,j_w Display the correct hostId# 02z,12mar01,wmd Fix spr 63962, add NIC hostId info for Windows hosts.# 02y,06nov00,bwd Remove resetting lmVals(reload) variable because of change# in page flow# 02x,04nov00,wmd Fix typos in text explanations.# 02w,18oct00,j_w remove tellMeMore button refrence (spr 35340)# 02v,03oct00,bwd SPR 31034: removed "Tell Me More" dialog since setup online# help is in place# 02u,12sep00,bwd SPR 34383: added a dialog box to display instruction for# End User when encountering DB errors. Change -helpfile to# -nocontexthelp# 02t,28jun00,bwd Changed host checking to use windHostTypeGet instead of# env(WIND_HOST_TYPE)# 02s,31may00,bwd SPR 31388: removed text DBQUERY_MSG_3 and modified message# display for TEXT mode# 02r,30may00,bwd Enable back for reload in TEXT mode# 02q,26may00,bwd Enable Back button for reload# 02p,23may00,bwd Fixed message# 02o,22may00,bwd fixed typo - calPage. Fixed page order when DB errors# occur.# 02n,22may00,bwd SPR 31003 - modified to add cancel button to banner # indicating database transaction.# 02m,17may00,bwd SPR 31030 - design change for nodelock to be like floating# license: added lmInstOptions before DBQUERY page and when # onDenied, go back to lmInstOptions.# 02l,15may00,bwd SPR 31030 - added lmInstOptions page list when user selects# "no access to Wind River web site"# 02k,12may00,wmd Modify the "Tell Me More" text string for clarity.# 02j,12may00,wmd Fix spr # 31201, warn users that internet access is# required.# 02i,23mar00,bwd Fixed licInfoGetAllCallBack to match with the new format of# data coming in from CGI. Removed licInfoGetAllText and moved# all TEXT mode codes to licInfoGetAllCallBack. Removed# lmTotalInfoGetByCode. Created new format for lmVals# 02h,17mar00,j_w Rewording radiobutton messages# 02g,14feb00,wmd Change all references to prodCode to featureId.# 02f,09feb00,wmd Fix text mode as well for "Tell Me More".# 02e,09feb00,wmd Provide a "Tell Me More" text specifically for end-user# mode.# 02d,04feb00,wmd Add text mode error handling.# 02c,03feb00,j_w Fix lmExit page problem# 02b,03feb00,j_w Initialize lmHostFeaturesNum to zero in licInfoGetAllText# 02a,03feb00,wmd Need to initialize lmHostFeaturesNum to zero.# 01z,31jan00,j_w Renamed lmVals(PinRequired) to lmVals(lmPinRequired)# 01y,25jan00,j_w Populate lmVals at the end of licInfoGetAllCallBack# 01x,21jan00,j_w Updated parameter list for sendToALD call# 01w,06jan00,bwd No test automation for command line SETUP# 01v,06jan00,j_w Fixed DBQUERY_STATEMENT message layout size# 01u,17dec99,clc change switch patterns# 01t,17dec99,clc fix missing-close brace# 01s,14dec99,wmd Add icon to wait banner.# 01r,10dec99,j_w Remove autoInst pageList if licInfoRetVal is 1# 01q,06dec99,wmd Fix the error handling to work correctly.# 01p,03dec99,wmd Add statement saying that we will not upload any user data.# 01o,23nov99,wmd Fix wait cursor.# 01o,23nov99,clc add text mode# 01n,22nov99,wmd Add lmLicHostIndexGet proc.# 01m,17nov99,j_w Disable the back button if reload option is selected in the# current license info page. Reset lmVals(reload) to 0 in# the onDenied option# 01l,16nov99,wmd Add record call totalRecs to hold totals.# 01k,15nov99,j_w set onGrant to be the default option# 01j,15nov99,j_w Removed desired pagelist if onDenied option is selected# 01i,15nov99,wmd Add a lmValsInit proc.# 01h,15nov99,bwd Added sections for automatic setup installation# 01g,11nov99,wmd Add code to parse the licInfoGetAll request reply.# 01f,05nov99,wmd Add code to make sure next button is enabled.# 01e,05nov99,j_w Fixed Next button# 01d,03nov99,j_w Renamed licInfoGetAll to licInfGetAllCallBack # 01c,01nov99,j_w Implemented details of licInfoGetAll# 01b,30oct99,wmd Change how it invokes the lmExit page.# 01a,04Oct99,j_w written#global licInfoRetValglobal cancelDBQUERY############################################################################### pageCreate(dbQuery) - Database Query Permission page## SYNOPSIS# .tS# pageCreate(dbQuery)# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc pageCreate(dbQuery) {} { global ctrlVals env setupVals lmVals set setupVals(WRSLicense) [setupLicenseNumGet] set idType "(MAC)" set licInfo "WRS License: $setupVals(WRSLicense)" set hostInfo "Host Name: $setupVals(hostName)" set idInfo "Host ID $idType: $setupVals(hostId)" if { [isGUImode] } { set ctrlVals(volatileFrm) [list \ [list label -name message1 \ -title [strTableGet DBQUERY_MSG_1] \ -x 99 -y 10 -w 197 -h 20] \ [list label -name licInfo \ -title $licInfo \ -x 99 -y 30 -w 190 -h 10] \ [list label -name hostInfo \ -title $hostInfo \ -x 99 -y 40 -w 190 -h 10] \ [list label -name idInfo \ -title $idInfo \ -x 99 -y 50 -w 190 -h 10] \ [list label -name message3 \ -title [strTableGet DBQUERY_MSG_2] \ -x 99 -y 80 -w 195 -h 35] \ [list choice -name grant -auto \ -title [strTableGet DBQUERY_GRANT] \ -x 99 -y 120 -w 190 -h 10 \ -callback onGrant] \ [list choice -name denied -auto \ -title [strTableGet DBQUERY_DENIED] \ -x 99 -y 130 -w 190 -h 10 \ -callback onDenied] \ [list label -name message4 \ -title [strTableGet DBQUERY_STATEMENT] \ -x 99 -y 145 -w 195 -h 20] ] if {$setupVals(lmInstType) == "nodeLocked" && ![isUnix]} { lappend ctrlVals(volatileFrm) \ [list boolean -name vsnChkBox \ -auto \ -title "Use Disk Serial Number for host ID" \ -x 110 -y 62 -w 130 -h 10 \ -callback onSerial] lappend ctrlVals(volatileFrm) \ [list button -name "vsn_details" \ -title "Details..." \ -x 250 -y 60 -w 40 -h 12 \ -callback onVsnDetails] } set w [dlgFrmCreate [strTableGet DBQUERY_TITLE]] controlValuesSet $w.nextButt "&Next >" controlEnable $w.backButt 1 controlEnable $w.nextButt 1 controlEnable $w.cancelButt 1 controlEnable $w.helpButt 1 if { [isTornadoProduct] } { controlEnable $w.helpButt 1 } else { controlEnable $w.helpButt 0 } controlCheckSet $w.grant 1 # test automation if { $ctrlVals(useInputScript) } { autoSetupLog "Database Query Permission Page: skipped" autoSetupLog "\tDB Permission: $setupVals(dbQueryOptions)" nextCallback } } else { # TEXT mode printPageTitle [strTableGet DBQUERY_TITLE] puts [strTableGet DBQUERY_MSG_1] puts "\n$info\n" puts "[strTableGet DBQUERY_MSG_2]\n" puts "[strTableGet DBQUERY_STATEMENT]\n" puts "Choose 1 - [strTableGet DBQUERY_GRANT]\n" puts " 2 - [strTableGet DBQUERY_DENIED]\n" set loop 1 while { $loop == 1} { set ret [prompt "Please enter the number of your selection. \[1\]"] switch -regexp -- $ret { "1" { onGrant nextCallback return 0 } "2" { onDenied nextCallback return 0 } "^-$" { backCallback return 0 } "[eE][xX][iI][tT]" { return 0 } "^$" { onGrant nextCallback return 0 } default { } } } } }############################################################################### pageProcess(dbQuery) - process inputs from dbQuery page ## This procedure will process inputs from dbQueru page## SYNOPSIS# .tS# pageProcess(dbQuery)# .tE## PARAMETERS: N/A## RETURNS: 1 when successful## ERRORS: N/A#proc pageProcess(dbQuery) {} { global setupVals lmVals ctrlVals global licInfoRetVal setupPageList # zero out values that are volatile lmValsInit switch $setupVals(dbQueryOptions) { onGrant { if { [isGUImode] } { # get license information set licInfoRetVal 0 while { $licInfoRetVal == 0 } { # Error occur and retry licInfoGetAllDlgCreate } # Error occur but don't retry # XXXX Need more work here... XXX if {$licInfoRetVal == 1} { # have to remove original pageList otherwise page # order will be wrong if { $setupPageList(currPageGrp) == "autoInst" } { pageListRemove "autoInst" return [calcPage lmInstOptions] } elseif { $setupVals(lmInstType) == "nodeLocked" } { pageListRemove "nodeLock" return [calcPage lmInstOptions] } else { # endUser set outFile "" if { [isUnix] } { set outFile "[destDirGet]/endUserInfo.txt" } else { set outFile "[destDirGet]\\endUserInfo.txt" } messageBox "[strTableGet DBQUERY_ERROR]\n\ \nThe information will be written to\ $outFile for your convenience.\n" if { ![catch {open $outFile "w"} outFile] } { puts $outFile [strTableGet DBQUERY_ERROR] } else { puts "ERROR writing to file: $outFile" } close $outFile set setupVals(cancel) 1 applicationExit } } } else { # TEXT MODE # get license information set licInfoRetVal 0 while { $licInfoRetVal == 0 } { # An error occurred, and retry by user licInfoGetAllCallBack } if { $licInfoRetVal == 1 } { backCallback } } if { $licInfoRetVal != 1 } { if { $setupVals(lmInstType) == "endUser" } { pageListAdd endUser } } } onDenied { # if lmInstOptions page exists, we are doing floating license # For LM Install and nodelock, SETUP should return to lmInstOptions. if { $setupPageList(currPageGrp) == "autoInst" || $setupVals(lmInstType) == "nodeLocked" } { if { $setupPageList(currPageGrp) == "autoInst" } { pageListRemove "autoInst" } else { pageListRemove "nodeLock" } # Return to lmInstOptions page and set to email option set setupVals(lmInstOptions) "onEmail" # return to the lmInstOptions page return [calcPage lmInstOptions]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -