Menu

Links database Log in to Edit

Links database

This database is a demo application for WODA, demonstrates some features and provides a template for end-user applications. The database would contain links to Web sites, with titles and descriptions.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/perl

# this file defines a Woda application
# 1) change the first line to point correctly
# 2) change the two lines below to point corectly
# 3) make sure it points to correct (.pl or .pm) version!

# woda-max.pl is the slower but more robust engine

#require "/var/www/woda/en/woda.pl" unless defined &main;
require "/var/www/woda/en/woda-max.pl" unless defined &main;

#
# Database definition:
#

$WBB{'about'} = <<EOM;
<P>
The database would contain links to Web sites, with titles and descriptions.
Feel free to set up your own categories by changing the field
<I>category</I>. Note that anyone is allowed to add data to the database, but only the <I>editor</I> can change
the rating of a site. Make sure you change his/hers password.
EOM
$WBB{'dbTitle'} = 'Architecture Links';
$WBB{'about'} = 'This is a library of links related to architecture';
$WBB{'recordTitle'} = 'Link';

$WBB{'sort;DEFAULT'} = '"$rec{type}\t$rec{title}"';
$WBB{'format;DEFAULT'} = '"<A HREF=$rec{url}><B>$rec{title}</B></A> $rec{description} (<I>$rec{category}</I>)\n"';
$WBB{'key'} = '"$rec{url}"';
# $WBB{'groups'} = <<EOM;
# editor    . denver
# EOM

$WBB{homePageFormat}=<<'EOM';
"
<TABLE WIDTH=100%>
<TR VALIGN=TOP>
<TD>
$SEARCH
$ABOUT
$DATA
</TD>
<TD>
<TD BGCOLOR=#000000>&nbsp;</TD>
<TD>$MENU</TD>
</TR>
</TABLE>
"
EOM

$WBB{homePageData} = 'category';

#
# Field definitions:
#

$i=1000;        # counter

$x='title'; # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = 'm/.{1,60}/';
$WBF{$x,'cond'} = '1-60 characters';

$x='url';   # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = 'm/.{5,100}/';
$WBF{$x,'cond'} = 'valid URL';
$WBF{$x,'type'} = 'URL';

$x='category';  # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = '
@_ = split(/\n/,$_);
$#_ < 5 && $#_ >= 0;
';
$WBF{$x,cond} = '1 to 5 categories.';
$WBF{$x,p} = 'Check the categories into which this site best fits. The list is quite long.';
$WBF{$x,type}='OPTION';
$WBF{$x,typePar}='MULTIPLE CHECKBOX TREE';
$WBF{$x,picture}=<<'EOM';
$v=&htEscape($_);
"<A HREF=\"$SCRIPT/BrowseTree?field=category&value=$v\">$_</A><BR>";
EOM
$WBF{$x,options} = <<EOM;
Architecture:Energy efficiency
Architecture:Ergonomics
Architecture:Interior
Architecture:Visualisation
Construction:Planning
Engineering:Aerospace
Engineering:Chemical
Engineering:Civil
Engineering:Civil:GIS
Engineering:Civil:Hydraulics
Engineering:Civil:Structural
Engineering:Civil:Structural:Analysis:Finite elements
Engineering:Civil:Structural:Design:Concrete
Engineering:Civil:Structural:Fire protection
Engineering:Civil:Structural:Materials:Expenses
Engineering:Civil:Surveying
Engineering:Civil:Visualisation
EOM

$x='description';   # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = 'm/.{10,100}/';
$WBF{$x,'cond'} = '10 to 100 characters';
$WBF{$x,'type'} = 'TEXTAREA';
$WBF{$x,'typePar'} = 'WRAP ROWS=8 COLS=70';

$x='rating';    # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = '1;';
$WBF{$x,'type'} = 'OPTION';
$WBF{$x,options} = <<EOM;
very good
good
average
bad
very bad
EOM
$WBF{$x,d}='average';
$WBF{$x,'p'} = 'Rate the link';
$WBF{$x,'modifies'}='editor';

$x='suppliedBy';    # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x,'p'} = 'First and last name of the person supplying this link';
$WBF{$x} = 'm/.{5,50}/';
$WBF{$x,'cond'} = '5-50 characters';
$WBF{$x,'sticky'} = '1';

$x='email'; # ------------------------------
$WBF{$x,srt}=$i--;
$WBF{$x} = '1;';
$WBF{$x,'type'} = 'EMAIL';

do main();

Related

Documentation Wiki: Commented samples
Documentation Wiki: Home