From d18b02782e95bef002814e3dba0b5223ac2c4bb6 Mon Sep 17 00:00:00 2001 From: ryounes Date: Tue, 24 May 2011 19:00:30 +0000 Subject: [PATCH 01/56] Changes to QR code generation to support swapping in a different model in IndividualController: fixed NPEs, and change getQrCode() to doQrCode() so it's invoked only when the template asks for it. --- .../templates/freemarker/body/aboutQrCodes.ftl | 4 ++-- .../freemarker/body/foaf-person--exportQrCode.ftl | 2 +- .../individual/individual-qrCodeFoafPerson.ftl | 2 +- .../individual/individual-qrCodeGenerator.ftl | 6 +++--- .../individual/IndividualTemplateModel.java | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/productMods/templates/freemarker/body/aboutQrCodes.ftl b/productMods/templates/freemarker/body/aboutQrCodes.ftl index aeb7c1ff..41ec0c81 100644 --- a/productMods/templates/freemarker/body/aboutQrCodes.ftl +++ b/productMods/templates/freemarker/body/aboutQrCodes.ftl @@ -6,13 +6,13 @@

What is QR?

-

QR stands for Quick Response is a standard for two-dimensional barcodes that can be read by mobile devices equipped with cameras (such as a smartphone).

+

QR, which stands for Quick Response, is a standard for two-dimensional barcodes that can be read by mobile devices equipped with cameras (such as a smartphone).

What kind of data is in a QR code?

QR codes can encode many different types of data. The QR code on the profile page of a person in VIVO encodes information about that person in vCard format. This is a sort of digital business card, containing information about the person's name, address, telephone number, email address, and more.

-

If you click on a person's QR code in VIVO, you will be taken to the QR Export page for that person. On this page contains the vCard QR code seen on the front page, as well as a QR code containing a simple hyperlink to the user's VIVO profile. It also contains an HTML tag for each code, that can be embedded in a web page to display that code on other sites.

+

If you click on a person's QR code in VIVO, you will be taken to the QR Export page for that person. This page contains the vCard QR code seen on the front page, as well as a QR code containing a simple hyperlink to the user's VIVO profile. It also contains an HTML tag for each code, that can be embedded in a web page to display that code on other sites.

<#-- todo: make VIVO API? Currently pasting Google API code into export area, this will be static and not change if VIVO data is updated. -->

How do I read a QR code?

diff --git a/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl b/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl index dbab2238..d6c00c1a 100644 --- a/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl +++ b/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl @@ -6,7 +6,7 @@ <#assign qrCodeWidth = "150"> -

Export QR Code (What is this?)

+

Export QR Code (What is this?)

