--- /dev/null
+# ---------------------------------------------------------------
+# Copyright © 2014 Jason J.A. Stephenson <jason@sigio.com>
+#
+# This file is part of NCIPServer.
+#
+# NCIPServer is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# NCIPServer is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with NCIPServer. If not, see <http://www.gnu.org/licenses/>.
+# ---------------------------------------------------------------
+package NCIP::ElectronicAddress;
+
+use parent qw(Class::Accessor);
+
+=head1 NAME
+
+ElectronicAddress - As defined in Z39.83-1-2012
+
+=head1 SYNOPSIS
+
+
+
+=head1 DESCRIPTION
+
+=head1 FIELDS
+
+=head2 Type
+
+Text string for the type of the electronic address, email, ip address,
+phone number, etc.
+
+=head2 Data
+
+Text string for the actual address data.
+
+=cut
+
+NCIP::ElectronicAddress->mk_accessors(qw(Type Data));
+
+1;
=head1 FIELDS
+Either one of PhysicalAddress or ElectronicAddress must be defined,
+and they are mutually exclusive, i.e. if one has a value defined, the
+other must be undefined.
+
=head2 UserAddressRoleType
A text string to indicate the role of the address.
=head2 PhysicalAddress
-A physical address stored in a StructuredAddress.
+A physical address stored in a NCIP::StructuredAddress.
+
+=head2 ElectronicAddress
+
+An electronic address or phone number stored in a
+NCIP::ElectronicAddress.
=cut
NCIP::User::AddressInformation->mk_accessors(
- qw(UserAddressRoleType PhysicalAddress)
+ qw(UserAddressRoleType PhysicalAddress ElectronicAddress)
);
1;
[% IF data.UserOptionalFields.UserAddressInformation -%]
[% FOREACH element IN data.UserOptionalFields.UserAddressInformation -%]
<UserAddressInformation>
- <UserAddressRoleType>[% element.AddressRoleType %]</UserAddressRoleType>
+ <UserAddressRoleType>[% element.AddressRoleType | xml %]</UserAddressRoleType>
+ [% IF element.PhysicalAddress -%]
<PhysicalAddress>
<StructuredAddress>
<Line1>[% element.PhysicalAddress.Line1 | xml %]</Line1>
[% END -%]
</StructuredAddress>
</PhysicalAddress>
+ [% ELSIF element.ElectronicAddress -%]
+ <ElectronicAddress>
+ <ElectronicAddressType>[% element.ElectronicAddress.Type | xml %]</ElectronicAddressType>
+ <ElectronicAddressData>[% element.ElectronicAddress.Data | xml %]</ElectronicAddressData>
+ </ElectronicAddress>
+ [% END -%]
</UserAddressInformation>
[% END -%]
[% END -%]