home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / sse99067.zip / JSSEARCH.INF (.txt) < prev   
OS/2 Help File  |  1999-03-08  |  16KB  |  436 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. Introduction 
  5.  
  6. This is a client side javascript search engine for smallish sites that don't 
  7. have access to server side CGI scripts. 
  8.  
  9. The reason that it is not suitable for large sites is the size of the page that 
  10. needs to be downloaded.  The search specification is also fairly primative. 
  11. There are options to limit the words that are used, you would not expect 
  12. someone to want to search on the word "the" for example! 
  13.  
  14. Note that some search engines such as HotBot allow you to restrict searches to 
  15. your site.  The problem with these are that you can only search on what was 
  16. there as at the last indexing the search robot performed, on a frequently 
  17. updated site this is not good enough.  One possibility I'd like to suggest is 
  18. that you supply both options.  One powerful but based on past index and a less 
  19. power up to date search. 
  20.  
  21. If you have used a previous version of this program then I'd recommended you 
  22. examine the change history section to determine what changes might effect you. 
  23.  
  24. Please see my web page "http://www.ozemail.com.au/~dbareis". for the latest 
  25. copy of this program or contact me (Dennis Bareis) via email (db0@anz.com). 
  26. I'm open to any reasonable suggestions. 
  27.  
  28. Please have a look at the proposed changes section and after using this program 
  29. for a while tell me what you think. 
  30.  
  31. A condition of use of this program is that you have a link to my homepage as 
  32. inserted by default.  If you wish to use my "TEXTEDIT" program to automatically 
  33. reformat the generated html you must leave in my link.  The link should be 
  34. visible showing the wording as generated. 
  35.  
  36.  
  37. ΓòÉΓòÉΓòÉ 1.1. Operating System Status ΓòÉΓòÉΓòÉ
  38.  
  39. Operating System Status 
  40.  
  41. You can only use OS/2 at this stage to create the search HTML. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 1.2. Proposed Changes ΓòÉΓòÉΓòÉ
  45.  
  46. If I've got the time I like to think about the best way of implementing 
  47. something (as well as questioning whether or not it should be).  If I have a 
  48. requirement I like to implement as generic a solution as possible.  This is my 
  49. "longer" term think about it list.. 
  50.  
  51. Proposed Changes - Rough Priority 
  52.  
  53.        1. Better searching. 
  54.  
  55.        2. Fix problem with pressing "ENTER" on input field. 
  56.  
  57.        3. Allow easier customisation of look and feel of generated code (append 
  58.           option or template based). 
  59.  
  60.        4. If found ".WRD" file for ".HTM" file then add its words to those of 
  61.           file. 
  62.  
  63.        5. Spell checker? 
  64.  
  65.  
  66. ΓòÉΓòÉΓòÉ 1.3. Change History ΓòÉΓòÉΓòÉ
  67.  
  68. Change History 
  69.  
  70. Note that none of these changes have been done due to feedback from users 
  71. (apart from myself!), can I assume everyone is happy? 
  72.  
  73.        1. Version 99.067 
  74.  
  75.               Fixed bug which could cause some java script errors such as 
  76.                "octal escape too large". 
  77.  
  78.        2. Version 98.365 
  79.  
  80.               Now use variable cookie name (unlikely to clash between multiple 
  81.                search pages). 
  82.               The '~' character is no longer a special character in an input 
  83.                mask, a round bracketed form is now used to determine what 
  84.                should be prepended to URLs. This is simplier to code for, 
  85.                easier for user to understand and is much more flexible. 
  86.               Now handles paths containing ":", "." & ".." better. 
  87.  
  88.        3. Version 98.356 
  89.  
  90.               Fixed bug where a line could be generated much too long. Some 
  91.                buggy browsers (such as OS/2 netscape 2.02E) will fail on these 
  92.                lines. 
  93.               Now points to my new web site (new ISP). 
  94.               Other minor improvements. 
  95.  
  96.        4. Version 98.254 
  97.  
  98.               New switch to allow valid word chars to be defined. 
  99.  
  100.        5. Version 98.180 
  101.  
  102.               Files are now sorted (case insensitive). 
  103.               Occurs array compressed (where possible) using new offset based 
  104.                technique. 
  105.               Other relatively minor improvements. 
  106.  
  107.        6. Version 98.176 
  108.  
  109.               Much more compact, overhead of each array element reduced. 
  110.               Tried to prevent reload() still can't do so, not sure I can even 
  111.                though my early testing seemed OK (a required routine probably 
  112.                marks page as requiring a reload).  At moment I'm concentrating 
  113.                on getting page size down. 
  114.               Am testing new compression technique which will get us an extra 
  115.                15% or more compression.  I've not documented this yet as I'm 
  116.                not 100% sure it will work. 
  117.               Some minor bugs/features fixed. 
  118.  
  119.  
  120. ΓòÉΓòÉΓòÉ 1.4. Bugs ΓòÉΓòÉΓòÉ
  121.  
  122. Currently Known Bugs 
  123.  
  124.        1. You can't specify parameters (such as filenames) containing spaces on 
  125.           the command line. 
  126.  
  127.  Reporting Bugs or Suggestions 
  128.  
  129.  If reporting bugs please supply: 
  130.  
  131.        1. All files involved (input, output and any Batch files used to run the 
  132.           preprocessor).  You have hopefully trimmed out everything which is 
  133.           not required to reproduce the problem. 
  134.  
  135.        2. A detailed description of the problem. 
  136.  
  137.  The easier you make it for me the faster I will be able to come up with a fix 
  138.  or tell you what your doing wrong etc. 
  139.  
  140.  
  141. ΓòÉΓòÉΓòÉ 2. JSSEARCH.CMD Command Line ΓòÉΓòÉΓòÉ
  142.  
  143. JSSEARCH.CMD Command Line 
  144.  
  145.         JSSEARCH[.CMD]  [whitespace]InputMask [whitespace][Options[:parms]][whitespace]
  146.  
  147. The "InputMask" can be the name of a single file or a filemask containing the 
  148. normal wildcard characters "?" & "*". 
  149.  
  150. The Input mask may be followed by a bracketed html prefix such as "(html\)" in 
  151. which case the path "html\" would be prepended to any html URL. Note that the 
  152. case of the prepended URL is never modified, you must supply it exactly as you 
  153. require it. 
  154.  
  155. Options 
  156.  
  157. You may specify one or more "Options" separated by whitespace.  Options in the 
  158. optional environment variable "JSSEARCH_OPTIONS" are processed before any 
  159. specified on the command line.  Valid options are: 
  160.  
  161.        1. /# 
  162.        2. /EXCLUDEFILES 
  163.        3. /EXCLUDEWORDS 
  164.        4. /JUSTWORDS 
  165.        5. /LOWER 
  166.        6. /MAXPERCENT 
  167.        7. /NOBUTTON 
  168.        8. /NOLISTONNOMATCH 
  169.        9. /OKINWORD 
  170.       10. /OUTPUT 
  171.       11. /PRETTY 
  172.       12. /S 
  173.       13. /TARGET 
  174.       14. /UPPER 
  175.  
  176.  RETURN CODES 
  177.  
  178.          A return code of 0 indicates success. 
  179.  
  180.          Any other value indicates an error occurred. 
  181.  
  182.  EXAMPLE BATCH FILE 
  183.  
  184.   /********************************/
  185.   /* A Simplistic TEST batch file */
  186.   /********************************/
  187.  
  188.   /*--- Initialization --------------------------------------------------------*/
  189.   address cmd '@echo off'
  190.   OutputFile = "out\SEARCH.HTM"
  191.   CloseRc = stream(OutputFile, 'c', 'close');
  192.   DosDelRc = SysFileDelete(OutputFile);
  193.  
  194.   /*--- Generate start of HTML ------------------------------------------------*/
  195.   call GenerateLine '<HTML>'
  196.   call GenerateLine '<HEAD>'
  197.   call GenerateLine "<TITLE>Dennis Bareis' SITE SEARCH Page</TITLE>"
  198.   call GenerateLine '<meta Name="description" Content="Search Dennis Bareis` site">'
  199.   call GenerateLine '<meta Name="keywords" Content="Dennis, Bareis, Site, Search, Engine">'
  200.   call GenerateLine '</HEAD>'
  201.   call GenerateLine '<BODY BACKGROUND="os2warp.jpg">'
  202.   CloseRc = stream(OutputFile, 'c', 'close');
  203.  
  204.   /*--- Work out what HTML files we don't want included in searches -----------*/
  205.   ExcludeFiles = '/excludefiles:C:\tmp\homepage.tst\sitesrch.htm /excludefiles:C:\tmp\homepage.tst\ssrchcmp.htm';
  206.  
  207.   /*--- Combine all options we wish to apply ----------------------------------*/
  208.   AllOptions = '/pretty /nobutton /Output:+' || OutputFile || ' ' || ExcludeFiles;
  209.  
  210.   /*--- Now start JSSEARCH.CMD to append to the html we began above -----------*/
  211.   signal S_014019; /*CommentBlock*/ /* (Friday 01/01/1999, 10:40:19, by Dennis_Bareis) */
  212.   //+--------------------------------------------------------------------------
  213.   //!FullOs2Cmd = 'out\jssearch.cmd out\*.htm(\html\) ' || AllOptions;
  214.   //+--------------------------------------------------------------------------
  215.   S_014019:                         /* (Friday 01/01/1999, 10:40:19, by Dennis_Bareis) */
  216.   FullOs2Cmd = 'out\jssearch.cmd out\*.htm ' || AllOptions;
  217.   say FullOs2Cmd;
  218.   address cmd 'cmd.exe /c ' || FullOs2Cmd;
  219.   ExitRc = Rc;
  220.  
  221.   /*--- Generate End of HTML --------------------------------------------------*/
  222.   call GenerateLine '</BODY>'
  223.   call GenerateLine '</HTML>'
  224.   CloseRc = stream(OutputFile, 'c', 'close');
  225.   exit(ExitRc);
  226.  
  227.  
  228.  
  229.   /*===========================================================================*/
  230.   GenerateLine:
  231.   /*===========================================================================*/
  232.      TheLine = translate(arg(1), "'", "`");   /* Restore Single quotes (coded as "`") */
  233.      call lineout OutputFile, TheLine;
  234.      return;
  235.  
  236.  
  237. ΓòÉΓòÉΓòÉ 2.1. /ExcludeFiles ΓòÉΓòÉΓòÉ
  238.  
  239. Switch /ExcludeFiles:FileMask 
  240.  
  241. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  242. switches in the "JSSEARCH_OPTIONS" environment variable. 
  243.  
  244. This command can be used multiple times if required to specify files that 
  245. should not be processed.  You can use this to prevent "hidden" html pages from 
  246. turning up in a search! 
  247.  
  248. EXAMPLE 
  249.  
  250.    JsSearch.CMD C:\PROJECTS\HTML\~*.HTM /ExcludeFiles:C:\PROJECTS\HTML\NoShow*.HTM
  251.  
  252.  
  253. ΓòÉΓòÉΓòÉ 2.2. /ExcludeWords ΓòÉΓòÉΓòÉ
  254.  
  255. Switch /ExcludeWords:FileContainingWords 
  256.  
  257. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  258. switches in the "JSSEARCH_OPTIONS" environment variable. 
  259.  
  260. This command can be used multiple times if required to specify files that 
  261. contain lists of words to be excluded. You would place words in this list which 
  262. a user is unlikely to select (or wish to match). 
  263.  
  264. The file should contain one word per line with blank lines and lines starting 
  265. with ";" being ignored. 
  266.  
  267. Note that the "/MAXPERCENT" switch can also be used to exclude common words 
  268. (and does do so by default). 
  269.  
  270. You can get a list of words using the "/JUSTWORDS" switch. 
  271.  
  272. EXAMPLE 
  273.  
  274.    JsSearch.CMD C:\PROJECTS\HTML\~*.HTM /ExcludeWords:C:\PROJECTS\HTML\WORD.LST
  275.  
  276.  
  277. ΓòÉΓòÉΓòÉ 2.3. /JustWords ΓòÉΓòÉΓòÉ
  278.  
  279. Switch /JustWords 
  280.  
  281. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  282. switches in the "JSSEARCH_OPTIONS" environment variable. 
  283.  
  284. This command causes the complete word list that would normally be imbedded in 
  285. the javascript to be generated.  This could be used to create a list of words 
  286. you are not interested in (to be loaded with /ExcludeWords) or to perform a 
  287. spell check. 
  288.  
  289.  
  290. ΓòÉΓòÉΓòÉ 2.4. /Lower ΓòÉΓòÉΓòÉ
  291.  
  292. Switch /Lower 
  293.  
  294. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  295. switches in the "JSSEARCH_OPTIONS" environment variable. 
  296.  
  297. Normally filenames are left in the case that they appear on the filesystem. 
  298. This switch forces all filenames to be in lower case. This could be required if 
  299. you force lower case when you ftp (to upload) your website. 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ 2.5. /MaxPercent ΓòÉΓòÉΓòÉ
  303.  
  304. Switch /MaxPercent:Percentage 
  305.  
  306. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  307. switches in the "JSSEARCH_OPTIONS" environment variable. 
  308.  
  309. There are two ways to exclude words, the first is to list the word in a file 
  310. included with the "/ExcludeWords" switch the other is this switch. 
  311.  
  312. If a word appears in all files there seems little point in having it available 
  313. in the word list (particularly if you don't use the /NOLISTONNOMATCH switch). 
  314. If it appeared in 80% of the files there is probably still little point. 
  315.  
  316. This switch allows you to specify the percentage of files a word is allowed to 
  317. appear in before its dropped.  To drop no words you would need to specify "0". 
  318.  
  319. EXAMPLE 
  320.  
  321.    JsSearch.CMD C:\PROJECTS\HTML\~*.HTM /MaxPercent:80
  322.  
  323.  
  324. ΓòÉΓòÉΓòÉ 2.6. /NoButton ΓòÉΓòÉΓòÉ
  325.  
  326. Switch /NoButton 
  327.  
  328. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  329. switches in the "JSSEARCH_OPTIONS" environment variable. 
  330.  
  331. By default the search dialog has a search button.  It does not really need one 
  332. as simply pressing enter will cause a search to be performed. 
  333.  
  334.  
  335. ΓòÉΓòÉΓòÉ 2.7. /NoListOnNoMatch ΓòÉΓòÉΓòÉ
  336.  
  337. Switch /NoListOnNoMatch 
  338.  
  339. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  340. switches in the "JSSEARCH_OPTIONS" environment variable. 
  341.  
  342. By default if a search fails to find a match all the files are listed.  This 
  343. switch prevents this from happening. 
  344.  
  345.  
  346. ΓòÉΓòÉΓòÉ 2.8. /OkInWord ΓòÉΓòÉΓòÉ
  347.  
  348. Switch /OkInWord:ExtraCharList 
  349.  
  350. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  351. switches in the "JSSEARCH_OPTIONS" environment variable. 
  352.  
  353. Letters and digits '0' to '9' are always valid in words. You may supply an 
  354. addition list of characters. 
  355.  
  356. EXAMPLE 
  357.  
  358.    JsSearch.CMD C:\PROJECTS\HTML\~*.HTM /OkInWord:#@/-
  359.  
  360.  
  361. ΓòÉΓòÉΓòÉ 2.9. /Output ΓòÉΓòÉΓòÉ
  362.  
  363. Switch /Output:[+]FileName 
  364.  
  365. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  366. switches in the "JSSEARCH_OPTIONS" environment variable. 
  367.  
  368. This option specifies the name of the generated html.  The default is 
  369. "JsSearch.htm". 
  370.  
  371. Unless "+" was specified the file is deleted before anything is written to it, 
  372. otherwise code is appended.  You would wish to append if you want specific 
  373. backgrounds etc to be used for the page. 
  374.  
  375. EXAMPLE 
  376.  
  377.    JsSearch.CMD C:\PROJECTS\HTML\~*.HTM /Output:+C:\TMP\SEARCH.HTML
  378.  
  379.  
  380. ΓòÉΓòÉΓòÉ 2.10. /Pretty ΓòÉΓòÉΓòÉ
  381.  
  382. Switch /Pretty 
  383.  
  384. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  385. switches in the "JSSEARCH_OPTIONS" environment variable. 
  386.  
  387. By default the generated code is fairly compact (approx 20% compressed), if you 
  388. wish to see it in a "prettier" format you need to use this switch. 
  389.  
  390.  
  391. ΓòÉΓòÉΓòÉ 2.11. /S ΓòÉΓòÉΓòÉ
  392.  
  393. Switch /S 
  394.  
  395. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  396. switches in the "JSSEARCH_OPTIONS" environment variable. 
  397.  
  398. By default when scanning for files we don't look in subdirectories.  This 
  399. option says to look in subdirectories. 
  400.  
  401.  
  402. ΓòÉΓòÉΓòÉ 2.12. /Target ΓòÉΓòÉΓòÉ
  403.  
  404. Switch /Target:WindowName 
  405.  
  406. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  407. switches in the "JSSEARCH_OPTIONS" environment variable. 
  408.  
  409. When you select a file link the default target for the html's page is "_top", 
  410. this may or may not be suitable in your environment. 
  411.  
  412. You can prevent the use of the "target" tag altogether by specifying "" for a 
  413. window name. You could also start a new browser or load the html into a frame 
  414. which you name. 
  415.  
  416.  
  417. ΓòÉΓòÉΓòÉ 2.13. /Upper ΓòÉΓòÉΓòÉ
  418.  
  419. Switch /Upper 
  420.  
  421. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  422. switches in the "JSSEARCH_OPTIONS" environment variable. 
  423.  
  424. Normally filenames are left in the case that they appear on the filesystem. 
  425. This switch forces all filenames to be in upper case. 
  426.  
  427.  
  428. ΓòÉΓòÉΓòÉ 2.14. /# ΓòÉΓòÉΓòÉ
  429.  
  430. Switch /# 
  431.  
  432. This is a JSSEARCH.CMD command line switch.  You can set up your own default 
  433. switches in the "JSSEARCH_OPTIONS" environment variable. 
  434.  
  435. By default a word which is a decimal number is not considered to be a word. 
  436. Use this switch to have them show up in searches.