VIVO-313: vcards for organizations

This commit is contained in:
tworrall 2013-10-11 14:35:15 -04:00
parent 8fd14cb2cf
commit 5cd482d6df
10 changed files with 373 additions and 14 deletions

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config>
<query-select>
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
SELECT DISTINCT ?vcard ?phone
?number
WHERE {
?subject ?property ?vcard .
?vcard vcard:hasTelephone ?phone .
?phone a vcard:Fax
OPTIONAL { ?phone vcard:telephone ?number }
}
</query-select>
<query-construct>
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
CONSTRUCT {
?subject ?property ?vcard .
?vcard vcard:hasTelephone ?phone .
?phone a vcard:Fax .
?phone ?phoneProperty ?phoneValue
} WHERE {
{
?subject ?property ?vcard
} UNION {
?subject ?property ?vcard .
?vcard vcard:hasTelephone ?phone .
?phone a vcard:Fax
} UNION {
?subject ?property ?vcard .
?vcard vcard:hasTelephone ?phone .
?phone a vcard:Fax .
?phone ?phoneProperty ?phoneValue
}
}
</query-construct>
<template>propStatement-phoneFaxNumber.ftl</template>
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.MaintainDuplicatesObjectPropertyDataPostProcessor</postprocessor>
</list-view-config>

View file

@ -13,7 +13,7 @@
?subject ?property ?vcard .
?vcard vcard:hasTelephone ?phone
OPTIONAL { ?phone vcard:telephone ?number }
MINUS {?phone a vcard:Fax}
}
</query-select>
@ -37,6 +37,6 @@
}
</query-construct>
<template>propStatement-telephoneNumber.ftl</template>
<template>propStatement-phoneFaxNumber.ftl</template>
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.MaintainDuplicatesObjectPropertyDataPostProcessor</postprocessor>
</list-view-config>

View file

@ -0,0 +1,95 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- this is in request.subject.name -->
<#-- leaving this edit/add mode code in for reference in case we decide we need it -->
<#import "lib-vivo-form.ftl" as lvf>
<#--Retrieve certain edit configuration information-->
<#if editConfiguration.objectUri?has_content>
<#assign editMode = "edit">
<#else>
<#assign editMode = "add">
</#if>
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
<#assign telephoneNumberValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "telephoneNumber") />
<#assign numberType = lvf.getEditConfigLiteralValue(editConfiguration, "numberType") />
<#--If edit submission exists, then retrieve validation errors if they exist-->
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
<#assign submissionErrors = editSubmission.validationErrors/>
</#if>
<#if numberType?? && numberType == "fax" >
<#assign labelString = "${i18n().fax_number}" />
<#assign errorString = "${i18n().enter_fax_number}" />
<#assign titleString = "${i18n().fax_number_for}" />
<#else>
<#assign labelString = "${i18n().telephone_number}" />
<#assign errorString = "${i18n().enter_telephone_number}" />
<#assign titleString = "${i18n().telephone_number_for}" />
</#if>
<#if editMode == "edit">
<#assign titleVerb="${i18n().edit_capitalized}">
<#assign submitButtonText="${titleVerb}" + " ${labelString}">
<#assign disabledVal="disabled">
<#else>
<#assign titleVerb="${i18n().create_capitalized}">
<#assign submitButtonText="${titleVerb}" + " ${labelString}">
<#assign disabledVal=""/>
</#if>
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<h2>${titleVerb}&nbsp;${titleString} ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>
<section id="error-alert" role="alert">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alert="${i18n().error_alert_icon}" />
<p>
<#--Checking if any required fields are empty-->
<#if lvf.submissionErrorExists(editSubmission, "telephoneNumber")>
${errorString}<br />
</#if>
</p>
</section>
</#if>
<@lvf.unsupportedBrowser urls.base />
<section id="personHasTelephoneNumber" role="region">
<form id="personHasTelephoneNumber" class="customForm noIE67" action="${submitUrl}" role="add/edit phone">
<p>
<label for="telephoneNumber">${labelString} ${requiredHint}</label>
<input size="25" type="text" id="telephoneNumber" name="telephoneNumber" value="${telephoneNumberValue}" />
</p>
<input type="hidden" id="editKey" name="editKey" value="${editKey}"/>
<p class="submit">
<input type="submit" id="submit" value="${submitButtonText}"/><span class="or"> ${i18n().or} </span>
<a class="cancel" href="${cancelUrl}" title="${i18n().cancel_title}">${i18n().cancel_link}</a>
</p>
<p id="requiredLegend" class="requiredHint">* ${i18n().required_fields}</p>
</form>
</section>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customFormWithAutocomplete.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>')}