| 1 | package XML::NewsML_G2::Role::Writer::News_Item_Picture; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 6 | with 'XML::NewsML_G2::Role::Writer'; | |||||||||
| 7 | |||||||||||
| 8 | 23 | ▶ | around '_build_g2_catalog_schemes' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 23 | my ( $orig, $self, @args ) = @_; | |||||||||
| 10 | 23 | my $result = $self->$orig(@args); | |||||||||
| 11 | 23 | $result->{rnd} = undef; | |||||||||
| 12 | 23 | $result->{colsp} = undef; | |||||||||
| 13 | 23 | return $result; | |||||||||
| 14 | 6 | }; | |||||||||
| 15 | |||||||||||
| 16 | 23 | ▶ | before '_create_authors' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||
| 17 | 23 | my ( $self, $root ) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 23 | ▶ | if ( $self->news_item->photographer ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 23 | my $c = $self->_create_creator( $self->news_item->photographer ); | |||||||||
| 21 | 23 | $root->appendChild($c); | |||||||||
| 22 | 23 | $self->scheme_manager->add_qcode( $c, 'crol', 'photographer' ); | |||||||||
| 23 | } | ||||||||||
| 24 | 23 | return; | |||||||||
| 25 | 6 | }; | |||||||||
| 26 | |||||||||||
| 27 | 37 | ▶ | after '_create_remote_content' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=19.7
| |||||||||||
| 28 | 37 | my ( $self, $root, $picture ) = @_; | |||||||||
| 29 | |||||||||||
| 30 | 37 | ▶ | return unless $picture->isa('XML::NewsML_G2::Picture'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | 37 | foreach (qw/width height orientation/) { | |||||||||
| 33 | 111 | ▶ | $root->setAttribute( $_, $picture->$_ ) if defined $picture->$_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 37 | my $rendition = | |||||||||
| 37 | $self->scheme_manager->build_qcode( 'rnd', $picture->rendition ); | ||||||||||
| 38 | 37 | ▶ | $root->setAttribute( 'rendition', $rendition ) if $rendition; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | |||||||||||
| 40 | 37 | my $colsp = | |||||||||
| 41 | $self->scheme_manager->build_qcode( 'colsp', $picture->colorspace ); | ||||||||||
| 42 | 37 | ▶ | $root->setAttribute( 'colourspace', $colsp ) if $colsp; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | |||||||||||
| 44 | 37 | ▶ | if ( my $altId = $picture->altId ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 9 | $root->appendChild( | |||||||||
| 46 | $self->create_element( 'altId', _text => $altId ) ); | ||||||||||
| 47 | } | ||||||||||
| 48 | 37 | return; | |||||||||
| 49 | 6 | }; | |||||||||
| 50 | |||||||||||
| 51 | 6 | 1; | |||||||||
| 52 | __END__ | ||||||||||