From: <bra...@us...> - 2010-05-18 22:54:16
|
Revision: 3105 http://archive-access.svn.sourceforge.net/archive-access/?rev=3105&view=rev Author: bradtofel Date: 2010-05-18 22:54:10 +0000 (Tue, 18 May 2010) Log Message: ----------- INITIAL REV: Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java 2010-05-18 22:54:10 UTC (rev 3105) @@ -0,0 +1,79 @@ +/* JSPReplayRenderer + * + * $Id$: + * + * Created on May 7, 2010. + * + * Copyright (C) 2006 Internet Archive. + * + * This file is part of Wayback. + * + * Wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.archive.wayback.replay; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.archive.wayback.ReplayRenderer; +import org.archive.wayback.ResultURIConverter; +import org.archive.wayback.core.CaptureSearchResult; +import org.archive.wayback.core.CaptureSearchResults; +import org.archive.wayback.core.Resource; +import org.archive.wayback.core.UIResults; +import org.archive.wayback.core.WaybackRequest; +import org.archive.wayback.exception.WaybackException; + +/** + * ReplayRenderer implementation which just forwards responsibility for + * rendering a resource to a .jsp file. + * + * @author brad + * + */ +public class JSPReplayRenderer implements ReplayRenderer { + private String targetJsp = null; + + public void renderResource(HttpServletRequest httpRequest, + HttpServletResponse httpResponse, WaybackRequest wbRequest, + CaptureSearchResult result, Resource resource, + ResultURIConverter uriConverter, CaptureSearchResults results) + throws ServletException, IOException, WaybackException { + UIResults uiResults = + new UIResults(wbRequest, uriConverter, results, result, resource); + uiResults.forward(httpRequest, httpResponse, targetJsp); + } + + /** + * @return the context-relative path to the .jsp responsible for rendering + * the resource + */ + public String getTargetJsp() { + return targetJsp; + } + + /** + * @param targetJsp the context-relative path to the .jsp responsible for + * rendering the resource + */ + public void setTargetJsp(String targetJsp) { + this.targetJsp = targetJsp; + } + +} Property changes on: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:23:24
|
Revision: 3125 http://archive-access.svn.sourceforge.net/archive-access/?rev=3125&view=rev Author: bradtofel Date: 2010-05-28 03:23:17 +0000 (Fri, 28 May 2010) Log Message: ----------- added option to wrap in normal UI-wrapper or not Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java 2010-05-19 00:07:08 UTC (rev 3124) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java 2010-05-28 03:23:17 UTC (rev 3125) @@ -49,6 +49,7 @@ */ public class JSPReplayRenderer implements ReplayRenderer { private String targetJsp = null; + private boolean wrap = true; public void renderResource(HttpServletRequest httpRequest, HttpServletResponse httpResponse, WaybackRequest wbRequest, @@ -57,7 +58,13 @@ throws ServletException, IOException, WaybackException { UIResults uiResults = new UIResults(wbRequest, uriConverter, results, result, resource); - uiResults.forward(httpRequest, httpResponse, targetJsp); + if(wrap) { + uiResults.forwardWrapped(httpRequest, httpResponse, + targetJsp, wbRequest.getAccessPoint().getWrapperJsp()); + } else { + uiResults.forward(httpRequest, httpResponse, + targetJsp); + } } /** @@ -76,4 +83,22 @@ this.targetJsp = targetJsp; } + /** + * @return true if the jsp should be wrapped in the stardard UI template + * wrapper jsp for the AccessPoint. + */ + public boolean isWrap() { + return wrap; + } + + /** + * @param wrap if true then the jsp configured for this page will be + * wrapped in the standard template used for the current AccessPoint, if + * false then the jsp configured is responsible for rendering the entire + * content. + */ + public void setWrap(boolean wrap) { + this.wrap = wrap; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |