Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5041 lines
137 KiB

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frmMain
  5. Caption = "HSC Production Tool"
  6. ClientHeight = 8670
  7. ClientLeft = 165
  8. ClientTop = 855
  9. ClientWidth = 11895
  10. Icon = "frmMain.frx":0000
  11. LinkTopic = "Form1"
  12. ScaleHeight = 8670
  13. ScaleWidth = 11895
  14. StartUpPosition = 3 'Windows Default
  15. Begin VB.ComboBox cboNavModel
  16. Height = 315
  17. Left = 8280
  18. Style = 2 'Dropdown List
  19. TabIndex = 5
  20. Top = 0
  21. Width = 1575
  22. End
  23. Begin VB.CommandButton cmdEditEntry
  24. Caption = "Edit"
  25. Height = 255
  26. Left = 11160
  27. TabIndex = 23
  28. Top = 2520
  29. Width = 615
  30. End
  31. Begin VB.TextBox txtEntry
  32. Height = 285
  33. Left = 6960
  34. TabIndex = 22
  35. Tag = "1"
  36. Top = 2520
  37. Width = 4095
  38. End
  39. Begin VB.CommandButton cmdURI
  40. Caption = "..."
  41. Height = 255
  42. Left = 11400
  43. TabIndex = 16
  44. Top = 1440
  45. Width = 375
  46. End
  47. Begin VB.CheckBox chkSubSite
  48. Caption = "Su&bSite"
  49. Height = 255
  50. Left = 6480
  51. TabIndex = 3
  52. Top = 0
  53. Width = 855
  54. End
  55. Begin VB.TextBox txtIconURI
  56. Height = 285
  57. Left = 6960
  58. TabIndex = 18
  59. Tag = "1"
  60. Top = 1800
  61. Width = 4815
  62. End
  63. Begin VB.Timer tmrRefresh
  64. Interval = 18000
  65. Left = 4320
  66. Top = 0
  67. End
  68. Begin VB.CheckBox chkVisible
  69. Caption = "&Visible"
  70. Height = 255
  71. Left = 5640
  72. TabIndex = 2
  73. Top = 0
  74. Width = 855
  75. End
  76. Begin VB.ComboBox cboLocInclude
  77. Height = 315
  78. Left = 10800
  79. TabIndex = 7
  80. Text = "cboLocInclude"
  81. Top = 0
  82. Width = 975
  83. End
  84. Begin VB.ComboBox cboNavigateLink
  85. Height = 315
  86. Left = 9360
  87. Style = 2 'Dropdown List
  88. TabIndex = 25
  89. Top = 3000
  90. Width = 1935
  91. End
  92. Begin VB.ComboBox cboKeywords
  93. Height = 1935
  94. ItemData = "frmMain.frx":212A
  95. Left = 5640
  96. List = "frmMain.frx":212C
  97. Sorted = -1 'True
  98. Style = 1 'Simple Combo
  99. TabIndex = 39
  100. Tag = "1"
  101. Top = 5520
  102. Width = 6135
  103. End
  104. Begin VB.CommandButton cmdNavigateLink
  105. Caption = "Go"
  106. Height = 375
  107. Left = 11400
  108. TabIndex = 26
  109. Top = 3000
  110. Width = 375
  111. End
  112. Begin VB.Timer tmrScrollDuringDrag
  113. Left = 3960
  114. Top = 0
  115. End
  116. Begin MSComctlLib.StatusBar staInfo
  117. Align = 2 'Align Bottom
  118. Height = 375
  119. Left = 0
  120. TabIndex = 47
  121. Tag = "1"
  122. Top = 8295
  123. Width = 11895
  124. _ExtentX = 20981
  125. _ExtentY = 661
  126. _Version = 393216
  127. BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
  128. NumPanels = 3
  129. BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
  130. AutoSize = 1
  131. Object.Width = 8440
  132. MinWidth = 1270
  133. EndProperty
  134. BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
  135. AutoSize = 1
  136. Object.Width = 8440
  137. MinWidth = 1270
  138. EndProperty
  139. BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
  140. Object.Width = 3528
  141. MinWidth = 3528
  142. EndProperty
  143. EndProperty
  144. End
  145. Begin VB.CommandButton cmdRefresh
  146. Caption = "Refresh"
  147. Height = 375
  148. Left = 4080
  149. TabIndex = 43
  150. Top = 7800
  151. Width = 1215
  152. End
  153. Begin VB.CommandButton cmdAddRemove
  154. Caption = "&Add/Remove Keywords ..."
  155. Height = 375
  156. Left = 8880
  157. TabIndex = 37
  158. Top = 5040
  159. Width = 2895
  160. End
  161. Begin VB.CommandButton cmdCreateLeaf
  162. Caption = "Create Topic"
  163. Height = 375
  164. Left = 1440
  165. TabIndex = 41
  166. Top = 7800
  167. Width = 1215
  168. End
  169. Begin MSComctlLib.ImageList ilsIcons
  170. Left = 3360
  171. Top = 0
  172. _ExtentX = 1005
  173. _ExtentY = 1005
  174. BackColor = -2147483643
  175. ImageWidth = 16
  176. ImageHeight = 16
  177. MaskColor = 16776960
  178. _Version = 393216
  179. BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
  180. NumListImages = 6
  181. BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
  182. Picture = "frmMain.frx":212E
  183. Key = ""
  184. EndProperty
  185. BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
  186. Picture = "frmMain.frx":2240
  187. Key = ""
  188. EndProperty
  189. BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
  190. Picture = "frmMain.frx":2352
  191. Key = ""
  192. EndProperty
  193. BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
  194. Picture = "frmMain.frx":2464
  195. Key = ""
  196. EndProperty
  197. BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
  198. Picture = "frmMain.frx":2576
  199. Key = ""
  200. EndProperty
  201. BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
  202. Picture = "frmMain.frx":2688
  203. Key = ""
  204. EndProperty
  205. EndProperty
  206. End
  207. Begin VB.CommandButton cmdDelete
  208. Caption = "Delete"
  209. Height = 375
  210. Left = 2760
  211. TabIndex = 42
  212. Top = 7800
  213. Width = 1215
  214. End
  215. Begin VB.CommandButton cmdCreateGroup
  216. Caption = "Create Node"
  217. Height = 375
  218. Left = 120
  219. TabIndex = 40
  220. Top = 7800
  221. Width = 1215
  222. End
  223. Begin MSComDlg.CommonDialog dlgCommon
  224. Left = 2880
  225. Top = 0
  226. _ExtentX = 847
  227. _ExtentY = 847
  228. _Version = 393216
  229. End
  230. Begin VB.CommandButton cmdCancel
  231. Caption = "Cancel"
  232. Height = 375
  233. Left = 10560
  234. TabIndex = 46
  235. Top = 7800
  236. Width = 1215
  237. End
  238. Begin VB.CommandButton cmdSave
  239. Caption = "Save"
  240. Height = 375
  241. Left = 9240
  242. TabIndex = 45
  243. Top = 7800
  244. Width = 1215
  245. End
  246. Begin VB.ComboBox cboType
  247. Height = 315
  248. Left = 6960
  249. Style = 2 'Dropdown List
  250. TabIndex = 13
  251. Top = 1080
  252. Width = 4815
  253. End
  254. Begin VB.TextBox txtURI
  255. Height = 285
  256. Left = 6960
  257. TabIndex = 15
  258. Tag = "1"
  259. Top = 1440
  260. Width = 4335
  261. End
  262. Begin VB.TextBox txtDescription
  263. Height = 285
  264. Left = 6960
  265. TabIndex = 11
  266. Tag = "1"
  267. Top = 720
  268. Width = 4815
  269. End
  270. Begin VB.TextBox txtTitle
  271. Height = 285
  272. Left = 6960
  273. TabIndex = 9
  274. Tag = "1"
  275. Top = 360
  276. Width = 4815
  277. End
  278. Begin MSComctlLib.TreeView treTaxonomy
  279. Height = 7335
  280. Left = 120
  281. TabIndex = 1
  282. Tag = "1"
  283. Top = 360
  284. Width = 5415
  285. _ExtentX = 9551
  286. _ExtentY = 12938
  287. _Version = 393217
  288. Indentation = 529
  289. Style = 7
  290. Appearance = 1
  291. End
  292. Begin VB.Frame fraSKU
  293. Caption = "&SKU"
  294. Height = 1575
  295. Left = 5640
  296. TabIndex = 27
  297. Top = 3360
  298. Width = 6135
  299. Begin VB.CheckBox chkWindowsMillennium
  300. Caption = "Windows Me"
  301. Height = 255
  302. Left = 240
  303. TabIndex = 28
  304. Top = 240
  305. Width = 1695
  306. End
  307. Begin VB.CheckBox chkDataCenterServer64
  308. Caption = "64-bit Datacenter Server"
  309. Height = 255
  310. Left = 3120
  311. TabIndex = 36
  312. Top = 1200
  313. Width = 2055
  314. End
  315. Begin VB.CheckBox chkAdvancedServer64
  316. Caption = "64-bit Advanced Server"
  317. Height = 255
  318. Left = 3120
  319. TabIndex = 34
  320. Top = 720
  321. Width = 2055
  322. End
  323. Begin VB.CheckBox chkProfessional64
  324. Caption = "64-bit Professional"
  325. Height = 255
  326. Left = 240
  327. TabIndex = 31
  328. Top = 960
  329. Width = 1695
  330. End
  331. Begin VB.CheckBox chkDataCenterServer
  332. Caption = "32-bit Datacenter Server"
  333. Height = 255
  334. Left = 3120
  335. TabIndex = 35
  336. Top = 960
  337. Width = 2055
  338. End
  339. Begin VB.CheckBox chkAdvancedServer
  340. Caption = "32-bit Advanced Server"
  341. Height = 255
  342. Left = 3120
  343. TabIndex = 33
  344. Top = 480
  345. Width = 2055
  346. End
  347. Begin VB.CheckBox chkServer
  348. Caption = "32-bit Server"
  349. Height = 255
  350. Left = 3120
  351. TabIndex = 32
  352. Top = 240
  353. Width = 2055
  354. End
  355. Begin VB.CheckBox chkProfessional
  356. Caption = "32-bit Professional"
  357. Height = 255
  358. Left = 240
  359. TabIndex = 30
  360. Top = 720
  361. Width = 1695
  362. End
  363. Begin VB.CheckBox chkStandard
  364. Caption = "32-bit Personal"
  365. Height = 255
  366. Left = 240
  367. TabIndex = 29
  368. Top = 480
  369. Width = 1695
  370. End
  371. End
  372. Begin VB.TextBox txtComments
  373. Height = 285
  374. Left = 6960
  375. TabIndex = 20
  376. Tag = "1"
  377. Top = 2160
  378. Width = 4815
  379. End
  380. Begin VB.Label lblNavModel
  381. Caption = "Nav Model:"
  382. Height = 255
  383. Left = 7440
  384. TabIndex = 4
  385. Top = 0
  386. Width = 855
  387. End
  388. Begin VB.Label lblEntry
  389. Caption = "Entry:"
  390. Height = 255
  391. Left = 5640
  392. TabIndex = 21
  393. Top = 2520
  394. Width = 1215
  395. End
  396. Begin VB.Label lblLastModified
  397. BorderStyle = 1 'Fixed Single
  398. Height = 375
  399. Left = 5400
  400. TabIndex = 44
  401. Top = 7800
  402. Width = 3735
  403. End
  404. Begin VB.Label lblIconURI
  405. Caption = "Ico&n URI:"
  406. Height = 255
  407. Left = 5640
  408. TabIndex = 17
  409. Top = 1800
  410. Width = 1215
  411. End
  412. Begin VB.Label lblLocInclude
  413. Caption = "&Loc. Incl:"
  414. Height = 255
  415. Left = 9960
  416. TabIndex = 6
  417. Top = 0
  418. Width = 735
  419. End
  420. Begin VB.Label lblNavigateLink
  421. Caption = "Vie&w Topic:"
  422. Height = 255
  423. Left = 8400
  424. TabIndex = 24
  425. Top = 3000
  426. Width = 855
  427. End
  428. Begin VB.Label lblComments
  429. Caption = "&Comments:"
  430. Height = 255
  431. Left = 5640
  432. TabIndex = 19
  433. Top = 2160
  434. Width = 1215
  435. End
  436. Begin VB.Label lblKeywords
  437. Caption = "&Keywords associated with selected Node:"
  438. Height = 255
  439. Left = 5640
  440. TabIndex = 38
  441. Top = 5160
  442. Width = 3135
  443. End
  444. Begin VB.Label lblURI
  445. Caption = "&URI of the topic:"
  446. Height = 255
  447. Left = 5640
  448. TabIndex = 14
  449. Top = 1440
  450. Width = 1215
  451. End
  452. Begin VB.Label lblType
  453. Caption = "Ty&pe:"
  454. Height = 255
  455. Left = 5640
  456. TabIndex = 12
  457. Top = 1080
  458. Width = 1215
  459. End
  460. Begin VB.Label lblDescription
  461. Caption = "&Description:"
  462. Height = 255
  463. Left = 5640
  464. TabIndex = 10
  465. Top = 720
  466. Width = 1215
  467. End
  468. Begin VB.Label lblTitle
  469. Caption = "* T&itle:"
  470. Height = 255
  471. Left = 5640
  472. TabIndex = 8
  473. Top = 360
  474. Width = 1215
  475. End
  476. Begin VB.Label lblTaxonomy
  477. Caption = "&Taxonomy tree (including topics):"
  478. Height = 255
  479. Left = 120
  480. TabIndex = 0
  481. Top = 120
  482. Width = 2775
  483. End
  484. Begin VB.Menu mnuFile
  485. Caption = "&File"
  486. Begin VB.Menu mnuFileOpenDatabase
  487. Caption = "Open Database..."
  488. End
  489. Begin VB.Menu mnuFileExportHHT
  490. Caption = "Archive authoring group changes..."
  491. End
  492. Begin VB.Menu mnuFileImportHHT
  493. Caption = "Restore authoring group changes..."
  494. End
  495. Begin VB.Menu mnuSeparator0
  496. Caption = "-"
  497. End
  498. Begin VB.Menu mnuFileExit
  499. Caption = "Exit"
  500. End
  501. End
  502. Begin VB.Menu mnuEdit
  503. Caption = "&Edit"
  504. Begin VB.Menu mnuEditStopSigns
  505. Caption = "Stop Signs..."
  506. End
  507. Begin VB.Menu mnuEditStopWords
  508. Caption = "Stop Words..."
  509. End
  510. Begin VB.Menu mnuEditKeywords
  511. Caption = "Keywords..."
  512. End
  513. Begin VB.Menu mnuEditSynonymSets
  514. Caption = "Synonym Sets..."
  515. End
  516. Begin VB.Menu mnuSeparator1
  517. Caption = "-"
  518. End
  519. Begin VB.Menu mnuEditFind
  520. Caption = "Find..."
  521. Shortcut = ^F
  522. End
  523. Begin VB.Menu mnuEditCopy
  524. Caption = "Copy"
  525. Shortcut = ^Y
  526. End
  527. Begin VB.Menu mnuEditCut
  528. Caption = "Cut"
  529. Shortcut = ^T
  530. End
  531. Begin VB.Menu mnuEditPaste
  532. Caption = "Paste"
  533. Shortcut = ^P
  534. End
  535. Begin VB.Menu mnuSeparator2
  536. Caption = "-"
  537. End
  538. Begin VB.Menu mnuEditCopyKeywords
  539. Caption = "Copy Keywords"
  540. Shortcut = ^K
  541. End
  542. Begin VB.Menu mnuEditPasteKeywords
  543. Caption = "Paste Keywords"
  544. Shortcut = ^L
  545. End
  546. End
  547. Begin VB.Menu mnuTools
  548. Caption = "T&ools"
  549. Begin VB.Menu mnuToolsCreateHHTandCAB
  550. Caption = "Create HHT and CAB..."
  551. End
  552. Begin VB.Menu mnuToolsFilterBySKU
  553. Caption = "Filter by SKU..."
  554. End
  555. Begin VB.Menu mnuToolsImporter
  556. Caption = "Importer..."
  557. End
  558. Begin VB.Menu mnuToolsParameters
  559. Caption = "Parameters..."
  560. End
  561. Begin VB.Menu mnuToolsPropagateKeywords
  562. Caption = "Propagate Keywords"
  563. End
  564. Begin VB.Menu mnuToolsSetFont
  565. Caption = "Set Font..."
  566. End
  567. End
  568. Begin VB.Menu mnuHelp
  569. Caption = "&Help"
  570. Begin VB.Menu mnuHelpContents
  571. Caption = "Contents..."
  572. End
  573. Begin VB.Menu mnuSeparator3
  574. Caption = "-"
  575. End
  576. Begin VB.Menu mnuHelpAbout
  577. Caption = "About..."
  578. End
  579. End
  580. Begin VB.Menu mnuRightClick
  581. Caption = "RightClick"
  582. Visible = 0 'False
  583. Begin VB.Menu mnuRightClickCopy
  584. Caption = "Copy"
  585. End
  586. Begin VB.Menu mnuRightClickCut
  587. Caption = "Cut"
  588. End
  589. Begin VB.Menu mnuRightClickPaste
  590. Caption = "Paste"
  591. End
  592. Begin VB.Menu mnuSeparator4
  593. Caption = "-"
  594. End
  595. Begin VB.Menu mnuRightClickCopyKeywords
  596. Caption = "Copy Keywords"
  597. End
  598. Begin VB.Menu mnuRightClickPasteKeywords
  599. Caption = "Paste Keywords"
  600. End
  601. Begin VB.Menu mnuSeparator5
  602. Caption = "-"
  603. End
  604. Begin VB.Menu mnuRightClickCreateNode
  605. Caption = "Create Node"
  606. End
  607. Begin VB.Menu mnuRightClickCreateTopic
  608. Caption = "Create Topic"
  609. End
  610. Begin VB.Menu mnuRightClickDelete
  611. Caption = "Delete"
  612. End
  613. Begin VB.Menu mnuSeparator6
  614. Caption = "-"
  615. End
  616. Begin VB.Menu mnuRightClickKeywordify
  617. Caption = "Create Keywords from Titles"
  618. End
  619. Begin VB.Menu mnuRightClickExport
  620. Caption = "Archive authoring group changes..."
  621. End
  622. End
  623. Begin VB.Menu mnuMove
  624. Caption = "Move"
  625. Visible = 0 'False
  626. Begin VB.Menu mnuMoveAbove
  627. Caption = "Move Above"
  628. End
  629. Begin VB.Menu mnuMoveBelow
  630. Caption = "Move Below"
  631. End
  632. Begin VB.Menu mnuMoveInside
  633. Caption = "Move Inside"
  634. End
  635. End
  636. Begin VB.Menu mnuTest
  637. Caption = "Test"
  638. Visible = 0 'False
  639. End
  640. End
  641. Attribute VB_Name = "frmMain"
  642. Attribute VB_GlobalNameSpace = False
  643. Attribute VB_Creatable = False
  644. Attribute VB_PredeclaredId = True
  645. Attribute VB_Exposed = False
  646. Option Explicit
  647. Private WithEvents p_clsTaxonomy As AuthDatabase.Taxonomy
  648. Attribute p_clsTaxonomy.VB_VarHelpID = -1
  649. Private WithEvents p_clsHHT As AuthDatabase.HHT
  650. Attribute p_clsHHT.VB_VarHelpID = -1
  651. Private p_clsKeywords As AuthDatabase.Keywords
  652. Private p_clsParameters As AuthDatabase.Parameters
  653. Private p_clsSizer As Sizer
  654. Private p_colKeywords As Collection
  655. Private p_dictKeywordsWithTitle As Scripting.Dictionary
  656. Private p_intAuthoringGroup As Long
  657. Private p_blnDatabaseOpen As Boolean
  658. Private p_nodeMouseDown As Node
  659. Private p_blnCtrlMouseDown As Boolean
  660. Private p_nodeCopied As Node
  661. Private p_nodeCut As Node
  662. Private p_blnScrollUp As Boolean
  663. Private p_DOMNode As MSXML2.IXMLDOMNode
  664. Private p_blnAddRemoveKeywordsOpen As Boolean
  665. Private p_strKeywords As String
  666. Private p_blnNoHHTStatus As Boolean
  667. Private p_enumFilterSKUs As SKU_E
  668. Private p_blnCreating As Boolean
  669. Private p_blnUpdating As Boolean
  670. Private p_blnDragging As Boolean
  671. Private p_blnSettingControls As Boolean
  672. Private Const KEY_PREFIX_C As String = "TID"
  673. Private Const CREATE_KEY_C As String = "Node being created"
  674. Private Const MODIFY_KEY_C As String = "Node being modified"
  675. Private Const MDB_FILE_FILTER_C As String = "Microsoft Access Files (*.mdb)|*.mdb"
  676. Private Const XML_FILE_FILTER_C As String = "XML Files (*.xml)|*.xml"
  677. Private Const HELP_FILE_NAME_C As String = "Hsc.chm"
  678. Private Const HELP_EXE_C As String = "hh.exe"
  679. Private Enum STATUS_BAR_PANEL_E
  680. SBPANEL_DATABASE = 1
  681. SBPANEL_OTHER = 2
  682. SBPANEL_MODE = 3
  683. End Enum
  684. Private Declare Function SendMessage Lib "user32" Alias _
  685. "SendMessageA" ( _
  686. ByVal hwnd As Long, _
  687. ByVal wMsg As Long, _
  688. ByVal wParam As Long, _
  689. lParam As Any _
  690. ) As Long
  691. Private Enum IMAGE_E
  692. IMAGE_LEAF_E = 1
  693. IMAGE_GROUP_E = 2
  694. IMAGE_BAD_LEAF_E = 3
  695. IMAGE_BAD_GROUP_E = 4
  696. IMAGE_FOREIGN_LEAF_E = 5
  697. IMAGE_FOREIGN_GROUP_E = 6
  698. End Enum
  699. ' Usage of a Node's Key and Tag:
  700. ' If a Taxonomy Node's TID is 8, then Key is TID8. Tag is its DOM Node.
  701. ' For a node being modified, Key is MODIFY_KEY_C.
  702. ' For a node under construction, Key is CREATE_KEY_C. Tag is the parent's DOM Node.
  703. ' A gotcha: You need to use CStr in p_colKeywords(CStr(intKID)).
  704. ' Otherwise, you will simply get the intKID'th keyword, not one with intKID as key.
  705. Private Sub Form_Load()
  706. SetLogFile
  707. Set g_AuthDatabase = New AuthDatabase.Main
  708. Set g_ErrorInfo = New CErrorInfo
  709. Set p_clsTaxonomy = g_AuthDatabase.Taxonomy
  710. Set p_clsHHT = g_AuthDatabase.HHT
  711. Set p_clsKeywords = g_AuthDatabase.Keywords
  712. Set p_clsParameters = g_AuthDatabase.Parameters
  713. Set p_clsSizer = New Sizer
  714. Set p_colKeywords = New Collection
  715. Set p_dictKeywordsWithTitle = New Scripting.Dictionary
  716. Set p_nodeMouseDown = Nothing
  717. Set p_nodeCopied = Nothing
  718. Set p_nodeCut = Nothing
  719. Set p_DOMNode = Nothing
  720. p_blnCtrlMouseDown = False
  721. p_blnAddRemoveKeywordsOpen = False
  722. tmrScrollDuringDrag.Enabled = False
  723. tmrScrollDuringDrag.Interval = 20
  724. PopulateCboWithSKUs cboNavigateLink
  725. p_InitializeLocIncludeCombo
  726. p_InitializeNavModelCombo
  727. p_enumFilterSKUs = ALL_SKUS_C
  728. p_StrikeoutUnselectedSKUs
  729. p_blnCreating = False
  730. p_blnUpdating = False
  731. p_blnDragging = False
  732. p_blnSettingControls = False
  733. ' The user needs to open a database first
  734. p_DisableEverything
  735. p_InitializeTaxonomyTree
  736. p_SetToolTips
  737. End Sub
  738. Private Sub Form_Unload(Cancel As Integer)
  739. Set g_AuthDatabase = Nothing
  740. Set g_ErrorInfo = Nothing
  741. Set g_Font = Nothing
  742. Set p_clsTaxonomy = Nothing
  743. Set p_clsHHT = Nothing
  744. Set p_clsKeywords = Nothing
  745. Set p_clsParameters = Nothing
  746. Set p_clsSizer = Nothing
  747. Set p_colKeywords = Nothing
  748. Set p_dictKeywordsWithTitle = Nothing
  749. Set p_nodeMouseDown = Nothing
  750. Set p_nodeCopied = Nothing
  751. Set p_nodeCut = Nothing
  752. Set p_DOMNode = Nothing
  753. AddRemoveKeywordsFormGoingAway
  754. Unload frmAddRemoveKeywords
  755. Unload frmFind
  756. Unload frmImporter
  757. End Sub
  758. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  759. If (p_blnCreating Or p_blnUpdating) Then
  760. MsgBox "You are in the middle of creating or updating an entry. " & _
  761. "Please finish or cancel first.", vbOKOnly
  762. Cancel = True
  763. End If
  764. End Sub
  765. Private Sub Form_Activate()
  766. On Error GoTo LErrorHandler
  767. p_SetSizingInfo
  768. Exit Sub
  769. LErrorHandler:
  770. g_ErrorInfo.SetInfoAndDump "Form_Activate"
  771. End Sub
  772. Private Sub Form_Resize()
  773. On Error GoTo LErrorHandler
  774. p_clsSizer.Resize
  775. Exit Sub
  776. LErrorHandler:
  777. g_ErrorInfo.SetInfoAndDump "Form_Resize"
  778. End Sub
  779. Private Sub mnuFileOpenDatabase_Click()
  780. Dim strDatabase As String
  781. On Error GoTo LErrorHandler
  782. dlgCommon.CancelError = True
  783. dlgCommon.Flags = cdlOFNHideReadOnly
  784. dlgCommon.Filter = MDB_FILE_FILTER_C
  785. dlgCommon.ShowOpen
  786. strDatabase = dlgCommon.FileName
  787. g_AuthDatabase.SetDatabase strDatabase
  788. p_SetTitle strDatabase
  789. cmdRefresh_Click
  790. ' Clear the cached list of all keywords from the old database
  791. AddRemoveKeywordsFormGoingAway
  792. Unload frmAddRemoveKeywords
  793. ' frmImporter may have an HHK with KIDs from the old database
  794. ' associated with Taxonomy entries.
  795. Unload frmImporter
  796. p_blnDatabaseOpen = True
  797. LEnd:
  798. Exit Sub
  799. LErrorHandler:
  800. Select Case Err.Number
  801. Case cdlCancel
  802. ' Nothing. The user cancelled.
  803. Case errDatabaseVersionIncompatible
  804. p_blnDatabaseOpen = False
  805. DisplayDatabaseVersionError
  806. Case errAuthoringGroupNotPresent
  807. p_blnDatabaseOpen = False
  808. DisplayAuthoringGroupError
  809. Case Else
  810. p_blnDatabaseOpen = False
  811. g_ErrorInfo.SetInfoAndDump "mnuFileOpenDatabase_Click"
  812. End Select
  813. GoTo LEnd
  814. End Sub
  815. Private Sub mnuTest_Click()
  816. Dim clsImporter As AuthDatabase.Importer
  817. Set clsImporter = g_AuthDatabase.Importer
  818. clsImporter.ImportHHK "\\srvua\Latest\HelpDirs\SRV\Help\HHK\suptools.hhk", _
  819. "\\srvua\Latest\HelpDirs\SRV\Help", SKU_SERVER_E, HELPDIR_HELP_MSITS_E, "", 2
  820. End Sub
  821. Private Sub mnuToolsSetFont_Click()
  822. On Error GoTo LErrorHandler
  823. dlgCommon.CancelError = True
  824. dlgCommon.Flags = cdlCFBoth Or cdlCFEffects
  825. dlgCommon.ShowFont
  826. Set g_Font = New StdFont
  827. g_Font.Name = dlgCommon.FontName
  828. g_Font.Size = dlgCommon.FontSize
  829. g_Font.Bold = dlgCommon.FontBold
  830. g_Font.Italic = dlgCommon.FontItalic
  831. g_Font.Underline = dlgCommon.FontUnderline
  832. g_Font.Strikethrough = dlgCommon.FontStrikethru
  833. g_intFontColor = dlgCommon.Color
  834. SetFontInternal Me
  835. Exit Sub
  836. LErrorHandler:
  837. ' User pressed Cancel button.
  838. Exit Sub
  839. End Sub
  840. Private Sub mnuFileExportHHT_Click()
  841. Dim DOMNode As MSXML2.IXMLDOMNode
  842. Set DOMNode = treTaxonomy.Nodes(KEY_PREFIX_C & ROOT_TID_C).Tag
  843. p_ExportHHT DOMNode
  844. End Sub
  845. Private Sub mnuFileImportHHT_Click()
  846. On Error GoTo LErrorHandler
  847. Dim strFileName As String
  848. Dim Response As VbMsgBoxResult
  849. Response = MsgBox("Are you sure that you want to do this? " & _
  850. "This operation could create a lot of new Nodes and Topics " & _
  851. "throughout the Taxonomy tree.", _
  852. vbOKCancel + vbDefaultButton2 + vbExclamation)
  853. If (Response <> vbOK) Then
  854. Exit Sub
  855. End If
  856. dlgCommon.CancelError = True
  857. dlgCommon.Flags = cdlOFNHideReadOnly
  858. dlgCommon.Filter = XML_FILE_FILTER_C
  859. dlgCommon.ShowOpen
  860. strFileName = dlgCommon.FileName
  861. Me.Enabled = False
  862. p_clsHHT.ImportHHT strFileName
  863. cmdRefresh_Click
  864. LEnd:
  865. Me.Enabled = True
  866. Exit Sub
  867. LErrorHandler:
  868. Select Case Err.Number
  869. Case cdlCancel
  870. ' Nothing. The user cancelled.
  871. Case errDatabaseVersionIncompatible
  872. DisplayDatabaseVersionError
  873. Case errAuthoringGroupNotPresent
  874. DisplayAuthoringGroupError
  875. Case Else
  876. g_ErrorInfo.SetInfoAndDump "mnuFileImportHHT_Click"
  877. End Select
  878. GoTo LEnd
  879. End Sub
  880. Private Sub mnuFileExit_Click()
  881. Unload Me
  882. End Sub
  883. Private Sub mnuEditFind_Click()
  884. On Error GoTo LErrorHandler
  885. frmFind.Show vbModeless
  886. Exit Sub
  887. LErrorHandler:
  888. g_ErrorInfo.SetInfoAndDump "mnuEditFind_Click"
  889. End Sub
  890. Private Sub mnuEditCopy_Click()
  891. On Error GoTo LErrorHandler
  892. Set p_nodeCopied = treTaxonomy.SelectedItem
  893. Set p_nodeCut = Nothing
  894. Exit Sub
  895. LErrorHandler:
  896. g_ErrorInfo.SetInfoAndDump "mnuEditCopy_Click"
  897. End Sub
  898. Private Sub mnuEditCut_Click()
  899. On Error GoTo LErrorHandler
  900. Set p_nodeCut = treTaxonomy.SelectedItem
  901. Set p_nodeCopied = Nothing
  902. Exit Sub
  903. LErrorHandler:
  904. g_ErrorInfo.SetInfoAndDump "mnuEditCut_Click"
  905. End Sub
  906. Private Sub mnuEditPaste_Click()
  907. On Error GoTo LErrorHandler
  908. If (Not p_nodeCopied Is Nothing) Then
  909. p_CreateTaxonomyEntries p_nodeCopied.Tag, treTaxonomy.SelectedItem, True
  910. ElseIf (Not p_nodeCut Is Nothing) Then
  911. p_ChangeParent p_nodeCut, treTaxonomy.SelectedItem
  912. Set p_nodeCut = Nothing
  913. p_DisableEditPaste
  914. End If
  915. Exit Sub
  916. LErrorHandler:
  917. g_ErrorInfo.SetInfoAndDump "mnuEditPaste_Click"
  918. End Sub
  919. Private Sub mnuEditCopyKeywords_Click()
  920. On Error GoTo LErrorHandler
  921. p_strKeywords = XMLGetAttribute(treTaxonomy.SelectedItem.Tag, HHT_keywords_C)
  922. p_EnableEditPasteKeywords
  923. Exit Sub
  924. LErrorHandler:
  925. g_ErrorInfo.SetInfoAndDump "mnuEditCopyKeywords_Click"
  926. End Sub
  927. Private Sub mnuEditPasteKeywords_Click()
  928. On Error Resume Next
  929. Dim Node As Node
  930. Dim blnDisableEditPasteKeywords As Boolean
  931. Dim intTID As Long
  932. If (p_blnCreating Or p_blnUpdating) Then
  933. MsgBox "You are in the middle of creating or updating an entry. " & _
  934. "Please finish or cancel first.", vbOKOnly
  935. Exit Sub
  936. End If
  937. blnDisableEditPasteKeywords = True
  938. For Each Node In treTaxonomy.Nodes
  939. If Node.Checked Then
  940. Err.Clear
  941. p_SetKeywords Node.Tag
  942. If (Err.Number <> 0) Then
  943. blnDisableEditPasteKeywords = False
  944. Err.Clear
  945. Else
  946. Node.Checked = False
  947. End If
  948. End If
  949. Next
  950. If (blnDisableEditPasteKeywords) Then
  951. p_DisableEditPasteKeywords
  952. p_strKeywords = ""
  953. Else
  954. MsgBox "Not all Nodes/Topics could be updated.", vbOKOnly
  955. End If
  956. intTID = XMLGetAttribute(treTaxonomy.SelectedItem.Tag, HHT_tid_C)
  957. ' The UI must show the new keywords that were associated.
  958. Highlight intTID
  959. End Sub
  960. Private Sub mnuEditStopSigns_Click()
  961. frmStopSigns.Show vbModal
  962. End Sub
  963. Private Sub mnuEditStopWords_Click()
  964. frmStopWords.Show vbModal
  965. End Sub
  966. Private Sub mnuEditKeywords_Click()
  967. frmKeywords.Show vbModal
  968. End Sub
  969. Private Sub mnuEditSynonymSets_Click()
  970. frmSynonymSets.Show vbModal
  971. End Sub
  972. Private Sub mnuToolsCreateHHTandCAB_Click()
  973. p_blnNoHHTStatus = True
  974. frmHHT.Show vbModal
  975. p_blnNoHHTStatus = False
  976. End Sub
  977. Private Sub mnuToolsFilterBySKU_Click()
  978. frmFilterSKU.SetSKUs p_enumFilterSKUs
  979. frmFilterSKU.Show vbModal
  980. End Sub
  981. Private Sub mnuToolsImporter_Click()
  982. frmImporter.Show vbModeless
  983. End Sub
  984. Private Sub mnuToolsParameters_Click()
  985. frmParameters.Show vbModal
  986. End Sub
  987. Private Sub mnuToolsPropagateKeywords_Click()
  988. On Error GoTo LErrorHandler
  989. Dim T0 As Date
  990. Dim T1 As Date
  991. Dim strStatusText As String
  992. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  993. Me.MousePointer = vbHourglass
  994. Me.Enabled = False
  995. T0 = Now
  996. p_SetStatusText SBPANEL_DATABASE, "Propagating keywords..."
  997. p_clsTaxonomy.PropagateKeywords
  998. p_SetStatusText SBPANEL_DATABASE, strStatusText
  999. T1 = Now
  1000. Debug.Print "mnuToolsPropagateKeywords_Click: " & FormatTime(T0, T1)
  1001. cmdRefresh_Click
  1002. LEnd:
  1003. Me.Enabled = True
  1004. Me.MousePointer = vbDefault
  1005. Exit Sub
  1006. LErrorHandler:
  1007. p_SetStatusText SBPANEL_DATABASE, strStatusText
  1008. Select Case Err.Number
  1009. Case E_FAIL
  1010. DisplayDatabaseLockedError
  1011. Case errDatabaseVersionIncompatible
  1012. DisplayDatabaseVersionError
  1013. Case Else:
  1014. g_ErrorInfo.SetInfoAndDump "mnuToolsPropagateKeywords_Click"
  1015. End Select
  1016. GoTo LEnd
  1017. End Sub
  1018. Private Sub mnuRightClickCopy_Click()
  1019. mnuEditCopy_Click
  1020. End Sub
  1021. Private Sub mnuRightClickCut_Click()
  1022. mnuEditCut_Click
  1023. End Sub
  1024. Private Sub mnuRightClickPaste_Click()
  1025. mnuEditPaste_Click
  1026. End Sub
  1027. Private Sub mnuRightClickCopyKeywords_Click()
  1028. mnuEditCopyKeywords_Click
  1029. End Sub
  1030. Private Sub mnuRightClickPasteKeywords_Click()
  1031. mnuEditPasteKeywords_Click
  1032. End Sub
  1033. Private Sub mnuRightClickCreateNode_Click()
  1034. cmdCreateGroup_Click
  1035. End Sub
  1036. Private Sub mnuRightClickCreateTopic_Click()
  1037. cmdCreateLeaf_Click
  1038. End Sub
  1039. Private Sub mnuRightClickDelete_Click()
  1040. cmdDelete_Click
  1041. End Sub
  1042. Private Sub mnuRightClickKeywordify_Click()
  1043. On Error GoTo LErrorHandler
  1044. Dim DOMNode As MSXML2.IXMLDOMNode
  1045. Dim intTID As Long
  1046. Dim T0 As Date
  1047. Dim T1 As Date
  1048. Dim strStatusText As String
  1049. Dim Response As VbMsgBoxResult
  1050. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  1051. Response = MsgBox("Are you sure that you want to create Keywords from Titles of the " & _
  1052. "Node/Topic and its descendents?", _
  1053. vbOKCancel + vbDefaultButton2)
  1054. If (Response <> vbOK) Then
  1055. Exit Sub
  1056. End If
  1057. Me.MousePointer = vbHourglass
  1058. Me.Enabled = False
  1059. Set DOMNode = treTaxonomy.SelectedItem.Tag
  1060. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  1061. T0 = Now
  1062. p_clsTaxonomy.KeywordifyTitles intTID
  1063. T1 = Now
  1064. Debug.Print "mnuRightClickKeywordify_Click: " & FormatTime(T0, T1)
  1065. p_SetStatusText SBPANEL_DATABASE, strStatusText
  1066. mnuToolsPropagateKeywords_Click
  1067. LEnd:
  1068. Me.Enabled = True
  1069. Me.MousePointer = vbDefault
  1070. Exit Sub
  1071. LErrorHandler:
  1072. p_SetStatusText SBPANEL_DATABASE, strStatusText
  1073. Select Case Err.Number
  1074. Case E_FAIL
  1075. DisplayDatabaseLockedError
  1076. Case errDatabaseVersionIncompatible
  1077. DisplayDatabaseVersionError
  1078. Case Else:
  1079. g_ErrorInfo.SetInfoAndDump "mnuRightClickKeywordify_Click"
  1080. End Select
  1081. GoTo LEnd
  1082. End Sub
  1083. Private Sub mnuRightClickExport_Click()
  1084. p_ExportHHT p_nodeMouseDown.Tag
  1085. End Sub
  1086. Private Sub mnuHelpContents_Click()
  1087. Dim strCmd As String
  1088. strCmd = HELP_EXE_C & " " & App.Path & "\" & HELP_FILE_NAME_C
  1089. Shell strCmd, vbNormalFocus
  1090. End Sub
  1091. Private Sub mnuHelpAbout_Click()
  1092. frmAbout.Show vbModal
  1093. End Sub
  1094. Private Sub chkVisible_Click()
  1095. If (Not p_blnSettingControls) Then
  1096. p_UserChangedSomethingForCurrentNode
  1097. End If
  1098. End Sub
  1099. Private Sub chkSubSite_Click()
  1100. If (Not p_blnSettingControls) Then
  1101. p_UserChangedSomethingForCurrentNode
  1102. End If
  1103. End Sub
  1104. Private Sub cboLocInclude_Change()
  1105. If (Not p_blnSettingControls) Then
  1106. p_UserChangedSomethingForCurrentNode
  1107. End If
  1108. End Sub
  1109. Private Sub p_clsTaxonomy_ReportStatus(ByVal strStatus As String, blnCancel As Boolean)
  1110. p_SetStatusText SBPANEL_DATABASE, strStatus
  1111. DoEvents
  1112. End Sub
  1113. Private Sub p_clsHHT_ReportStatus(ByVal strStatus As String, blnCancel As Boolean)
  1114. If (Not p_blnNoHHTStatus) Then
  1115. p_SetStatusText SBPANEL_DATABASE, strStatus
  1116. End If
  1117. DoEvents
  1118. End Sub
  1119. Private Sub txtTitle_Change()
  1120. On Error GoTo LErrorHandler
  1121. Dim Node As Node
  1122. If (p_blnSettingControls) Then
  1123. Exit Sub
  1124. End If
  1125. p_UserChangedSomethingForCurrentNode
  1126. If (p_blnCreating) Then
  1127. Set Node = treTaxonomy.Nodes(CREATE_KEY_C)
  1128. Node.Text = txtTitle
  1129. ElseIf (p_blnUpdating) Then
  1130. Set Node = treTaxonomy.Nodes(MODIFY_KEY_C)
  1131. Node.Text = txtTitle
  1132. End If
  1133. Exit Sub
  1134. LErrorHandler:
  1135. g_ErrorInfo.SetInfoAndDump "txtTitle_Change"
  1136. End Sub
  1137. Private Sub txtDescription_Change()
  1138. If (Not p_blnSettingControls) Then
  1139. p_UserChangedSomethingForCurrentNode
  1140. End If
  1141. End Sub
  1142. Private Sub cboNavModel_Click()
  1143. If (Not p_blnSettingControls) Then
  1144. p_UserChangedSomethingForCurrentNode
  1145. End If
  1146. End Sub
  1147. Private Sub cboNavModel_Change()
  1148. If (Not p_blnSettingControls) Then
  1149. p_UserChangedSomethingForCurrentNode
  1150. End If
  1151. End Sub
  1152. Private Sub cboType_Click()
  1153. If (Not p_blnSettingControls) Then
  1154. p_UserChangedSomethingForCurrentNode
  1155. End If
  1156. End Sub
  1157. Private Sub cboType_Change()
  1158. If (Not p_blnSettingControls) Then
  1159. p_UserChangedSomethingForCurrentNode
  1160. End If
  1161. End Sub
  1162. Private Sub txtURI_Change()
  1163. If (Not p_blnSettingControls) Then
  1164. p_UserChangedSomethingForCurrentNode
  1165. End If
  1166. End Sub
  1167. Private Sub txtIconURI_Change()
  1168. If (Not p_blnSettingControls) Then
  1169. p_UserChangedSomethingForCurrentNode
  1170. End If
  1171. End Sub
  1172. Private Sub txtComments_Change()
  1173. If (Not p_blnSettingControls) Then
  1174. p_UserChangedSomethingForCurrentNode
  1175. End If
  1176. End Sub
  1177. Private Sub txtEntry_Change()
  1178. If (Not p_blnSettingControls) Then
  1179. p_UserChangedSomethingForCurrentNode
  1180. End If
  1181. End Sub
  1182. Private Sub chkStandard_Click()
  1183. If (Not p_blnSettingControls) Then
  1184. p_UserChangedSomethingForCurrentNode
  1185. End If
  1186. End Sub
  1187. Private Sub chkProfessional_Click()
  1188. If (Not p_blnSettingControls) Then
  1189. p_UserChangedSomethingForCurrentNode
  1190. End If
  1191. End Sub
  1192. Private Sub chkProfessional64_Click()
  1193. If (Not p_blnSettingControls) Then
  1194. p_UserChangedSomethingForCurrentNode
  1195. End If
  1196. End Sub
  1197. Private Sub chkWindowsMillennium_Click()
  1198. If (Not p_blnSettingControls) Then
  1199. p_UserChangedSomethingForCurrentNode
  1200. End If
  1201. End Sub
  1202. Private Sub chkServer_Click()
  1203. If (Not p_blnSettingControls) Then
  1204. p_UserChangedSomethingForCurrentNode
  1205. End If
  1206. End Sub
  1207. Private Sub chkAdvancedServer_Click()
  1208. If (Not p_blnSettingControls) Then
  1209. p_UserChangedSomethingForCurrentNode
  1210. End If
  1211. End Sub
  1212. Private Sub chkDataCenterServer_Click()
  1213. If (Not p_blnSettingControls) Then
  1214. p_UserChangedSomethingForCurrentNode
  1215. End If
  1216. End Sub
  1217. Private Sub chkAdvancedServer64_Click()
  1218. If (Not p_blnSettingControls) Then
  1219. p_UserChangedSomethingForCurrentNode
  1220. End If
  1221. End Sub
  1222. Private Sub chkDataCenterServer64_Click()
  1223. If (Not p_blnSettingControls) Then
  1224. p_UserChangedSomethingForCurrentNode
  1225. End If
  1226. End Sub
  1227. Private Sub treTaxonomy_Collapse(ByVal Node As MSComctlLib.Node)
  1228. If (Node = treTaxonomy.SelectedItem) Then
  1229. treTaxonomy_NodeClick Node
  1230. End If
  1231. End Sub
  1232. Private Sub treTaxonomy_NodeClick(ByVal Node As MSComctlLib.Node)
  1233. On Error GoTo LErrorHandler
  1234. Dim blnUpdateControls As Boolean
  1235. Dim DOMNode As MSXML2.IXMLDOMNode
  1236. Dim intAG As Long
  1237. If (p_blnCreating Or p_blnUpdating) Then
  1238. ' The user wants to go to a different Group/Leaf.
  1239. ' Assume that he wants to save his changes.
  1240. p_SaveClicked blnUpdateControls
  1241. If (Not blnUpdateControls) Then
  1242. Exit Sub
  1243. End If
  1244. End If
  1245. If (p_NodeDeleted(Node)) Then
  1246. ' If we start creating a node X, and then Create it by right clicking
  1247. ' on it, then we will come here. The info on the RHS is up to date.
  1248. ' So it is OK to simply exit.
  1249. Exit Sub
  1250. End If
  1251. Set DOMNode = Node.Tag
  1252. p_UpdateRHSControls DOMNode
  1253. Set treTaxonomy.SelectedItem = Node
  1254. If (p_IsLeaf(Node)) Then
  1255. p_DisableCreate
  1256. p_DisableEditPaste
  1257. p_DisableSubSite
  1258. p_DisableEditEntry
  1259. p_DisableNavModel
  1260. Else
  1261. p_EnableCreate
  1262. p_EnableSubSite
  1263. p_EnableNavModel
  1264. p_EnableEditEntry
  1265. If (Not p_nodeCut Is Nothing) Then
  1266. p_EnableEditPaste
  1267. ElseIf (Not p_nodeCopied Is Nothing) Then
  1268. p_EnableEditPaste
  1269. End If
  1270. End If
  1271. intAG = XMLGetAttribute(DOMNode, HHT_authoringgroup_C)
  1272. If (intAG = p_intAuthoringGroup) Then
  1273. p_EnableNodeDetailsExceptIndividualSKUs
  1274. Else
  1275. p_DisableNodeDetails
  1276. p_DisableDelete
  1277. p_DisableEditCut
  1278. End If
  1279. If (p_IsRoot(Node)) Then
  1280. p_DisableDelete
  1281. p_DisableEditCopy
  1282. p_DisableEditCut
  1283. p_DisableAddRemoveAndKeywordsCombo
  1284. Else
  1285. p_EnableEditCopy
  1286. If (intAG = p_intAuthoringGroup) Then
  1287. p_EnableDelete
  1288. p_EnableEditCut
  1289. p_EnableAddRemoveAndKeywordsCombo
  1290. End If
  1291. End If
  1292. Exit Sub
  1293. LErrorHandler:
  1294. g_ErrorInfo.SetInfoAndDump "treTaxonomy_NodeClick"
  1295. End Sub
  1296. Private Sub mnuMoveAbove_Click()
  1297. p_Move p_nodeMouseDown, treTaxonomy.DropHighlight, True
  1298. End Sub
  1299. Private Sub mnuMoveBelow_Click()
  1300. p_Move p_nodeMouseDown, treTaxonomy.DropHighlight, False
  1301. End Sub
  1302. Private Sub mnuMoveInside_Click()
  1303. p_ChangeParent p_nodeMouseDown, treTaxonomy.DropHighlight
  1304. End Sub
  1305. Private Sub p_PopupMoveMenu(i_Node As Node)
  1306. mnuMoveInside.Visible = True
  1307. mnuMoveAbove.Visible = True
  1308. mnuMoveBelow.Visible = True
  1309. If (p_IsLeaf(i_Node)) Then
  1310. mnuMoveInside.Visible = False
  1311. ElseIf (p_IsRoot(i_Node)) Then
  1312. mnuMoveAbove.Visible = False
  1313. mnuMoveBelow.Visible = False
  1314. End If
  1315. PopupMenu mnuMove
  1316. End Sub
  1317. Private Sub treTaxonomy_DragDrop(Source As Control, x As Single, y As Single)
  1318. On Error GoTo LErrorHandler
  1319. Dim nodeCurrent As Node
  1320. Dim Response As VbMsgBoxResult
  1321. Dim enumSKUs As SKU_E
  1322. Dim intParentTID As Long
  1323. Set nodeCurrent = treTaxonomy.DropHighlight
  1324. If (Not (nodeCurrent Is Nothing)) Then
  1325. If (Not p_nodeMouseDown Is Nothing) Then
  1326. If (p_nodeMouseDown.Key <> nodeCurrent.Key) Then
  1327. If (p_blnCtrlMouseDown) Then
  1328. If (Not p_IsLeaf(nodeCurrent)) Then
  1329. Response = MsgBox("Are you sure that you want to create " & _
  1330. "a copy of this Node or Topic?", _
  1331. vbOKCancel + vbDefaultButton1)
  1332. If (Response = vbOK) Then
  1333. p_CreateTaxonomyEntries p_nodeMouseDown.Tag, nodeCurrent, _
  1334. True
  1335. End If
  1336. End If
  1337. Else
  1338. p_PopupMoveMenu nodeCurrent
  1339. End If
  1340. End If
  1341. ElseIf (Not (p_DOMNode Is Nothing)) Then
  1342. If (p_blnCreating Or p_blnUpdating) Then
  1343. MsgBox "You are in the middle of creating or updating an entry. " & _
  1344. "Please finish or cancel first.", vbOKOnly
  1345. ElseIf (p_IsLeaf(nodeCurrent)) Then
  1346. MsgBox "Please drop over a Node, not a Topic.", vbOKOnly
  1347. Else
  1348. enumSKUs = frmImporter.GetSelectedSKUs
  1349. intParentTID = XMLGetAttribute(nodeCurrent.Tag, HHT_tid_C)
  1350. p_ReplaceTaxonomySubtree p_DOMNode, intParentTID, enumSKUs, True
  1351. Set p_DOMNode = Nothing
  1352. End If
  1353. End If
  1354. End If
  1355. Set treTaxonomy.DropHighlight = Nothing
  1356. Set p_nodeMouseDown = Nothing
  1357. Set p_DOMNode = Nothing
  1358. p_blnCtrlMouseDown = False
  1359. p_blnDragging = False
  1360. tmrScrollDuringDrag.Enabled = False
  1361. Exit Sub
  1362. LErrorHandler:
  1363. g_ErrorInfo.SetInfoAndDump "treTaxonomy_DragDrop"
  1364. End Sub
  1365. Private Sub treTaxonomy_DragOver(Source As Control, x As Single, y As Single, State As Integer)
  1366. On Error GoTo LErrorHandler
  1367. Dim nodeCurrent As Node
  1368. If (p_blnDragging) Then
  1369. If (y > 0 And y < 800) Then
  1370. 'scroll up
  1371. p_blnScrollUp = True
  1372. tmrScrollDuringDrag.Enabled = True
  1373. ElseIf (y > (treTaxonomy.Height - 800) And y < treTaxonomy.Height) Then
  1374. 'scroll down
  1375. p_blnScrollUp = False
  1376. tmrScrollDuringDrag.Enabled = True
  1377. Else
  1378. tmrScrollDuringDrag.Enabled = False
  1379. End If
  1380. Set nodeCurrent = treTaxonomy.HitTest(x, y)
  1381. If (nodeCurrent Is Nothing) Then
  1382. Exit Sub
  1383. End If
  1384. If (p_blnCtrlMouseDown And p_IsLeaf(nodeCurrent)) Then
  1385. Exit Sub
  1386. End If
  1387. Set treTaxonomy.DropHighlight = nodeCurrent
  1388. 'nodeCurrent.Expanded = True Users hated this.
  1389. End If
  1390. Exit Sub
  1391. LErrorHandler:
  1392. g_ErrorInfo.SetInfoAndDump "treTaxonomy_DragOver"
  1393. End Sub
  1394. Private Sub treTaxonomy_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  1395. If (Not p_blnCreating And Not p_blnUpdating) Then
  1396. If (treTaxonomy.Checkboxes) Then
  1397. Exit Sub
  1398. End If
  1399. Set p_nodeMouseDown = treTaxonomy.HitTest(x, y)
  1400. If (p_nodeMouseDown Is Nothing) Then
  1401. Exit Sub
  1402. End If
  1403. treTaxonomy_NodeClick p_nodeMouseDown
  1404. If (p_IsRoot(p_nodeMouseDown)) Then
  1405. Set p_nodeMouseDown = Nothing
  1406. End If
  1407. If (Not (p_nodeMouseDown Is Nothing)) Then
  1408. If (Shift = vbCtrlMask) Then
  1409. p_blnCtrlMouseDown = True
  1410. Else
  1411. p_blnCtrlMouseDown = False
  1412. End If
  1413. End If
  1414. End If
  1415. End Sub
  1416. Private Sub treTaxonomy_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  1417. On Error GoTo LErrorHandler
  1418. If ((Not p_blnCreating And Not p_blnUpdating) And _
  1419. (Button = vbLeftButton) And _
  1420. (Not (p_nodeMouseDown Is Nothing))) Then
  1421. p_blnDragging = True
  1422. treTaxonomy.DragIcon = p_nodeMouseDown.CreateDragImage
  1423. treTaxonomy.Drag vbBeginDrag
  1424. End If
  1425. Exit Sub
  1426. LErrorHandler:
  1427. ' If a node is selected, and then the user clicks on mnuFileOpenDatabase,
  1428. ' and double clicks a database, this event fires. We get the exception "This item's
  1429. ' control has been deleted".
  1430. End Sub
  1431. Public Sub BeginDrag( _
  1432. ByVal i_DOMNode As MSXML2.IXMLDOMNode, _
  1433. ByVal i_blnHHK As Boolean _
  1434. )
  1435. ' Something is being dragged over from the frmImporter form.
  1436. Set p_nodeMouseDown = Nothing
  1437. p_blnCtrlMouseDown = False
  1438. Set p_DOMNode = i_DOMNode
  1439. If (Not i_DOMNode Is Nothing) Then
  1440. p_blnDragging = True
  1441. Else
  1442. p_blnDragging = False
  1443. End If
  1444. End Sub
  1445. Private Sub treTaxonomy_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  1446. tmrScrollDuringDrag.Enabled = False
  1447. If (Not p_blnCreating And Not p_blnUpdating) Then
  1448. Set p_nodeMouseDown = treTaxonomy.HitTest(x, y)
  1449. If (p_nodeMouseDown Is Nothing) Then
  1450. Exit Sub
  1451. End If
  1452. If (Button = vbRightButton) Then
  1453. Set treTaxonomy.SelectedItem = p_nodeMouseDown
  1454. PopupMenu mnuRightClick
  1455. End If
  1456. End If
  1457. End Sub
  1458. Private Sub Form_DragOver(Source As Control, x As Single, y As Single, State As Integer)
  1459. If Source.Name = "treTaxonomy" Then
  1460. tmrScrollDuringDrag.Enabled = False
  1461. End If
  1462. End Sub
  1463. Private Sub tmrScrollDuringDrag_Timer()
  1464. If (p_blnScrollUp) Then
  1465. ' Send a WM_VSCROLL message 0 is up and 1 is down
  1466. SendMessage treTaxonomy.hwnd, 277&, 0&, vbNull
  1467. Else
  1468. 'Scroll Down
  1469. SendMessage treTaxonomy.hwnd, 277&, 1&, vbNull
  1470. End If
  1471. End Sub
  1472. Private Sub tmrRefresh_Timer()
  1473. ' Auto refresh every 30 min because we cache the database.
  1474. Static intTicks As Long
  1475. intTicks = intTicks + 1
  1476. If (intTicks <> 100) Then
  1477. Exit Sub
  1478. End If
  1479. intTicks = 0
  1480. If (p_blnUpdating Or p_blnCreating) Then
  1481. Exit Sub
  1482. End If
  1483. If (Not p_blnDatabaseOpen) Then
  1484. Exit Sub
  1485. End If
  1486. ' cmdRefresh_Click
  1487. End Sub
  1488. Private Sub cmdCreateGroup_Click()
  1489. On Error GoTo LErrorHandler
  1490. p_CreateNode True
  1491. Exit Sub
  1492. LErrorHandler:
  1493. g_ErrorInfo.SetInfoAndDump "cmdCreateGroup_Click"
  1494. End Sub
  1495. Private Sub cmdCreateLeaf_Click()
  1496. On Error GoTo LErrorHandler
  1497. p_CreateNode False
  1498. Exit Sub
  1499. LErrorHandler:
  1500. g_ErrorInfo.SetInfoAndDump "cmdCreateLeaf_Click"
  1501. End Sub
  1502. Private Sub cmdDelete_Click()
  1503. On Error GoTo LErrorHandler
  1504. Dim nodeCurrent As Node
  1505. Dim strTitle As String
  1506. Dim str1 As String
  1507. Dim str2 As String
  1508. Dim Response As VbMsgBoxResult
  1509. Dim dtmModifiedTime As Date
  1510. Dim intTID As Long
  1511. Dim DOMNodeParent As MSXML2.IXMLDOMNode
  1512. Dim strStatusText As String
  1513. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  1514. If (p_blnCreating Or p_blnUpdating) Then
  1515. GoTo LEnd
  1516. End If
  1517. Set nodeCurrent = treTaxonomy.SelectedItem
  1518. strTitle = txtTitle
  1519. If (p_IsLeaf(nodeCurrent)) Then
  1520. str1 = "topic """
  1521. str2 = """"
  1522. Else
  1523. str1 = "node """
  1524. str2 = """ and all its children"
  1525. End If
  1526. Response = MsgBox("Are you sure that you want to permanently delete " & _
  1527. str1 & strTitle & str2 & "?", vbOKCancel + vbDefaultButton2)
  1528. If (Response <> vbOK) Then
  1529. GoTo LEnd
  1530. End If
  1531. Me.Enabled = False
  1532. dtmModifiedTime = XMLGetAttribute(nodeCurrent.Tag, HHT_modifiedtime_C)
  1533. intTID = XMLGetAttribute(nodeCurrent.Tag, HHT_tid_C)
  1534. p_clsTaxonomy.Delete intTID, dtmModifiedTime
  1535. Set DOMNodeParent = nodeCurrent.Tag.parentNode
  1536. DOMNodeParent.removeChild nodeCurrent.Tag
  1537. treTaxonomy.Nodes.Remove treTaxonomy.SelectedItem.Key
  1538. treTaxonomy_NodeClick treTaxonomy.SelectedItem
  1539. LEnd:
  1540. Me.Enabled = True
  1541. p_SetStatusText SBPANEL_DATABASE, strStatusText
  1542. Exit Sub
  1543. LErrorHandler:
  1544. Select Case Err.Number
  1545. Case errNodeOrTopicAlreadyModified
  1546. MsgBox "Someone else already modified this entry. " & _
  1547. "You need to Refresh the database and then try again. " & _
  1548. "This prevents you from accidentally overwriting something " & _
  1549. "the other person entered.", _
  1550. vbExclamation + vbOKOnly
  1551. Case E_FAIL
  1552. DisplayDatabaseLockedError
  1553. Case errDatabaseVersionIncompatible
  1554. DisplayDatabaseVersionError
  1555. Case errNotPermittedForAuthoringGroup, errAuthoringGroupDiffers, errAuthoringGroupNotPresent
  1556. DisplayAuthoringGroupError
  1557. Case Else:
  1558. g_ErrorInfo.SetInfoAndDump "cmdDelete_Click"
  1559. End Select
  1560. GoTo LEnd
  1561. End Sub
  1562. Private Sub cmdRefresh_Click()
  1563. On Error GoTo LErrorHandler
  1564. Dim DOMNode As MSXML2.IXMLDOMNode
  1565. Dim intTID As Long
  1566. p_intAuthoringGroup = p_clsParameters.AuthoringGroup
  1567. If (treTaxonomy.SelectedItem Is Nothing) Then
  1568. intTID = ROOT_TID_C
  1569. Else
  1570. intTID = XMLGetAttribute(treTaxonomy.SelectedItem.Tag, HHT_tid_C)
  1571. End If
  1572. Me.MousePointer = vbHourglass
  1573. p_InitializeDataStructures DOMNode
  1574. p_Refresh DOMNode
  1575. p_SetStatusText SBPANEL_DATABASE, "Database last read at: " & Now
  1576. If (p_NodeExists(intTID)) Then
  1577. treTaxonomy_NodeClick treTaxonomy.Nodes(KEY_PREFIX_C & intTID)
  1578. Else
  1579. treTaxonomy_NodeClick treTaxonomy.Nodes(KEY_PREFIX_C & ROOT_TID_C)
  1580. End If
  1581. LEnd:
  1582. Me.MousePointer = vbDefault
  1583. Exit Sub
  1584. LErrorHandler:
  1585. Me.Enabled = True
  1586. Select Case Err.Number
  1587. Case errAuthoringGroupNotPresent
  1588. DisplayAuthoringGroupError
  1589. Case Else
  1590. g_ErrorInfo.SetInfoAndDump "cmdRefresh_Click"
  1591. End Select
  1592. GoTo LEnd
  1593. End Sub
  1594. Private Sub cmdURI_Click()
  1595. frmURI.SetOldURI txtURI
  1596. frmURI.Show vbModal
  1597. End Sub
  1598. Private Sub cmdEditEntry_Click()
  1599. Dim Response As VbMsgBoxResult
  1600. If (Not p_blnCreating) Then
  1601. Response = MsgBox("Are you sure that you want to change this ENTRY? " & _
  1602. "Changing the ENTRY does not change the TITLE, " & _
  1603. "but it does change the identifier that others may be using " & _
  1604. "to reference this topic. If you really want to change this ENTRY, " & _
  1605. "please notify everybody who is linking to this topic so they can " & _
  1606. "update their hyperlink.", _
  1607. vbOKCancel + vbDefaultButton2 + vbExclamation)
  1608. If (Response <> vbOK) Then
  1609. p_DisableEntry
  1610. Exit Sub
  1611. End If
  1612. End If
  1613. p_EnableEntry
  1614. End Sub
  1615. Private Sub cmdNavigateLink_Click()
  1616. On Error GoTo LErrorHandler
  1617. Dim strBrokenLinkDir As String
  1618. Dim strVendor As String
  1619. Dim strURI As String
  1620. Dim Browser As HTMLDocument
  1621. strBrokenLinkDir = p_GetBrokenLinkDir(cboNavigateLink.ItemData(cboNavigateLink.ListIndex))
  1622. strVendor = p_clsParameters.Value(VENDOR_STRING_C) & ""
  1623. LinkValid strBrokenLinkDir, strVendor, txtURI, strURI
  1624. Set Browser = New HTMLDocument
  1625. Browser.url = strURI
  1626. Exit Sub
  1627. LErrorHandler:
  1628. Select Case Err.Number
  1629. Case errNotConfiguredForNavigateLink
  1630. MsgBox "Please verify that you've selected the correct SKU. " & _
  1631. "If the SKU is correct, the database needs to be configured " & _
  1632. "to point to the BrokenLinkWorkingDir.", _
  1633. vbExclamation Or vbOKOnly
  1634. Case Else
  1635. g_ErrorInfo.SetInfoAndDump "cmdNavigateLink_Click"
  1636. End Select
  1637. End Sub
  1638. Public Function GetNavigateLinkURI(i_intListIndex As Long) As String
  1639. On Error GoTo LErrorHandler
  1640. Dim strBrokenLinkDir As String
  1641. Dim strVendor As String
  1642. If (txtURI = "") Then
  1643. Exit Function
  1644. End If
  1645. strBrokenLinkDir = p_GetBrokenLinkDir(cboNavigateLink.ItemData(i_intListIndex))
  1646. strVendor = p_clsParameters.Value(VENDOR_STRING_C) & ""
  1647. LinkValid strBrokenLinkDir, strVendor, txtURI, GetNavigateLinkURI
  1648. Exit Function
  1649. LErrorHandler:
  1650. Select Case Err.Number
  1651. Case errNotConfiguredForNavigateLink
  1652. MsgBox "Please verify that you've selected the correct SKU. " & _
  1653. "If the SKU is correct, the database needs to be configured " & _
  1654. "to point to the BrokenLinkWorkingDir.", _
  1655. vbExclamation Or vbOKOnly
  1656. Case Else
  1657. g_ErrorInfo.SetInfoAndDump "GetNavigateLinkURI"
  1658. End Select
  1659. End Function
  1660. Private Sub cmdAddRemove_Click()
  1661. On Error GoTo LErrorHandler
  1662. Dim Node As Node
  1663. Set Node = treTaxonomy.SelectedItem
  1664. If (Node Is Nothing) Then
  1665. Exit Sub
  1666. End If
  1667. frmAddRemoveKeywords.SetKeywords p_dictKeywordsWithTitle
  1668. frmAddRemoveKeywords.SetTitle txtTitle, p_IsLeaf(Node)
  1669. If (txtURI <> "") Then
  1670. frmAddRemoveKeywords.LinkNavigable True
  1671. Else
  1672. frmAddRemoveKeywords.LinkNavigable False
  1673. End If
  1674. If (Not p_blnAddRemoveKeywordsOpen) Then
  1675. frmAddRemoveKeywords.Show vbModeless
  1676. p_blnAddRemoveKeywordsOpen = True
  1677. End If
  1678. Exit Sub
  1679. LErrorHandler:
  1680. g_ErrorInfo.SetInfoAndDump "cmdAddRemove_Click"
  1681. End Sub
  1682. Private Sub cboKeywords_KeyPress(KeyAscii As Integer)
  1683. On Error GoTo LErrorHandler
  1684. Dim strKeyword As String
  1685. Dim intIndex As Long
  1686. Dim intKID As Long
  1687. Dim Response As VbMsgBoxResult
  1688. If (KeyAscii <> Asc(vbCr)) Then
  1689. Exit Sub
  1690. End If
  1691. strKeyword = RemoveExtraSpaces(cboKeywords.Text)
  1692. cboKeywords.Text = ""
  1693. For intIndex = 0 To cboKeywords.ListCount
  1694. If (LCase$(strKeyword) = LCase$(cboKeywords.List(intIndex))) Then
  1695. Exit Sub
  1696. End If
  1697. Next
  1698. intKID = p_clsKeywords.GetKIDOfKeyword(strKeyword)
  1699. If (intKID = INVALID_ID_C) Then
  1700. Response = MsgBox( _
  1701. "The keyword """ & strKeyword & """ doesn't exist. Do you want to create it?", _
  1702. vbOKCancel + vbDefaultButton1)
  1703. If (Response = vbCancel) Then
  1704. Exit Sub
  1705. End If
  1706. End If
  1707. intKID = p_clsKeywords.Create(strKeyword)
  1708. p_dictKeywordsWithTitle.Add intKID, strKeyword
  1709. If (Not CollectionContainsKey(p_colKeywords, intKID)) Then
  1710. p_colKeywords.Add strKeyword, CStr(intKID)
  1711. End If
  1712. p_SetKeywordsList
  1713. p_UserChangedSomethingForCurrentNode
  1714. Exit Sub
  1715. LErrorHandler:
  1716. Select Case Err.Number
  1717. Case errContainsGarbageChar
  1718. MsgBox "The Keyword " & strKeyword & " contains garbage characters.", _
  1719. vbExclamation + vbOKOnly
  1720. Case errContainsStopSign
  1721. MsgBox "The Keyword " & strKeyword & " contains a Stop Sign.", _
  1722. vbExclamation + vbOKOnly
  1723. Case errContainsStopWord
  1724. MsgBox "The Keyword " & strKeyword & " contains a Stop Word.", _
  1725. vbExclamation + vbOKOnly
  1726. Case errContainsOperatorShortcut
  1727. MsgBox "The Keyword " & strKeyword & " contains an operator shortcut.", _
  1728. vbExclamation + vbOKOnly
  1729. Case errContainsVerbalOperator
  1730. MsgBox "The Keyword " & strKeyword & " contains a verbal operator.", _
  1731. vbExclamation + vbOKOnly
  1732. Case errContainsQuote
  1733. MsgBox "The Keyword " & strKeyword & " contains a quote.", _
  1734. vbExclamation + vbOKOnly
  1735. Case errTooLong
  1736. MsgBox "The Keyword " & strKeyword & " is too long", _
  1737. vbExclamation + vbOKOnly
  1738. Case E_FAIL
  1739. DisplayDatabaseLockedError
  1740. Case errDatabaseVersionIncompatible
  1741. DisplayDatabaseVersionError
  1742. Case Else
  1743. g_ErrorInfo.SetInfoAndDump "cboKeywords_KeyPress"
  1744. End Select
  1745. End Sub
  1746. Private Sub cmdSave_Click()
  1747. On Error GoTo LErrorHandler
  1748. Dim blnUpdateControls As Boolean
  1749. p_SaveClicked blnUpdateControls
  1750. Exit Sub
  1751. LErrorHandler:
  1752. g_ErrorInfo.SetInfoAndDump "cmdSave_Click"
  1753. End Sub
  1754. Private Sub cmdCancel_Click()
  1755. On Error GoTo LErrorHandler
  1756. Dim Node As Node
  1757. If (p_blnCreating) Then
  1758. p_DeleteNodeBeingCreated
  1759. p_SetModeCreating False
  1760. ElseIf (p_blnUpdating) Then
  1761. p_SetModeUpdating False
  1762. End If
  1763. treTaxonomy_NodeClick treTaxonomy.SelectedItem
  1764. Exit Sub
  1765. LErrorHandler:
  1766. g_ErrorInfo.SetInfoAndDump "cmdCancel_Click"
  1767. End Sub
  1768. Private Sub p_SetBrokenLinkAttribute( _
  1769. ByVal i_enumSKU As SKU_E, _
  1770. ByRef i_strBrokenLinkDir As String, _
  1771. ByRef i_strVendor As String, _
  1772. ByRef i_strBrokenLinkAttribute As String, _
  1773. ByRef u_DOMNode As MSXML2.IXMLDOMNode _
  1774. )
  1775. Dim enumSKUs As SKU_E
  1776. Dim strURI As String
  1777. Dim strNewURI As String
  1778. Dim DOMNode As MSXML2.IXMLDOMNode
  1779. Dim strTitle As String
  1780. enumSKUs = XMLGetAttribute(u_DOMNode, HHT_skus_C) And _
  1781. XMLGetAttribute(u_DOMNode, HHT_allowedskus_C)
  1782. strTitle = XMLGetAttribute(u_DOMNode, HHT_TITLE_C)
  1783. strURI = XMLGetAttribute(u_DOMNode, HHT_URI_C)
  1784. p_SetStatusText SBPANEL_DATABASE, "Evaluating " & strTitle
  1785. If ((i_enumSKU And enumSKUs) = 0) Then
  1786. XMLSetAttribute u_DOMNode, i_strBrokenLinkAttribute, "0"
  1787. Exit Sub
  1788. End If
  1789. If (LinkValid(i_strBrokenLinkDir, i_strVendor, strURI, strNewURI)) Then
  1790. XMLSetAttribute u_DOMNode, i_strBrokenLinkAttribute, "0"
  1791. Else
  1792. XMLSetAttribute u_DOMNode, i_strBrokenLinkAttribute, "1"
  1793. End If
  1794. If (Not (u_DOMNode.firstChild Is Nothing)) Then
  1795. For Each DOMNode In u_DOMNode.childNodes
  1796. p_SetBrokenLinkAttribute i_enumSKU, i_strBrokenLinkDir, i_strVendor, _
  1797. i_strBrokenLinkAttribute, DOMNode
  1798. Next
  1799. End If
  1800. End Sub
  1801. Private Sub p_ComputeBrokenLinkAttributes( _
  1802. ByVal i_enumSearchTarget As SEARCH_TARGET_E _
  1803. )
  1804. On Error GoTo LErrorHandler
  1805. Dim DOMNodeRoot As MSXML2.IXMLDOMNode
  1806. Dim strStatusText As String
  1807. Dim enumSKU As SKU_E
  1808. Dim strBrokenLinkDir As String
  1809. Dim strVendor As String
  1810. Dim strBrokenLinkAttribute As String
  1811. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  1812. Set DOMNodeRoot = treTaxonomy.Nodes(KEY_PREFIX_C & ROOT_TID_C).Tag
  1813. strVendor = p_clsParameters.Value(VENDOR_STRING_C) & ""
  1814. If (i_enumSearchTarget And ST_BROKEN_LINK_WINME_E) Then
  1815. enumSKU = SKU_WINDOWS_MILLENNIUM_E
  1816. strBrokenLinkAttribute = HHT_brokenlinkwinme_C
  1817. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1818. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1819. DOMNodeRoot
  1820. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_STD_E) Then
  1821. enumSKU = SKU_STANDARD_E
  1822. strBrokenLinkAttribute = HHT_brokenlinkstd_C
  1823. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1824. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1825. DOMNodeRoot
  1826. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_PRO_E) Then
  1827. enumSKU = SKU_PROFESSIONAL_E
  1828. strBrokenLinkAttribute = HHT_brokenlinkpro_C
  1829. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1830. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1831. DOMNodeRoot
  1832. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_PRO64_E) Then
  1833. enumSKU = SKU_PROFESSIONAL_64_E
  1834. strBrokenLinkAttribute = HHT_brokenlinkpro64_C
  1835. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1836. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1837. DOMNodeRoot
  1838. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_SRV_E) Then
  1839. enumSKU = SKU_SERVER_E
  1840. strBrokenLinkAttribute = HHT_brokenlinksrv_C
  1841. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1842. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1843. DOMNodeRoot
  1844. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_ADV_E) Then
  1845. enumSKU = SKU_ADVANCED_SERVER_E
  1846. strBrokenLinkAttribute = HHT_brokenlinkadv_C
  1847. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1848. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1849. DOMNodeRoot
  1850. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_ADV64_E) Then
  1851. enumSKU = SKU_ADVANCED_SERVER_64_E
  1852. strBrokenLinkAttribute = HHT_brokenlinkadv64_C
  1853. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1854. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1855. DOMNodeRoot
  1856. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_DAT_E) Then
  1857. enumSKU = SKU_DATA_CENTER_SERVER_E
  1858. strBrokenLinkAttribute = HHT_brokenlinkdat_C
  1859. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1860. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1861. DOMNodeRoot
  1862. ElseIf (i_enumSearchTarget And ST_BROKEN_LINK_DAT64_E) Then
  1863. enumSKU = SKU_DATA_CENTER_SERVER_64_E
  1864. strBrokenLinkAttribute = HHT_brokenlinkdat64_C
  1865. strBrokenLinkDir = p_GetBrokenLinkDir(enumSKU)
  1866. p_SetBrokenLinkAttribute enumSKU, strBrokenLinkDir, strVendor, strBrokenLinkAttribute, _
  1867. DOMNodeRoot
  1868. End If
  1869. LDone:
  1870. p_SetStatusText SBPANEL_DATABASE, strStatusText
  1871. Exit Sub
  1872. LErrorHandler:
  1873. Select Case Err.Number
  1874. Case errNotConfiguredForNavigateLink
  1875. MsgBox "Please verify that you've selected the correct SKU. " & _
  1876. "If the SKU is correct, the database needs to be configured " & _
  1877. "to point to the BrokenLinkWorkingDir.", _
  1878. vbExclamation Or vbOKOnly
  1879. End Select
  1880. GoTo LDone
  1881. End Sub
  1882. Private Function p_GetBrokenLinkXPathQuery( _
  1883. ByVal i_enumSearchTarget As SEARCH_TARGET_E _
  1884. ) As String
  1885. Dim str As String
  1886. Dim strQuery As String
  1887. strQuery = "attribute::" & HHT_tid_C & "!=""" & INVALID_ID_C & """"
  1888. If (i_enumSearchTarget And ST_BROKEN_LINK_WINME_E) Then
  1889. str = "attribute::" & HHT_brokenlinkwinme_C & "=""1"""
  1890. strQuery = strQuery & " and " & str
  1891. End If
  1892. If (i_enumSearchTarget And ST_BROKEN_LINK_STD_E) Then
  1893. str = "attribute::" & HHT_brokenlinkstd_C & "=""1"""
  1894. strQuery = strQuery & " and " & str
  1895. End If
  1896. If (i_enumSearchTarget And ST_BROKEN_LINK_PRO_E) Then
  1897. str = "attribute::" & HHT_brokenlinkpro_C & "=""1"""
  1898. strQuery = strQuery & " and " & str
  1899. End If
  1900. If (i_enumSearchTarget And ST_BROKEN_LINK_PRO64_E) Then
  1901. str = "attribute::" & HHT_brokenlinkpro64_C & "=""1"""
  1902. strQuery = strQuery & " and " & str
  1903. End If
  1904. If (i_enumSearchTarget And ST_BROKEN_LINK_SRV_E) Then
  1905. str = "attribute::" & HHT_brokenlinksrv_C & "=""1"""
  1906. strQuery = strQuery & " and " & str
  1907. End If
  1908. If (i_enumSearchTarget And ST_BROKEN_LINK_ADV_E) Then
  1909. str = "attribute::" & HHT_brokenlinkadv_C & "=""1"""
  1910. strQuery = strQuery & " and " & str
  1911. End If
  1912. If (i_enumSearchTarget And ST_BROKEN_LINK_ADV64_E) Then
  1913. str = "attribute::" & HHT_brokenlinkadv64_C & "=""1"""
  1914. strQuery = strQuery & " and " & str
  1915. End If
  1916. If (i_enumSearchTarget And ST_BROKEN_LINK_DAT_E) Then
  1917. str = "attribute::" & HHT_brokenlinkdat_C & "=""1"""
  1918. strQuery = strQuery & " and " & str
  1919. End If
  1920. If (i_enumSearchTarget And ST_BROKEN_LINK_DAT64_E) Then
  1921. str = "attribute::" & HHT_brokenlinkdat64_C & "=""1"""
  1922. strQuery = strQuery & " and " & str
  1923. End If
  1924. p_GetBrokenLinkXPathQuery = strQuery
  1925. End Function
  1926. Private Function p_GetXPathAttributeString( _
  1927. ByVal i_strAttributeName As String, _
  1928. ByVal i_strStringToFind As String _
  1929. ) As String
  1930. p_GetXPathAttributeString = "attribute::" & i_strAttributeName & _
  1931. "[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')," & _
  1932. """" & i_strStringToFind & """ )]"
  1933. End Function
  1934. Private Function p_GetXPathQuery( _
  1935. ByVal i_strStringToFind As String, _
  1936. ByVal i_enumSearchTarget As SEARCH_TARGET_E _
  1937. ) As String
  1938. Dim strQuery As String
  1939. Dim str As String
  1940. strQuery = "descendant::TAXONOMY_ENTRY["
  1941. str = "attribute::" & HHT_tid_C & "!=""" & INVALID_ID_C & """"
  1942. strQuery = strQuery & str
  1943. If (i_enumSearchTarget And _
  1944. (ST_TITLE_E Or _
  1945. ST_DESCRIPTION_E Or _
  1946. ST_URI_E Or _
  1947. ST_COMMENTS_E Or _
  1948. ST_BASE_FILE_E)) Then
  1949. strQuery = strQuery & " and ("
  1950. strQuery = strQuery & p_GetXPathAttributeString(HHT_basefile_C, "!!!An impossible string!!!")
  1951. If (i_enumSearchTarget And ST_TITLE_E) Then
  1952. str = p_GetXPathAttributeString(HHT_TITLE_C, i_strStringToFind)
  1953. strQuery = strQuery & " or " & str
  1954. End If
  1955. If (i_enumSearchTarget And ST_DESCRIPTION_E) Then
  1956. str = p_GetXPathAttributeString(HHT_DESCRIPTION_C, i_strStringToFind)
  1957. strQuery = strQuery & " or " & str
  1958. End If
  1959. If (i_enumSearchTarget And ST_URI_E) Then
  1960. str = p_GetXPathAttributeString(HHT_URI_C, i_strStringToFind)
  1961. strQuery = strQuery & " or " & str
  1962. End If
  1963. If (i_enumSearchTarget And ST_COMMENTS_E) Then
  1964. str = p_GetXPathAttributeString(HHT_comments_C, i_strStringToFind)
  1965. strQuery = strQuery & " or " & str
  1966. End If
  1967. If (i_enumSearchTarget And ST_BASE_FILE_E) Then
  1968. str = p_GetXPathAttributeString(HHT_basefile_C, i_strStringToFind)
  1969. strQuery = strQuery & " or " & str
  1970. End If
  1971. strQuery = strQuery & ")"
  1972. End If
  1973. If (i_enumSearchTarget And ST_SELF_AUTHORING_GROUP_E) Then
  1974. str = "attribute::" & HHT_authoringgroup_C & "=""" & p_intAuthoringGroup & """"
  1975. strQuery = strQuery & " and " & str
  1976. End If
  1977. If (i_enumSearchTarget And ST_NODES_WITHOUT_KEYWORDS_E) Then
  1978. str = "attribute::" & HHT_keywords_C & "="""" and "
  1979. str = str & "attribute::" & HHT_leaf_C & "=""False"""
  1980. strQuery = strQuery & " and " & str
  1981. End If
  1982. If (i_enumSearchTarget And ST_TOPICS_WITHOUT_KEYWORDS_E) Then
  1983. str = "attribute::" & HHT_keywords_C & "="""" and "
  1984. str = str & "attribute::" & HHT_leaf_C & "=""True"""
  1985. strQuery = strQuery & " and " & str
  1986. End If
  1987. If (i_enumSearchTarget And _
  1988. (ST_BROKEN_LINK_WINME_E Or _
  1989. ST_BROKEN_LINK_STD_E Or _
  1990. ST_BROKEN_LINK_PRO_E Or _
  1991. ST_BROKEN_LINK_PRO64_E Or _
  1992. ST_BROKEN_LINK_SRV_E Or _
  1993. ST_BROKEN_LINK_ADV_E Or _
  1994. ST_BROKEN_LINK_ADV64_E Or _
  1995. ST_BROKEN_LINK_DAT_E Or _
  1996. ST_BROKEN_LINK_DAT64_E)) Then
  1997. p_ComputeBrokenLinkAttributes i_enumSearchTarget
  1998. str = p_GetBrokenLinkXPathQuery(i_enumSearchTarget)
  1999. strQuery = strQuery & " and " & str
  2000. End If
  2001. strQuery = strQuery & "]"
  2002. p_GetXPathQuery = strQuery
  2003. End Function
  2004. Public Function Find( _
  2005. ByVal i_strStringToFind As String, _
  2006. ByVal i_enumSearchTarget As SEARCH_TARGET_E _
  2007. ) As MSXML2.IXMLDOMNodeList
  2008. Dim str As String
  2009. Dim DOMNodeRoot As MSXML2.IXMLDOMNode
  2010. Dim DOMDocument As MSXML2.DOMDocument
  2011. Dim strQuery As String
  2012. str = LCase$(i_strStringToFind)
  2013. strQuery = p_GetXPathQuery(str, i_enumSearchTarget)
  2014. Set DOMNodeRoot = treTaxonomy.Nodes(KEY_PREFIX_C & ROOT_TID_C).Tag
  2015. Set DOMDocument = DOMNodeRoot.ownerDocument
  2016. DOMDocument.setProperty "SelectionLanguage", "XPath"
  2017. Set Find = DOMNodeRoot.selectNodes(strQuery)
  2018. End Function
  2019. Public Sub Highlight( _
  2020. ByVal i_intTID As Long _
  2021. )
  2022. Dim Node As Node
  2023. If (Not p_NodeExists(i_intTID)) Then
  2024. MsgBox "The Node or Topic no longer exists", vbOKOnly
  2025. Exit Sub
  2026. End If
  2027. Set Node = treTaxonomy.Nodes(KEY_PREFIX_C & i_intTID)
  2028. Node.EnsureVisible
  2029. treTaxonomy_NodeClick Node
  2030. Set treTaxonomy.SelectedItem = Node
  2031. End Sub
  2032. Public Sub SetURI(ByVal i_strURI As String)
  2033. txtURI = i_strURI
  2034. End Sub
  2035. Public Sub SetKeywords(ByVal i_dictKeywordsWithTitle As Scripting.Dictionary)
  2036. On Error GoTo LErrorHandler
  2037. Dim intKID As Variant
  2038. p_dictKeywordsWithTitle.RemoveAll
  2039. For Each intKID In i_dictKeywordsWithTitle.Keys
  2040. p_dictKeywordsWithTitle.Add intKID, i_dictKeywordsWithTitle(intKID)
  2041. If (Not CollectionContainsKey(p_colKeywords, intKID)) Then
  2042. p_colKeywords.Add i_dictKeywordsWithTitle(intKID), CStr(intKID)
  2043. End If
  2044. Next
  2045. p_SetKeywordsList
  2046. p_UserChangedSomethingForCurrentNode
  2047. Exit Sub
  2048. LErrorHandler:
  2049. g_ErrorInfo.SetInfoAndRaiseError "SetKeywords"
  2050. End Sub
  2051. Public Sub AddRemoveKeywordsFormGoingAway()
  2052. p_blnAddRemoveKeywordsOpen = False
  2053. End Sub
  2054. Public Sub SetSKUs(i_enumSKUs As SKU_E)
  2055. On Error GoTo LErrorHandler
  2056. Dim T0 As Date
  2057. Dim T1 As Date
  2058. If (p_enumFilterSKUs <> i_enumSKUs) Then
  2059. p_enumFilterSKUs = i_enumSKUs
  2060. p_StrikeoutUnselectedSKUs
  2061. T0 = Now
  2062. p_UpdateSubTree ROOT_TID_C, ALL_SKUS_C
  2063. T1 = Now
  2064. Debug.Print "SetSKUs: " & FormatTime(T0, T1)
  2065. End If
  2066. Exit Sub
  2067. LErrorHandler:
  2068. g_ErrorInfo.SetInfoAndRaiseError "SetSKUs"
  2069. End Sub
  2070. Private Function p_IsLeaf(i_Node As Node) As Boolean
  2071. If ((i_Node.Image = IMAGE_LEAF_E) Or (i_Node.Image = IMAGE_BAD_LEAF_E) Or _
  2072. (i_Node.Image = IMAGE_FOREIGN_LEAF_E)) Then
  2073. p_IsLeaf = True
  2074. Else
  2075. p_IsLeaf = False
  2076. End If
  2077. End Function
  2078. Private Function p_IsRoot(i_Node As Node) As Boolean
  2079. If (i_Node.Parent Is Nothing) Then
  2080. p_IsRoot = True
  2081. Else
  2082. p_IsRoot = False
  2083. End If
  2084. End Function
  2085. Private Function p_NodeDeleted(i_Node As Node) As Boolean
  2086. Dim Node As Node
  2087. On Error GoTo LErrorHandler
  2088. Set Node = i_Node.Parent
  2089. p_NodeDeleted = False
  2090. Exit Function
  2091. LErrorHandler:
  2092. p_NodeDeleted = True
  2093. End Function
  2094. Private Function p_NodeExists(i_intTID As Long) As Boolean
  2095. Dim Node As Node
  2096. If (p_blnUpdating) Then
  2097. Set Node = treTaxonomy.Nodes(MODIFY_KEY_C)
  2098. If (XMLGetAttribute(Node.Tag, HHT_tid_C) = i_intTID) Then
  2099. p_NodeExists = True
  2100. Exit Function
  2101. End If
  2102. End If
  2103. On Error GoTo LErrorHandler
  2104. Set Node = treTaxonomy.Nodes(KEY_PREFIX_C & i_intTID)
  2105. p_NodeExists = True
  2106. Exit Function
  2107. LErrorHandler:
  2108. p_NodeExists = False
  2109. End Function
  2110. Private Sub p_UserChangedSomethingForCurrentNode()
  2111. On Error GoTo LErrorHandler
  2112. If (p_blnCreating Or p_blnUpdating) Then
  2113. Exit Sub
  2114. End If
  2115. p_SetModeUpdating True
  2116. Exit Sub
  2117. LErrorHandler:
  2118. g_ErrorInfo.SetInfoAndDump "p_UserChangedSomethingForCurrentNode"
  2119. End Sub
  2120. Private Sub p_SetLastModified( _
  2121. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2122. )
  2123. Dim strLastModified As String
  2124. strLastModified = "Modified by " & XMLGetAttribute(i_DOMNode, HHT_username_C) & _
  2125. " on " & XMLGetAttribute(i_DOMNode, HHT_modifiedtime_C)
  2126. lblLastModified.Caption = strLastModified
  2127. End Sub
  2128. Private Sub p_UpdateRHSControls( _
  2129. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2130. )
  2131. On Error GoTo LErrorHandler
  2132. Dim enumSKUs As SKU_E
  2133. Dim intAllowedSKUs As Long
  2134. Dim enumAllowedSKUs As SKU_E
  2135. Dim intIndex As Long
  2136. Dim arrKIDs() As String
  2137. Dim intKID As Long
  2138. Dim strKeyword As String
  2139. Dim intType As Long
  2140. Dim blnSettingControls As Boolean
  2141. blnSettingControls = p_blnSettingControls
  2142. p_blnSettingControls = True
  2143. txtTitle = XMLGetAttribute(i_DOMNode, HHT_TITLE_C)
  2144. txtDescription = XMLGetAttribute(i_DOMNode, HHT_DESCRIPTION_C)
  2145. txtURI = XMLGetAttribute(i_DOMNode, HHT_URI_C)
  2146. txtIconURI = XMLGetAttribute(i_DOMNode, HHT_ICONURI_C)
  2147. txtComments = XMLGetAttribute(i_DOMNode, HHT_comments_C)
  2148. txtEntry = XMLGetAttribute(i_DOMNode, HHT_ENTRY_C)
  2149. p_DisableEntry
  2150. p_SetLastModified i_DOMNode
  2151. chkVisible.Value = IIf(XMLGetAttribute(i_DOMNode, HHT_VISIBLE_C), 1, 0)
  2152. If (XMLGetAttribute(i_DOMNode, HHT_leaf_C)) Then
  2153. p_DisableSubSite
  2154. p_DisableNavModel
  2155. p_DisableEditEntry
  2156. Else
  2157. p_EnableSubSite
  2158. p_EnableNavModel
  2159. p_EnableEditEntry
  2160. End If
  2161. chkSubSite.Value = IIf(XMLGetAttribute(i_DOMNode, HHT_SUBSITE_C), 1, 0)
  2162. p_SetTypeComboIndex -1
  2163. intType = XMLGetAttribute(i_DOMNode, HHT_TYPE_C)
  2164. For intIndex = 0 To cboType.ListCount - 1
  2165. If (cboType.ItemData(intIndex) = intType) Then
  2166. p_SetTypeComboIndex intIndex
  2167. Exit For
  2168. End If
  2169. Next
  2170. p_SetNavModelCombo XMLGetAttribute(i_DOMNode, HHT_NAVIGATIONMODEL_C)
  2171. p_SetLocIncludeCombo XMLGetAttribute(i_DOMNode, HHT_locinclude_C)
  2172. p_SetSKUs XMLGetAttribute(i_DOMNode, HHT_skus_C), _
  2173. XMLGetAttribute(i_DOMNode, HHT_allowedskus_C)
  2174. If (txtURI <> "") Then
  2175. p_EnableNavigateLink
  2176. Else
  2177. p_DisableNavigateLink
  2178. End If
  2179. arrKIDs = Split(XMLGetAttribute(i_DOMNode, HHT_keywords_C), " ")
  2180. p_dictKeywordsWithTitle.RemoveAll
  2181. ' This loop is time consuming and sometimes causes a couple of seconds delay.
  2182. ' This mostly happens when there are a lot of KIDs of deleted keywords.
  2183. For intIndex = LBound(arrKIDs) To UBound(arrKIDs)
  2184. If (arrKIDs(intIndex) <> "") Then
  2185. intKID = arrKIDs(intIndex)
  2186. If (CollectionContainsKey(p_colKeywords, intKID)) Then
  2187. p_dictKeywordsWithTitle.Add intKID, p_colKeywords(CStr(intKID))
  2188. Else
  2189. ' It is possible that Keyword propagation (for same URI) has gotten
  2190. ' us new KIDs for which we don't have any Keyword.
  2191. p_clsKeywords.GetKeyword intKID, strKeyword
  2192. If (strKeyword <> "") Then
  2193. p_colKeywords.Add strKeyword, CStr(intKID)
  2194. p_dictKeywordsWithTitle.Add intKID, strKeyword
  2195. End If
  2196. End If
  2197. End If
  2198. Next
  2199. p_SetKeywordsList
  2200. ' Reset it to the state it was in when this function was called.
  2201. p_blnSettingControls = blnSettingControls
  2202. If (p_blnAddRemoveKeywordsOpen) Then
  2203. cmdAddRemove_Click
  2204. End If
  2205. Exit Sub
  2206. LErrorHandler:
  2207. p_blnSettingControls = blnSettingControls
  2208. g_ErrorInfo.SetInfoAndRaiseError "p_UpdateRHSControls"
  2209. End Sub
  2210. Private Sub p_SetSKUs(i_enumSelectedSKUs As SKU_E, i_enumAllowedSKUs As SKU_E)
  2211. p_ClearSKUs
  2212. p_DisableSKUs
  2213. If (i_enumAllowedSKUs And SKU_STANDARD_E) Then
  2214. chkStandard.Enabled = True
  2215. If (i_enumSelectedSKUs And SKU_STANDARD_E) Then
  2216. chkStandard.Value = 1
  2217. End If
  2218. End If
  2219. If (i_enumAllowedSKUs And SKU_PROFESSIONAL_E) Then
  2220. chkProfessional.Enabled = True
  2221. If (i_enumSelectedSKUs And SKU_PROFESSIONAL_E) Then
  2222. chkProfessional.Value = 1
  2223. End If
  2224. End If
  2225. If (i_enumAllowedSKUs And SKU_PROFESSIONAL_64_E) Then
  2226. chkProfessional64.Enabled = True
  2227. If (i_enumSelectedSKUs And SKU_PROFESSIONAL_64_E) Then
  2228. chkProfessional64.Value = 1
  2229. End If
  2230. End If
  2231. If (i_enumAllowedSKUs And SKU_WINDOWS_MILLENNIUM_E) Then
  2232. chkWindowsMillennium.Enabled = True
  2233. If (i_enumSelectedSKUs And SKU_WINDOWS_MILLENNIUM_E) Then
  2234. chkWindowsMillennium.Value = 1
  2235. End If
  2236. End If
  2237. If (i_enumAllowedSKUs And SKU_SERVER_E) Then
  2238. chkServer.Enabled = True
  2239. If (i_enumSelectedSKUs And SKU_SERVER_E) Then
  2240. chkServer.Value = 1
  2241. End If
  2242. End If
  2243. If (i_enumAllowedSKUs And SKU_ADVANCED_SERVER_E) Then
  2244. chkAdvancedServer.Enabled = True
  2245. If (i_enumSelectedSKUs And SKU_ADVANCED_SERVER_E) Then
  2246. chkAdvancedServer.Value = 1
  2247. End If
  2248. End If
  2249. If (i_enumAllowedSKUs And SKU_DATA_CENTER_SERVER_E) Then
  2250. chkDataCenterServer.Enabled = True
  2251. If (i_enumSelectedSKUs And SKU_DATA_CENTER_SERVER_E) Then
  2252. chkDataCenterServer.Value = 1
  2253. End If
  2254. End If
  2255. If (i_enumAllowedSKUs And SKU_ADVANCED_SERVER_64_E) Then
  2256. chkAdvancedServer64.Enabled = True
  2257. If (i_enumSelectedSKUs And SKU_ADVANCED_SERVER_64_E) Then
  2258. chkAdvancedServer64.Value = 1
  2259. End If
  2260. End If
  2261. If (i_enumAllowedSKUs And SKU_DATA_CENTER_SERVER_64_E) Then
  2262. chkDataCenterServer64.Enabled = True
  2263. If (i_enumSelectedSKUs And SKU_DATA_CENTER_SERVER_64_E) Then
  2264. chkDataCenterServer64.Value = 1
  2265. End If
  2266. End If
  2267. End Sub
  2268. Private Function p_GetSelectedSKUs() As SKU_E
  2269. Dim enumSelectedSKUs As SKU_E
  2270. If (chkStandard.Value = 1) Then
  2271. enumSelectedSKUs = enumSelectedSKUs Or SKU_STANDARD_E
  2272. End If
  2273. If (chkProfessional.Value = 1) Then
  2274. enumSelectedSKUs = enumSelectedSKUs Or SKU_PROFESSIONAL_E
  2275. End If
  2276. If (chkProfessional64.Value = 1) Then
  2277. enumSelectedSKUs = enumSelectedSKUs Or SKU_PROFESSIONAL_64_E
  2278. End If
  2279. If (chkWindowsMillennium.Value = 1) Then
  2280. enumSelectedSKUs = enumSelectedSKUs Or SKU_WINDOWS_MILLENNIUM_E
  2281. End If
  2282. If (chkServer.Value = 1) Then
  2283. enumSelectedSKUs = enumSelectedSKUs Or SKU_SERVER_E
  2284. End If
  2285. If (chkAdvancedServer.Value = 1) Then
  2286. enumSelectedSKUs = enumSelectedSKUs Or SKU_ADVANCED_SERVER_E
  2287. End If
  2288. If (chkDataCenterServer.Value = 1) Then
  2289. enumSelectedSKUs = enumSelectedSKUs Or SKU_DATA_CENTER_SERVER_E
  2290. End If
  2291. If (chkAdvancedServer64.Value = 1) Then
  2292. enumSelectedSKUs = enumSelectedSKUs Or SKU_ADVANCED_SERVER_64_E
  2293. End If
  2294. If (chkDataCenterServer64.Value = 1) Then
  2295. enumSelectedSKUs = enumSelectedSKUs Or SKU_DATA_CENTER_SERVER_64_E
  2296. End If
  2297. p_GetSelectedSKUs = enumSelectedSKUs
  2298. End Function
  2299. Private Function p_GetSelectedNavModel() As Long
  2300. If (cboNavModel.ListIndex = -1) Then
  2301. p_GetSelectedNavModel = NAVMODEL_DEFAULT_NUM_C
  2302. Else
  2303. p_GetSelectedNavModel = cboNavModel.ItemData(cboNavModel.ListIndex)
  2304. End If
  2305. End Function
  2306. Private Function p_GetSelectedType() As Long
  2307. If (cboType.ListIndex = -1) Then
  2308. p_GetSelectedType = 0
  2309. Else
  2310. p_GetSelectedType = cboType.ItemData(cboType.ListIndex)
  2311. End If
  2312. End Function
  2313. Private Function p_GetSelectedLocInclude() As String
  2314. p_GetSelectedLocInclude = cboLocInclude.Text
  2315. End Function
  2316. Private Sub p_SetNodeColor( _
  2317. ByRef i_Node As Node, _
  2318. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2319. )
  2320. Dim enumSKUs As SKU_E
  2321. Dim blnVisible As Boolean
  2322. Dim blnSubSite As Boolean
  2323. enumSKUs = XMLGetAttribute(i_DOMNode, HHT_skus_C) And _
  2324. XMLGetAttribute(i_DOMNode, HHT_allowedskus_C)
  2325. blnVisible = XMLGetAttribute(i_DOMNode, HHT_VISIBLE_C)
  2326. blnSubSite = XMLGetAttribute(i_DOMNode, HHT_SUBSITE_C)
  2327. If ((p_enumFilterSKUs And enumSKUs) = 0) Then
  2328. i_Node.ForeColor = vbWhite
  2329. i_Node.BackColor = vbWhite
  2330. Else
  2331. If (blnVisible) Then
  2332. i_Node.ForeColor = vbBlack
  2333. Else
  2334. i_Node.ForeColor = &HB0B0B0
  2335. End If
  2336. End If
  2337. If (blnSubSite) Then
  2338. i_Node.Bold = True
  2339. Else
  2340. i_Node.Bold = False
  2341. End If
  2342. End Sub
  2343. Private Sub p_SetNodeImage( _
  2344. ByRef i_Node As Node, _
  2345. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2346. )
  2347. Dim blnLeaf As Boolean
  2348. Dim intAG As Long
  2349. blnLeaf = XMLGetAttribute(i_DOMNode, HHT_leaf_C)
  2350. intAG = XMLGetAttribute(i_DOMNode, HHT_authoringgroup_C)
  2351. If (intAG <> p_intAuthoringGroup) Then
  2352. If (blnLeaf) Then
  2353. i_Node.Image = IMAGE_FOREIGN_LEAF_E
  2354. Else
  2355. i_Node.Image = IMAGE_FOREIGN_GROUP_E
  2356. End If
  2357. Exit Sub
  2358. End If
  2359. If (blnLeaf) Then
  2360. i_Node.Image = IMAGE_LEAF_E
  2361. Else
  2362. i_Node.Image = IMAGE_GROUP_E
  2363. End If
  2364. End Sub
  2365. Private Sub p_DeleteNodeBeingCreated()
  2366. On Error GoTo LErrorHandler
  2367. treTaxonomy.Nodes.Remove CREATE_KEY_C
  2368. Exit Sub
  2369. LErrorHandler:
  2370. g_ErrorInfo.SetInfoAndRaiseError "p_DeleteNodeBeingCreated"
  2371. End Sub
  2372. Private Sub p_SetModeCreating(i_bln As Boolean)
  2373. On Error GoTo LErrorHandler
  2374. If (i_bln And Not p_blnCreating) Then
  2375. p_blnCreating = True
  2376. p_DisableCreate
  2377. p_DisableDelete
  2378. p_DisableRefresh
  2379. p_EnableSaveCancel
  2380. p_SetStatusText SBPANEL_MODE, "Creating Node/Topic"
  2381. ElseIf (Not i_bln And p_blnCreating) Then
  2382. p_blnCreating = False
  2383. p_EnableRefresh
  2384. p_DisableSaveCancel
  2385. p_SetStatusText SBPANEL_MODE, ""
  2386. End If
  2387. Exit Sub
  2388. LErrorHandler:
  2389. g_ErrorInfo.SetInfoAndRaiseError "p_SetModeCreating"
  2390. End Sub
  2391. Private Sub p_SetModeUpdating(i_bln As Boolean)
  2392. On Error GoTo LErrorHandler
  2393. Dim Node As Node
  2394. If (i_bln And Not p_blnUpdating) Then
  2395. p_blnUpdating = True
  2396. treTaxonomy.SelectedItem.Key = MODIFY_KEY_C
  2397. p_DisableCreate
  2398. p_DisableDelete
  2399. p_DisableRefresh
  2400. p_EnableSaveCancel
  2401. p_SetStatusText SBPANEL_MODE, "Modifying Node/Topic"
  2402. ElseIf (Not i_bln And p_blnUpdating) Then
  2403. p_blnUpdating = False
  2404. p_EnableRefresh
  2405. Set Node = treTaxonomy.Nodes(MODIFY_KEY_C)
  2406. Node.Key = KEY_PREFIX_C & XMLGetAttribute(Node.Tag, HHT_tid_C)
  2407. Node.Text = XMLGetAttribute(Node.Tag, HHT_TITLE_C)
  2408. p_DisableSaveCancel
  2409. p_SetStatusText SBPANEL_MODE, ""
  2410. End If
  2411. Exit Sub
  2412. LErrorHandler:
  2413. g_ErrorInfo.SetInfoAndRaiseError "p_SetModeUpdating"
  2414. End Sub
  2415. Private Sub p_ExportHHT( _
  2416. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2417. )
  2418. On Error GoTo LErrorHandler
  2419. Dim strFileName As String
  2420. Dim DOMNode As MSXML2.IXMLDOMNode
  2421. Dim strStatusText As String
  2422. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  2423. dlgCommon.CancelError = True
  2424. dlgCommon.Flags = cdlOFNHideReadOnly
  2425. dlgCommon.Filter = XML_FILE_FILTER_C
  2426. dlgCommon.ShowSave
  2427. strFileName = Trim$(dlgCommon.FileName)
  2428. If (strFileName = "") Then
  2429. Exit Sub
  2430. End If
  2431. Me.Enabled = False
  2432. p_clsHHT.ExportHHT strFileName
  2433. LEnd:
  2434. Me.Enabled = True
  2435. p_SetStatusText SBPANEL_DATABASE, strStatusText
  2436. Exit Sub
  2437. LErrorHandler:
  2438. Select Case Err.Number
  2439. Case cdlCancel
  2440. ' Nothing. The user cancelled.
  2441. Case Else
  2442. g_ErrorInfo.SetInfoAndDump "p_ExportHHT"
  2443. End Select
  2444. GoTo LEnd
  2445. End Sub
  2446. Private Sub p_CreateNode(i_blnGroupNode As Boolean)
  2447. On Error GoTo LErrorHandler
  2448. Dim DOMNode As MSXML2.IXMLDOMNode
  2449. Dim nodeNew As Node
  2450. Dim strParentKey As String
  2451. Dim intParentTID As Long
  2452. Dim enumSelectedSKUs As SKU_E
  2453. If (p_blnCreating Or p_blnUpdating) Then
  2454. Exit Sub
  2455. End If
  2456. p_SetModeCreating True
  2457. Set DOMNode = treTaxonomy.SelectedItem.Tag
  2458. intParentTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2459. strParentKey = KEY_PREFIX_C & intParentTID
  2460. Set nodeNew = treTaxonomy.Nodes.Add(strParentKey, tvwChild, CREATE_KEY_C)
  2461. Set nodeNew.Tag = DOMNode
  2462. If (i_blnGroupNode) Then
  2463. nodeNew.Image = IMAGE_GROUP_E
  2464. p_EnableSubSite
  2465. p_EnableNavModel
  2466. p_EnableEditEntry
  2467. Else
  2468. nodeNew.Image = IMAGE_LEAF_E
  2469. p_DisableSubSite
  2470. p_DisableNavModel
  2471. p_DisableEditEntry
  2472. End If
  2473. Set treTaxonomy.SelectedItem = nodeNew
  2474. nodeNew.EnsureVisible
  2475. p_DisableUnselectedSKUs
  2476. p_EnableNodeDetailsExceptIndividualSKUs
  2477. p_EnableNavigateLink
  2478. p_EnableAddRemoveAndKeywordsCombo
  2479. chkSubSite.Value = 0
  2480. p_SetNavModelCombo NAVMODEL_DEFAULT_STR_C
  2481. enumSelectedSKUs = p_GetSelectedSKUs
  2482. p_SetSKUs enumSelectedSKUs, enumSelectedSKUs
  2483. txtTitle = ""
  2484. txtDescription = ""
  2485. txtURI = ""
  2486. txtIconURI = ""
  2487. txtComments = ""
  2488. txtEntry = ""
  2489. lblLastModified = ""
  2490. txtTitle.SetFocus
  2491. p_dictKeywordsWithTitle.RemoveAll
  2492. p_SetKeywordsList
  2493. Exit Sub
  2494. LErrorHandler:
  2495. g_ErrorInfo.SetInfoAndRaiseError "p_CreateNode"
  2496. End Sub
  2497. Private Sub p_ReplaceTaxonomySubtree( _
  2498. ByVal u_DOMNode As MSXML2.IXMLDOMNode, _
  2499. ByVal i_intParentTID As Long, _
  2500. ByVal i_enumSKUs As SKU_E, _
  2501. ByVal i_blnFastImport As Boolean _
  2502. )
  2503. Dim DOMNode As MSXML2.IXMLDOMNode
  2504. Dim T0 As Date
  2505. Dim T1 As Date
  2506. T0 = Now
  2507. If (u_DOMNode.nodeName = HHT_TAXONOMY_ENTRIES_C) Then
  2508. If (Not (u_DOMNode.firstChild Is Nothing)) Then
  2509. For Each DOMNode In u_DOMNode.childNodes
  2510. p_ReplaceTaxonomySubtree2 DOMNode, i_intParentTID, i_enumSKUs, i_blnFastImport
  2511. Next
  2512. End If
  2513. ElseIf (u_DOMNode.nodeName = HHT_TAXONOMY_ENTRY_C) Then
  2514. p_ReplaceTaxonomySubtree2 u_DOMNode, i_intParentTID, i_enumSKUs, i_blnFastImport
  2515. End If
  2516. T1 = Now
  2517. Debug.Print "p_ReplaceTaxonomySubtree: " & FormatTime(T0, T1)
  2518. End Sub
  2519. Private Sub p_SetTypeSKUsLeafLocIncludeVisibleSubSite( _
  2520. ByVal u_DOMNode As MSXML2.IXMLDOMNode, _
  2521. ByVal i_enumSKUs As SKU_E, _
  2522. ByRef i_strLocInclude As String _
  2523. )
  2524. Dim DOMNode As MSXML2.IXMLDOMNode
  2525. Dim blnHasChildren As Boolean
  2526. If (XMLGetAttribute(u_DOMNode, HHT_TYPE_C) = "") Then
  2527. XMLSetAttribute u_DOMNode, HHT_TYPE_C, 0
  2528. End If
  2529. XMLSetAttribute u_DOMNode, HHT_skus_C, i_enumSKUs
  2530. If (Not u_DOMNode.firstChild Is Nothing) Then
  2531. blnHasChildren = True
  2532. End If
  2533. If (XMLGetAttribute(u_DOMNode, HHT_leaf_C) = "") Then
  2534. XMLSetAttribute u_DOMNode, HHT_leaf_C, IIf(blnHasChildren, False, True)
  2535. End If
  2536. XMLSetAttribute u_DOMNode, HHT_locinclude_C, i_strLocInclude
  2537. If (XMLGetAttribute(u_DOMNode, HHT_VISIBLE_C) = "") Then
  2538. XMLSetAttribute u_DOMNode, HHT_VISIBLE_C, CStr(True)
  2539. End If
  2540. If (XMLGetAttribute(u_DOMNode, HHT_SUBSITE_C) = "") Then
  2541. XMLSetAttribute u_DOMNode, HHT_SUBSITE_C, CStr(False)
  2542. End If
  2543. If (blnHasChildren) Then
  2544. For Each DOMNode In u_DOMNode.childNodes
  2545. p_SetTypeSKUsLeafLocIncludeVisibleSubSite DOMNode, i_enumSKUs, i_strLocInclude
  2546. Next
  2547. End If
  2548. End Sub
  2549. Private Sub p_ReplaceTaxonomySubtree2( _
  2550. ByVal u_DOMNode As MSXML2.IXMLDOMNode, _
  2551. ByVal i_intParentTID As Long, _
  2552. ByVal i_enumSKUs As SKU_E, _
  2553. ByVal i_blnFastImport As Boolean _
  2554. )
  2555. On Error GoTo LErrorHandler
  2556. Dim strStatusText As String
  2557. Dim NodeParent As Node
  2558. Dim strLocInclude As String
  2559. Me.MousePointer = vbHourglass
  2560. Me.Enabled = False
  2561. strStatusText = p_GetStatusText(SBPANEL_DATABASE)
  2562. ' For some reason, if nodeParent is passed in to p_ReplaceTaxonomySubtree2
  2563. ' from treTaxonomy_DragDrop, we get the error "The items's control has been
  2564. ' deleted" after about 20 min of processing. So we pass in the TID instead.
  2565. Set NodeParent = treTaxonomy.Nodes(KEY_PREFIX_C & i_intParentTID)
  2566. p_SetStatusText SBPANEL_DATABASE, "Creating new Nodes/Topics..."
  2567. strLocInclude = XMLGetAttribute(NodeParent.Tag, HHT_locinclude_C)
  2568. p_SetTypeSKUsLeafLocIncludeVisibleSubSite u_DOMNode, i_enumSKUs, strLocInclude
  2569. p_CreateTaxonomyEntries u_DOMNode, NodeParent, i_blnFastImport
  2570. LEnd:
  2571. Me.Enabled = True
  2572. Me.MousePointer = vbDefault
  2573. p_SetStatusText SBPANEL_DATABASE, strStatusText
  2574. Exit Sub
  2575. LErrorHandler:
  2576. g_ErrorInfo.SetInfoAndDump "p_ReplaceTaxonomySubtree2"
  2577. GoTo LEnd
  2578. End Sub
  2579. Private Sub p_SaveClicked( _
  2580. ByRef o_blnUpdateControls As Boolean _
  2581. )
  2582. Dim str As String
  2583. Dim intError As Long
  2584. Dim bln As Boolean
  2585. Dim intTID As Long
  2586. If (p_blnUpdating) Then
  2587. intTID = XMLGetAttribute(treTaxonomy.Nodes(MODIFY_KEY_C).Tag, HHT_tid_C)
  2588. If (intTID = ROOT_TID_C) Then
  2589. p_SetModeUpdating False
  2590. o_blnUpdateControls = True
  2591. Exit Sub
  2592. End If
  2593. End If
  2594. o_blnUpdateControls = False
  2595. str = RemoveExtraSpaces(txtTitle)
  2596. If (str = "") Then
  2597. MsgBox "Title cannot be blank", vbExclamation Or vbOKOnly
  2598. txtTitle.SetFocus
  2599. Exit Sub
  2600. End If
  2601. If (p_blnCreating) Then
  2602. bln = p_CreateTaxonomy
  2603. ElseIf (p_blnUpdating) Then
  2604. bln = p_UpdateTaxonomy
  2605. End If
  2606. o_blnUpdateControls = bln
  2607. End Sub
  2608. Private Function p_GetAllowedSKUs( _
  2609. ByRef i_DOMNodeParent As MSXML2.IXMLDOMNode _
  2610. ) As SKU_E
  2611. p_GetAllowedSKUs = XMLGetAttribute(i_DOMNodeParent, HHT_allowedskus_C) And _
  2612. XMLGetAttribute(i_DOMNodeParent, HHT_skus_C)
  2613. End Function
  2614. Private Function p_CreateTaxonomy() As Boolean
  2615. On Error GoTo LErrorHandler
  2616. Dim intSelectedSKUs As Long
  2617. Dim intParentTID As Long
  2618. Dim Node As Node
  2619. Dim blnLeaf As Boolean
  2620. Dim blnVisible As Boolean
  2621. Dim blnSubSite As Boolean
  2622. Dim strTitle As String
  2623. Dim strDescription As String
  2624. Dim strURI As String
  2625. Dim strIconURI As String
  2626. Dim intTID As Long
  2627. Dim intType As Long
  2628. Dim intNavModel As Long
  2629. Dim strLocInclude As String
  2630. Dim strKeywords As String
  2631. Dim DOMNodeParent As MSXML2.IXMLDOMNode
  2632. Dim DOMNode As MSXML2.IXMLDOMNode
  2633. Dim ModifiedDOMNodes As MSXML2.IXMLDOMNode
  2634. Dim NodeParent As Node
  2635. Dim enumAllowedSKUs As SKU_E
  2636. p_CreateTaxonomy = False
  2637. Set Node = treTaxonomy.Nodes(CREATE_KEY_C)
  2638. Set DOMNodeParent = Node.Tag
  2639. intParentTID = XMLGetAttribute(DOMNodeParent, HHT_tid_C)
  2640. intSelectedSKUs = p_GetSelectedSKUs
  2641. If (p_IsLeaf(Node)) Then
  2642. blnLeaf = True
  2643. Else
  2644. blnLeaf = False
  2645. End If
  2646. strTitle = RemoveExtraSpaces(txtTitle)
  2647. strDescription = RemoveExtraSpaces(txtDescription)
  2648. strURI = RemoveExtraSpaces(txtURI)
  2649. strIconURI = RemoveExtraSpaces(txtIconURI)
  2650. blnVisible = IIf((chkVisible.Value = 0), False, True)
  2651. blnSubSite = IIf((chkSubSite.Value = 0), False, True)
  2652. intType = p_GetSelectedType
  2653. strLocInclude = p_GetSelectedLocInclude
  2654. intNavModel = p_GetSelectedNavModel
  2655. strKeywords = p_GetKeywords
  2656. p_clsTaxonomy.Create strTitle, strDescription, intType, intNavModel, strURI, strIconURI, _
  2657. intSelectedSKUs, blnLeaf, intParentTID, strLocInclude, blnVisible, blnSubSite, _
  2658. strKeywords, "", txtComments, txtEntry, DOMNodeParent.ownerDocument, DOMNode, _
  2659. ModifiedDOMNodes
  2660. p_SetModeCreating False
  2661. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2662. DOMNodeParent.appendChild DOMNode
  2663. treTaxonomy.Nodes.Remove CREATE_KEY_C
  2664. enumAllowedSKUs = p_GetAllowedSKUs(DOMNodeParent)
  2665. Set NodeParent = treTaxonomy.Nodes(KEY_PREFIX_C & intParentTID)
  2666. p_CreateTree DOMNode, NodeParent, enumAllowedSKUs
  2667. p_CreateTaxonomy = True
  2668. p_UpdateTIDs ModifiedDOMNodes
  2669. ' The UI must show the new keywords that were associated by p_clsTaxonomy.Create
  2670. Highlight intTID
  2671. LEnd:
  2672. Exit Function
  2673. LErrorHandler:
  2674. Select Case Err.Number
  2675. Case errContainsGarbageChar
  2676. MsgBox "The Title " & strTitle & _
  2677. " or the Description " & strDescription & _
  2678. " contains garbage characters", _
  2679. vbExclamation + vbOKOnly
  2680. Case errTooLong
  2681. MsgBox "The Title " & strTitle & " is too long", _
  2682. vbExclamation + vbOKOnly
  2683. Case E_FAIL
  2684. DisplayDatabaseLockedError
  2685. Case errDatabaseVersionIncompatible
  2686. DisplayDatabaseVersionError
  2687. Err.Raise Err.Number
  2688. Case errAuthoringGroupNotPresent
  2689. DisplayAuthoringGroupError
  2690. Case Else
  2691. g_ErrorInfo.SetInfoAndRaiseError "p_CreateTaxonomy"
  2692. End Select
  2693. GoTo LEnd
  2694. End Function
  2695. Private Sub p_SetKeywords( _
  2696. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  2697. )
  2698. Dim intTID As Long
  2699. Dim strURI As String
  2700. Dim DOMNodeNew As MSXML2.IXMLDOMNode
  2701. Dim ModifiedDOMNodes As MSXML2.IXMLDOMNode
  2702. Dim dtmModifiedTime As Date
  2703. intTID = XMLGetAttribute(i_DOMNode, HHT_tid_C)
  2704. strURI = XMLGetAttribute(i_DOMNode, HHT_URI_C)
  2705. dtmModifiedTime = XMLGetAttribute(i_DOMNode, HHT_modifiedtime_C)
  2706. p_clsTaxonomy.SetKeywords intTID, strURI, p_strKeywords, dtmModifiedTime, _
  2707. i_DOMNode.ownerDocument, DOMNodeNew, ModifiedDOMNodes
  2708. If (Not DOMNodeNew Is Nothing) Then
  2709. ' If nothing changed, then DOMNodeNew will be Nothing.
  2710. XMLCopyAttributes DOMNodeNew, i_DOMNode
  2711. End If
  2712. If (Not ModifiedDOMNodes Is Nothing) Then
  2713. p_UpdateTIDs ModifiedDOMNodes
  2714. End If
  2715. End Sub
  2716. Private Function p_UpdateTaxonomy() As Boolean
  2717. On Error GoTo LErrorHandler
  2718. Dim intSelectedSKUs As Long
  2719. Dim intTID As Long
  2720. Dim Node As Node
  2721. Dim blnVisible As Boolean
  2722. Dim blnSubSite As Boolean
  2723. Dim strTitle As String
  2724. Dim strDescription As String
  2725. Dim strURI As String
  2726. Dim strIconURI As String
  2727. Dim intType As Long
  2728. Dim intNavModel As Long
  2729. Dim strLocInclude As String
  2730. Dim strKeywords As String
  2731. Dim strOriginalKeywords As String
  2732. Dim strDeletedKeywords As String
  2733. Dim DOMNode As MSXML2.IXMLDOMNode
  2734. Dim DOMNodeNew As MSXML2.IXMLDOMNode
  2735. Dim ModifiedDOMNodes As MSXML2.IXMLDOMNode
  2736. Dim dtmModifiedTime As Date
  2737. Dim enumSKUsOld As SKU_E
  2738. p_UpdateTaxonomy = False
  2739. Set Node = treTaxonomy.Nodes(MODIFY_KEY_C)
  2740. Set DOMNode = Node.Tag
  2741. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2742. intSelectedSKUs = p_GetSelectedSKUs
  2743. blnVisible = IIf((chkVisible.Value = 0), False, True)
  2744. blnSubSite = IIf((chkSubSite.Value = 0), False, True)
  2745. strTitle = RemoveExtraSpaces(txtTitle)
  2746. strDescription = RemoveExtraSpaces(txtDescription)
  2747. strURI = RemoveExtraSpaces(txtURI)
  2748. strIconURI = RemoveExtraSpaces(txtIconURI)
  2749. intType = p_GetSelectedType
  2750. intNavModel = p_GetSelectedNavModel
  2751. strLocInclude = p_GetSelectedLocInclude
  2752. strKeywords = p_GetKeywords
  2753. strOriginalKeywords = XMLGetAttribute(DOMNode, HHT_keywords_C)
  2754. strDeletedKeywords = p_GetDeletedKeywords(strOriginalKeywords, strKeywords)
  2755. dtmModifiedTime = XMLGetAttribute(DOMNode, HHT_modifiedtime_C)
  2756. p_clsTaxonomy.Update intTID, strTitle, strDescription, intType, intNavModel, strURI, _
  2757. strIconURI, intSelectedSKUs, strLocInclude, blnVisible, blnSubSite, strKeywords, _
  2758. strDeletedKeywords, txtComments, txtEntry, dtmModifiedTime, _
  2759. DOMNode.ownerDocument, DOMNodeNew, ModifiedDOMNodes
  2760. enumSKUsOld = XMLGetAttribute(DOMNode, HHT_skus_C)
  2761. If (Not DOMNodeNew Is Nothing) Then
  2762. ' If nothing changed, then DOMNodeNew will be Nothing.
  2763. ' p_SetModeUpdating will set the title. Make sure that it is correct.
  2764. XMLCopyAttributes DOMNodeNew, DOMNode
  2765. End If
  2766. p_SetModeUpdating False
  2767. p_UpdateTaxonomy = True
  2768. If (intSelectedSKUs <> enumSKUsOld) Then
  2769. p_UpdateSubTree intTID, XMLGetAttribute(DOMNode, HHT_allowedskus_C)
  2770. End If
  2771. If (Not ModifiedDOMNodes Is Nothing) Then
  2772. p_UpdateTIDs ModifiedDOMNodes
  2773. End If
  2774. p_SetNodeColor Node, DOMNode
  2775. ' The UI must show the new keywords that were associated by p_clsTaxonomy.Update
  2776. Highlight intTID
  2777. LEnd:
  2778. Exit Function
  2779. LErrorHandler:
  2780. Select Case Err.Number
  2781. Case errContainsGarbageChar
  2782. MsgBox "The Title " & strTitle & _
  2783. " or the Description " & strDescription & _
  2784. " contains garbage characters", _
  2785. vbExclamation + vbOKOnly
  2786. Case errTooLong
  2787. MsgBox "The Title " & strTitle & " is too long", _
  2788. vbExclamation + vbOKOnly
  2789. Case errNodeOrTopicAlreadyModified
  2790. MsgBox "Someone else already modified this entry. " & _
  2791. "You need to Cancel your entry, Refresh the database and then " & _
  2792. "re-enter your changes. " & _
  2793. "This prevents you from accidentally overwriting something " & _
  2794. "the other person entered. " & _
  2795. "Tip: Before cancelling your changes, copy them to Notepad.", _
  2796. vbExclamation + vbOKOnly
  2797. Case E_FAIL
  2798. DisplayDatabaseLockedError
  2799. Case errDatabaseVersionIncompatible
  2800. DisplayDatabaseVersionError
  2801. Err.Raise Err.Number
  2802. Case errNotPermittedForAuthoringGroup, errAuthoringGroupDiffers, errAuthoringGroupNotPresent
  2803. DisplayAuthoringGroupError
  2804. Case Else
  2805. g_ErrorInfo.SetInfoAndRaiseError "p_UpdateTaxonomy"
  2806. End Select
  2807. GoTo LEnd
  2808. End Function
  2809. Private Sub p_UpdateTIDs( _
  2810. ByRef i_ModifiedDOMNodes As MSXML2.IXMLDOMNode _
  2811. )
  2812. Dim DOMNodes As MSXML2.IXMLDOMNode
  2813. Dim DOMNode As MSXML2.IXMLDOMNode
  2814. Dim intTID As Long
  2815. Dim intParentTID As Long
  2816. Dim intOrderUnderParent As Long
  2817. Dim enumSKUs As SKU_E
  2818. Dim Node As Node
  2819. Dim DOMNodeOld As MSXML2.IXMLDOMNode
  2820. Dim intParentTIDOld As Long
  2821. Dim intOrderUnderParentOld As Long
  2822. Dim enumSKUsOld As SKU_E
  2823. Dim blnRefresh As Boolean
  2824. Dim strTitle As String
  2825. Set DOMNodes = XMLFindFirstNode(i_ModifiedDOMNodes, HHT_TAXONOMY_ENTRIES_C)
  2826. If (Not DOMNodes.firstChild Is Nothing) Then
  2827. For Each DOMNode In DOMNodes.childNodes
  2828. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2829. If (Not p_NodeExists(intTID)) Then
  2830. GoTo LForEnd
  2831. End If
  2832. intParentTID = XMLGetAttribute(DOMNode, HHT_parenttid_C)
  2833. intOrderUnderParent = XMLGetAttribute(DOMNode, HHT_orderunderparent_C)
  2834. enumSKUs = XMLGetAttribute(DOMNode, HHT_skus_C)
  2835. Set Node = treTaxonomy.Nodes(KEY_PREFIX_C & intTID)
  2836. Set DOMNodeOld = Node.Tag
  2837. intParentTIDOld = XMLGetAttribute(DOMNodeOld, HHT_parenttid_C)
  2838. intOrderUnderParentOld = XMLGetAttribute(DOMNodeOld, HHT_orderunderparent_C)
  2839. enumSKUsOld = XMLGetAttribute(DOMNodeOld, HHT_skus_C)
  2840. If ((intParentTID <> intParentTIDOld) Or _
  2841. (intOrderUnderParent <> intOrderUnderParentOld)) Then
  2842. blnRefresh = True
  2843. Exit For
  2844. End If
  2845. XMLCopyAttributes DOMNode, DOMNodeOld
  2846. strTitle = XMLGetAttribute(DOMNode, HHT_TITLE_C)
  2847. Node.Text = strTitle
  2848. If (enumSKUs <> enumSKUsOld) Then
  2849. p_UpdateSubTree intTID, XMLGetAttribute(DOMNode, HHT_allowedskus_C)
  2850. End If
  2851. LForEnd:
  2852. Next
  2853. End If
  2854. If (blnRefresh) Then
  2855. cmdRefresh_Click
  2856. End If
  2857. End Sub
  2858. Private Sub p_CreateTaxonomyEntries( _
  2859. ByRef i_DOMNode As MSXML2.IXMLDOMNode, _
  2860. ByRef i_nodeParent As Node, _
  2861. ByVal i_blnFast As Boolean _
  2862. )
  2863. On Error GoTo LErrorHandler
  2864. Dim intParentTID As Long
  2865. Dim DOMNodeParent As MSXML2.IXMLDOMNode
  2866. Dim enumAllowedSKUs As SKU_E
  2867. Dim DOMDoc As MSXML2.DOMDocument
  2868. Dim DOMNode As MSXML2.IXMLDOMNode
  2869. If (p_blnCreating Or p_blnUpdating) Then
  2870. Exit Sub
  2871. End If
  2872. Set DOMNodeParent = i_nodeParent.Tag
  2873. intParentTID = XMLGetAttribute(DOMNodeParent, HHT_tid_C)
  2874. Set DOMDoc = New MSXML2.DOMDocument
  2875. Set DOMNode = HhtPreamble(DOMDoc, True)
  2876. XMLCopyDOMTree i_DOMNode, DOMNode
  2877. Set DOMNode = XMLFindFirstNode(DOMNode, HHT_TAXONOMY_ENTRY_C)
  2878. p_clsTaxonomy.CreateTaxonomyEntries DOMNode, intParentTID, i_blnFast
  2879. enumAllowedSKUs = p_GetAllowedSKUs(DOMNodeParent)
  2880. DOMNodeParent.appendChild DOMNode
  2881. p_CreateTree DOMNode, i_nodeParent, enumAllowedSKUs
  2882. LEnd:
  2883. Exit Sub
  2884. LErrorHandler:
  2885. Select Case Err.Number
  2886. Case E_FAIL
  2887. DisplayDatabaseLockedError
  2888. Case errDatabaseVersionIncompatible
  2889. DisplayDatabaseVersionError
  2890. Err.Raise Err.Number
  2891. Case errAuthoringGroupNotPresent
  2892. DisplayAuthoringGroupError
  2893. Case Else
  2894. g_ErrorInfo.SetInfoAndRaiseError "p_CreateTaxonomyEntries"
  2895. End Select
  2896. GoTo LEnd
  2897. End Sub
  2898. Private Sub p_Move(i_Node As Node, i_nodeRef As Node, i_blnAbove As Boolean)
  2899. On Error GoTo LErrorHandler
  2900. Dim DOMNode As MSXML2.IXMLDOMNode
  2901. Dim DOMNodeRef As MSXML2.IXMLDOMNode
  2902. Dim DOMNodeNewParent As MSXML2.IXMLDOMNode
  2903. Dim intTID As Long
  2904. Dim intRefTID As Long
  2905. Dim dtmModifiedTime As Date
  2906. Dim intNewParentTID As Long
  2907. Dim NodeNewParent As Node
  2908. Dim enumAllowedSKUs As SKU_E
  2909. Dim intOrderUnderParent As Long
  2910. If (p_blnCreating Or p_blnUpdating) Then
  2911. Exit Sub
  2912. End If
  2913. Set DOMNode = i_Node.Tag
  2914. Set DOMNodeRef = i_nodeRef.Tag
  2915. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2916. intRefTID = XMLGetAttribute(DOMNodeRef, HHT_tid_C)
  2917. dtmModifiedTime = XMLGetAttribute(DOMNode, HHT_modifiedtime_C)
  2918. p_clsTaxonomy.Move intTID, intRefTID, i_blnAbove, dtmModifiedTime, intOrderUnderParent
  2919. intNewParentTID = XMLGetAttribute(DOMNodeRef, HHT_parenttid_C)
  2920. XMLSetAttribute DOMNode, HHT_modifiedtime_C, Now
  2921. XMLSetAttribute DOMNode, HHT_parenttid_C, intNewParentTID
  2922. XMLSetAttribute DOMNode, HHT_orderunderparent_C, intOrderUnderParent
  2923. Set DOMNodeNewParent = treTaxonomy.Nodes(KEY_PREFIX_C & intNewParentTID).Tag
  2924. DOMNode.parentNode.removeChild DOMNode
  2925. DOMNodeNewParent.insertBefore DOMNode, DOMNodeRef
  2926. treTaxonomy.Nodes.Remove i_Node.Key
  2927. enumAllowedSKUs = p_GetAllowedSKUs(DOMNodeNewParent)
  2928. p_CreateTree DOMNode, i_nodeRef.Parent, enumAllowedSKUs, _
  2929. i_nodeRef, i_blnAbove
  2930. treTaxonomy_NodeClick treTaxonomy.SelectedItem
  2931. LEnd:
  2932. Exit Sub
  2933. LErrorHandler:
  2934. Select Case Err.Number
  2935. Case errRefNodeCannotBeDescendent
  2936. MsgBox "A Node cannot move above or below a descendent Node", _
  2937. vbExclamation + vbOKOnly
  2938. Case errNodeOrTopicAlreadyModified
  2939. MsgBox "Someone else already modified this entry. " & _
  2940. "You need to Refresh the database and then try again. " & _
  2941. "This prevents you from accidentally overwriting something " & _
  2942. "the other person entered.", _
  2943. vbExclamation + vbOKOnly
  2944. Case E_FAIL
  2945. DisplayDatabaseLockedError
  2946. Case errDatabaseVersionIncompatible
  2947. DisplayDatabaseVersionError
  2948. Err.Raise Err.Number
  2949. Case errNotPermittedForAuthoringGroup, errAuthoringGroupDiffers, errAuthoringGroupNotPresent
  2950. DisplayAuthoringGroupError
  2951. Case Else
  2952. g_ErrorInfo.SetInfoAndRaiseError "p_Move"
  2953. End Select
  2954. GoTo LEnd
  2955. End Sub
  2956. Private Sub p_ChangeParent(i_Node As Node, i_nodeParent As Node)
  2957. On Error GoTo LErrorHandler
  2958. Dim DOMNode As MSXML2.IXMLDOMNode
  2959. Dim intTID As Long
  2960. Dim intOldParentTID As Long
  2961. Dim intNewParentTID As Long
  2962. Dim dtmModifiedTime As Date
  2963. Dim DOMNodeNewParent As MSXML2.IXMLDOMNode
  2964. Dim NodeNewParent As Node
  2965. Dim enumAllowedSKUs As SKU_E
  2966. Dim intOrderUnderParent As Long
  2967. If (p_blnCreating Or p_blnUpdating) Then
  2968. Exit Sub
  2969. End If
  2970. Set DOMNode = i_Node.Tag
  2971. Set DOMNodeNewParent = i_nodeParent.Tag
  2972. intTID = XMLGetAttribute(DOMNode, HHT_tid_C)
  2973. intOldParentTID = XMLGetAttribute(i_Node.Parent.Tag, HHT_tid_C)
  2974. intNewParentTID = XMLGetAttribute(DOMNodeNewParent, HHT_tid_C)
  2975. dtmModifiedTime = XMLGetAttribute(DOMNode, HHT_modifiedtime_C)
  2976. Set NodeNewParent = treTaxonomy.Nodes(KEY_PREFIX_C & intNewParentTID)
  2977. If (intOldParentTID = intNewParentTID) Then
  2978. Exit Sub
  2979. End If
  2980. p_clsTaxonomy.MoveInto intTID, intNewParentTID, dtmModifiedTime, intOrderUnderParent
  2981. XMLSetAttribute DOMNode, HHT_modifiedtime_C, Now
  2982. XMLSetAttribute DOMNode, HHT_parenttid_C, intNewParentTID
  2983. XMLSetAttribute DOMNode, HHT_orderunderparent_C, intOrderUnderParent
  2984. DOMNode.parentNode.removeChild DOMNode
  2985. DOMNodeNewParent.appendChild DOMNode
  2986. treTaxonomy.Nodes.Remove i_Node.Key
  2987. enumAllowedSKUs = p_GetAllowedSKUs(DOMNodeNewParent)
  2988. p_CreateTree DOMNode, NodeNewParent, enumAllowedSKUs
  2989. treTaxonomy_NodeClick treTaxonomy.SelectedItem
  2990. LEnd:
  2991. Exit Sub
  2992. LErrorHandler:
  2993. Select Case Err.Number
  2994. Case errRefNodeCannotBeDescendent
  2995. MsgBox "A Node cannot be a child of a descendent Node", _
  2996. vbExclamation + vbOKOnly
  2997. Case errParentCannotBeLeaf
  2998. MsgBox "A Node cannot be a child of a Topic", _
  2999. vbExclamation + vbOKOnly
  3000. Case errNodeOrTopicAlreadyModified
  3001. MsgBox "Someone else already modified this entry. " & _
  3002. "You need to Refresh the database and then try again. " & _
  3003. "This prevents you from accidentally overwriting something " & _
  3004. "the other person entered.", _
  3005. vbExclamation + vbOKOnly
  3006. Case E_FAIL
  3007. DisplayDatabaseLockedError
  3008. Case errDatabaseVersionIncompatible
  3009. DisplayDatabaseVersionError
  3010. Err.Raise Err.Number
  3011. Case errNotPermittedForAuthoringGroup, errAuthoringGroupDiffers, errAuthoringGroupNotPresent
  3012. DisplayAuthoringGroupError
  3013. Case Else
  3014. g_ErrorInfo.SetInfoAndRaiseError "p_ChangeParent"
  3015. End Select
  3016. GoTo LEnd
  3017. End Sub
  3018. Private Function p_GetKeywords() As String
  3019. Dim intKID As Variant
  3020. p_GetKeywords = " "
  3021. For Each intKID In p_dictKeywordsWithTitle.Keys
  3022. p_GetKeywords = p_GetKeywords & intKID & " "
  3023. Next
  3024. If (p_GetKeywords = " ") Then
  3025. p_GetKeywords = ""
  3026. End If
  3027. End Function
  3028. Private Function p_GetDeletedKeywords( _
  3029. ByVal strOldKeywords As String, _
  3030. ByVal strNewKeywords As String _
  3031. ) As String
  3032. Dim arrOldKIDs() As String
  3033. Dim arrNewKIDs() As String
  3034. Dim intIndex1 As Long
  3035. Dim intIndex2 As Long
  3036. Dim blnFound As Boolean
  3037. p_GetDeletedKeywords = " "
  3038. arrOldKIDs = Split(strOldKeywords, " ")
  3039. arrNewKIDs = Split(strNewKeywords, " ")
  3040. For intIndex1 = LBound(arrOldKIDs) To UBound(arrOldKIDs)
  3041. blnFound = False
  3042. intIndex2 = LBound(arrNewKIDs)
  3043. Do While (intIndex2 <= UBound(arrNewKIDs))
  3044. If (arrOldKIDs(intIndex1) = arrNewKIDs(intIndex2)) Then
  3045. blnFound = True
  3046. Exit Do
  3047. End If
  3048. intIndex2 = intIndex2 + 1
  3049. Loop
  3050. If (Not blnFound) Then
  3051. p_GetDeletedKeywords = p_GetDeletedKeywords & arrOldKIDs(intIndex1) & " "
  3052. End If
  3053. Next
  3054. End Function
  3055. Private Sub p_UpdateSubTree( _
  3056. ByVal i_intTID As Long, _
  3057. ByVal i_enumAllowedSKUs As SKU_E _
  3058. )
  3059. Dim Node As Node
  3060. Dim DOMNode As MSXML2.IXMLDOMNode
  3061. Dim ChildDOMNode As MSXML2.IXMLDOMNode
  3062. Dim enumAllowedSKUs As SKU_E
  3063. Dim intTID As Long
  3064. Set Node = treTaxonomy.Nodes(KEY_PREFIX_C & i_intTID)
  3065. Set DOMNode = Node.Tag
  3066. If (i_intTID <> ROOT_TID_C) Then
  3067. XMLSetAttribute DOMNode, HHT_allowedskus_C, i_enumAllowedSKUs
  3068. p_SetNodeImage Node, DOMNode
  3069. p_SetNodeColor Node, DOMNode
  3070. enumAllowedSKUs = i_enumAllowedSKUs And XMLGetAttribute(DOMNode, HHT_skus_C)
  3071. Else
  3072. enumAllowedSKUs = i_enumAllowedSKUs
  3073. End If
  3074. ' Now update the descendents
  3075. If (Not DOMNode.firstChild Is Nothing) Then
  3076. For Each ChildDOMNode In DOMNode.childNodes
  3077. intTID = XMLGetAttribute(ChildDOMNode, HHT_tid_C)
  3078. p_UpdateSubTree intTID, enumAllowedSKUs
  3079. Next
  3080. End If
  3081. End Sub
  3082. Private Sub p_CreateTree( _
  3083. ByRef u_DOMNode As MSXML2.IXMLDOMNode, _
  3084. ByRef i_Node As Node, _
  3085. ByVal i_enumAllowedSKUs As SKU_E, _
  3086. Optional ByRef i_nodeRef As Node = Nothing, _
  3087. Optional ByRef i_blnAbove As Boolean _
  3088. )
  3089. On Error GoTo LErrorHandler
  3090. Dim DOMNode As MSXML2.IXMLDOMNode
  3091. Dim Node As Node
  3092. Dim strTitle As String
  3093. Dim strKey As String
  3094. Dim enumAllowedSKUs As SKU_E
  3095. Dim intRelationship As Long
  3096. If (u_DOMNode.nodeName = HHT_TAXONOMY_ENTRY_C) Then
  3097. strTitle = XMLGetAttribute(u_DOMNode, HHT_TITLE_C)
  3098. strKey = KEY_PREFIX_C & XMLGetAttribute(u_DOMNode, HHT_tid_C)
  3099. XMLSetAttribute u_DOMNode, HHT_allowedskus_C, i_enumAllowedSKUs
  3100. If (i_Node Is Nothing) Then
  3101. Set Node = treTaxonomy.Nodes.Add(Key:=strKey, Text:=strTitle)
  3102. Node.Expanded = True
  3103. Else
  3104. If (i_nodeRef Is Nothing) Then
  3105. Set Node = treTaxonomy.Nodes.Add(i_Node, tvwChild, strKey, strTitle)
  3106. Else
  3107. If (i_blnAbove) Then
  3108. intRelationship = tvwPrevious
  3109. Else
  3110. intRelationship = tvwNext
  3111. End If
  3112. Set Node = treTaxonomy.Nodes.Add(i_nodeRef.Key, intRelationship, strKey, _
  3113. strTitle)
  3114. End If
  3115. End If
  3116. Set Node.Tag = u_DOMNode
  3117. p_SetNodeColor Node, u_DOMNode
  3118. p_SetNodeImage Node, u_DOMNode
  3119. enumAllowedSKUs = i_enumAllowedSKUs And XMLGetAttribute(u_DOMNode, HHT_skus_C)
  3120. Else
  3121. Set Node = i_Node
  3122. enumAllowedSKUs = i_enumAllowedSKUs
  3123. End If
  3124. If (Not (u_DOMNode.firstChild Is Nothing)) Then
  3125. For Each DOMNode In u_DOMNode.childNodes
  3126. p_CreateTree DOMNode, Node, enumAllowedSKUs
  3127. Next
  3128. End If
  3129. LEnd:
  3130. Exit Sub
  3131. LErrorHandler:
  3132. g_ErrorInfo.SetInfoAndRaiseError "p_CreateTree"
  3133. GoTo LEnd
  3134. End Sub
  3135. Private Sub p_InitializeDataStructures( _
  3136. ByRef o_DOMNode As MSXML2.IXMLDOMNode _
  3137. )
  3138. ' Put a Me.Enabled = True in the error handler that will handle errors
  3139. ' that happen here.
  3140. Dim T0 As Date
  3141. Dim T1 As Date
  3142. Dim DOMDoc As MSXML2.DOMDocument
  3143. Me.Enabled = False
  3144. T0 = Now
  3145. Set p_colKeywords = New Collection
  3146. p_SetStatusText SBPANEL_DATABASE, "Reading Keywords from Database..."
  3147. p_clsKeywords.GetAllKeywordsColl p_colKeywords
  3148. p_SetStatusText SBPANEL_DATABASE, "Reading Taxonomy from Database..."
  3149. Set DOMDoc = p_clsTaxonomy.GetTaxonomyInXml
  3150. p_SetStatusText SBPANEL_DATABASE, ""
  3151. Set o_DOMNode = XMLFindFirstNode(DOMDoc, HHT_TAXONOMY_ENTRY_C)
  3152. T1 = Now
  3153. Debug.Print "p_InitializeDataStructures: " & FormatTime(T0, T1)
  3154. Me.Enabled = True
  3155. End Sub
  3156. Private Sub p_Refresh( _
  3157. ByRef i_DOMNode As MSXML2.IXMLDOMNode _
  3158. )
  3159. ' Put a Me.Enabled = True in the error handler that will handle errors
  3160. ' that happen here.
  3161. Dim T0 As Date
  3162. Dim T1 As Date
  3163. Me.Enabled = False
  3164. T0 = Now
  3165. If (p_blnCreating Or p_blnUpdating) Then
  3166. Exit Sub
  3167. End If
  3168. p_ClearTreeView
  3169. p_ClearNodeDetails
  3170. p_DisableEditPaste
  3171. p_DisableEditPasteKeywords
  3172. p_InitializeTypeCombo
  3173. p_EnableTaxonomyAndSomeMenus
  3174. p_EnableRefresh
  3175. p_EnableNodeDetailsExceptIndividualSKUs
  3176. p_SetStatusText SBPANEL_DATABASE, "Creating Taxonomy tree..."
  3177. p_CreateTree i_DOMNode, Nothing, ALL_SKUS_C
  3178. p_SetStatusText SBPANEL_DATABASE, ""
  3179. T1 = Now
  3180. Debug.Print "p_Refresh: " & FormatTime(T0, T1)
  3181. Me.Enabled = True
  3182. End Sub
  3183. Private Sub p_SetKeywordsList()
  3184. On Error GoTo LErrorHandler
  3185. Dim intKID As Variant
  3186. cboKeywords.Clear
  3187. For Each intKID In p_dictKeywordsWithTitle
  3188. cboKeywords.AddItem p_colKeywords(CStr(intKID))
  3189. Next
  3190. Exit Sub
  3191. LErrorHandler:
  3192. g_ErrorInfo.SetInfoAndRaiseError "p_SetKeywordsList"
  3193. End Sub
  3194. Private Function p_GetStatusText(i_enumPanel As STATUS_BAR_PANEL_E) As String
  3195. p_GetStatusText = staInfo.Panels(i_enumPanel).Text
  3196. End Function
  3197. Private Sub p_SetStatusText(i_enumPanel As STATUS_BAR_PANEL_E, i_strText As String)
  3198. staInfo.Panels(i_enumPanel).Text = i_strText
  3199. End Sub
  3200. Private Sub p_SetNavModelCombo(i_strNavModel As String)
  3201. Dim strNavModel As String
  3202. Dim intIndex As Long
  3203. If (i_strNavModel = "") Then
  3204. strNavModel = NAVMODEL_DEFAULT_STR_C
  3205. Else
  3206. strNavModel = i_strNavModel
  3207. End If
  3208. For intIndex = 0 To cboNavModel.ListCount - 1
  3209. If (cboNavModel.List(intIndex) = strNavModel) Then
  3210. cboNavModel.ListIndex = intIndex
  3211. Exit For
  3212. End If
  3213. Next
  3214. End Sub
  3215. Private Sub p_InitializeNavModelCombo()
  3216. cboNavModel.Clear
  3217. cboNavModel.AddItem NAVMODEL_DEFAULT_STR_C
  3218. cboNavModel.ItemData(cboNavModel.NewIndex) = NAVMODEL_DEFAULT_NUM_C
  3219. cboNavModel.AddItem NAVMODEL_SERVER_STR_C
  3220. cboNavModel.ItemData(cboNavModel.NewIndex) = NAVMODEL_SERVER_NUM_C
  3221. cboNavModel.AddItem NAVMODEL_DESKTOP_STR_C
  3222. cboNavModel.ItemData(cboNavModel.NewIndex) = NAVMODEL_DESKTOP_NUM_C
  3223. End Sub
  3224. Private Sub p_SetLocIncludeCombo(i_strLocInclude As String)
  3225. Dim intIndex As Long
  3226. Dim blnExistingLocInclude As Boolean
  3227. p_InitializeLocIncludeCombo
  3228. For intIndex = LBound(LocIncludes) To UBound(LocIncludes)
  3229. If (i_strLocInclude = LocIncludes(intIndex)) Then
  3230. blnExistingLocInclude = True
  3231. End If
  3232. Next
  3233. If (Not blnExistingLocInclude) Then
  3234. cboLocInclude.AddItem i_strLocInclude, UBound(LocIncludes) + 1
  3235. End If
  3236. cboLocInclude.Text = i_strLocInclude
  3237. End Sub
  3238. Private Sub p_InitializeLocIncludeCombo()
  3239. Dim intIndex As Long
  3240. InitializeLocIncludes
  3241. cboLocInclude.Clear
  3242. For intIndex = LBound(LocIncludes) To UBound(LocIncludes)
  3243. cboLocInclude.AddItem LocIncludes(intIndex), intIndex
  3244. Next
  3245. End Sub
  3246. Private Sub p_SetTypeComboIndex(i_intIndex As Long)
  3247. cboType.ListIndex = i_intIndex
  3248. End Sub
  3249. Private Sub p_InitializeTypeCombo()
  3250. On Error GoTo LErrorHandler
  3251. Dim arrTypes() As Variant
  3252. Dim intIndex As Long
  3253. ' Initialize the Types Combo Box
  3254. arrTypes = p_clsTaxonomy.GetTypes
  3255. cboType.Clear
  3256. For intIndex = 0 To UBound(arrTypes)
  3257. cboType.AddItem arrTypes(intIndex)(1), intIndex
  3258. cboType.ItemData(cboType.NewIndex) = arrTypes(intIndex)(0)
  3259. Next
  3260. Exit Sub
  3261. LErrorHandler:
  3262. Select Case Err.Number
  3263. Case errDatabaseVersionIncompatible
  3264. DisplayDatabaseVersionError
  3265. Err.Raise Err.Number
  3266. Case Else
  3267. g_ErrorInfo.SetInfoAndRaiseError "p_InitializeTypeCombo"
  3268. End Select
  3269. End Sub
  3270. Private Function p_GetBrokenLinkDir( _
  3271. ByVal i_enumSKU As SKU_E _
  3272. ) As String
  3273. p_GetBrokenLinkDir = p_clsParameters.Value(BROKEN_LINK_WORKING_DIR_C & Hex(i_enumSKU)) & ""
  3274. If (p_GetBrokenLinkDir = "") Then
  3275. Err.Raise errNotConfiguredForNavigateLink
  3276. End If
  3277. End Function
  3278. Private Sub p_InitializeTaxonomyTree()
  3279. Dim nodeNew As Node
  3280. Set treTaxonomy.ImageList = ilsIcons
  3281. treTaxonomy.HideSelection = False
  3282. treTaxonomy.LabelEdit = tvwManual
  3283. ' The problem with FullRowSelect is that if you click on the far right side of
  3284. ' a row, it will be highlighted, but NodeClick will not be called.
  3285. ' treTaxonomy.FullRowSelect = True
  3286. End Sub
  3287. Private Sub p_ClearTreeView()
  3288. ' Remove the root. Does garbage collection caused the other nodes to be removed?
  3289. If (treTaxonomy.Nodes.Count > 0) Then
  3290. treTaxonomy.Nodes.Remove 1
  3291. End If
  3292. End Sub
  3293. Private Sub p_EnableTaxonomyAndSomeMenus()
  3294. mnuEdit.Enabled = True
  3295. mnuTools.Enabled = True
  3296. mnuFileExportHHT.Enabled = True
  3297. mnuFileImportHHT.Enabled = True
  3298. lblTaxonomy.Enabled = True
  3299. treTaxonomy.Enabled = True
  3300. End Sub
  3301. Private Sub p_DisableTaxonomyAndSomeMenus()
  3302. mnuEdit.Enabled = False
  3303. mnuTools.Enabled = False
  3304. mnuFileExportHHT.Enabled = False
  3305. mnuFileImportHHT.Enabled = False
  3306. lblTaxonomy.Enabled = False
  3307. treTaxonomy.Enabled = False
  3308. End Sub
  3309. Private Sub p_EnableCreate()
  3310. cmdCreateGroup.Enabled = True
  3311. cmdCreateLeaf.Enabled = True
  3312. mnuRightClickCreateNode.Enabled = True
  3313. mnuRightClickCreateTopic.Enabled = True
  3314. End Sub
  3315. Private Sub p_DisableCreate()
  3316. cmdCreateGroup.Enabled = False
  3317. cmdCreateLeaf.Enabled = False
  3318. mnuRightClickCreateNode.Enabled = False
  3319. mnuRightClickCreateTopic.Enabled = False
  3320. End Sub
  3321. Private Sub p_EnableDelete()
  3322. cmdDelete.Enabled = True
  3323. mnuRightClickDelete.Enabled = True
  3324. End Sub
  3325. Private Sub p_DisableDelete()
  3326. cmdDelete.Enabled = False
  3327. mnuRightClickDelete.Enabled = False
  3328. End Sub
  3329. Private Sub p_EnableRefresh()
  3330. cmdRefresh.Enabled = True
  3331. End Sub
  3332. Private Sub p_DisableRefresh()
  3333. cmdRefresh.Enabled = False
  3334. End Sub
  3335. Private Sub p_EnableNavModel()
  3336. lblNavModel.Enabled = True
  3337. cboNavModel.Enabled = True
  3338. End Sub
  3339. Private Sub p_DisableNavModel()
  3340. lblNavModel.Enabled = False
  3341. cboNavModel.Enabled = False
  3342. End Sub
  3343. Private Sub p_EnableSubSite()
  3344. chkSubSite.Enabled = True
  3345. End Sub
  3346. Private Sub p_DisableSubSite()
  3347. chkSubSite.Enabled = False
  3348. End Sub
  3349. Private Sub p_EnableEditEntry()
  3350. cmdEditEntry.Enabled = True
  3351. End Sub
  3352. Private Sub p_DisableEditEntry()
  3353. cmdEditEntry.Enabled = False
  3354. End Sub
  3355. Private Sub p_EnableEntry()
  3356. txtEntry.Locked = False
  3357. End Sub
  3358. Private Sub p_DisableEntry()
  3359. txtEntry.Locked = True
  3360. End Sub
  3361. Private Sub p_EnableNodeDetailsExceptIndividualSKUs()
  3362. chkVisible.Enabled = True
  3363. lblLocInclude.Enabled = True
  3364. cboLocInclude.Enabled = True
  3365. lblTitle.Enabled = True
  3366. lblDescription.Enabled = True
  3367. lblURI.Enabled = True
  3368. cmdURI.Enabled = True
  3369. lblIconURI.Enabled = True
  3370. lblType.Enabled = True
  3371. lblComments.Enabled = True
  3372. lblEntry.Enabled = True
  3373. txtTitle.Locked = False
  3374. txtDescription.Locked = False
  3375. txtURI.Locked = False
  3376. txtIconURI.Locked = False
  3377. cboType.Enabled = True
  3378. txtComments.Locked = False
  3379. fraSKU.Enabled = True
  3380. lblKeywords.Enabled = True
  3381. cboKeywords.Enabled = True
  3382. lblLastModified.Enabled = True
  3383. End Sub
  3384. Private Sub p_DisableNodeDetails()
  3385. chkVisible.Enabled = False
  3386. lblLocInclude.Enabled = False
  3387. cboLocInclude.Enabled = False
  3388. chkSubSite.Enabled = False
  3389. p_DisableNavModel
  3390. lblTitle.Enabled = False
  3391. lblDescription.Enabled = False
  3392. lblURI.Enabled = False
  3393. cmdURI.Enabled = False
  3394. lblIconURI.Enabled = False
  3395. lblType.Enabled = False
  3396. lblComments.Enabled = False
  3397. lblEntry.Enabled = False
  3398. p_DisableEditEntry
  3399. txtTitle.Locked = True
  3400. txtDescription.Locked = True
  3401. txtURI.Locked = True
  3402. txtIconURI.Locked = True
  3403. cboType.Enabled = False
  3404. txtComments.Locked = True
  3405. p_DisableEntry
  3406. chkVisible.Enabled = False
  3407. fraSKU.Enabled = False
  3408. p_DisableSKUs
  3409. lblKeywords.Enabled = False
  3410. cboKeywords.Enabled = False
  3411. lblLastModified.Enabled = False
  3412. p_DisableAddRemoveAndKeywordsCombo
  3413. p_DisableNavigateLink
  3414. End Sub
  3415. Private Sub p_EnableNavigateLink()
  3416. lblNavigateLink.Enabled = True
  3417. cboNavigateLink.Enabled = True
  3418. cmdNavigateLink.Enabled = True
  3419. End Sub
  3420. Private Sub p_DisableNavigateLink()
  3421. lblNavigateLink.Enabled = False
  3422. cboNavigateLink.Enabled = False
  3423. cmdNavigateLink.Enabled = False
  3424. End Sub
  3425. Private Sub p_EnableAddRemoveAndKeywordsCombo()
  3426. cmdAddRemove.Enabled = True
  3427. cboKeywords.Enabled = True
  3428. End Sub
  3429. Private Sub p_DisableAddRemoveAndKeywordsCombo()
  3430. cmdAddRemove.Enabled = False
  3431. cboKeywords.Enabled = False
  3432. End Sub
  3433. Private Sub p_ClearNodeDetails()
  3434. Dim blnSettingControls As Boolean
  3435. blnSettingControls = p_blnSettingControls
  3436. p_blnSettingControls = True
  3437. txtTitle = ""
  3438. txtDescription = ""
  3439. txtURI = ""
  3440. txtIconURI = ""
  3441. txtComments = ""
  3442. txtEntry = ""
  3443. lblLastModified = ""
  3444. p_SetTypeComboIndex -1
  3445. chkVisible.Value = 0
  3446. chkSubSite.Value = 0
  3447. p_SetNavModelCombo NAVMODEL_DEFAULT_NUM_C
  3448. p_ClearSKUs
  3449. cboKeywords.Clear
  3450. ' Reset it to the state it was in when this function was called.
  3451. p_blnSettingControls = blnSettingControls
  3452. End Sub
  3453. Private Sub p_EnableSKUs()
  3454. chkStandard.Enabled = True
  3455. chkProfessional.Enabled = True
  3456. chkProfessional64.Enabled = True
  3457. chkWindowsMillennium.Enabled = True
  3458. chkServer.Enabled = True
  3459. chkAdvancedServer.Enabled = True
  3460. chkDataCenterServer.Enabled = True
  3461. chkAdvancedServer64.Enabled = True
  3462. chkDataCenterServer64.Enabled = True
  3463. End Sub
  3464. Private Sub p_DisableSKUs()
  3465. chkStandard.Enabled = False
  3466. chkProfessional.Enabled = False
  3467. chkProfessional64.Enabled = False
  3468. chkWindowsMillennium.Enabled = False
  3469. chkServer.Enabled = False
  3470. chkAdvancedServer.Enabled = False
  3471. chkDataCenterServer.Enabled = False
  3472. chkAdvancedServer64.Enabled = False
  3473. chkDataCenterServer64.Enabled = False
  3474. End Sub
  3475. Private Sub p_ClearSKUs()
  3476. chkStandard.Value = 0
  3477. chkProfessional.Value = 0
  3478. chkProfessional64.Value = 0
  3479. chkWindowsMillennium.Value = 0
  3480. chkServer.Value = 0
  3481. chkAdvancedServer.Value = 0
  3482. chkDataCenterServer.Value = 0
  3483. chkAdvancedServer64.Value = 0
  3484. chkDataCenterServer64.Value = 0
  3485. End Sub
  3486. Private Sub p_StrikeoutUnselectedSKUs()
  3487. chkStandard.Font.Strikethrough = _
  3488. IIf((p_enumFilterSKUs And SKU_STANDARD_E), False, True)
  3489. chkProfessional.Font.Strikethrough = _
  3490. IIf((p_enumFilterSKUs And SKU_PROFESSIONAL_E), False, True)
  3491. chkProfessional64.Font.Strikethrough = _
  3492. IIf((p_enumFilterSKUs And SKU_PROFESSIONAL_64_E), False, True)
  3493. chkWindowsMillennium.Font.Strikethrough = _
  3494. IIf((p_enumFilterSKUs And SKU_WINDOWS_MILLENNIUM_E), False, True)
  3495. chkServer.Font.Strikethrough = _
  3496. IIf((p_enumFilterSKUs And SKU_SERVER_E), False, True)
  3497. chkAdvancedServer.Font.Strikethrough = _
  3498. IIf((p_enumFilterSKUs And SKU_ADVANCED_SERVER_E), False, True)
  3499. chkDataCenterServer.Font.Strikethrough = _
  3500. IIf((p_enumFilterSKUs And SKU_DATA_CENTER_SERVER_E), False, True)
  3501. chkAdvancedServer64.Font.Strikethrough = _
  3502. IIf((p_enumFilterSKUs And SKU_ADVANCED_SERVER_64_E), False, True)
  3503. chkDataCenterServer64.Font.Strikethrough = _
  3504. IIf((p_enumFilterSKUs And SKU_DATA_CENTER_SERVER_64_E), False, True)
  3505. End Sub
  3506. Private Sub p_DisableUnselectedSKUs()
  3507. If (chkStandard.Value = 0) Then
  3508. chkStandard.Enabled = False
  3509. End If
  3510. If (chkProfessional.Value = 0) Then
  3511. chkProfessional.Enabled = False
  3512. End If
  3513. If (chkProfessional64.Value = 0) Then
  3514. chkProfessional64.Enabled = False
  3515. End If
  3516. If (chkWindowsMillennium.Value = 0) Then
  3517. chkWindowsMillennium.Enabled = False
  3518. End If
  3519. If (chkServer.Value = 0) Then
  3520. chkServer.Enabled = False
  3521. End If
  3522. If (chkAdvancedServer.Value = 0) Then
  3523. chkAdvancedServer.Enabled = False
  3524. End If
  3525. If (chkDataCenterServer.Value = 0) Then
  3526. chkDataCenterServer.Enabled = False
  3527. End If
  3528. If (chkAdvancedServer64.Value = 0) Then
  3529. chkAdvancedServer64.Enabled = False
  3530. End If
  3531. If (chkDataCenterServer64.Value = 0) Then
  3532. chkDataCenterServer64.Enabled = False
  3533. End If
  3534. End Sub
  3535. Private Sub p_EnableSaveCancel()
  3536. cmdSave.Enabled = True
  3537. cmdCancel.Enabled = True
  3538. cmdCancel.Cancel = True
  3539. End Sub
  3540. Private Sub p_DisableSaveCancel()
  3541. cmdSave.Enabled = False
  3542. cmdCancel.Enabled = False
  3543. cmdCancel.Cancel = False
  3544. End Sub
  3545. Private Sub p_EnableEditCopy()
  3546. mnuEditCopy.Enabled = True
  3547. mnuRightClickCopy.Enabled = True
  3548. End Sub
  3549. Private Sub p_DisableEditCopy()
  3550. mnuEditCopy.Enabled = False
  3551. mnuRightClickCopy.Enabled = False
  3552. End Sub
  3553. Private Sub p_EnableEditCut()
  3554. mnuEditCut.Enabled = True
  3555. mnuRightClickCut.Enabled = True
  3556. End Sub
  3557. Private Sub p_DisableEditCut()
  3558. mnuEditCut.Enabled = False
  3559. mnuRightClickCut.Enabled = False
  3560. End Sub
  3561. Private Sub p_EnableEditPaste()
  3562. mnuEditPaste.Enabled = True
  3563. mnuRightClickPaste.Enabled = True
  3564. End Sub
  3565. Private Sub p_DisableEditPaste()
  3566. mnuEditPaste.Enabled = False
  3567. mnuRightClickPaste.Enabled = False
  3568. End Sub
  3569. Private Sub p_EnableEditPasteKeywords()
  3570. mnuEditPasteKeywords.Enabled = True
  3571. mnuRightClickPasteKeywords.Enabled = True
  3572. p_AddCheckboxesToTree
  3573. End Sub
  3574. Private Sub p_DisableEditPasteKeywords()
  3575. mnuEditPasteKeywords.Enabled = False
  3576. mnuRightClickPasteKeywords.Enabled = False
  3577. p_RemoveCheckboxesFromTree
  3578. End Sub
  3579. Private Sub p_DisableEverything()
  3580. p_DisableTaxonomyAndSomeMenus
  3581. p_DisableCreate
  3582. p_DisableDelete
  3583. p_DisableRefresh
  3584. p_DisableNodeDetails
  3585. p_DisableAddRemoveAndKeywordsCombo
  3586. p_DisableNavigateLink
  3587. p_DisableSaveCancel
  3588. End Sub
  3589. Private Sub p_AddCheckboxesToTree()
  3590. treTaxonomy.Checkboxes = True
  3591. End Sub
  3592. Private Sub p_RemoveCheckboxesFromTree()
  3593. treTaxonomy.Checkboxes = False
  3594. End Sub
  3595. Private Sub p_SetTitle( _
  3596. ByVal i_strDatabase As String _
  3597. )
  3598. frmMain.Caption = "Production Tool (" & i_strDatabase & ")"
  3599. End Sub
  3600. Private Sub p_SetSizingInfo()
  3601. Static blnInfoSet As Boolean
  3602. If (blnInfoSet) Then
  3603. Exit Sub
  3604. End If
  3605. p_clsSizer.AddControl treTaxonomy
  3606. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = frmMain
  3607. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = frmMain
  3608. p_clsSizer.Operation(DIM_WIDTH_E) = OP_MULTIPLY_E
  3609. p_clsSizer.AddControl cmdCreateGroup
  3610. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = treTaxonomy
  3611. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_BOTTOM_E
  3612. p_clsSizer.AddControl cmdCreateLeaf
  3613. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3614. p_clsSizer.AddControl cmdDelete
  3615. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3616. p_clsSizer.AddControl cmdRefresh
  3617. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3618. p_clsSizer.AddControl lblLocInclude
  3619. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = frmMain
  3620. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  3621. p_clsSizer.AddControl cboLocInclude
  3622. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblLocInclude
  3623. p_clsSizer.AddControl lblTitle
  3624. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = treTaxonomy
  3625. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  3626. p_clsSizer.AddControl txtTitle
  3627. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblTitle
  3628. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = frmMain
  3629. p_clsSizer.ReferenceDimension(DIM_RIGHT_E) = DIM_WIDTH_E
  3630. p_clsSizer.AddControl chkVisible
  3631. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3632. p_clsSizer.AddControl chkSubSite
  3633. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3634. p_clsSizer.AddControl lblNavModel
  3635. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3636. p_clsSizer.AddControl cboNavModel
  3637. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3638. p_clsSizer.AddControl lblDescription
  3639. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3640. p_clsSizer.AddControl txtDescription
  3641. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3642. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3643. p_clsSizer.AddControl lblType
  3644. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3645. p_clsSizer.AddControl cboType
  3646. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3647. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3648. p_clsSizer.AddControl lblURI
  3649. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3650. p_clsSizer.AddControl txtURI
  3651. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3652. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3653. p_clsSizer.AddControl cmdURI
  3654. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3655. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  3656. p_clsSizer.AddControl lblIconURI
  3657. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3658. p_clsSizer.AddControl txtIconURI
  3659. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3660. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3661. p_clsSizer.AddControl lblComments
  3662. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3663. p_clsSizer.AddControl txtComments
  3664. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3665. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3666. p_clsSizer.AddControl lblEntry
  3667. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3668. p_clsSizer.AddControl txtEntry
  3669. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3670. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3671. p_clsSizer.AddControl cmdEditEntry
  3672. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3673. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  3674. p_clsSizer.AddControl lblNavigateLink
  3675. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3676. p_clsSizer.AddControl cboNavigateLink
  3677. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3678. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = frmMain
  3679. p_clsSizer.ReferenceDimension(DIM_RIGHT_E) = DIM_WIDTH_E
  3680. p_clsSizer.AddControl cmdNavigateLink
  3681. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3682. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  3683. p_clsSizer.AddControl fraSKU
  3684. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3685. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3686. p_clsSizer.AddControl chkServer
  3687. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = fraSKU
  3688. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  3689. p_clsSizer.Operation(DIM_LEFT_E) = OP_MULTIPLY_E
  3690. p_clsSizer.AddControl chkAdvancedServer
  3691. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkServer
  3692. p_clsSizer.AddControl chkDataCenterServer
  3693. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkServer
  3694. p_clsSizer.AddControl chkAdvancedServer64
  3695. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkServer
  3696. p_clsSizer.AddControl chkDataCenterServer64
  3697. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkServer
  3698. p_clsSizer.AddControl lblKeywords
  3699. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3700. p_clsSizer.AddControl cmdAddRemove
  3701. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3702. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  3703. p_clsSizer.AddControl cboKeywords
  3704. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = txtTitle
  3705. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = txtTitle
  3706. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = frmMain
  3707. p_clsSizer.AddControl cmdSave
  3708. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3709. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = frmMain
  3710. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  3711. p_clsSizer.AddControl cmdCancel
  3712. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3713. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdSave
  3714. p_clsSizer.AddControl lblLastModified
  3715. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdCreateGroup
  3716. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdCreateGroup
  3717. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = cmdSave
  3718. blnInfoSet = True
  3719. End Sub
  3720. Private Sub p_SetToolTips()
  3721. chkVisible.ToolTipText = "Controls whether the user can navigate to the Node/Topic using the Taxonomy."
  3722. chkSubSite.ToolTipText = "Indicates whether this node is a subsite, or appears on the flyout menu."
  3723. lblNavModel.ToolTipText = "Determines which navigation model will be used for the node."
  3724. cboNavModel.ToolTipText = lblNavModel.ToolTipText
  3725. lblLocInclude.ToolTipText = "Indicates localization preferences for the topic."
  3726. cboLocInclude.ToolTipText = lblLocInclude.ToolTipText
  3727. lblTitle.ToolTipText = "The title as it will appear in the taxonomy tree."
  3728. txtTitle.ToolTipText = lblTitle.ToolTipText
  3729. lblDescription.ToolTipText = "A description of the node or topic."
  3730. txtDescription.ToolTipText = lblDescription.ToolTipText
  3731. lblType.ToolTipText = "The category of the title, to be used for search categories."
  3732. cboType.ToolTipText = lblType.ToolTipText
  3733. lblURI.ToolTipText = "Uniform Resource Indicator. This is the address of the file."
  3734. txtURI.ToolTipText = lblURI.ToolTipText
  3735. lblIconURI.ToolTipText = "The path to the icon that is displayed in the Desktop navigation model."
  3736. txtIconURI.ToolTipText = lblIconURI.ToolTipText
  3737. lblComments.ToolTipText = "Additional comment about the node or topic."
  3738. txtComments.ToolTipText = lblComments.ToolTipText
  3739. lblEntry.ToolTipText = "Used by other files to link to this topic. It is not recommended that this field be changed after it has been set."
  3740. txtEntry.ToolTipText = lblEntry.ToolTipText
  3741. lblNavigateLink.ToolTipText = "Select a valid SKU to view the content of the selected topic."
  3742. cboNavigateLink.ToolTipText = lblNavigateLink.ToolTipText
  3743. fraSKU.ToolTipText = "Select which platforms this node or topic applies to. " & _
  3744. "Child nodes or topics will inherit only the boxes checked for the parent " & _
  3745. "node or topic."
  3746. cboKeywords.ToolTipText = "These are the keywords associated with selected node."
  3747. End Sub