<#assign thumbUrl = individual.thumbUrl! "${urls.images}/placeholders/person.thumbnail.jpg" > diff --git a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl index 467c52d4..7a0bc83c 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeFoafPerson.ftl @@ -3,5 +3,5 @@ <#include "individual-qrCodeGenerator.ftl"> <#if hasValidVCard()> -
  • qr icon
  • +
  • qr icon
  • \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl index 21e72246..094830b9 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl @@ -24,7 +24,7 @@ <#function getQrCodeUrlForVCard qrCodeWidth> - <#local qrData = individual.qrData > + <#local qrData = individual.doQrData() > <#local core = "http://vivoweb.org/ontology/core#"> <#local foaf = "http://xmlns.com/foaf/0.1/"> @@ -69,7 +69,7 @@ <#function getQrCodeUrlForLink qrCodeWidth> - <#local qrData = individual.qrData > + <#local qrData = individual.doQrData() > <#local url = qrData.externalUrl! > @@ -105,7 +105,7 @@ <#function hasValidVCard> - <#local qrData = individual.qrData > + <#local qrData = individual.doQrData() > <#local firstName = qrData.firstName! > <#local lastName = qrData.lastName! > diff --git a/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java b/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java index 4b02eb18..2888a60b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java +++ b/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java @@ -102,7 +102,7 @@ public class IndividualTemplateModel extends BaseIndividualTemplateModel { return id; } - public Map getQrData() { + public Map doQrData() { if(qrData == null) qrData = generateQrData(); return qrData; @@ -120,15 +120,15 @@ public class IndividualTemplateModel extends BaseIndividualTemplateModel { Collection phoneNumbers = wdf.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(individual, core + "phoneNumber"); Collection emails = wdf.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(individual, core + "email"); - if(firstNames.size() > 0) + if(firstNames != null && ! firstNames.isEmpty()) qrData.put("firstName", firstNames.toArray(new DataPropertyStatement[firstNames.size()])[0].getData()); - if(lastNames.size() > 0) + if(lastNames != null && ! lastNames.isEmpty()) qrData.put("lastName", lastNames.toArray(new DataPropertyStatement[firstNames.size()])[0].getData()); - if(preferredTitles.size() > 0) + if(preferredTitles != null && ! preferredTitles.isEmpty()) qrData.put("preferredTitle", preferredTitles.toArray(new DataPropertyStatement[firstNames.size()])[0].getData()); - if(phoneNumbers.size() > 0) + if(phoneNumbers != null && ! phoneNumbers.isEmpty()) qrData.put("phoneNumber", phoneNumbers.toArray(new DataPropertyStatement[firstNames.size()])[0].getData()); - if(emails.size() > 0) + if(emails != null && ! emails.isEmpty()) qrData.put("email", emails.toArray(new DataPropertyStatement[firstNames.size()])[0].getData()); String tempUrl = vreq.getRequestURL().toString(); From 8f65033e3480ca54becb406b648b21b3f343c716 Mon Sep 17 00:00:00 2001 From: ryounes Date: Tue, 24 May 2011 19:18:14 +0000 Subject: [PATCH 02/56] NIHVIVO-2460, NIHVIVO-2643 Add Solr versions of JSONServlet and JSONReconcileServlet (not yet migrated from Lucene to Solr) and corresponding commented-out servlet mappings. --- productMods/WEB-INF/web.xml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/productMods/WEB-INF/web.xml b/productMods/WEB-INF/web.xml index 5cd5d3b4..517184b7 100644 --- a/productMods/WEB-INF/web.xml +++ b/productMods/WEB-INF/web.xml @@ -144,6 +144,7 @@ + edu.cornell.mannlib.vitro.webapp.search.lucene.LuceneSetup @@ -899,6 +900,7 @@ /listObjectPropertyStatements + IndividualListController edu.cornell.mannlib.vitro.webapp.controller.freemarker.IndividualListController @@ -913,11 +915,11 @@ IndividualListController /individuallist - - + + IndividualListRdf edu.cornell.mannlib.vitro.webapp.controller.EntityURLController - + JSON Service /dataservice @@ -1026,6 +1035,12 @@ JSON Reconcile Service edu.cornell.mannlib.vitro.webapp.controller.JSONReconcileServlet + JSON Reconcile Service /reconcile From 9593b175a8d928203979602b1c4ea3a33b462a6c Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 24 May 2011 19:30:55 +0000 Subject: [PATCH 03/56] NIHVIVO-2279 Implement FreemarkerEmailFactory and standardize on it. Change the parameters used to enable e-mail. --- doc/upgrade-1.3.html | 13 ++++++++++++- productMods/WEB-INF/web.xml | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/upgrade-1.3.html b/doc/upgrade-1.3.html index f2a78ee7..c214dff6 100644 --- a/doc/upgrade-1.3.html +++ b/doc/upgrade-1.3.html @@ -28,7 +28,18 @@ -

    upload.directory and LuceneSetup.indexDir are merged into vitro.home.directory.

    +

    upload.directory and LuceneSetup.indexDir are merged into vitro.home.directory [see JB for further details]

    + +

    Email parameters in deploy.properties have changed. [see JB for further details]

    +
      +
    • + Vitro.smtpHost is replaced by email.smtpHost +
    • +
    • + Added email.replyTo as the "from" and "reply-to" address + that appear in emails sent by the application. +
    • +

    Template changes [see RY for further details]

      diff --git a/productMods/WEB-INF/web.xml b/productMods/WEB-INF/web.xml index 517184b7..e05793fa 100644 --- a/productMods/WEB-INF/web.xml +++ b/productMods/WEB-INF/web.xml @@ -50,6 +50,10 @@ edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup + + edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup + + From a9bc9fcfda039bdc3583c14f8cf2dc3756c82087 Mon Sep 17 00:00:00 2001 From: manolobevia Date: Wed, 25 May 2011 02:30:07 +0000 Subject: [PATCH 04/56] NIHVIVO-2280. Worked on markup and styles for account main page, add account, and edit account. Work in progress. --- themes/wilma/css/wilma.css | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/themes/wilma/css/wilma.css b/themes/wilma/css/wilma.css index f50b1de8..3ad89178 100644 --- a/themes/wilma/css/wilma.css +++ b/themes/wilma/css/wilma.css @@ -1459,7 +1459,7 @@ h2#hasResearchArea .verbosePropertyListing { display: block; } /* -------------------------------------------------> */ -/* ACCOUNTS ----------------------------------------> */ +/* ACCOUNTS PAGE -----------------------------------> */ /* -------------------------------------------------> */ .account-feedback p { padding: 10px; @@ -1517,4 +1517,21 @@ table#account td { } .accounts-per-page-form { display: inline-block; -} \ No newline at end of file +} +/* -------------------------------------------------> */ +/* ADD ACCOUNTS -----------------------------------> */ +/* -------------------------------------------------> */ +#add-account p { + margin-top: 15px; +} +#reset-password { + background-color: green; +} +form.customForm #reset-password { + margin-top: 20px; +} +#add-account .note { + padding-bottom: 20px; + padding-top: 0; + margin-top: 5px; +} From 44c537174946309d16b04c95bafe07c326ad8884 Mon Sep 17 00:00:00 2001 From: manolobevia Date: Wed, 25 May 2011 02:35:36 +0000 Subject: [PATCH 05/56] NIHVIVO-2588: Updated identity.ftl in wilma to accommodate the new user menu (when logged in) in header links. My account and My profile don't link to any URL yet. Rebecca will need to provide the $profileURL to be used for the "My profile" link, and Jim Blake will need to provide $accountURL to be used for the "My account Link. --- themes/wilma/css/wilma.css | 89 ++++++++++++++++++ themes/wilma/images/arrow-down-account.gif | Bin 0 -> 175 bytes .../wilma/images/arrow-down-over-account.gif | Bin 0 -> 56 bytes themes/wilma/images/arrow-menu-account.gif | Bin 0 -> 170 bytes themes/wilma/templates/identity.ftl | 19 +++- 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 themes/wilma/images/arrow-down-account.gif create mode 100644 themes/wilma/images/arrow-down-over-account.gif create mode 100644 themes/wilma/images/arrow-menu-account.gif diff --git a/themes/wilma/css/wilma.css b/themes/wilma/css/wilma.css index 3ad89178..b62801cc 100644 --- a/themes/wilma/css/wilma.css +++ b/themes/wilma/css/wilma.css @@ -1535,3 +1535,92 @@ form.customForm #reset-password { padding-top: 0; margin-top: 5px; } +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +@charset "UTF-8"; +/* CSS Document */ +/* -------------------------------------------------> */ +/* DROP DOWN USER MENU ----------------------------> */ +/* -------------------------------------------------> */ + +/* LEVEL ONE */ +ul.dropdown { + position: relative; +} +ul.dropdown li { + float: left; + zoom: 1; + padding: 0 !important; +} +ul.dropdown li a { + display: block; + font-size: 1.4em; +} +ul.dropdown li#user-menu { + background: url(../images/arrow-down-over-account.gif) right 9px no-repeat; +} +ul.dropdown li#user-menu a { + margin-right: 18px; +} +ul.dropdown li#user-menu.hover, +ul.dropdown li#user-menu:hover { + color: #000 !important; + position: relative; + background: #fff url(../images/arrow-down-account.gif) right 9px no-repeat; + padding-right: 10px; + border-bottom: 1px solid #cdcfcf; +} +ul.dropdown li.hover a, +ul.dropdown li:hover a { + color: #000 !important; + padding: 0 10px; +} +/* LEVEL TWO */ +ul.dropdown ul.sub_menu { + background-color: #fff; + font-size: 1.4em; + visibility: hidden; + position: absolute; + top: 100%; + right: 0; + z-index: 999; + color: #000; +} +ul.dropdown ul.sub_menu li { + float: none; + clear: both; + padding-left: 14px !important; + width: 88px; + border-right: none !important; + border-bottom: 1px solid #cdcfcf; + background: #fff url(../images/arrow-menu-account.gif) 7px 8px no-repeat; +} +ul.dropdown ul.sub_menu li:last-child { +} +/* IE 6 & 7 Needs Inline Block */ +/* ADD IN IE6.css and IE7.css*/ +ul.dropdown ul.sub_menu li a { + width: 90%; + display: inline-block; + color: #000 !important; + background-color: #fff; + padding: 0; + padding-left: 8px; + height: 24px; +} +ul.dropdown ul.sub_menu li.inactive { + color: #aab0ae !important; + font-size: 1em !important; + padding-left: 22px !important; +} +ul.dropdown ul.sub_menu li a:hover, +ul.dropdown ul.sub_menu li a.hover { + color: #999 !important; +} +/* LEVEL THREE */ +ul.dropdown ul ul { + left: 100%; top: 0; +} +ul.dropdown li:hover > ul { + visibility: visible; +} \ No newline at end of file diff --git a/themes/wilma/images/arrow-down-account.gif b/themes/wilma/images/arrow-down-account.gif new file mode 100644 index 0000000000000000000000000000000000000000..0f5463ebaa8ae4b7964f0e3a94a809cac6de77c7 GIT binary patch literal 175 zcmZ?wbhEHb6lY*(IKsg2`Rg~!*!;#BORn5`U>uPxWE*_*!IMv4zCC~Q?$WLMN6ue; z|LKcSc-F@+U-_&8xy<}bBXh6cf5c?q@&EsS1|opsPZmZ724MyrkXn$P46Hf}6naxM wHG@~J^Guw^v+3N*k9&klF4R1k(ZZH5v9njg#EC^^Wht4NfByVA zcmDj5qenAxbMM{1|Ni~^sWWEe6cl{<`gO+a*-xH6t*Wc5uCKpw>(;-2{|+BL`t#?{ zxa8#j|Nk?9f#OdVMg|611|1L&WG4fwdP2BhENA42uq+wzmEH>qj$KI&sV+Hu)UwB^ TiCLf|Vv@V& +