[ 
https://issues.apache.org/jira/browse/STREAMS-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16662769#comment-16662769
 ] 

ASF GitHub Bot commented on STREAMS-624:
----------------------------------------

steveblackmon closed pull request #462: resolves STREAMS-624
URL: https://github.com/apache/streams/pull/462
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/streams-contrib/streams-provider-linkedin/src/main/templates/linkedin.ttl.ftl 
b/streams-contrib/streams-provider-linkedin/src/main/templates/linkedin.ttl.ftl
index f796bb6396..266760a0bf 100644
--- 
a/streams-contrib/streams-provider-linkedin/src/main/templates/linkedin.ttl.ftl
+++ 
b/streams-contrib/streams-provider-linkedin/src/main/templates/linkedin.ttl.ftl
@@ -110,12 +110,28 @@
 
 <#if phone_numbers??>
 :${id}
-<#list phone_numbers as phone_number>
-  vcard:tel "tel:${phone_number.number}" ;
+<#list phone_numbers as phone_number_obj>
+  <#assign phone_number = pp.loadData('eval', '
+      com.google.i18n.phonenumbers.PhoneNumberUtil phoneUtil = 
com.google.i18n.phonenumbers.PhoneNumberUtil.getInstance();
+      String rawPhoneNumber = "${phone_number_obj.number}";
+      phoneNumber = phoneUtil.parse(rawPhoneNumber, "US");
+      return phoneUtil.format(phoneNumber, 
com.google.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat.RFC3966);
+    ')>
+  vcard:tel "${phone_number}" ;
 </#list>
   .
 </#if>
 
+<#--
+# Imported Contacts.csv
+# First Name,Last Name,Companies,Title,Email Address,Phone Numbers,Created 
At,Instant Message Handles,Addresses,Sites,Full 
Name,Birthday,Location,Bookmarked At,Profiles
+-->
+
+<#attempt>
+  <#assign contacts = pp.loadData('csv', 'Imported Contacts.csv', 
{'separator':',', 'normalizeHeaders': true})>
+  <#recover>
+</#attempt>
+
 <#--
 # Connections.csv
 # First Name,Last Name,Address,Email Address,Company,Position,Connected 
On,Websites,Instant Messengers
@@ -135,9 +151,36 @@
   vcard:fn "${connection.first_name} ${connection.last_name}" ;
   vcard:given-name "${connection.first_name}" ;
   vcard:family-name "${connection.last_name}" ;
+  <#if connection.email_address?? && connection.email_address?contains("@")>
   vcard:email "mailto:${connection.email_address}"; ;
+  </#if>
   vcard:org "${connection.company?replace("\\W"," ","r")}" ;
   vcard:title "${connection.position?replace("\\W"," ","r")}" ;
+<#list contacts as contact>
+  <#if (contact.first_name == connection.first_name ) && (contact.last_name == 
connection.last_name)>
+  <#attempt>
+    <#list contact.email_address?split(",") as email_address>
+      <#if email_address?? && email_address?contains("@") && email_address != 
connection.email_address>
+  vcard:email "mailto:${email_address}"; ;
+      </#if>
+    </#list>
+  <#recover>
+  </#attempt>
+  <#attempt>
+    <#list contact.phone_numbers?split(",") as raw_phone_number>
+      <#assign raw_phone_number = pp.loadData('eval', '
+    debug();
+    com.google.i18n.phonenumbers.PhoneNumberUtil phoneUtil = 
com.google.i18n.phonenumbers.PhoneNumberUtil.getInstance();
+    String rawPhoneNumber = "${raw_phone_number}";
+    phoneNumber = phoneUtil.parse(rawPhoneNumber, "US");
+    return phoneUtil.format(phoneNumber, 
com.google.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat.RFC3966);
+  ')>
+  vcard:tel "${phone_number}" ;
+    </#list>
+    <#recover>
+  </#attempt>
+  </#if>
+</#list>
   .
 
 :${id}-connect-${cid}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Attach phone numbers and email addresses from imported contacts to linkedin 
> connections
> ---------------------------------------------------------------------------------------
>
>                 Key: STREAMS-624
>                 URL: https://issues.apache.org/jira/browse/STREAMS-624
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>            Assignee: Steve Blackmon
>            Priority: Major
>
> Imported Contacts.csv contains phone numbers and email addresses - attach 
> them to the AS2.0 TTL Profile nodes with vcard:email and vcard:tel when there 
> is a name match



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to