web.xml: add servlet for AboutQrCodesController

aboutQrCodes.ftl: create initial mockup
foaf-person--exportQrCode.ftl: rename from individual-exportQrCode
individual-exportQrCode.ftl: delete
AboutQrCodesController.java: create
ExportQrCodeController.java: handle rename of FTL file
This commit is contained in:
mbarbier 2011-04-06 20:03:34 +00:00
parent e08a675874
commit 6a2614710f
5 changed files with 71 additions and 1 deletions

View file

@ -1423,6 +1423,15 @@
<url-pattern>/qrcode</url-pattern> <url-pattern>/qrcode</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet>
<servlet-name>AboutQrCodesController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.AboutQrCodesController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AboutQrCodesController</servlet-name>
<url-pattern>/qrcode/about</url-pattern>
</servlet-mapping>
<!-- ============================== servlet-mappings ======================== --> <!-- ============================== servlet-mappings ======================== -->
<servlet-mapping> <servlet-mapping>

View file

@ -0,0 +1,21 @@
<h2>About QR Codes</h2>
<h3>What is QR?</h3>
<p>QR stands for <i>Quick Response</i> is a standard for two-dimensional barcodes that can be read by mobile devices equipped with cameras (such as a smartphone).</p>
<h3>What kind of data is in a QR code?</h3>
<p>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 <i>vCard</i> format. This is a sort of digital business card, containing information about the person's name, address, telephone number, email address, and more.</p>
<p>If you click on a person's QR code in VIVO, you will be taken to the <i>QR Export</i> 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.</p>
<#-- todo: make VIVO API? Currently pasting Google API code into export area, this will be static and not change if VIVO data is updated. -->
<h3>How do I read a QR code?</h3>
<p>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.</p>
<h3>What can I do with a QR code?</h3>
<p>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.</p>

View file

@ -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<String, Object> body = new HashMap<String, Object>();
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";
}
}

View file

@ -23,7 +23,7 @@ public class ExportQrCodeController extends FreemarkerHttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(ExportQrCodeController.class); 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 @Override
protected ResponseValues processRequest(VitroRequest vreq) { protected ResponseValues processRequest(VitroRequest vreq) {