| 1 | # $Id: XML.pm 1072 2006-01-04 05:01:11Z btrott $ | ||||||||||
| 2 | |||||||||||
| 3 | package Catalyst::View::Atom::XML; | ||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use base qw( Catalyst::Base ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 0 | ▶ | sub process { | ||||||||
|
Subroutine
process: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 8 | 0 | my($self, $c) = @_; | |||||||||
| 9 | |||||||||||
| 10 | 0 | my $obj = $c->stash->{xml_atom_object}; | |||||||||
| 11 | 0 | ▶ | unless ($obj) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | ▶ | $c->log->debug("No Atom object specified for rendering") | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | if $c->debug; | ||||||||||
| 14 | 0 | return 0; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | unless ($c->response->content_type) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | $c->response->content_type('application/atom+xml'); | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | $c->response->body($obj->as_xml); | |||||||||
| 22 | |||||||||||
| 23 | 0 | 1; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 1 | 1; | |||||||||
| 27 | __END__ | ||||||||||