Debian Codegraph @

reports/fileindex.ll

raw
1 /*
2 * @progname fileindex.ll
3 * @version 1999
4 * @author Dennis Nicklaus
5 * @category
6 * @output HTML
7 * @description
8
9 I have lines on indi's in my database which look like:
10 1 NOTE FILE: BIOGRAPHY $FAMHIST/matthews/alkire.bio
11 or maybe OBITUARY, MARRIAGE, WILL, NEWS ... instead of BIOGRAPHY.
12 and the lowercase letters (matthews/alkire.bio in this example)
13 will change to reflect the location of the file in question.
14
15 The purpose of this report is to make an index for these files.
16 Each entry looks something like:
17 <a href=momI83.html> ALKIRE, James Denton</a> : <a href=matthews_alkire_bio.txt> matthews_alkire_bio</a> <br>
18 referencing my page for the individual and the file which has the article
19 in it. (I had to change the file naming scheme from my local disk to the
20 place where I have my files served to the WWW (geocities used to not allow
21 subdirectories).
22
23 The files are grouped by type (e.g. BIO, OBIT, ...) and then
24 are sorted alphabetically by the individual's surname within each grouping.
25
26 Probably not generally useful to anyone else, but shows one thing
27 that can be done.
28 */
29
30
31
32 proc main()
33 {
34 indiset(obitset)
35 indiset(marrset)
36 indiset(otherset)
37 indiset(bioset)
38 indiset(willset)
39
40 table(obittab)
41 table(marrtab)
42 table(othertab)
43 table(biotab)
44 table(willtab)
45
46
47 print("patience please, you have a lot of data\n")
48 forindi (person, pnum) {
49 fornotes(inode(person),note){
50 set (i, index(note,"FILE:",1))
51 if (gt(i,0)){
52
53
54 /* Get the filename. lifted from html.dn */
55
56 set(what,save(substring(note,add(i,6),strlen(note))))
57 set (i, index(what," ",1))
58 set(descrip,save(substring(what,1,i)))
59
60 /* now get and flatten the file name */
61 set (i, index(what,"FAMHIST/",1))
62 set (fname,save(substring(what,add(i,strlen("FAMHIST/")),strlen(what))))o
63 set (slash, index(fname,"/",1))
64 while (gt(slash,0)){
65 set(fnameb,save(concat(concat(substring(fname,1,sub(slash,1)),"_"),
66 substring(fname,add(slash,1),strlen(fname)))))
67 set(fname,fnameb)
68 set (slash, index(fname,"/",1))
69 }
70 set (slash, index(fname,".",1))
71 while (gt(slash,0)){
72 set(fnameb,save(concat(concat(substring(fname,1,sub(slash,1)),"_"),
73 substring(fname,add(slash,1),strlen(fname)))))
74 set(fname,fnameb)
75 set (slash, index(fname,".",1))
76 }
77 /* filename is now complete except for adding .txt on the end of it */
78
79
80
81 /* now figure out which table things go in */
82
83 set (i, index(note,"OBITUARY",1))
84 if (gt(i,0)){
85 addtoset(obitset,person,0)
86 list(temp)
87 if (lookup(obittab, key(person))){
88 set(temp,lookup(obittab, key(person)))
89 enqueue(temp,fname)
90 } else {
91 enqueue(temp,fname)
92 }
93 insert(obittab, save(key(person)), temp)
94 }
95 set (j, index(note,"MARRIAGE",1))
96 if (gt(j,0)){
97 addtoset(marrset,person,0)
98 list(temp)
99 if (lookup(marrtab, key(person))){
100 set(temp,lookup(marrtab, key(person)))
101 enqueue(temp,fname)
102 } else {
103 enqueue(temp,fname)
104 }
105 insert(marrtab, save(key(person)), temp)
106 }
107 set (k, add(index(note,"BIOGRAPHY",1),index(note,"HISTORY",1)))
108 if (gt(k,0)){
109 addtoset(bioset,person,0)
110 list(temp)
111 if (lookup(biotab, key(person))){
112 set(temp,lookup(biotab, key(person)))
113 enqueue(temp,fname)
114 } else {
115 enqueue(temp,fname)
116 }
117 insert(biotab, save(key(person)), temp)
118 }
119 set (m, index(note,"WILL",1))
120 if (gt(m,0)){
121 addtoset(willset,person,0)
122 list(temp)
123 if (lookup(willtab, key(person))){
124 set(temp,lookup(willtab, key(person)))
125 enqueue(temp,fname)
126 } else {
127 enqueue(temp,fname)
128 }
129 insert(willtab, save(key(person)), temp)
130 }
131 if (eq(add(add(add(i,j),k),m),0)){
132 addtoset(otherset,person,0)
133 list(temp)
134 if (lookup(othertab, key(person))){
135 set(temp,lookup(othertab, key(person)))
136 enqueue(temp,fname)
137 } else {
138 enqueue(temp,fname)
139 }
140 insert(othertab, save(key(person)), temp)
141 }
142 }
143 }
144 }
145 /* now sort and print things out */
146 print("uniquing\n")
147 /* uniqueset(obitset)
148 uniqueset(marrset)
149 uniqueset(otherset)
150 uniqueset(bioset)*/
151 print("sorting\n")
152 namesort(obitset)
153 namesort(marrset)
154 namesort(otherset)
155 namesort(bioset)
156 namesort(willset)
157 print("printing\n")
158 call intro()
159 "<center> Have Obituaries for :</center><br>\n"
160 forindiset(obitset,person,i,j) {
161 call nameout(person)
162 forlist(lookup(obittab, key(person)),newfile,n){
163 " : <a href=" newfile ".txt> " newfile "</a> "
164 }
165 "<br>\n"
166 }
167 "<center> Have marriage articles for :</center><br>\n"
168 forindiset(marrset,person,i,j) {
169 call nameout(person)
170 forlist(lookup(marrtab, key(person)),newfile,n){
171 " : <a href=" newfile ".txt> " newfile "</a> "
172 }
173 "<br>\n"
174 }
175 "<center> Have Biographical or historical articles for :</center><br>\n"
176 forindiset(bioset,person,i,j) {
177 call nameout(person)
178 forlist(lookup(biotab, key(person)),newfile,n){
179 " : <a href=" newfile ".txt> " newfile "</a> "
180 }
181 "<br>\n"
182 }
183 "<center> Have Wills for :</center><br>\n"
184 forindiset(willset,person,i,j) {
185 call nameout(person)
186 forlist(lookup(willtab, key(person)),newfile,n){
187 " : <a href=" newfile ".txt> " newfile "</a> "
188 }
189 "<br>\n"
190 }
191 "<center> Have Other info for :</center><br>\n"
192 forindiset(otherset,person,i,j) {
193 call nameout(person)
194 forlist(lookup(othertab, key(person)),newfile,n){
195 " : <a href=" newfile ".txt> " newfile "</a> "
196 }
197 "<br>\n"
198 }
199 call end()
200 }
201
202 proc nameout(person)
203 {
204 "<a href=" database() key(person) ".html> "
205 fullname(person,1,0,999)
206 "</a> "
207 }
208 proc intro()
209 {
210 set(db_owner, getproperty("user.fullname"))
211 set(owner_email, concat("mailto:",getproperty("user.email")))
212 "<html>\n"
213 "<title>" db_owner " Genealogy Article Index</title>\n"
214 "<META NAME=\"keywords\" CONTENT=\"genealogy, obituary, index\" >\n"
215 "<center> <h1>Family Article Index</h1></center>\n"
216 "<center> <a href=\"" owner_email "\">" db_owner " " owner_email "</a><br></center>\n"
217 "<p>\n"
218 "This is an index of the various obituaries, biographies, wedding announcements, \n"
219 "wills, etc. that I have, sorted into those categories. Selecting the name\n"
220 "of the person will take you to that person's page. Following the person's\n"
221 "name is a filename or list of filenames which are the articles for that person.\n"
222 "Selecting the article filename will take you directly to it.\n"
223 "<p> Some of the persons on this list may not have a personal page if they are \n"
224 "of a generation not included here, or if they are only related to me by marriage.\n"
225 "But the article should still be present.\n"
226 "So if you click on a person and don't go anywhere interesting, it's OK.\n"
227 "But let me know if any of the article links are invalid.\n"
228 "<hr><p>"
229 }
230 proc end()
231 {
232 "<center><b>\n"
233 "This page hosted by <a href=\"/\"><img src=/pictures/gc_icon.gif align=middle alt=\"GeoCities\" border=0></a>\n"
234 "Get your own <a href=\"/\">Free Home Page</a></b></center>\n"
235 "<br><br>\n"
236 }