--- Webpacus/lib/Webpacus/Controller/Editor.pm 2005/12/14 18:56:11 241 +++ Webpacus/lib/Webpacus/Controller/Editor.pm 2005/12/17 03:20:14 274 @@ -75,7 +75,7 @@ if ($webpac->save_html( $template_full_path, $t )) { $c->res->output("saved $template_filename, $size bytes"); } else { - $c->res->output("error saving $template_filename!"); + $c->res->output("error saving $template_filename!"); } return; } @@ -131,7 +131,7 @@ if ($webpac->save_html( $css_full_path, $t )) { $c->res->output("saved $css_filename, $size bytes"); } else { - $c->res->output("error saving $css_filename!"); + $c->res->output("error saving $css_filename!"); } return; } @@ -156,11 +156,15 @@ $c->log->debug('record params '.Dumper($c->req->params)); - my $mfn = $c->req->params->{mfn}; - - if (! $mfn) { - $c->log->warn("no mfn, using 1"); - $mfn = 1; + my $record_uri = $c->req->params->{record_uri}; + $record_uri ||= $c->config->{editor}->{default_record_uri} and + $c->log->warn("using editor: default_record_uri"); + + if (! $record_uri) { + $c->log->fatal("record called without record_uri and default_record_uri not found in config under editor"); + $c->stash->{error} = 'record retrival failed'; + $c->stash->{template} = 'error.tt'; + return; } my $template_filename = $c->req->params->{template_filename}; @@ -171,7 +175,7 @@ my $webpac = $c->comp('Model::WebPAC'); - my $html = $webpac->record( mfn => $mfn, template => $template_filename ); + my $html = $webpac->record( record_uri => $record_uri, template => $template_filename ); if ($html) { $c->log->debug('check html with tidy'); @@ -216,8 +220,7 @@ } else { $html .= qq{
Can't find record
}; } - - + $c->response->content_type('text/html; charset=utf-8'); $c->response->body( $html ); }