home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
ib
/
setups
/
intrabld
/
data.z
/
KBRESULT.JRP
< prev
next >
Wrap
Text File
|
1996-12-11
|
13KB
|
405 lines
/****************************************************************************\
* *
* KBResult.jrp -- Knowledge Base Search Results Report *
* *
* KBResult.jrp is part of the Knowledge Base solution application. It is *
* called by the kbsearch.jfm form to show a list of documents that match the *
* search criteria. The report file takes several parameters that control the *
* generation of the sql statement that is used to search for data. Each of *
* the document titles is used to link to the kbdoc.jfm form. *
* *
* Dependencies: knowbs31.gif *
* homepg31.gif *
* paper_22.gif *
* database.cc *
* apps\shared\controls.cc *
* *
* Links to: ibapps/index.htm *
* svr/intrasrv.isv?apps/kbase_ib/kbsearch.jfm *
* svr/intrasrv.isv?apps/kbase_ib/kbdoc.jfm(<DocID>) *
* *
* Updated 11/13/96 by IntraBuilder Samples Group *
* $Revision: 1.24 $ *
* *
* Copyright (c) 1996, Borland International, Inc. All rights reserved. *
* *
\****************************************************************************/
// This heading is used in place of the standard report heading, to get
// the query string for the report.
var argv = KBRESULT.arguments;
var noneFound = false;
var r = new KBRESULTReport();
// printing subset of pages
if (argv.length >= 2) {
r.startPage = argv[0];
r.endPage = argv[1];
}
// printing with query conditions
if (argv.length >= 3) {
var prod = argv[2];
var cat = argv[3];
var key = argv[4];
var searchDoc = argv[5]
// build a select statement to get the desired records
// basic select
var select = 'SELECT KBASE.DocumentID , KBASE.Title , ' +
' KBPROD.ProdDescript , KBCAT.CatDescript , ' +
' KBASE.Keyword , KBASE.Document ' +
'FROM KBASE , KBPROD , KBCAT ' +
'WHERE ( KBASE.Product = KBPROD.Product ) ' +
' AND ' +
' ( KBASE.Category = KBCAT.Category ) ' ;
// process the product field
if (prod.length > 0 && prod.string != "(all products)") {
select += " AND ( KBPROD.ProdDescript = '" + prod.string + "' )";
}
// process the category field
if (cat.length > 0 && cat.string != "(all categories)") {
select += " AND ( KBCAT.CatDescript = '" + cat.string + "' )";
}
// process the keyword field
if (key.length > 0) {
// search the keyword/title
select += " AND ( UPPER(KBASE.Keyword) LIKE '%" + key.toUpperCase() + "%' OR "
+ "UPPER(KBASE.Title) LIKE '%" + key.toUpperCase() + "%'";
// search the document if necessary
if (searchDoc) {
select += " OR KBASE.Document LIKE '%" + key.string + "%'";
}
// add the closing paren around the OR clauses
select += ' )';
}
// run the results form if there is any data
r.query1.sql = select;
noneFound = r.query1.rowset.endOfSet;
if (noneFound) {
_sys.scripts.run("kbdoc.jfm",0);
}
else {
r.nextPageParams = ",'" + escape(argv[2]) + "','" + escape(argv[3]) + "','" + escape(argv[4]) + "'," + argv[5];
r.pageTemplate1.NextPageHTML.text = {||this.form.isLastPage() ? "" : '<A HREF="/svr/intrasrv.isv?apps/kbase_ib/kbresult.jrp(' + (this.form.endPage + 1) + "," + (this.form.endPage + 1) + this.form.nextPageParams + ')">Next Page</A>'};
}
}
// precount the number of matches
if (!noneFound) {
r.matches = r.query1.rowset.count();
r.query1.rowset.first();
r.render();
}
return;
// {End Header} Do not remove this comment//
// Generated on 11/13/96
//
var r = new KBRESULTReport();
if (KBRESULT.arguments.length == 2) {
r.startPage = KBRESULT.arguments[0];
r.endPage = KBRESULT.arguments[1];
}
r.render();
class KBRESULTReport extends Report {
_sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC")
_sys.scripts.load("DATABASE.CC")
with (this) {
onDesignLoad = {;this.matches = 1};
title = "Knowledge Base Search Results";
linkText = "";
}
with (this.ibapps1 = new KbaseDatabase()){
left = 49;
top = 3;
active = true;
}
with (this.query1 = new Query()){
left = 570;
top = 0;
database = parent.ibapps1;
sql = "@kbresult.sql";
requestLive = false;
active = true;
}
with (this.query1.rowset) {
}
with (this.pageTemplate1 = new PageTemplate(this)){
height = 15000;
width = 9000;
marginTop = 0;
marginLeft = 0;
marginBottom = 0;
marginRight = 0;
gridLineWidth = 0;
color = "ffffdb";
}
with (this.pageTemplate1.streamFrame1 = new StreamFrame(this.pageTemplate1)){
height = 9000;
top = 2000;
width = 9000;
}
with (this.pageTemplate1.KnowledgeBaseLogo = new Image(this.pageTemplate1)){
height = 1255;
width = 1265;
dataSource = "filename KNOWBS31.GIF";
alignment = 4;
}
with (this.pageTemplate1.HeadingHTML = new HTML(this.pageTemplate1)){
height = 1255;
left = 1300;
width = 7700;
color = "navy";
alignVertical = 1;
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">R</FONT></FONT>esults</H1>'};
}
with (this.pageTemplate1.rule1 = new Rule(this.pageTemplate1)){
top = 1300;
size = 2;
right = 9000;
}
with (this.pageTemplate1.MatchesHTML = new HTML(this.pageTemplate1)){
height = 200;
top = 1500;
width = 9000;
color = "maroon";
fontItalic = true;
text = {||"Number of matches: " + this.form.matches};
}
with (this.pageTemplate1.rule2 = new Rule(this.pageTemplate1)){
top = 1800;
size = 2;
right = 9000;
}
with (this.pageTemplate1.rule3 = new Rule(this.pageTemplate1)){
top = 11100;
size = 2;
right = 9000;
}
with (this.pageTemplate1.SearchLinkImage = new Image(this.pageTemplate1)){
onImageClick = class::SearchLinkImage_onClick;
height = 1245;
top = 11200;
width = 1240;
dataSource = "filename KNOWBS31.GIF";
alignment = 4;
}
with (this.pageTemplate1.SearchLinkHTML = new HTML(this.pageTemplate1)){
height = 250;
left = 1300;
top = 11200;
width = 7700;
color = "black";
fontBold = false;
text = {||'<A HREF="/svr/intrasrv.isv?apps/kbase_ib/kbsearch.jfm">Start a New Search</A>'};
}
with (this.pageTemplate1.HomePageLinkImage = new Image(this.pageTemplate1)){
onImageClick = class::HomePageLinkImage_onClick;
height = 1215;
top = 12600;
width = 1255;
dataSource = "filename HOMEPG31.GIF";
alignment = 4;
}
with (this.pageTemplate1.HomePageLinkHTML = new HTML(this.pageTemplate1)){
height = 250;
left = 1300;
top = 12600;
width = 7700;
color = "black";
fontBold = false;
text = {||'<A HREF="/ibapps/index.htm">Return to Home Page</A>'};
}
with (this.pageTemplate1.rule4 = new Rule(this.pageTemplate1)){
top = 14100;
size = 2;
right = 9000;
}
with (this.pageTemplate1.GeneratedHTML = new GeneratedHTML(this.pageTemplate1)){
height = 200;
top = 14200;
width = 9000;
fontBold = false;
}
with (this.pageTemplate1.NextPageHTML = new HTML(this.pageTemplate1)){
height = 200;
top = 13900;
width = 9000;
color = "black";
fontBold = false;
text = {||this.form.isLastPage() ? "" : '<A HREF="/svr/intrasrv.isv?apps/kbase_ib/kbresult.jrp(' + (this.form.endPage + 1) + ',' + (this.form.endPage + 1) + ')">Next Page</A>'};
}
with (this.streamSource1 = new StreamSource(this)){
}
with (this.streamSource1.detailBand) {
height = 1200;
}
with (this.streamSource1.detailBand.TitleHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
width = 2000;
color = "black";
fontBold = false;
text = "Title ";
}
with (this.streamSource1.detailBand.TitleFieldHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
left = 2000;
width = 7000;
color = "black";
text = {||"<A HREF='/svr/intrasrv.isv?apps/kbase_ib/kbdoc.jfm(" + parseInt(this.form.query1.rowset.fields["DocumentID"].value) + ")'>" + this.form.query1.rowset.fields["Title"].value + "</A>"};
}
with (this.streamSource1.detailBand.DocumentIdHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
top = 200;
width = 2000;
color = "black";
fontBold = false;
text = "Document Number ";
}
with (this.streamSource1.detailBand.DocumentIdFieldHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
left = 2000;
top = 200;
width = 7000;
color = "black";
text = {||parseInt(this.form.query1.rowset.fields["DocumentID"].value)};
}
with (this.streamSource1.detailBand.ProdCatHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
top = 400;
width = 2000;
color = "black";
fontBold = false;
text = "Product / Category ";
}
with (this.streamSource1.detailBand.ProdCatFieldsHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
left = 2000;
top = 400;
width = 7000;
color = "black";
text = {||this.form.query1.rowset.fields["ProdDescript"].value + " / " + this.form.query1.rowset.fields["CatDescript"].value};
}
with (this.streamSource1.detailBand.KeywordHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
top = 600;
width = 2000;
color = "black";
fontBold = false;
text = "Key words ";
}
with (this.streamSource1.detailBand.KeywordFieldHTML = new HTML(this.streamSource1.detailBand)){
height = 200;
left = 2000;
top = 600;
width = 7000;
color = "black";
text = {||this.form.query1.rowset.fields["Keyword"].value};
}
with (this.streamSource1.detailBand.rule1 = new Rule(this.streamSource1.detailBand)){
top = 900;
size = 2;
right = 9000;
}
with (this.printer) {
duplex = 1;
orientation = 1;
paperSource = 15;
paperSize = 1;
resolution = 4;
color = 2;
trueTypeFonts = 2;
}
with (this.reportGroup) {
groupBy = "";
}
with (this.reportGroup.headerBand) {
height = 0;
}
with (this.reportGroup.footerBand) {
height = 0;
}
this.firstPageTemplate = this.form.pageTemplate1
this.form.pageTemplate1.nextPageTemplate = this.form.pageTemplate1
this.form.pageTemplate1.streamFrame1.streamSource = this.form.streamSource1
this.form.streamSource1.rowset = this.form.query1.rowset
function HomePageLinkImage_onClick()
{
// {Export} This comment causes this function body to be sent to the client
location.href="/ibapps/index.htm";
}
function SearchLinkImage_onClick()
{
// {Export} This comment causes this function body to be sent to the client
location.href="/svr/intrasrv.isv?apps/kbase_ib/kbsearch.jfm";
}
}