1Ace::Browser::AceSubs(3U)ser Contributed Perl DocumentatiAocne::Browser::AceSubs(3)
2
3
4
6 Ace::Browser::AceSubs - Subroutines for AceBrowser
7
9 use Ace;
10 use Ace::Browser::AceSubs;
11 use CGI qw(:standard);
12 use CGI::Cookie;
13
14 my $obj = GetAceObject() || AceNotFound();
15 PrintTop($obj);
16 print $obj->asHTML;
17 PrintBottom();
18
20 Ace::Browser::AceSubs exports a set of routines that are useful for
21 creating search pages and displays for AceBrowser CGI pages. See
22 http://stein.cshl.org/AcePerl/AceBrowser.
23
24 The following subroutines are exported by default:
25
26 AceError
27 AceMissing
28 AceNotFound
29 Configuration
30 DoRedirect
31 GetAceObject
32 Object2URL
33 ObjectLink
34 OpenDatabase
35 PrintTop
36 PrintBottom
37 Url
38
39 The following subroutines are exported if explicitly requested:
40
41 AceAddCookie
42 AceInit
43 AceHeader
44 AceMultipleChoices
45 AceRedirect
46 DB_Name
47 Footer
48 Header
49 ResolveUrl
50 Style
51 Toggle
52 TypeSelector
53
54 To load the default subroutines load the module with:
55
56 use Ace::Browser::AceSubs;
57
58 To bring in a set of optionally routines, load the module with:
59
60 use Ace::Browser::AceSubs qw(AceInit AceRedirect);
61
62 To bring in all the default subroutines, plus some of the optional
63 ones:
64
65 use Ace::Browser::AceSubs qw(:DEFAULT AceInit AceRedirect);
66
67 There are two main types of AceBrowser scripts:
68
69 display scripts
70 These are called with the CGI parameters b<name> and b<class>,
71 corresponding to the name and class of an AceDB object to display.
72 The subroutine GetAceObject() will return the requested object, or
73 undef if the object does not exist.
74
75 To retrieve the parameters, use the CGI.pm param() method:
76
77 $name = param('name');
78 $class = param('class');
79
80 search scripts
81 These are not called with any CGI parameters on their first
82 invocation, but can define their own parameter lists by creating
83 fill-out forms. The AceBrowser system remembers the last search
84 performed by a search script in a cookie and regenerates the CGI
85 parameters the next time the user selects that search script.
86
88 The following sections describe the exported subroutines.
89
90 AceError($message)
91 This subroutine will print out an error message and exit the
92 script. The text of the message is taken from $message.
93
94 AceHeader()
95 This function prints the HTTP header and issues a number of cookies
96 used for maintaining AceBrowser state. It is not exported by
97 default.
98