From c5dc320cc0a3123746cadca014920a6354253e1d Mon Sep 17 00:00:00 2001 From: ryounes Date: Thu, 24 Mar 2011 18:36:10 +0000 Subject: [PATCH] NIHVIVO-1592 Fix TermOfUse controller and template so the page displays when no copyright anchor has been specified. --- .../freemarker/TermsOfUseController.java | 16 +++++++++++----- .../templates/freemarker/body/termsOfUse.ftl | 18 +++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/TermsOfUseController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/TermsOfUseController.java index d3c9e0f67..6a040481d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/TermsOfUseController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/TermsOfUseController.java @@ -25,15 +25,21 @@ public class TermsOfUseController extends FreemarkerHttpServlet { protected ResponseValues processRequest(VitroRequest vreq) { Portal portal = vreq.getPortal(); - Map body = new HashMap(); + Map map = new HashMap(); + Map termsOfUse = new HashMap(); String rootBreadCrumbAnchor = portal.getRootBreadCrumbAnchor(); - String websiteName = StringUtils.isEmpty(rootBreadCrumbAnchor) ? portal.getAppName() : rootBreadCrumbAnchor; - body.put("websiteName", websiteName); + String siteName = StringUtils.isEmpty(rootBreadCrumbAnchor) ? portal.getAppName() : rootBreadCrumbAnchor; + termsOfUse.put("siteName", siteName); - body.put("copyrightAnchor", portal.getCopyrightAnchor()); + String siteHost = portal.getCopyrightAnchor(); + if (siteHost == null) { + siteHost = "the hosting institution"; + } + termsOfUse.put("siteHost", siteHost); - return new TemplateResponseValues(TEMPLATE_DEFAULT, body); + map.put("termsOfUse", termsOfUse); + return new TemplateResponseValues(TEMPLATE_DEFAULT, map); } @Override diff --git a/webapp/web/templates/freemarker/body/termsOfUse.ftl b/webapp/web/templates/freemarker/body/termsOfUse.ftl index 846b5eca3..a0862c635 100644 --- a/webapp/web/templates/freemarker/body/termsOfUse.ftl +++ b/webapp/web/templates/freemarker/body/termsOfUse.ftl @@ -4,8 +4,8 @@

Terms of Use

Disclaimers

-

This ${websiteName} website contains material—text information, publication - citations, links, and images—provided by ${copyrightAnchor} and by various +

This ${termsOfUse.siteName} website contains material—text information, publication + citations, links, and images—provided by ${termsOfUse.siteHost} and by various third parties, both individuals and organizations, commercial and otherwise. The use of this material is protected by copyright and unless the terms of use are clearly stated with respect to individual items, users must seek permission from the copyright owner for all uses that are not allowed by fair use and @@ -13,17 +13,17 @@ without express written permission.

Disclaimer of Liability

-

${copyrightAnchor} makes no warranty, expressed or implied, including the warranties of merchantability +

${termsOfUse.siteHost?cap_first} makes no warranty, expressed or implied, including the warranties of merchantability and fitness for a particular purpose, or assumes any legal liability or responsibility for the accuracy, completeness, currency or usefulness of any material displayed or distributed through the - ${siteName} website or represents that its use would not infringe privately owned rights. - ${copyrightAnchor} disclaims all warranties with regard to the information provided. Any reliance upon such information - is at your own risk. In no event will ${copyrightAnchor} be liable to you for any damages or losses whatsoever resulting - from or caused by the ${siteName} website or its contents.

+ ${termsOfUse.siteName} website or represents that its use would not infringe privately owned rights. + ${termsOfUse.siteHost?cap_first} disclaims all warranties with regard to the information provided. Any reliance upon such information + is at your own risk. In no event will ${termsOfUse.siteHost} be liable to you for any damages or losses whatsoever resulting + from or caused by the ${termsOfUse.siteName} website or its contents.

Disclaimer of Endorsement

Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement or recommendation - by ${copyrightAnchor}. The views and opinions of authors expressed herein do not necessarily state or reflect those of - ${copyrightAnchor} and shall not be used for advertising or product endorsement purposes.

+ by ${termsOfUse.siteHost}. The views and opinions of authors expressed herein do not necessarily state or reflect those of + ${termsOfUse.siteHost} and shall not be used for advertising or product endorsement purposes.

\ No newline at end of file