File Coverage

blib/lib/Net/DRI/Protocol/EPP/Extensions/Afilias/IDNLanguage.pm
Criterion Covered Total %
statement 12 26 46.1
branch 0 4 0.0
condition n/a
subroutine 4 8 50.0
pod 0 4 0.0
total 16 42 38.1


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, EPP IDN Language (EPP-IDN-Lang-Mapping.pdf)
2             ##
3             ## Copyright (c) 2007,2008,2013 Tonnerre Lombard . All rights reserved.
4             ##
5             ## This file is part of Net::DRI
6             ##
7             ## Net::DRI is free software; you can redistribute it and/or modify
8             ## it under the terms of the GNU General Public License as published by
9             ## the Free Software Foundation; either version 2 of the License, or
10             ## (at your option) any later version.
11             ##
12             ## See the LICENSE file that comes with this distribution for more details.
13             ####################################################################################################
14              
15             package Net::DRI::Protocol::EPP::Extensions::Afilias::IDNLanguage;
16              
17 1     1   1520 use strict;
  1         2  
  1         30  
18 1     1   3 use warnings;
  1         2  
  1         20  
19              
20 1     1   3 use Net::DRI::Util;
  1         2  
  1         21  
21 1     1   4 use Net::DRI::Exception;
  1         1  
  1         229  
22              
23             =pod
24              
25             =head1 NAME
26              
27             Net::DRI::Protocol::EPP::Extensions::Afilias::IDNLanguage - Afilias EPP IDN Language commands (EPP-IDN-Lang-Mapping.pdf) for Net::DRI
28              
29             =head1 DESCRIPTION
30              
31             Please see the README file for details.
32              
33             =head1 SUPPORT
34              
35             For now, support questions should be sent to:
36              
37             Enetdri@dotandco.comE
38              
39             Please also see the SUPPORT file in the distribution.
40              
41             =head1 SEE ALSO
42              
43             Ehttp://www.dotandco.com/services/software/Net-DRI/E and
44             Ehttp://oss.bdsprojects.net/projects/netdri/E
45              
46             =head1 AUTHOR
47              
48             Tonnerre Lombard Etonnerre.lombard@sygroup.chE
49              
50             =head1 COPYRIGHT
51              
52             Copyright (c) 2007,2008,2013 Tonnerre Lombard .
53             All rights reserved.
54              
55             This program is free software; you can redistribute it and/or modify
56             it under the terms of the GNU General Public License as published by
57             the Free Software Foundation; either version 2 of the License, or
58             (at your option) any later version.
59              
60             See the LICENSE file that comes with this distribution for more details.
61              
62             =cut
63              
64             ####################################################################################################
65              
66             sub register_commands
67             {
68 0     0 0   my ($class,$version)=@_;
69 0           my %tmp=(
70             create => [ \&create, undef ],
71             check => [ \&check, undef ],
72             );
73              
74 0           return { 'domain' => \%tmp };
75             }
76              
77             ####################################################################################################
78              
79             sub add_language
80             {
81 0     0 0   my ($tag,$epp,$domain,$rd)=@_;
82 0           my $mes=$epp->message();
83              
84 0 0         if (Net::DRI::Util::has_key($rd,'language'))
85             {
86 0 0         Net::DRI::Exception::usererr_invalid_parameters('IDN language tag must be of type XML schema language') unless Net::DRI::Util::xml_is_language($rd->{language});
87 0           my $eid=$mes->command_extension_register($tag,'xmlns:idn="urn:iana:xml:ns:idn" xsi:schemaLocation="urn:iana:xml:ns:idn idn.xsd"');
88 0           $mes->command_extension($eid,['idn:script', $rd->{language}]);
89             }
90 0           return;
91             }
92              
93             sub create
94             {
95 0     0 0   my (@args)=@_;
96 0           return add_language('idn:create',@args);
97             }
98              
99             sub check
100             {
101 0     0 0   my (@args)=@_;
102 0           return add_language('idn:check',@args);
103             }
104              
105             ####################################################################################################
106             1;