From a097dc27845cf677b085490ecac19422c0e4b378 Mon Sep 17 00:00:00 2001 From: mbarbier Date: Mon, 28 Mar 2011 20:56:54 +0000 Subject: [PATCH] individual-qrCodeFoafPerson.ftl: Created. Contains macro to insert a QR code into a foaf-person individual page containing a vCard for that person. Incomplete. --- .../individual-qrCodeFoafPerson.ftl | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl diff --git a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl new file mode 100644 index 00000000..4c259f86 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl @@ -0,0 +1,35 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- QR code --> + +<#macro qrCodeFoafPerson qrCodeWidth> + + <#local foaf = "http://xmlns.com/foaf/0.1/"> + <#local rdfs = "http://www.w3.org/2000/01/rdf-schema#"> + + <#local label = individual.nameStatement.value > + <#local workPhone = (propertyGroups.getProperty("${core}workPhone").firstValue)! > + <#local firstName = (propertyGroups.getProperty("${foaf}firstName").firstValue)! > + <#local lastName = (propertyGroups.getProperty("${foaf}lastName").firstValue)! > + + <#assign vCard><#t> + BEGIN:VCARD%0A<#t> + VERSION:3.0%0A<#t> + N:${lastName};${firstName}%0A<#t> + FN:${label}%0A<#t> + <#if workPhone??><#t> + TEL;TYPE=WORK,VOICE:${workPhone}%0A<#t> + <#t> + <#if email.statements?has_content><#t> + <#list email.statements as statement><#t> + EMAIL;TYPE=PREF,INTERNET:${statement.value}%0A<#t> + <#t> + <#t> + END:VCARD<#t> + <#t> + + <#local qrCodeUrl = "https://chart.googleapis.com/chart?cht=qr&chs=${qrCodeWidth}x${qrCodeWidth}&chl=${vCard}&choe=UTF-8" > + + + + \ No newline at end of file