htmlindex.cls source

00001 /*----------------------------------------------------------------------------*/
00002 /*                                                                            */
00003 /*   Copyright (c) 2004-2009 William  Data  Systems Ltd. and Geoff Stevens.   */
00004 /*   All rights reserved.                                                     */
00005 /*                                                                            */
00006 /*   This program and the  accompanying  materials are made available under   */
00007 /*   the terms of the  Common  Public  License  v1.0 which accompanies this   */
00008 /*   distribution. A  copy  is  also  available  at  the following address:   */
00009 /*   http://www.opensource.org/licenses/cpl1.0.php                            */
00010 /*                                                                            */
00011 /*   Redistribution and use in  source  and  binary  forms, with or without   */
00012 /*   modification, are  permitted  provided  that  the following conditions   */
00013 /*   are met:                                                                 */
00014 /*                                                                            */
00015 /*   Redistributions  of  source  code  must  retain  the  above  copyright   */
00016 /*   notice, this list of conditions and the following disclaimer.            */
00017 /*                                                                            */
00018 /*   Redistributions in  binary  form  must  reproduce  the above copyright   */
00019 /*   notice, this list of  conditions  and  the following disclaimer in the   */
00020 /*   documentation and/or other materials provided with the distribution.     */
00021 /*                                                                            */
00022 /*   Neither the name or trademarks  of  William Data Systems nor the names   */
00023 /*   of its  contributors  may  be  used  to  endorse  or  promote products   */
00024 /*   derived from this software without specific prior written permission.    */
00025 /*                                                                            */
00026 /*   DISCLAIMER                                                               */
00027 /*                                                                            */
00028 /*   THIS SOFTWARE IS PROVIDED  BY  THE  COPYRIGHT HOLDERS AND CONTRIBUTORS   */
00029 /*   "AS IS" AND  ANY  EXPRESS  OR  IMPLIED  WARRANTIES, INCLUDING, BUT NOT   */
00030 /*   LIMITED TO, THE IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR   */
00031 /*   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN  NO EVENT SHALL THE COPYRIGHT   */
00032 /*   OWNER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL,   */
00033 /*   SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT NOT   */
00034 /*   LIMITED TO, PROCUREMENT OF SUBSTITUTE  GOODS OR SERVICES; LOSS OF USE,   */
00035 /*   DATA, OR PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON ANY   */
00036 /*   THEORY OF LIABILITY, WHETHER  IN  CONTRACT,  STRICT LIABILITY, OR TORT   */
00037 /*   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN  ANY WAY OUT OF THE USE   */
00038 /*   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     */
00039 /*                                                                            */
00040 /*----------------------------------------------------------------------------*/
00041 --  HTML page output static classes
00042 --
00043 --  These could be recast as routines, but making them class methods keeps them
00044 --  out of the namespace
00045 --
00046  
00047   -- html components
00048 ::REQUIRES 'fsobjects.cls'
00049   -- html utility
00050 ::REQUIRES 'htmlutil.cls'
00051   -- rexx class html 
00052 ::REQUIRES 'htmlrexxclass.cls'
00053   -- html indexing
00054 ::REQUIRES 'htmlindexelement.cls'
00055  
00056 -- static class to emit html pages indices
00057 -- all methods are class methods
00058 ::CLASS htmlindex PUBLIC
00059  
00060 -- emit html indices for global object
00061 -- @param htmlout - .htmlout object
00062 -- @param global - a global object to hold index results
00063 ::METHOD emit CLASS
00064   use strict arg htmlout, global
00065  
00066   self~emitprogrami(global~files, htmlout, 'Index of programs', 'petprograms', 'programs')
00067   self~emitclassi(global~classes, htmlout, 'Index of classes', 'petclasses', 'classes')
00068   self~emitmethi(global~methods, htmlout, 'Index of methods', 'petmethods', 'methods')
00069   self~emitmethi(global~attributes, htmlout, 'Index of attributes', 'petattributes', 'attributes')
00070   self~emitprocedurei(global~procedures, htmlout, 'Index of procedures', 'petprocedures', 'procedures')
00071   self~emitroutinei(global~routines, htmlout, 'Index of routines', 'petroutines', 'routines')
00072   self~emitconstanti(global~constants, htmlout, 'Index of constants', 'petconstants', 'constants')
00073   self~emitoptioni(global~options, htmlout, 'Index of options', 'petoptions', 'options')
00074  
00075   self~emittextfilei(global~files, htmlout, 'Index of text files', 'pettext', 'text')
00076   self~emitfilei(global~files, htmlout, 'Index of files', 'petfiles', 'files')
00077  
00078 -- emit program index
00079 ::METHOD emitprogrami CLASS PRIVATE
00080   use arg files, htmlout, title, pet, indexfile
00081   self~emitprogramalli(files, htmlout, title, pet, indexfile)
00082   self~emitprogramooi(files, htmlout, title, pet, indexfile'_oorexx')
00083   self~emitprogramcli(files, htmlout, title, pet, indexfile'_rexx')
00084  
00085 -- emit classic programs index
00086 ::METHOD emitprogramcli CLASS PRIVATE
00087   use arg files, htmlout, title, pet, indexfile
00088   hdr = self~makehdr(htmlout, title, pet)
00089   trl = self~maketrl(htmlout)
00090  
00091   menuq = .queue~new
00092   menuq~queue(.array~of('ooRexx', 'programs_oorexx.html', 'petoorexx'))
00093   menuq~queue(.array~of('rexx',   'programs_rexx.html',   'petrexx'))
00094   menuq~queue(.array~of('all',    'programs.html',        'petall' ))
00095   .htmlutil~tabshead(hdr, menuq, 'petrexx')
00096  
00097   elem = .queue~new
00098   do i over files
00099  
00100     if \i~isrexx
00101       then iterate
00102  
00103     if i~document~featurelist~items < 1
00104       then iterate
00105  
00106     if i~document~featurelist[1]~rexxname <> '--entry_proc'
00107       then iterate
00108  
00109     if i~document~isoo
00110       then iterate
00111  
00112     urldisplay = i~folder~foldername'/'i~filename
00113     docurl = i~document~hdocurl
00114  
00115     urlq = .queue~new
00116     urlq~queue(.array~of(urldisplay, docurl))
00117     urlq~queue(.array~of('source', i~document~hsrcurl))
00118  
00119     e = .htmlindexelement~new(i~filename, urlq)
00120     elem~queue(e)
00121   end
00122  
00123   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00124  
00125 -- emit oo programs index
00126 ::METHOD emitprogramooi CLASS PRIVATE
00127   use arg files, htmlout, title, pet, indexfile
00128   hdr = self~makehdr(htmlout, title, pet)
00129   trl = self~maketrl(htmlout)
00130  
00131   menuq = .queue~new
00132   menuq~queue(.array~of('ooRexx', 'programs_oorexx.html', 'petoorexx'))
00133   menuq~queue(.array~of('rexx',   'programs_rexx.html',   'petrexx'))
00134   menuq~queue(.array~of('all',    'programs.html',        'petall' ))
00135   .htmlutil~tabshead(hdr, menuq, 'petoorexx')
00136  
00137   elem = .queue~new
00138   do i over files
00139  
00140     if \i~isrexx
00141       then iterate
00142  
00143     if i~document~featurelist~items < 1
00144       then iterate
00145  
00146     if i~document~featurelist[1]~rexxname <> '--entry_proc'
00147       then iterate
00148  
00149     if \i~document~isoo
00150       then iterate
00151  
00152     urldisplay = i~folder~foldername'/'i~filename
00153     docurl = i~document~hdocurl
00154  
00155     urlq = .queue~new
00156     urlq~queue(.array~of(urldisplay, docurl))
00157     urlq~queue(.array~of('source', i~document~hsrcurl))
00158  
00159     e = .htmlindexelement~new(i~filename, urlq)
00160     elem~queue(e)
00161   end
00162  
00163   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00164  
00165 ::METHOD emitprogramalli CLASS PRIVATE
00166   use arg files, htmlout, title, pet, indexfile
00167   hdr = self~makehdr(htmlout, title, pet)
00168   trl = self~maketrl(htmlout)
00169  
00170   menuq = .queue~new
00171   menuq~queue(.array~of('ooRexx', 'programs_oorexx.html', 'petoorexx'))
00172   menuq~queue(.array~of('rexx',   'programs_rexx.html',   'petrexx'))
00173   menuq~queue(.array~of('all',    'programs.html',        'petall' ))
00174   .htmlutil~tabshead(hdr, menuq, 'petall')
00175  
00176   elem = .queue~new
00177   do i over files
00178  
00179     if \i~isrexx
00180       then iterate
00181  
00182     if i~document~featurelist~items < 1
00183       then iterate
00184  
00185     if i~document~featurelist[1]~rexxname <> '--entry_proc'
00186       then iterate
00187  
00188     urldisplay = i~folder~foldername'/'i~filename
00189     docurl = i~document~hdocurl
00190  
00191     urlq = .queue~new
00192     urlq~queue(.array~of(urldisplay, docurl))
00193     urlq~queue(.array~of('source', i~document~hsrcurl))
00194  
00195     e = .htmlindexelement~new(i~filename, urlq)
00196     elem~queue(e)
00197   end
00198  
00199   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00200  
00201 -- emit procedure index
00202 ::METHOD emitprocedurei CLASS PRIVATE
00203   use arg procedures, htmlout, title, pet, indexfile
00204  
00205   hdr = self~makehdr(htmlout, title, pet)
00206   trl = self~maketrl(htmlout)
00207  
00208   elem = .queue~new
00209   do i over procedures
00210  
00211     if i~rexxname = '--entry_proc'
00212       then iterate
00213  
00214     urldisplay = i~document~filename 
00215     docurl = i~hdocurl'#'i~hdocanchor
00216  
00217     urlq = .queue~new
00218     urlq~queue(.array~of(urldisplay, docurl))
00219     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00220  
00221     e = .htmlindexelement~new(i~rexxname, urlq)
00222     elem~queue(e)
00223   end
00224  
00225   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00226  
00227 -- emit routine index
00228 ::METHOD emitroutinei CLASS PRIVATE
00229   use arg routines, htmlout, title, pet, indexfile
00230  
00231   hdr = self~makehdr(htmlout, title, pet)
00232   trl = self~maketrl(htmlout)
00233  
00234   elem = .queue~new
00235   do i over routines
00236  
00237     urldisplay = i~document~filename 
00238     docurl = i~hdocurl'#'i~hdocanchor
00239  
00240     urlq = .queue~new
00241     urlq~queue(.array~of(urldisplay, docurl))
00242     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00243  
00244     e = .htmlindexelement~new(i~rexxname, urlq)
00245     elem~queue(e)
00246   end
00247  
00248   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00249  
00250 -- emit constants index
00251 ::METHOD emitconstanti CLASS PRIVATE
00252   use arg constants, htmlout, title, pet, indexfile
00253  
00254   hdr = self~makehdr(htmlout, title, pet)
00255   trl = self~maketrl(htmlout)
00256  
00257   elem = .queue~new
00258   do i over constants
00259  
00260     urldisplay = i~document~filename 
00261     docurl = i~hdocurl'#'i~hdocanchor
00262  
00263     urlq = .queue~new
00264     urlq~queue(.array~of(urldisplay, docurl))
00265     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00266  
00267     e = .htmlindexelement~new(i~rexxname, urlq)
00268     elem~queue(e)
00269   end
00270  
00271   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00272  
00273 ::METHOD emitoptioni CLASS PRIVATE
00274   use arg options, htmlout, title, pet, indexfile
00275  
00276   hdr = self~makehdr(htmlout, title, pet)
00277   trl = self~maketrl(htmlout)
00278  
00279   elem = .queue~new
00280   do i over options
00281  
00282     urldisplay = i~document~filename 
00283     docurl = i~hdocurl'#'i~hdocanchor
00284  
00285     urlq = .queue~new
00286     urlq~queue(.array~of(urldisplay, docurl))
00287     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00288  
00289     e = .htmlindexelement~new(i~rexxname, urlq)
00290     elem~queue(e)
00291   end
00292  
00293   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00294  
00295  
00296 -- emit text file index
00297 ::METHOD emittextfilei CLASS PRIVATE
00298   use arg files, htmlout, title, pet, indexfile
00299  
00300   hdr = self~makehdr(htmlout, title, pet)
00301   trl = self~maketrl(htmlout)
00302  
00303   elem = .queue~new
00304   do i over files
00305     if \i~istxt
00306       then iterate
00307  
00308     urldisplay = i~folder~foldername'/'i~filename
00309     docurl = i~document~hsrcurl
00310     urlq = .array~of(.array~of(urldisplay, docurl))
00311  
00312     e = .htmlindexelement~new(i~filename, urlq)
00313     elem~queue(e)
00314   end
00315  
00316   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00317  
00318 -- emit file index
00319 ::METHOD emitfilei CLASS PRIVATE
00320   use arg files, htmlout, title, pet, indexfile
00321  
00322   hdr = self~makehdr(htmlout, title, pet)
00323   trl = self~maketrl(htmlout)
00324  
00325   elem = .queue~new
00326   do i over files
00327  
00328     if i~istxt
00329       then do
00330              urldisplay = i~folder~foldername'/'i~filename
00331              docurl = i~document~hsrcurl
00332            end
00333       else do
00334              urldisplay = i~folder~foldername'/'i~filename
00335              docurl = i~document~hdocurl
00336            end
00337     urlq = .queue~new
00338     urlq~queue(.array~of(urldisplay, docurl))
00339     urlq~queue(.array~of('source', i~document~hsrcurl))
00340  
00341     e = .htmlindexelement~new(i~filename, urlq)
00342     elem~queue(e)
00343   end
00344  
00345   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00346  
00347  
00348 -- emit classes index
00349 ::METHOD emitclassi CLASS PRIVATE
00350   use arg classes, htmlout, title, pet, indexfile
00351  
00352   hdr = self~makehdr(htmlout, title, pet)
00353   trl = self~maketrl(htmlout)
00354  
00355   elem = .queue~new
00356   do i over classes
00357  
00358  
00359     urlq = .queue~new
00360     urlq~queue(.array~of(i~document~filename, i~hdocurl))
00361     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00362  
00363     e = .htmlindexelement~new(i~rexxname, urlq)
00364     elem~queue(e)
00365   end
00366  
00367   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00368  
00369 -- emit method index
00370 ::METHOD emitmethi CLASS PRIVATE
00371   use arg methods, htmlout, title, pet, indexfile
00372  
00373   hdr = self~makehdr(htmlout, title, pet)
00374   trl = self~maketrl(htmlout)
00375  
00376   elem = .queue~new
00377   do i over methods
00378  
00379     if i~feature~ownerclass <> .nil
00380       then do
00381              owner = i~feature~ownerclass~user -- owning rdclass
00382              urldisplay =  i~document~filename'::'owner~rexxname
00383              docurl = owner~hdocurl'#'i~hdocanchor
00384            end
00385       else do
00386              urldisplay = i~document~filename 
00387              docurl = i~hdocurl'#'i~hdocanchor
00388            end
00389  
00390     urlq = .queue~new
00391     urlq~queue(.array~of(urldisplay, docurl))
00392     urlq~queue(.array~of('source', i~document~hsrcurl'#'i~hsrcanchor))
00393  
00394     e = .htmlindexelement~new(i~rexxname, urlq)
00395     elem~queue(e)
00396   end
00397  
00398   call hiea2html elem~makeArray, indexfile, '', htmlout~hdest, 80, hdr, trl
00399  
00400 -- make header
00401 -- @param htmlout - where to get the top menu
00402 -- @param title - title to insert into header
00403 -- @param pet - pet name of active top-level menu
00404 ::METHOD makehdr CLASS PRIVATE
00405   use arg htmlout, title, pet
00406   hdr = .head_html~new~text
00407   hdr~queue('<title>'title'</title>')
00408   hdr~queue(.nodes~prodssheet)
00409   hdr~queue('<link rel="stylesheet" href="tabs.css">')
00410   hdr~queue('</head>')
00411   hdr~queue('<body>')
00412   .htmlutil~tabshead(hdr, htmlout~topmenu, pet)
00413   hdr~queue('<h2>'title'</h2>')
00414   return hdr
00415  
00416 -- make trailer
00417 -- @param htmlout - where to get trailer details
00418 ::METHOD maketrl CLASS PRIVATE
00419   use arg htmlout
00420   trl = .queue~new
00421   .htmlutil~trailer(htmlout, trl)
00422   trl~queue('</body></html>')
00423   return trl
00424  

Get RexxLiterate at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on 31 Aug 2010 05:20:24 for RexxLiterate by rexxliterate  0.0.1