diff --git a/productMods/WEB-INF/web.xml b/productMods/WEB-INF/web.xml index 9a8f6d95..2ac12f00 100644 --- a/productMods/WEB-INF/web.xml +++ b/productMods/WEB-INF/web.xml @@ -1423,6 +1423,15 @@ /qrcode + + AboutQrCodesController + edu.cornell.mannlib.vitro.webapp.controller.AboutQrCodesController + + + AboutQrCodesController + /qrcode/about + + diff --git a/productMods/templates/freemarker/body/aboutQrCodes.ftl b/productMods/templates/freemarker/body/aboutQrCodes.ftl new file mode 100644 index 00000000..836e8b1d --- /dev/null +++ b/productMods/templates/freemarker/body/aboutQrCodes.ftl @@ -0,0 +1,21 @@ +

About QR Codes

+ +

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).

+ +

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.

+<#-- 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?

+ +

There are apps you can download for the iPhone and Android phones that allow you to use your phone's camera to interact with QR codes placed on objects in the real world.

+ +

What can I do with a QR code?

+ +

Anything! For a state-of-the-art business card, put your hyperlink QR code on the back of it. That way anyone with a properly-equipped smartphone can quickly go to your VIVO profile by simply pointing their camera at the code. Or put your vCard QR code on your office door to provide more contact information.

+ diff --git a/productMods/templates/freemarker/body/individual-exportQrCode.ftl b/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl similarity index 100% rename from productMods/templates/freemarker/body/individual-exportQrCode.ftl rename to productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java b/src/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java new file mode 100644 index 00000000..6b75946a --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java @@ -0,0 +1,40 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.controller; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ExceptionResponseValues; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; + +public class AboutQrCodesController extends FreemarkerHttpServlet { + + private static final long serialVersionUID = 1L; + private static final Log log = LogFactory.getLog(ExportQrCodeController.class); + private static final String TEMPLATE_DEFAULT = "aboutQrCodes.ftl"; + + @Override + protected ResponseValues processRequest(VitroRequest vreq) { + try { + Map body = new HashMap(); + + return new TemplateResponseValues(TEMPLATE_DEFAULT, body); + } catch (Throwable e) { + log.error(e, e); + return new ExceptionResponseValues(e); + } + } + + @Override + protected String getTitle(String siteName, VitroRequest vreq) { + return "About QR Codes"; + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java b/src/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java index 36cd4529..826598c0 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java @@ -23,7 +23,7 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(ExportQrCodeController.class); - private static final String TEMPLATE_DEFAULT = "individual-exportQrCode.ftl"; + private static final String TEMPLATE_DEFAULT = "foaf-person--exportQrCode.ftl"; @Override protected ResponseValues processRequest(VitroRequest vreq) {