From 1f071acb8264c9cb85a8b97473fc3c76c5f43628 Mon Sep 17 00:00:00 2001 From: Farruco Sanjurjo Date: Wed, 5 Jan 2011 13:46:55 +0100 Subject: [PATCH] Deleted method used to adapt callbacks for older versions on Timelinez * This method was added due to a bug on Timeline, see: http://sourceforge.net/mailarchive/message.php?msg_id=25935247 * Since newer versions of Timeplot (2.3.X) this is not happening anymore. * This method was causing weird behaviours with the URL used by timeline to retrieve the data. As a result of deleting the first "/" the final URL used by timeline was relative to the page where the chart was shown, i.e. if the callback-url submited by the application was "navalplanner-webapp/callback/XXXXXXX" and the page that contained the chart was "http://localhost:8080/navalplanner-webapp/planner/index.zul", the resulting callback was "http://localhost:8080/navalplanner-webapp/planner/navalplanner-webapp/callback/XXXXXXX". As a result, several mappings were needed at web.xml (now deleted) FEA: ItEr02S03MigracionZK5 --- .../web/planner/chart/ChartFiller.java | 17 ++--------------- .../src/main/webapp/WEB-INF/web.xml | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/chart/ChartFiller.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/chart/ChartFiller.java index 05612d84d..c36098a54 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/chart/ChartFiller.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/chart/ChartFiller.java @@ -578,13 +578,13 @@ public abstract class ChartFiller implements IChartFiller { HttpServletRequest request = (HttpServletRequest) Executions .getCurrent().getNativeRequest(); String uri = CallbackServlet.registerAndCreateURLFor(request, - graphicSpecificationCreator); + graphicSpecificationCreator, false); return uri; } private Plotinfo createPlotInfoFrom(String dataSourceUri) { PlotDataSource pds = new PlotDataSource(); - pds.setDataSourceUri(adaptCallbackForTimePlot(dataSourceUri)); + pds.setDataSourceUri(dataSourceUri); pds.setSeparator(" "); Plotinfo plotinfo = new Plotinfo(); @@ -592,19 +592,6 @@ public abstract class ChartFiller implements IChartFiller { return plotinfo; } - /* - * Get rid of the initial-slash of the callback uri: - * - * before: /callback/ - * after: callback/ - * - *This is needed because how the Javascript component of Timeplot handles - *the application webpath - * */ - private String adaptCallbackForTimePlot(String uri){ - return ! uri.equals("") ? uri.substring(1) : uri; - } - protected void appendPlotinfo(Timeplot chart, Plotinfo plotinfo, ValueGeometry valueGeometry, TimeGeometry timeGeometry) { plotinfo.setValueGeometry(valueGeometry); diff --git a/navalplanner-webapp/src/main/webapp/WEB-INF/web.xml b/navalplanner-webapp/src/main/webapp/WEB-INF/web.xml index 01d4cb1f1..5d46f08fc 100644 --- a/navalplanner-webapp/src/main/webapp/WEB-INF/web.xml +++ b/navalplanner-webapp/src/main/webapp/WEB-INF/web.xml @@ -38,7 +38,7 @@ callbackServlet - /callback/* + callback/* dspLoader