From c31cb0c057e046ad81acba41abb853ba839d9b4e Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 21 Jan 2012 05:30:23 +0000 Subject: [PATCH 01/36] Initial beginnings of a tunnel creation wizard as per ticket #502 --- .../src/net/i2p/i2ptunnel/web/WizardBean.java | 24 +++++ apps/i2ptunnel/jsp/web.xml | 5 ++ apps/i2ptunnel/jsp/wizard.jsp | 89 +++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java create mode 100644 apps/i2ptunnel/jsp/wizard.jsp diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java new file mode 100644 index 000000000..afac4235e --- /dev/null +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java @@ -0,0 +1,24 @@ +package net.i2p.i2ptunnel.web; + +/** + * A temporary data holder for the wizard pages + * + * Warning - This class is not part of the i2ptunnel API, and at some point + * it will be moved from the jar to the war. + * Usage by classes outside of i2ptunnel.war is deprecated. + */ +public class WizardBean extends IndexBean { + private boolean _isClient; + public WizardBean() { super(); } + + /** + * Whether the tunnel being set up is a client tunnel or not. + * + */ + public void setIsClient(String isClient) { + _isClient = Boolean.valueOf(isClient); + } + public boolean getIsClient() { + return _isClient; + } +} diff --git a/apps/i2ptunnel/jsp/web.xml b/apps/i2ptunnel/jsp/web.xml index d333d2936..d8d51c823 100644 --- a/apps/i2ptunnel/jsp/web.xml +++ b/apps/i2ptunnel/jsp/web.xml @@ -18,6 +18,11 @@ /edit + + net.i2p.i2ptunnel.jsp.wizard_jsp + /wizard + + 30 diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp new file mode 100644 index 000000000..5f77e6ae0 --- /dev/null +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -0,0 +1,89 @@ +<% + // NOTE: Do the header carefully so there is no whitespace before the <%@page pageEncoding="UTF-8" +%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.WizardBean" +%> + + + +<% String pageStr = request.getParameter("page"); + int curPage = 1; + if (pageStr != null) { + try { + curPage = Integer.parseInt(pageStr); + if (curPage > 7 || curPage <= 0) { + curPage = 1; + } + } catch (NumberFormatException nfe) { + curPage = 1; + } + } +%> + + + <%=intl._("I2P Tunnel Manager - Tunnel Creation Wizard")%> + + + + + + <% if (wizardBean.allowCSS()) { + %> + + <% } + %> + + + + +
+ +
+
+ <% + if (curPage == 1) { + %>

<%=intl._("Page 1")%>

<% + } %> + " /> + +
+ +
+
+
+ + <% + if (curPage == 1) { + %>
+ + + + + +
<% + } else { + %><% + } %> +
+ +
+
+ +
+ +
+ + + + From eda2ac510af0bf0024acfd3f613f96ab3c3cb5db Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 00:07:06 +0000 Subject: [PATCH 02/36] Make getType() a public method so can be accessed from wizard.jsp --- apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 3b658b65e..d28a103e9 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -604,7 +604,7 @@ public class IndexBean { public void setType(String type) { _type = (type != null ? type.trim() : null); } - String getType() { return _type; } + public String getType() { return _type; } /** Short name of the tunnel */ public void setName(String name) { From 17e8cf777f3ba4513311bc3345cf9f3b2e90791a Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 00:11:29 +0000 Subject: [PATCH 03/36] Flesh out some more of wizard.jsp --- apps/i2ptunnel/jsp/wizard.jsp | 55 ++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 5f77e6ae0..673291af7 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -19,6 +19,7 @@ curPage = 1; } } + boolean tunnelIsClient = wizardBean.getIsClient(); %> @@ -38,13 +39,25 @@ -
+ ">
<% if (curPage == 1) { - %>

<%=intl._("Page 1")%>

<% + %>

<%=intl._("Server or client tunnel?")%>

<% + } else if (curPage == 2) { + %>

<%=intl._("Tunnel type")%>

<% + } else if (curPage == 3) { + %>

<%=intl._("Tunnel name and description")%>

<% + } else if (curPage == 4 && tunnelIsClient) { + %>

<%=intl._("Tunnel destination")%>

<% + } else if (curPage == 5) { + %>

<%=intl._("Binding address and port")%>

<% + } else if (curPage == 6) { + %>

<%=intl._("Tunnel auto-start")%>

<% + } else if (curPage == 7) { + %>

<%=intl._("Wizard completed")%>

<% } %> " /> @@ -57,16 +70,39 @@ <% if (curPage == 1) { %>
-
<% } else { - %><% + %><% + } %> + + <% if (curPage == 2) { + %>
+ <% if (tunnelIsClient) { + %><% + } else { + %><% + } %> +
<% + } else { + %><% } %>
@@ -75,8 +111,11 @@
From 77c217342115e10329fe9ab0fb34f5c562cc768f Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 00:21:13 +0000 Subject: [PATCH 04/36] Added in a hidden input for "tunnel" set to "null" The idea is to utilise the existing saveChanges function in IndexBean.java that the edit page posts to. Consequently, the wizard will need to have all the same inputs that need to be POSTed as the edit page does. --- apps/i2ptunnel/jsp/wizard.jsp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 673291af7..ae50f1882 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -60,6 +60,7 @@ %>

