1 |
package WebHACC::Language::CacheManifest; |
package WebHACC::Language::CacheManifest; |
2 |
use strict; |
use strict; |
3 |
require WebHACC::Language::Base; |
require WebHACC::Language::Base; |
4 |
push our @ISA, 'WebHACC::Langauge::Base'; |
push our @ISA, 'WebHACC::Language::Base'; |
5 |
|
|
6 |
sub new ($) { |
sub new ($) { |
7 |
my $self = bless {}, shift; |
my $self = bless {}, shift; |
15 |
|
|
16 |
my $out = $self->output; |
my $out = $self->output; |
17 |
|
|
18 |
$out->start_section (id => 'parse-errors', title => 'Parse Errors'); |
$out->start_section (role => 'parse-errors'); |
19 |
$out->start_tag ('dl', id => 'parse-errors-list'); |
$out->start_error_list (role => 'parse-errors'); |
20 |
|
|
21 |
my $input = $self->input; |
my $input = $self->input; |
22 |
my $result = $self->result; |
my $result = $self->result; |
26 |
($input->{s}, $input->{uri}, $input->{base_uri}, sub { |
($input->{s}, $input->{uri}, $input->{base_uri}, sub { |
27 |
$result->add_error (@_, layer => 'syntax', index_has_link => 1); |
$result->add_error (@_, layer => 'syntax', index_has_link => 1); |
28 |
}); |
}); |
29 |
|
|
30 |
$out->end_tag ('dl'); |
$out->end_error_list (role => 'parse-errors'); |
31 |
$out->end_section; |
$out->end_section; |
32 |
} # generate_syntax_error_section |
} # generate_syntax_error_section |
33 |
|
|
35 |
my $self = shift; |
my $self = shift; |
36 |
my $manifest = $self->{structure}; |
my $manifest = $self->{structure}; |
37 |
|
|
38 |
$self->start_section (id => 'dump-manifest', title => 'Cache Manifest'); |
my $out = $self->output; |
39 |
|
|
40 |
|
$out->start_section (role => 'structure'); |
41 |
|
|
42 |
$self->html (qq[<dl><dt>Explicit entries</dt>]); |
$out->html (qq[<dl><dt>Explicit entries</dt>]); |
43 |
my $i = 0; |
my $i = 0; |
44 |
for my $uri (@{$manifest->[0]}) { |
for my $uri (@{$manifest->[0]}) { |
45 |
$out->start_tag ('dd', id => 'index-' . $i++); |
$out->start_tag ('dd', id => 'index-' . $i++); |
73 |
|
|
74 |
my $out = $self->output; |
my $out = $self->output; |
75 |
|
|
76 |
$out->start_section (id => 'document-errors', title => 'Document Errors'); |
$out->start_section (role => 'structure-errors'); |
77 |
$out->start_tag ('dl'); |
$out->start_error_list (role => 'structure-errors'); |
78 |
|
|
79 |
my $result = $out->result; |
my $result = $self->result; |
80 |
|
|
81 |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
82 |
$result->add_error (@_, layer => 'structure'); |
$result->add_error (@_, layer => 'structure'); |
83 |
}); |
}); |
84 |
|
|
85 |
|
$out->end_error_list; |
86 |
$out->end_section; |
$out->end_section; |
87 |
} # generate_structure_error_section |
} # generate_structure_error_section |
88 |
|
|