File Coverage

blib/lib/Net/DRI/Protocol/EPP/Extensions/NeuLevel/IDNLanguage.pm
Criterion Covered Total %
statement 12 24 50.0
branch 0 4 0.0
condition n/a
subroutine 4 7 57.1
pod 0 3 0.0
total 16 38 42.1


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, Neulevel EPP IDN Language
2             ##
3             ## Copyright (c) 2009,2013 Jouanne Mickael . 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::NeuLevel::IDNLanguage;
16              
17 1     1   657 use strict;
  1         2  
  1         24  
18 1     1   3 use warnings;
  1         1  
  1         17  
19              
20 1     1   3 use Net::DRI::Util;
  1         1  
  1         17  
21 1     1   2 use Net::DRI::Exception;
  1         2  
  1         157  
22              
23             =pod
24              
25             =head1 NAME
26              
27             Net::DRI::Protocol::EPP::Extensions::NeuLevel::IDNLanguage - NeuLevel EPP IDN Language Commands 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
44              
45             =head1 AUTHOR
46              
47             Jouanne Mickael Egrigouze@gandi.netE
48              
49             =head1 COPYRIGHT
50              
51             Copyright (c) 2009,2013 Jouanne Mickael .
52             All rights reserved.
53              
54             This program is free software; you can redistribute it and/or modify
55             it under the terms of the GNU General Public License as published by
56             the Free Software Foundation; either version 2 of the License, or
57             (at your option) any later version.
58              
59             See the LICENSE file that comes with this distribution for more details.
60              
61             =cut
62              
63             ####################################################################################################
64              
65             sub register_commands
66             {
67 0     0 0   my ($class,$version)=@_;
68 0           my %tmp=(
69             create => [ \&create, undef ],
70             );
71              
72 0           return { 'domain' => \%tmp };
73             }
74              
75             ####################################################################################################
76              
77             sub add_language
78             {
79 0     0 0   my ($tag,$epp,$domain,$rd)=@_;
80 0           my $mes=$epp->message();
81              
82 0 0         if (Net::DRI::Util::has_key($rd,'language'))
83             {
84 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});
85 0           my $eid=$mes->command_extension_register($tag,'xmlns:neulevel="urn:ietf:params:xml:ns:neulevel-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:neulevel-1.0 neulevel-1.0.xsd"');
86 0           $mes->command_extension($eid,['neulevel:unspec', 'IDNLang=' . $rd->{language}]);
87             }
88 0           return;
89             }
90              
91             sub create
92             {
93 0     0 0   my (@args)=@_;
94 0           return add_language('neulevel:extension',@args);
95             }
96              
97             ####################################################################################################
98             1;