<%=intl._("Wizard completed")%>

<% } %> " /> + From e0b70375a6b061adb11ca2b2fc6a51455db29405 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 02:37:39 +0000 Subject: [PATCH 05/36] Added inputs for page 3 of wizard --- apps/i2ptunnel/jsp/wizard.jsp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index ae50f1882..846e83b19 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -105,6 +105,24 @@ } else { %><% } %> + + <% if (curPage == 3) { + %>
+ + +
+
+ + +
<% + } else { + %> + <% + } %>
From a09205441709bfff410cc33e90af49c3971fabfb Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 02:44:51 +0000 Subject: [PATCH 06/36] Formatting and comments in JSP code --- apps/i2ptunnel/jsp/wizard.jsp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 846e83b19..96a205d09 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -78,11 +78,13 @@
<% } else { %><% - } %> + } /* curPage 1 */ %> - <% if (curPage == 2) { + <% + if (curPage == 2) { %>
- <% if (tunnelIsClient) { + <% + if (tunnelIsClient) { %><% - } %> + } /* tunnelIsClient */ %>
<% } else { %><% - } %> + } /* curPage 2 */ %> - <% if (curPage == 3) { + <% + if (curPage == 3) { %>
From 3793e2c4ecfc3ea91372b815ac0eda7d7df56050 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 22 Jan 2012 04:23:45 +0000 Subject: [PATCH 07/36] Added inputs for page 4 of wizard --- apps/i2ptunnel/jsp/wizard.jsp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 96a205d09..7117e7697 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -20,6 +20,7 @@ } } boolean tunnelIsClient = wizardBean.getIsClient(); + String tunnelType = wizardBean.getType(); %> @@ -105,7 +106,7 @@ } /* tunnelIsClient */ %>
<% } else { - %><% + %><% } /* curPage 2 */ %> <% @@ -128,6 +129,34 @@ } /* curPage 3 */ %> + <% + if (tunnelIsClient) { + if (curPage == 4) { + if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { + %>
+ + +
<% + } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) { + %>
+ + + (<%=intl._("name or destination")%>; <%=intl._("b32 not recommended")%>) +
<% + } + } else { + if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { + %><% + } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) { + %><% + } /* curPage 4 */ + } /* tunnelIsClient */ %> + +
From 9a5430beeb634b2a7992402129e875c89b4fbf3d Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 23 Jan 2012 01:09:17 +0000 Subject: [PATCH 09/36] Added inputs for page 5 of wizard --- apps/i2ptunnel/jsp/wizard.jsp | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 0e4a8cc74..67d5ab99e 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -156,6 +156,72 @@ } /* curPage 4 */ } } /* tunnelIsClient */ %> + + <% /* Page 5 - Binding ports and addresses*/ + + if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || !"streamrserver".equals(tunnelType)) { + if (curPage == 5) { + %>
+ + +
<% + } else { + %><% + } /* curPage 5 */ + } /* streamrclient or !streamrserver */ %> + <% + if (!tunnelIsClient) { + if (curPage == 5) { + %>
+ + +
<% + } else { + %><% + } /* curPage 5 */ + } /* !tunnelIsClient */ %> + <% + if (tunnelIsClient || "httpbidirserver".equals(tunnelType)) { + if (curPage == 5) { + %>
+ + +
<% + } else { + %><% + } /* curPage 5 */ + } /* tunnelIsClient or httpbidirserver */ %> + <% + if ((tunnelIsClient && !"streamrclient".equals(tunnelType)) || "httpbidirserver".equals(tunnelType) || "streamrserver".equals(tunnelType)) { + if (curPage == 5) { + %>
+ + +
<% + } else { + %><% + } /* curPage 5 */ + } /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */ %>
From 745e2952ffe5da331614ab87deccc6a46da21f76 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 23 Jan 2012 01:21:19 +0000 Subject: [PATCH 10/36] Added getters for the hidden variables needed by wizard.jsp --- .../src/net/i2p/i2ptunnel/web/WizardBean.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java index afac4235e..2fbec2eb5 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java @@ -21,4 +21,36 @@ public class WizardBean extends IndexBean { public boolean getIsClient() { return _isClient; } + + public String getName() { + return _name; + } + + public String getDescription() { + return _description; + } + + public String getProxyList() { + return _proxyList; + } + + public String getTargetDestination() { + return _targetDestination; + } + + public String getTargetHost() { + return _targetHost; + } + + public String getTargetPort() { + return _targetPort; + } + + public String getPort() { + return _port; + } + + public String getReachableBy() { + return _reachableBy; + } } From 12ee1a70b299e9ef67e7dea0c20063e7c2c4da7c Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 25 Jan 2012 00:06:18 +0000 Subject: [PATCH 11/36] Added comments to clarify page boundaries, and removed extra
--- apps/i2ptunnel/jsp/wizard.jsp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 67d5ab99e..fa1404550 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -69,7 +69,8 @@
- <% + <% /* Page 1 - Whether to make a client or server tunnel */ + if (curPage == 1) { %>
@@ -79,9 +80,12 @@
<% } else { %><% - } /* curPage 1 */ %> + } /* curPage 1 */ + + /* End page 1 */ %> + + <% /* Page 2 - Tunnel type */ - <% if (curPage == 2) { %>
<% @@ -107,9 +111,12 @@
<% } else { %><% - } /* curPage 2 */ %> + } /* curPage 2 */ + + /* End page 2 */ %> + + <% /* Page 3 - Name and description */ - <% if (curPage == 3) { %>
+ } /* curPage 3 */ + + /* End page 3 */ %> + + <% /* Page 4 - Target destination or proxy list */ - <% if (tunnelIsClient) { if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { if (curPage == 4) { @@ -155,7 +164,9 @@ %><% } /* curPage 4 */ } - } /* tunnelIsClient */ %> + } /* tunnelIsClient */ + + /* End page 4 */ %> <% /* Page 5 - Binding ports and addresses*/ @@ -221,7 +232,9 @@ } else { %><% } /* curPage 5 */ - } /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */ %> + } /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */ + + /* End page 5 */ %>
From e43182b842ec44d8a8708ec4c6df8c077165a5aa Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 25 Jan 2012 01:12:17 +0000 Subject: [PATCH 12/36] Added inputs for page 6 of wizard --- apps/i2ptunnel/jsp/wizard.jsp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index fa1404550..006f4bf8c 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -235,6 +235,22 @@ } /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */ /* End page 5 */ %> + + <% /* Page 6 - Automatic start */ + + if (curPage == 6) { + %>
+ + + <%=intl._("(Check the Box for 'YES')")%> +
<% + } else { + %><% + } /* curPage 6 */ + + /* End page 6 */ %>
From 776a8c5a63cc85e594b4793a723517579e1f6d06 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 25 Jan 2012 22:53:14 +0000 Subject: [PATCH 13/36] Undo revision 30dba6c75dcd43c7c67112558dad7b36504ba5a7 --- apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index d28a103e9..3b658b65e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -604,7 +604,7 @@ public class IndexBean { public void setType(String type) { _type = (type != null ? type.trim() : null); } - public String getType() { return _type; } + String getType() { return _type; } /** Short name of the tunnel */ public void setName(String name) { From e1b53a63f4180d87fd8ca8ae359846f22431f8df Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 25 Jan 2012 23:05:23 +0000 Subject: [PATCH 14/36] Undo revision 126c1c30c0c02fd95719ffeae6d4709abb7bf18d --- .../src/net/i2p/i2ptunnel/web/WizardBean.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java index 2fbec2eb5..afac4235e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java @@ -21,36 +21,4 @@ public class WizardBean extends IndexBean { public boolean getIsClient() { return _isClient; } - - public String getName() { - return _name; - } - - public String getDescription() { - return _description; - } - - public String getProxyList() { - return _proxyList; - } - - public String getTargetDestination() { - return _targetDestination; - } - - public String getTargetHost() { - return _targetHost; - } - - public String getTargetPort() { - return _targetPort; - } - - public String getPort() { - return _port; - } - - public String getReachableBy() { - return _reachableBy; - } } From 9e446f9ae8c803174bfac55d46b954bb0dcd231e Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 26 Jan 2012 03:18:50 +0000 Subject: [PATCH 15/36] Use request.getParameter() to fetch POSTed parameters --- apps/i2ptunnel/jsp/wizard.jsp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 006f4bf8c..44b68f696 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -20,7 +20,7 @@ } } boolean tunnelIsClient = wizardBean.getIsClient(); - String tunnelType = wizardBean.getType(); + String tunnelType = request.getParameter("type"); %> @@ -131,8 +131,8 @@
<% } else { - %> - <% + %>" /> + " /><% } /* curPage 3 */ /* End page 3 */ %> @@ -149,7 +149,7 @@ <% } else { - %><% + %>" /><% } /* curPage 4 */ } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) { if (curPage == 4) { @@ -161,7 +161,7 @@ (<%=intl._("name or destination")%>; <%=intl._("b32 not recommended")%>) <% } else { - %><% + %>" /><% } /* curPage 4 */ } } /* tunnelIsClient */ @@ -179,7 +179,7 @@ <% } else { - %><% + %>" /><% } /* curPage 5 */ } /* streamrclient or !streamrserver */ %> <% @@ -191,7 +191,7 @@ <% } else { - %><% + %>" /><% } /* curPage 5 */ } /* !tunnelIsClient */ %> <% @@ -204,7 +204,7 @@ <% } else { - %><% + %>" /><% } /* curPage 5 */ } /* tunnelIsClient or httpbidirserver */ %> <% @@ -230,7 +230,7 @@ <% } else { - %><% + %>" /><% } /* curPage 5 */ } /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */ @@ -247,7 +247,7 @@ <%=intl._("(Check the Box for 'YES')")%> <% } else { - %><% + %>" /><% } /* curPage 6 */ /* End page 6 */ %> From ac493d7bcb1de9fb4136b631c590739ac0d83f35 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 26 Jan 2012 03:35:25 +0000 Subject: [PATCH 16/36] Show Next and Finish buttons the right way round --- apps/i2ptunnel/jsp/wizard.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 44b68f696..bf4607ea5 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -259,9 +259,9 @@
<% if (curPage == 7) { - %><% - } else { %><% + } else { + %><% } %>
From 6d0514b4514ad3433cf8f32c584acbf520d11db0 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 26 Jan 2012 03:53:05 +0000 Subject: [PATCH 17/36] Get wizard to step through pages correctly --- apps/i2ptunnel/jsp/wizard.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index bf4607ea5..fbb47f3d7 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -40,7 +40,7 @@ - "> +
From 9a5ea686827cc21716b13d4b5b97f674fec6ba27 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 26 Jan 2012 03:53:43 +0000 Subject: [PATCH 18/36] Subclass WizardBean from EditBean to get access to the interfaceSet() method --- apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java index afac4235e..76986a0c1 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java @@ -7,7 +7,7 @@ package net.i2p.i2ptunnel.web; * it will be moved from the jar to the war. * Usage by classes outside of i2ptunnel.war is deprecated. */ -public class WizardBean extends IndexBean { +public class WizardBean extends EditBean { private boolean _isClient; public WizardBean() { super(); } From c9f1f69c16d893b65d62241fbe955150bca05a64 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 27 Jan 2012 02:52:39 +0000 Subject: [PATCH 19/36] Fix isClient to get passed through properly --- apps/i2ptunnel/jsp/wizard.jsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index fbb47f3d7..052b7316e 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -19,7 +19,7 @@ curPage = 1; } } - boolean tunnelIsClient = wizardBean.getIsClient(); + boolean tunnelIsClient = Boolean.valueOf(request.getParameter("isClient")); String tunnelType = request.getParameter("type"); %> @@ -74,9 +74,9 @@ if (curPage == 1) { %>
- + - +
<% } else { %><% From 4be3f16805431d4ee03383d3315fa499cdd980fa Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 27 Jan 2012 03:12:57 +0000 Subject: [PATCH 20/36] Added missing label for targetPort --- apps/i2ptunnel/jsp/wizard.jsp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 052b7316e..64f0ce9af 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -187,6 +187,7 @@ if (curPage == 5) { %>
<% From c81c4cb873f78134d525228fe5237334a8fda6a0 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 27 Jan 2012 04:06:04 +0000 Subject: [PATCH 21/36] Fix autostart hidden input to not appear if checkbox not ticked --- apps/i2ptunnel/jsp/wizard.jsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 64f0ce9af..40eee4d56 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -248,7 +248,9 @@ <%=intl._("(Check the Box for 'YES')")%>
<% } else { + if ("1".equals(request.getParameter("startOnLoad"))) { %>" /><% + } } /* curPage 6 */ /* End page 6 */ %> From 39953b69253ee859e68dda3f0dfbbb0ea76ccc56 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 27 Jan 2012 04:10:01 +0000 Subject: [PATCH 22/36] Fix condition for including targetHost --- apps/i2ptunnel/jsp/wizard.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 40eee4d56..184d7074a 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -170,7 +170,7 @@ <% /* Page 5 - Binding ports and addresses*/ - if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || !"streamrserver".equals(tunnelType)) { + if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || (!tunnelIsClient && !"streamrserver".equals(tunnelType))) { if (curPage == 5) { %>
From 621f13206907c79885cd1329eacc2df272d2f4e3 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 1 Feb 2012 03:03:57 +0000 Subject: [PATCH 24/36] Change Finish action on wizard to "Save changes" This means that the form is handled by the same handler as the edit forms, hopefully reducing maintenance ^_^ --- apps/i2ptunnel/jsp/wizard.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 0d97e616b..c7852a11b 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -317,7 +317,7 @@ http://i2jump.i2p/" /><%
<% if (curPage == 7) { - %><% + %><% } else { %><% } %> From 7dd03fda8d247a2c5b91b1a95d0d5e38b248803c Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 1 Feb 2012 03:48:39 +0000 Subject: [PATCH 25/36] Added a Previous page button At present the ?page= in the URL isn't affected, which could possibly confuse users - maybe move to having the page variable as a POST variable so the url is just always /i2ptunnel/wizard --- apps/i2ptunnel/jsp/wizard.jsp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index c7852a11b..150a96104 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -19,6 +19,12 @@ curPage = 1; } } + if ("Previous page".equals(request.getParameter("action") { + curPage = curPage - 2; + if (curPage <= 0) { + curPage = 1; + } + } boolean tunnelIsClient = Boolean.valueOf(request.getParameter("isClient")); String tunnelType = request.getParameter("type"); %> @@ -316,6 +322,9 @@ http://i2jump.i2p/" /><% <% } else { @@ -185,7 +185,7 @@ - + " class="freetext" />
<% } else { %>" /><% @@ -198,7 +198,7 @@ - + " class="freetext" />
<% } else { %>" /><% @@ -211,7 +211,7 @@ - + " class="freetext" />
<% } else { %>" /><% From 27e14e7f360c9fd7b73e058cd1097b3ec9795f46 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 2 Feb 2012 03:06:34 +0000 Subject: [PATCH 32/36] Remember reachableBy selection --- apps/i2ptunnel/jsp/wizard.jsp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 1fdb9f93c..8879ee8bf 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -226,11 +226,15 @@ + class="tickbox" /> <%=intl._("(Check the Box for 'YES')")%> <% } else { From 973dbe6fb2173cf6abe5e008c170c6c5a974ec1c Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 2 Feb 2012 03:43:13 +0000 Subject: [PATCH 34/36] Don't display page 4 for server tunnels (tunnel destination) --- apps/i2ptunnel/jsp/wizard.jsp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 5d5a4352b..5870b739e 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -8,6 +8,7 @@ <% String pageStr = request.getParameter("page"); + /* Get the number of the page we came from */ int lastPage = 0; if (pageStr != null) { try { @@ -19,6 +20,7 @@ lastPage = 0; } } + /* Determine what page to display now */ int curPage = 1; if ("Previous page".equals(request.getParameter("action"))) { curPage = lastPage - 1; @@ -28,8 +30,17 @@ if (curPage > 7 || curPage <= 0) { curPage = 1; } + /* Fetch and format a couple of regularly-used values */ boolean tunnelIsClient = Boolean.valueOf(request.getParameter("isClient")); String tunnelType = request.getParameter("type"); + /* Special case - don't display page 4 for server tunnels */ + if (curPage == 4 && !tunnelIsClient) { + if ("Previous page".equals(request.getParameter("action"))) { + curPage = curPage - 1; + } else { + curPage = curPage + 1; + } + } %> From 8cbf94f9eb75394eb4d003aa7ae90749985fd655 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 3 Feb 2012 17:07:10 +0000 Subject: [PATCH 35/36] Added placeholder blurbs for explaining the various wizard options --- apps/i2ptunnel/jsp/wizard.jsp | 83 ++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 11 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 5870b739e..6daae14fb 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -92,7 +92,10 @@ <% /* Page 1 - Whether to make a client or server tunnel */ if (curPage == 1) { - %>
+ %>

+ <%=intl._("The first thing to decide is whether you want to create a client or server tunnel.")%> +

+
@@ -107,7 +110,33 @@ <% /* Page 2 - Tunnel type */ if (curPage == 2) { - %>
+ %>

+ <%=intl._("There are several types of tunnels to choose from:")%> +

+
    <% + if (tunnelIsClient) { + %> +
  • <%=intl._("Standard")%>
  • +
  • HTTP
  • +
  • IRC
  • +
  • SOCKS 4/4a/5
  • +
  • SOCKS IRC
  • +
  • CONNECT
  • +
  • Streamr
  • <% + } else { + %> +
  • <%=intl._("Standard")%>
  • +
  • HTTP
  • +
  • HTTP bidir
  • +
  • IRC
  • +
  • Streamr
  • <% + } + %> +
+

+ <%=intl._("The above might look better as a table, possibly.")%> +

+
<% if (tunnelIsClient) { %> From 7461d8c1f1b0ab4717a1febde98de3813e9808c0 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 3 Feb 2012 17:10:44 +0000 Subject: [PATCH 36/36] Added "@since 0.8.13" tags to the only two methods in WizardBean --- apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java index 76986a0c1..779df4417 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/WizardBean.java @@ -13,11 +13,12 @@ public class WizardBean extends EditBean { /** * Whether the tunnel being set up is a client tunnel or not. - * + * @since 0.8.13 */ public void setIsClient(String isClient) { _isClient = Boolean.valueOf(isClient); } + /** @since 0.8.13 */ public boolean getIsClient() { return _isClient; }