File tree Expand file tree Collapse file tree 10 files changed +128
-3
lines changed Expand file tree Collapse file tree 10 files changed +128
-3
lines changed Original file line number Diff line number Diff line change 1
- v0.92 Fri Nov 11 2005
1
+ v0.92 Thu Dec 15 2005
2
2
- updated Catalyst plugin for Catalyst 5.5
3
+ - pod updates
3
4
4
5
v0.91 Wed Oct 5 2005
5
6
- modified Response/SearchRetrieve.pm to
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ t/cgi.t
23
23
t/cgi_app.t
24
24
t/diagnostic.t
25
25
t/pod.t
26
+ t/pod_coverage.t
26
27
t/record.t
27
28
t/request_explain.t
28
29
t/request_scan.t
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ my @validParams = qw(
58
58
extraRequestData
59
59
) ;
60
60
61
+ =head2 validParams()
62
+
63
+ =cut
64
+
61
65
# no pod since this is used in SRU::Request
62
66
sub validParams { return @validParams };
63
67
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ my @validParams = qw(
61
61
extraRequestData
62
62
) ;
63
63
64
+ =head2 validParams()
65
+
66
+ =cut
67
+
64
68
sub validParams { return @validParams ; }
65
69
66
70
SRU::Request::Scan-> mk_accessors( @validParams );
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ my @validParams = qw(
73
73
extraRequestData
74
74
) ;
75
75
76
+ =head2 validParams()
77
+
78
+ =cut
79
+
76
80
sub validParams { return @validParams };
77
81
78
82
SRU::Request::SearchRetrieve-> mk_accessors( @validParams );
Original file line number Diff line number Diff line change @@ -79,6 +79,14 @@ my @accessors = qw( request response cql );
79
79
80
80
__PACKAGE__ -> mk_accessors( @accessors );
81
81
82
+ =head1 CGI::APPLICATION METHODS
83
+
84
+ =head2 setup
85
+
86
+ Sets the C<run_modes > , C<mode_param > and the default runmode (explain).
87
+
88
+ =cut
89
+
82
90
sub setup {
83
91
my $self = shift ;
84
92
@@ -87,6 +95,12 @@ sub setup {
87
95
$self -> mode_param( ' operation' );
88
96
}
89
97
98
+ =head2 cgiapp_prerun
99
+
100
+ Parses the incoming SRU request and if needed, checks the CQL query.
101
+
102
+ =cut
103
+
90
104
sub cgiapp_prerun {
91
105
my $self = shift ;
92
106
my $mode = shift ;
@@ -115,6 +129,12 @@ sub cgiapp_prerun {
115
129
}
116
130
}
117
131
132
+ =head2 cgiapp_postrun
133
+
134
+ Sets the content type (text/xml) and serializes the response.
135
+
136
+ =cut
137
+
118
138
sub cgiapp_postrun {
119
139
my $self = shift ;
120
140
my $output_ref = shift ;
@@ -124,6 +144,12 @@ sub cgiapp_postrun {
124
144
$$output_ref = $self -> response-> asXML;
125
145
}
126
146
147
+ =head2 error_mode
148
+
149
+ Stub error runmode.
150
+
151
+ =cut
152
+
127
153
sub error_mode {
128
154
}
129
155
Original file line number Diff line number Diff line change @@ -6,6 +6,27 @@ use base qw( Exporter );
6
6
7
7
our @EXPORT_OK = qw( error ) ;
8
8
9
+ =head1 NAME
10
+
11
+ SRU::Utils - Utility functions for SRU
12
+
13
+ =head1 SYNOPSIS
14
+
15
+ use SRU::Utils qw( error );
16
+ return error( "error!" );
17
+
18
+ =head1 DESCRIPTION
19
+
20
+ This is a set of utility functions for the SRU objects.
21
+
22
+ =head1 METHODS
23
+
24
+ =head2 error( $message )
25
+
26
+ Sets the C<$SRU::Error > message.
27
+
28
+ =cut
29
+
9
30
sub error {
10
31
if ( $_ [0] ) { $SRU::Error = $_ [0]; };
11
32
return ;
Original file line number Diff line number Diff line change @@ -6,18 +6,51 @@ use base qw( Exporter );
6
6
7
7
our @EXPORT_OK = qw( element elementNoEscape escape stylesheet ) ;
8
8
9
+ =head1 NAME
10
+
11
+ SRU::Utils::XML - XML utility functions for SRU
12
+
13
+ =head1 SYNOPSIS
14
+
15
+ use SRU::Utils::XML qw( escape );
16
+ return escape( $text );
17
+
18
+ =head1 DESCRIPTION
19
+
20
+ This is a set of utility functions for use with XML data.
21
+
22
+ =head1 METHODS
23
+
24
+ =head2 element( $tag, $text )
25
+
26
+ Creates an xml element named C<$tag > containing escaped data (C<$text > ).
27
+
28
+ =cut
29
+
9
30
sub element {
10
- my ($tag ,$text ) = @_ ;
31
+ my ($tag , $text ) = @_ ;
11
32
return ' ' if ! defined $text ;
12
33
return " <$tag >" . escape($text ) . " </$tag >" ;
13
34
}
14
35
36
+ =head2 elementNoEscape( $tag, $text )
37
+
38
+ Similar to C<element > , except that C<$text > is not escaped.
39
+
40
+ =cut
41
+
15
42
sub elementNoEscape {
16
- my ($tag ,$text ) = @_ ;
43
+ my ($tag , $text ) = @_ ;
17
44
return ' ' if ! defined $text ;
18
45
return " <$tag >$text </$tag >" ;
19
46
}
20
47
48
+ =head2 escape( $text )
49
+
50
+ Does minimal escaping on C<$text > .
51
+
52
+ =cut
53
+
21
54
sub escape {
22
55
my $text = shift || ' ' ;
23
56
$text =~ s / </ </ g ;
@@ -26,6 +59,12 @@ sub escape {
26
59
return $text ;
27
60
}
28
61
62
+ =head2 stylesheet( $uri )
63
+
64
+ A shortcut method to create an xml-stylesheet declaration.
65
+
66
+ =cut
67
+
29
68
sub stylesheet {
30
69
my $uri = shift ;
31
70
return qq( <?xml-stylesheet type='text/xsl' href="$uri " ?>) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,27 @@ use base qw( Exporter );
7
7
8
8
our @EXPORT = qw( wellFormedXML ) ;
9
9
10
+ =head1 NAME
11
+
12
+ SRU::Utils::XMLTest - XML testing utility functions
13
+
14
+ =head1 SYNOPSIS
15
+
16
+ use SRU::Utils::XMLText;
17
+ ok( wellFormedXML($xml), '$xml is well formed' );
18
+
19
+ =head1 DESCRIPTION
20
+
21
+ This is a set of utility functions for use with testing XML data.
22
+
23
+ =head1 METHODS
24
+
25
+ =head2 wellFormedXML( $xml )
26
+
27
+ Checks if C<$xml > is welformed.
28
+
29
+ =cut
30
+
10
31
sub wellFormedXML {
11
32
my $xml_string = shift ;
12
33
eval {
Original file line number Diff line number Diff line change
1
+ use Test::More;
2
+ eval " use Test::Pod::Coverage 1.00" ;
3
+ plan skip_all => " Test::Pod::Coverage 1.00 required for testing POD coverage" if $@ ;
4
+ all_pod_coverage_ok();
You can’t perform that action at this time.
0 commit comments