You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Ron Wheeler <rw...@artifact-software.com> on 2015/02/05 05:37:36 UTC

TelecomNumber Entity parsing

What are people using to validate and parse Telephone numbers into the 
component parts that OFBiz expects?

com.google.i18n.phonenumbers.PhoneNumberUtil ( 
https://github.com/googlei18n/libphonenumber ) seems to be able parse 
and format telephone numbers but then it appears that it needs to be 
parsed another time to get the 3 pieces that OFBiz wants.





     <entity entity-name="TelecomNumber"
             package-name="org.ofbiz.party.contact"
             title="Telecommunications Number Entity">
       <field name="contactMechId" type="id-ne"></field>
       <field name="countryCode" type="very-short"></field>
       <field name="areaCode" type="very-short"></field>
       <field name="contactNumber" type="short-varchar"></field>
       <field name="askForName" type="name"></field> <!-- person or 
department to ask for at this number -->
       <prim-key field="contactMechId"/>
       <relation type="one" fk-name="TEL_NUM_CMECH" 
rel-entity-name="ContactMech">
         <key-map field-name="contactMechId"/>
       </relation>
       <index name="COUNTRY_CODE_IDX">
         <index-field name="countryCode"/>
       </index>
       <index name="AREA_CODE_IDX">
         <index-field name="areaCode"/>
       </index>
       <index name="CONTACT_NUMBER_IDX">
         <index-field name="contactNumber"/>
       </index>
     </entity>

-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102