| 1 | package Geo::GoogleEarth::Pluggable::NetworkLink; | ||||||||||||||
| 2 | 7 | ▶ | use base qw{Geo::GoogleEarth::Pluggable::Base}; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 7 | ▶ | use XML::LibXML::LazyBuilder qw{E}; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 7 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | 7 | our $VERSION='0.17'; | |||||||||||||
| 8 | |||||||||||||||
| 9 | =head1 NAME | ||||||||||||||
| 10 | |||||||||||||||
| 11 | Geo::GoogleEarth::Pluggable::NetworkLink - Geo::GoogleEarth::Pluggable::NetworkLink | ||||||||||||||
| 12 | |||||||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||||||
| 14 | |||||||||||||||
| 15 | use Geo::GoogleEarth::Pluggable; | ||||||||||||||
| 16 | my $document=Geo::GoogleEarth::Pluggable->new; | ||||||||||||||
| 17 | $document->NetworkLink(url=>"./anotherdocument.cgi"); | ||||||||||||||
| 18 | |||||||||||||||
| 19 | =head1 DESCRIPTION | ||||||||||||||
| 20 | |||||||||||||||
| 21 | Geo::GoogleEarth::Pluggable::NetworkLink is a L<Geo::GoogleEarth::Pluggable::Base> with a few other methods. | ||||||||||||||
| 22 | |||||||||||||||
| 23 | =head1 USAGE | ||||||||||||||
| 24 | |||||||||||||||
| 25 | my $networklink=$document->NetworkLink(name=>"My NetworkLink", | ||||||||||||||
| 26 | url=>"./anotherdocument.cgi"); | ||||||||||||||
| 27 | |||||||||||||||
| 28 | =head2 type | ||||||||||||||
| 29 | |||||||||||||||
| 30 | Returns the object type. | ||||||||||||||
| 31 | |||||||||||||||
| 32 | my $type=$networklink->type; | ||||||||||||||
| 33 | |||||||||||||||
| 34 | =cut | ||||||||||||||
| 35 | |||||||||||||||
| 36 | 0 | ▶ | sub type {"NetworkLink"}; | ||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 37 | |||||||||||||||
| 38 | =head2 node | ||||||||||||||
| 39 | |||||||||||||||
| 40 | =cut | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 0 | ▶ | sub node { | ||||||||||||
|
Subroutine
node: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||
| 43 | 0 | my $self=shift; | |||||||||||||
| 44 | 0 | my @element=(E(Snippet=>{maxLines=>scalar(@{$self->Snippet})}, join("\n", @{$self->Snippet}))); | |||||||||||||
| 45 | 0 | my @link=(); | |||||||||||||
| 46 | 0 | my %link=map {$_=>1} qw{href refreshMode refreshInterval viewRefreshMode viewRefreshTime viewBoundScale viewFormat httpQuery}; | |||||||||||||
| 47 | 0 | foreach my $key (keys %$self) { | |||||||||||||
| 48 | 0 | ▶ | next if $key eq "Snippet"; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 49 | 0 | ▶ | if ($key eq "url") { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 50 | 0 | push @link, E(href=>{}, $self->url); | |||||||||||||
| 51 | } elsif(exists $link{$key}) { #these go in the Link element | ||||||||||||||
| 52 | 0 | ▶ | push @link, E($key=>{}, $self->{$key}) unless ref($self->{$key}); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 53 | } else { | ||||||||||||||
| 54 | 0 | ▶ | push @element, E($key=>{}, $self->{$key}) unless ref($self->{$key}); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 55 | } | ||||||||||||||
| 56 | } | ||||||||||||||
| 57 | 0 | ▶ | push @element, E(Link=>{}, @link) if @link; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 58 | 0 | return E(NetworkLink=>{}, @element); | |||||||||||||
| 59 | } | ||||||||||||||
| 60 | |||||||||||||||
| 61 | =head2 url | ||||||||||||||
| 62 | |||||||||||||||
| 63 | Sets or returns the Uniform Resource Locator (URL) for the NetworkLink | ||||||||||||||
| 64 | |||||||||||||||
| 65 | my $url=$networklink->url; | ||||||||||||||
| 66 | $networklink->url("./newdoc.cgi"); | ||||||||||||||
| 67 | |||||||||||||||
| 68 | =cut | ||||||||||||||
| 69 | |||||||||||||||
| 70 | 0 | ▶ | sub url { | ||||||||||||
|
Subroutine
url: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||
| 71 | 0 | my $self=shift(); | |||||||||||||
| 72 | 0 | ▶ | if (@_) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 73 | 0 | $self->{'url'}=shift(); | |||||||||||||
| 74 | } | ||||||||||||||
| 75 | 0 | ▶ | return defined($self->{'url'}) ? $self->{'url'} : 'http://localhost/'; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 76 | } | ||||||||||||||
| 77 | |||||||||||||||
| 78 | =head1 BUGS | ||||||||||||||
| 79 | |||||||||||||||
| 80 | Please log on RT and send to the geo-perl email list. | ||||||||||||||
| 81 | |||||||||||||||
| 82 | =head1 SUPPORT | ||||||||||||||
| 83 | |||||||||||||||
| 84 | DavisNetworks.com supports all Perl applications including this package. | ||||||||||||||
| 85 | |||||||||||||||
| 86 | =head1 AUTHOR | ||||||||||||||
| 87 | |||||||||||||||
| 88 | Michael R. Davis (mrdvt92) | ||||||||||||||
| 89 | CPAN ID: MRDVT | ||||||||||||||
| 90 | |||||||||||||||
| 91 | =head1 COPYRIGHT | ||||||||||||||
| 92 | |||||||||||||||
| 93 | This program is free software licensed under the... | ||||||||||||||
| 94 | |||||||||||||||
| 95 | The BSD License | ||||||||||||||
| 96 | |||||||||||||||
| 97 | The full text of the license can be found in the LICENSE file included with this module. | ||||||||||||||
| 98 | |||||||||||||||
| 99 | =head1 SEE ALSO | ||||||||||||||
| 100 | |||||||||||||||
| 101 | L<Geo::GoogleEarth::Pluggable> creates a GoogleEarth Document. | ||||||||||||||
| 102 | |||||||||||||||
| 103 | =cut | ||||||||||||||
| 104 | |||||||||||||||
| 105 | 7 | 1; | |||||||||||||