home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / progs / ite / ite10d1.exe / DATA.Z / KBDOC.JFM < prev    next >
Encoding:
Text File  |  1996-09-07  |  9.0 KB  |  331 lines

  1. /****************************************************************************\
  2. *                                                                            *
  3. * KBDoc.jfm  --  Knowledge Base Document Form                                *
  4. *                                                                            *
  5. * KBDoc.jfm is part of the Knowledge Base solution application. It is used   *
  6. * to display a single Knowledge Base document. The documentID number can     *
  7. * be passed to this script. If no number is passed, the first document is    *
  8. * displayed.                                                                 *
  9. *                                                                            *
  10. * Dependencies:  knowbs31.gif                                                *
  11. *                homepg31.gif                                                *
  12. *                paper_22.gif                                                *
  13. *                apps\shared\controls.cc                                     *
  14. *                                                                            *
  15. * Links to:      ibapps/index.htm                                            *
  16. *                svr/intrasrv.isv?apps/knowbase/kbsearch.jfm                 *
  17. *                                                                            *
  18. * Updated 8/27/96 by IntraBuilder Samples Group                              *
  19. * $Revision:   1.18  $                                                       *
  20. *                                                                            *
  21. * Copyright (c) 1996, Borland International, Inc. All rights reserved.       *
  22. *                                                                            *
  23. \****************************************************************************/
  24. /* 
  25.    This header section is used to duplicate the normal
  26.    process of opening the form. One additional line is 
  27.    added to store the arguments passed to the form.
  28.    The code between the return and the class is never 
  29.    executed.
  30. */
  31. var f = new kbdocForm();
  32. f.argv = KBDOC.arguments;
  33. f.open();
  34. return;
  35. // {End Header} Do not remove this comment//
  36. // Generated on 08/27/1996
  37. //
  38. var f = new kbdocForm();
  39. f.open();
  40. class kbdocForm extends Form {
  41.    _sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC")
  42.    with (this) {
  43.       height = 27.4118;
  44.       left = 0.6667;
  45.       top = 0;
  46.       width = 84.5;
  47.       title = "Knowledge Base Document";
  48.       background = "filename PAPER_22.GIF";
  49.       onServerLoad = class::Form_onServerLoad;
  50.    }
  51.  
  52.  
  53.    with (this.ibapps1 = new Database()){
  54.       left = 49;
  55.       top = 3;
  56.       databaseName = "IBAPPS";
  57.       active = true;
  58.    }
  59.  
  60.  
  61.    with (this.query1 = new Query()){
  62.       left = 54;
  63.       top = 3;
  64.       database = parent.ibapps1;
  65.       sql = "@kbase.sql";
  66.       active = true;
  67.    }
  68.  
  69.  
  70.    with (this.query1.rowset) {
  71.  
  72.    }
  73.  
  74.  
  75.    with (this.rule1 = new Rule(this)){
  76.       left = 2;
  77.       top = 6;
  78.       size = 2;
  79.       right = 82;
  80.       pageno = 0;
  81.    }
  82.  
  83.  
  84.    with (this.rule2 = new Rule(this)){
  85.       left = 2;
  86.       top = 12;
  87.       size = 2;
  88.       right = 82;
  89.    }
  90.  
  91.  
  92.    with (this.rule4 = new Rule(this)){
  93.       left = 2;
  94.       top = 18;
  95.       size = 2;
  96.       right = 82;
  97.       pageno = 0;
  98.    }
  99.  
  100.  
  101.    with (this.rule5 = new Rule(this)){
  102.       left = 2;
  103.       top = 30;
  104.       size = 2;
  105.       right = 82;
  106.       pageno = 0;
  107.    }
  108.  
  109.  
  110.    with (this.KnowledgeBaseLogo = new Image(this)){
  111.       height = 4.8235;
  112.       left = 2;
  113.       top = 0.4706;
  114.       width = 13.6667;
  115.       dataSource = "filename KNOWBS31.GIF";
  116.       alignment = 4;
  117.       pageno = 0;
  118.    }
  119.  
  120.  
  121.    with (this.HeadingHTML = new HTML(this)){
  122.       height = 2;
  123.       left = 22;
  124.       top = 0.4706;
  125.       width = 60;
  126.       color = "navy";
  127.       text = {||'<H1><FONT SIZE="+4"><FONT COLOR="maroon">K</FONT></FONT>nowledge <FONT SIZE="+4"><FONT COLOR="maroon">B</FONT></FONT>ase <FONT SIZE="+4"><FONT COLOR="maroon">D</FONT></FONT>ocument <FONT SIZE="+4"><FONT COLOR="maroon">' + parseInt(this.parent.query1.rowset.fields["DocumentID"].value) + '</FONT></FONT></H1>'};
  128.       pageno = 0;
  129.    }
  130.  
  131.  
  132.    with (this.TitleHTML = new HTML(this)){
  133.       height = 1;
  134.       left = 2;
  135.       top = 7;
  136.       width = 8;
  137.       color = "black";
  138.       fontBold = false;
  139.       text = "Title";
  140.    }
  141.  
  142.  
  143.    with (this.TitleFieldHTML = new HTML(this)){
  144.       height = 1;
  145.       left = 22;
  146.       top = 7;
  147.       width = 60;
  148.       color = "black";
  149.       text = {||this.parent.query1.rowset.fields["Title"].value};
  150.    }
  151.  
  152.  
  153.    with (this.ProductHTML = new HTML(this)){
  154.       height = 1;
  155.       left = 2;
  156.       top = 8;
  157.       width = 8;
  158.       color = "black";
  159.       fontBold = false;
  160.       text = "Product";
  161.    }
  162.  
  163.  
  164.    with (this.ProdDescriptFieldHTML = new HTML(this)){
  165.       height = 1;
  166.       left = 22;
  167.       top = 8;
  168.       width = 30;
  169.       color = "black";
  170.       fontBold = false;
  171.       text = {||this.parent.query1.rowset.fields["ProdDescript"].value};
  172.    }
  173.  
  174.  
  175.    with (this.CategoryHTML = new HTML(this)){
  176.       height = 1;
  177.       left = 2;
  178.       top = 9;
  179.       width = 8;
  180.       color = "black";
  181.       fontBold = false;
  182.       text = "Category";
  183.    }
  184.  
  185.  
  186.    with (this.CatDescriptFieldHTML = new HTML(this)){
  187.       height = 1;
  188.       left = 22;
  189.       top = 9;
  190.       width = 30;
  191.       color = "black";
  192.       fontBold = false;
  193.       text = {||this.parent.query1.rowset.fields["CatDescript"].value};
  194.    }
  195.  
  196.  
  197.    with (this.DocumentFieldHTML = new HTML(this)){
  198.       height = 4;
  199.       left = 2;
  200.       top = 13;
  201.       width = 80;
  202.       fixed = true;
  203.       color = "black";
  204.       fontBold = false;
  205.       text = {||(this.parent.query1.rowset.fields['reformat'].value?"":"<PRE>") + this.parent.query1.rowset.fields["Document"].value + (this.parent.query1.rowset.fields['reformat'].value?"":"</PRE>")};
  206.    }
  207.  
  208.  
  209.    with (this.KeyWordsHTML = new HTML(this)){
  210.       height = 1;
  211.       left = 2;
  212.       top = 10;
  213.       width = 8;
  214.       color = "black";
  215.       fontBold = false;
  216.       text = "Key Words: ";
  217.    }
  218.  
  219.  
  220.    with (this.KeyWordFieldHTML = new HTML(this)){
  221.       height = 1;
  222.       left = 22;
  223.       top = 10;
  224.       width = 60;
  225.       color = "black";
  226.       fontBold = false;
  227.       text = {||this.parent.query1.rowset.fields["Keyword"].value};
  228.    }
  229.  
  230.  
  231.    with (this.SearchLinkImage = new Image(this)){
  232.       height = 4.8235;
  233.       left = 2;
  234.       top = 19;
  235.       width = 13.6667;
  236.       dataSource = "filename KNOWBS31.GIF";
  237.       alignment = 4;
  238.       pageno = 0;
  239.       onImageClick = class::link_to_search_page;
  240.    }
  241.  
  242.  
  243.    with (this.SearchLinkHTML = new HTML(this)){
  244.       height = 1;
  245.       left = 22;
  246.       top = 19;
  247.       width = 28;
  248.       color = "black";
  249.       fontBold = false;
  250.       text = "<A HREF='/svr/intrasrv.isv?apps/knowbase/kbsearch.jfm'>Start a new search</A>";
  251.       pageno = 0;
  252.    }
  253.  
  254.  
  255.    with (this.HomePageLinkImage = new Image(this)){
  256.       height = 4.8235;
  257.       left = 2;
  258.       top = 24;
  259.       width = 13.6667;
  260.       dataSource = "filename HOMEPG31.GIF";
  261.       alignment = 4;
  262.       pageno = 0;
  263.       onImageClick = class::link_to_home_page;
  264.    }
  265.  
  266.  
  267.    with (this.HomePageLinkHTML = new HTML(this)){
  268.       height = 1;
  269.       left = 22;
  270.       top = 24;
  271.       width = 28;
  272.       color = "black";
  273.       fontBold = false;
  274.       text = "<A HREF='/ibapps/index.htm'>Return to Home Page</A>";
  275.       pageno = 0;
  276.    }
  277.  
  278.  
  279.    with (this.GeneratedHTML = new GeneratedHTML(this)){
  280.       height = 1;
  281.       left = 2;
  282.       top = 31;
  283.       width = 80;
  284.       pageno = 0;
  285.    }
  286.  
  287.  
  288.    with (this.NotFoundHTML = new HTML(this)){
  289.       height = 3;
  290.       left = 2;
  291.       top = 7;
  292.       width = 80;
  293.       color = "navy";
  294.       text = "<H2>The requested document was not found. Please try again.</H2>";
  295.       pageno = 2;
  296.    }
  297.  
  298.    this.rowset = this.query1.rowset;
  299.  
  300.    function Form_onServerLoad()
  301.    {
  302.       // look for specific document
  303.       if (form.argv.length == 1) {
  304.          if (form.rowset.applyLocate("documentid=" + form.argv[0])) {
  305.             // redisplay each of the HTML fields
  306.             form.HeadingHTML.text = form.HeadingHTML.text;
  307.             form.TitleFieldHTML.text = form.TitleFieldHTML.text;
  308.             form.ProdDescriptFieldHTML.text = form.ProdDescriptFieldHTML.text;
  309.             form.CatDescriptFieldHTML.text = form.CatDescriptFieldHTML.text;
  310.             form.DocumentFieldHTML.text = form.DocumentFieldHTML.text;
  311.             form.KeyWordFieldHTML.text = form.KeyWordFieldHTML.text;
  312.          }
  313.          else {
  314.             form.HeadingHTML.text = '<H1><FONT SIZE="+4"><FONT COLOR="maroon">K</FONT></FONT>nowledge <FONT SIZE="+4"><FONT COLOR="maroon">B</FONT></FONT>ase <FONT SIZE="+4"><FONT COLOR="maroon">D</FONT></FONT>ocument</H1>';
  315.             form.pageno = 2; // this has the document not found text
  316.          }
  317.       }
  318.    }
  319.  
  320.    function link_to_home_page()
  321.    {
  322.       location.href="/ibapps/index.htm";
  323.    }
  324.  
  325.    function link_to_search_page()
  326.    {
  327.       location.href="/svr/intrasrv.isv?apps/knowbase/kbsearch.jfm";
  328.    }
  329.  
  330. }
  331.