« lib/Spreadsheet/Reader/ExcelXML/ZipReader/WorkbookRels.pm
↑ Summary
lib/Spreadsheet/Reader/ExcelXML/XMLReader/WorkbookProps.pm »
| 1 | package Spreadsheet::Reader::ExcelXML::ZipReader::WorkbookProps; | ||||||||||||||||||||||||||||
| 2 | 14 | our $AUTHORITY = 'cpan:JANDREW'; | |||||||||||||||||||||||||||
| 3 | 14 | ▶ | use version; our $VERSION = version->declare('v0.16.8'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | ###LogSD warn "You uncovered internal logging statements for Spreadsheet::Reader::ExcelXML::ZipReader::WorkbookProps-$VERSION"; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 14 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 14 | requires qw( | |||||||||||||||||||||||||||
| 8 | current_node_parsed good_load close_the_file | ||||||||||||||||||||||||||||
| 9 | parse_element squash_node advance_element_position | ||||||||||||||||||||||||||||
| 10 | ); | ||||||||||||||||||||||||||||
| 11 | 14 | ▶ | use Types::Standard qw( is_HashRef StrMatch Str ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | ###LogSD use Log::Shiras::Telephone; | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | #########1 Dispatch Tables 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 14 | my $method_lookup = { | |||||||||||||||||||||||||||
| 17 | 'dc:creator' => '_set_creator', | ||||||||||||||||||||||||||||
| 18 | 'cp:lastModifiedBy' => '_set_modified_by', | ||||||||||||||||||||||||||||
| 19 | 'dcterms:created' => '_set_date_created', | ||||||||||||||||||||||||||||
| 20 | 'dcterms:modified' => '_set_date_modified', | ||||||||||||||||||||||||||||
| 21 | }; | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | #########1 Public Attributes 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | #########1 Public Methods 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 17 | ▶ | sub load_unique_bits{ | ||||||||||||||||||||||||||
|
Subroutine
load_unique_bits: called CC=7 SCAR=19.9
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 17 | my( $self, ) = @_; | |||||||||||||||||||||||||||
| 31 | ###LogSD my $phone = Log::Shiras::Telephone->new( name_space => | ||||||||||||||||||||||||||||
| 32 | ###LogSD $self->get_all_space . '::_load_unique_bits', ); | ||||||||||||||||||||||||||||
| 33 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 34 | ###LogSD "Setting the WorkbookPropsInterface unique bits" ] ); | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # turn workbook properties into a hashref | ||||||||||||||||||||||||||||
| 37 | 17 | my( $result, $node_name, $node_level, $result_ref ); | |||||||||||||||||||||||||||
| 38 | 17 | my $current_node = $self->current_node_parsed; | |||||||||||||||||||||||||||
| 39 | ###LogSD $phone->talk( level => 'trace', message =>[ | ||||||||||||||||||||||||||||
| 40 | ###LogSD "The current node is:", $current_node ] ); | ||||||||||||||||||||||||||||
| 41 | 17 | ▶ | if( (keys %$current_node)[0] eq 'cp:coreProperties' ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | ###LogSD $phone->talk( level => 'trace', message =>[ | ||||||||||||||||||||||||||||
| 43 | ###LogSD "Found the core properties node" ] ); | ||||||||||||||||||||||||||||
| 44 | 17 | $result = 2; | |||||||||||||||||||||||||||
| 45 | 17 | $node_name = 'cp:coreProperties'; | |||||||||||||||||||||||||||
| 46 | }else{ | ||||||||||||||||||||||||||||
| 47 | 0 | ( $result, $node_name, $node_level, $result_ref ) = | |||||||||||||||||||||||||||
| 48 | $self->advance_element_position( 'cp:coreProperties' ); | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | 17 | ▶ | if( $result and $node_name eq 'cp:coreProperties' ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$result and $node_name eq "cp:coreProperties"
MC/DC0%0/2
$result and $node_name eq "cp:coreProperties"
$result
$node_name eq "cp:coreProperties"
Truth table33%1/3
A and B
A= $resultB= $node_name eq "cp:coreProperties"
| |||||||||||||||||||||||||||||
| 51 | 17 | my $properties = $self->squash_node( $self->parse_element ); | |||||||||||||||||||||||||||
| 52 | ###LogSD $phone->talk( level => 'trace', message =>[ | ||||||||||||||||||||||||||||
| 53 | ###LogSD "The parsed properties are:", $properties ] ); | ||||||||||||||||||||||||||||
| 54 | 17 | for my $header ( keys %$properties ){ | |||||||||||||||||||||||||||
| 55 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 56 | ###LogSD "processing header: $header" ] ); | ||||||||||||||||||||||||||||
| 57 | 153 | ▶ | if( exists $method_lookup->{$header} ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | 68 | my $method = $method_lookup->{$header}; | |||||||||||||||||||||||||||
| 59 | my $value = is_HashRef( $properties->{$header} ) ? | ||||||||||||||||||||||||||||
| 60 | 68 | ▶ | $properties->{$header}->{raw_text} : $properties->{$header}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | ###LogSD $phone->talk( level => 'trace', message => [ | ||||||||||||||||||||||||||||
| 62 | ###LogSD "Implementing -$method- with value: $value" ] ); | ||||||||||||||||||||||||||||
| 63 | 68 | $self->$method( $value ); | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | 17 | $self->good_load( 1 ); | |||||||||||||||||||||||||||
| 67 | }else{ | ||||||||||||||||||||||||||||
| 68 | ###LogSD $phone->talk( level => 'warn', message =>[ "no cp:coreProperties found" ] ); | ||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 72 | ###LogSD "Closing out the xml file" ] ); | ||||||||||||||||||||||||||||
| 73 | 17 | $self->close_the_file; | |||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | #########1 Private Attributes 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 14 | has _file_creator =>( | |||||||||||||||||||||||||||
| 79 | isa => Str, | ||||||||||||||||||||||||||||
| 80 | reader => 'get_creator', | ||||||||||||||||||||||||||||
| 81 | writer => '_set_creator', | ||||||||||||||||||||||||||||
| 82 | clearer => '_clear_creator', | ||||||||||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 14 | has _file_modified_by =>( | |||||||||||||||||||||||||||
| 86 | isa => Str, | ||||||||||||||||||||||||||||
| 87 | reader => 'get_modified_by', | ||||||||||||||||||||||||||||
| 88 | writer => '_set_modified_by', | ||||||||||||||||||||||||||||
| 89 | clearer => '_clear_modified_by', | ||||||||||||||||||||||||||||
| 90 | ); | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 14 | has _file_date_created =>( | |||||||||||||||||||||||||||
| 93 | isa => StrMatch[qr/^\d{4}\-\d{2}\-\d{2}/], | ||||||||||||||||||||||||||||
| 94 | reader => 'get_date_created', | ||||||||||||||||||||||||||||
| 95 | writer => '_set_date_created', | ||||||||||||||||||||||||||||
| 96 | clearer => '_clear_date_created', | ||||||||||||||||||||||||||||
| 97 | ); | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 14 | has _file_date_modified =>( | |||||||||||||||||||||||||||
| 100 | isa => StrMatch[qr/^\d{4}\-\d{2}\-\d{2}/], | ||||||||||||||||||||||||||||
| 101 | reader => 'get_date_modified', | ||||||||||||||||||||||||||||
| 102 | writer => '_set_date_modified', | ||||||||||||||||||||||||||||
| 103 | clearer => '_clear_date_modified', | ||||||||||||||||||||||||||||
| 104 | ); | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | #########1 Private Methods 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | #########1 Phinish 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 14 | ▶ | no Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 113 | 14 | 1; | |||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | #########1 Documentation 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 116 | __END__ | ||||||||||||||||||||||||||||