From d31ce253360f95366d8805fd8316160b7a9cba4a Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 26 Jul 2018 13:50:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-10066=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=BB=BA=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/RemoteEnvURL.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java b/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java index bc948f972a..01415c136a 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java @@ -17,11 +17,11 @@ public class RemoteEnvURL implements FCloneable { /** * 默认 web app name */ - private static final String DEFAULT_WEB_APP_NAME = "WebReport"; + private static final String DEFAULT_WEB_APP_NAME = "webroot"; /** * 默认 servlet name */ - private static final String DEFAULT_SERVLET_NAME = "ReportServer"; + private static final String DEFAULT_SERVLET_NAME = "decision"; /** * 默认端口 */ From 4803d6d27401a7d9d2580f1821a1e645f78c4761 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 26 Jul 2018 15:13:25 +0800 Subject: [PATCH 2/3] . --- designer-base/src/main/java/com/fr/env/RemoteEnvURL.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java b/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java index 01415c136a..717dc05845 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java @@ -25,7 +25,7 @@ public class RemoteEnvURL implements FCloneable { /** * 默认端口 */ - private static final String DEFAULT_PORT = "8080"; + private static final String DEFAULT_PORT = "8075"; private static final String HTTPS = "https://"; private static final String HTTP = "http://"; From 3551be07b4d3e7c1614a736d496613236534d9b0 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 26 Jul 2018 15:19:00 +0800 Subject: [PATCH 3/3] . --- .../main/java/com/fr/env/RemoteEnvPane.java | 47 ++++++----- ...oteEnvURL.java => RemoteWorkspaceURL.java} | 24 +++--- .../java/com/fr/env/RemoteEnvURLTest.java | 82 +++++++++---------- 3 files changed, 76 insertions(+), 77 deletions(-) rename designer-base/src/main/java/com/fr/env/{RemoteEnvURL.java => RemoteWorkspaceURL.java} (90%) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index dc39232b1c..a49779ea4b 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -23,7 +23,6 @@ import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JDialog; import javax.swing.JFileChooser; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextPane; import javax.swing.SwingConstants; @@ -115,7 +114,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * 主机位置 */ - private RemoteEnvURL remoteEnvURL = new RemoteEnvURL(""); + private RemoteWorkspaceURL remoteWorkspaceURL = new RemoteWorkspaceURL(""); /** * https 配置面板 */ @@ -189,7 +188,7 @@ public class RemoteEnvPane extends BasicBeanPane { fileChooserButton.setEnabled(isHttps); updateHttpsConfigPanel(); - remoteEnvURL.setHttps(isHttps); + remoteWorkspaceURL.setHttps(isHttps); fillRemoteEnvURLField(); fillIndividualField(); } @@ -267,9 +266,9 @@ public class RemoteEnvPane extends BasicBeanPane { public void populateBean(RemoteDesignerWorkspaceInfo ob) { WorkspaceConnection connection = ob.getConnection(); if (connection != null) { - this.remoteEnvURL = Strings.isNullOrEmpty(connection.getUrl()) - ? RemoteEnvURL.createDefaultURL() - : new RemoteEnvURL(connection.getUrl()); + this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl()) + ? RemoteWorkspaceURL.createDefaultURL() + : new RemoteWorkspaceURL(connection.getUrl()); String username = fromNullable(connection.getUserName()).or(StringUtils.EMPTY); String pwd = fromNullable(connection.getPassword()).or(StringUtils.EMPTY); String certPath = fromNullable(connection.getCertPath()).or(StringUtils.EMPTY); @@ -280,17 +279,17 @@ public class RemoteEnvPane extends BasicBeanPane { this.certSecretKeyInput.setText(certSecretKey); } else { - this.remoteEnvURL = RemoteEnvURL.createDefaultURL(); + this.remoteWorkspaceURL = RemoteWorkspaceURL.createDefaultURL(); this.usernameInput.setText(StringUtils.EMPTY); this.passwordInput.setText(StringUtils.EMPTY); } fillRemoteEnvURLField(); fillIndividualField(); - httpsCheckbox.setSelected(this.remoteEnvURL.getHttps()); + httpsCheckbox.setSelected(this.remoteWorkspaceURL.getHttps()); - DesignerEnvManager.getEnvManager().setHttps(this.remoteEnvURL.getHttps()); - fileChooserButton.setEnabled(this.remoteEnvURL.getHttps()); + DesignerEnvManager.getEnvManager().setHttps(this.remoteWorkspaceURL.getHttps()); + fileChooserButton.setEnabled(this.remoteWorkspaceURL.getHttps()); updateHttpsConfigPanel(); @@ -299,7 +298,7 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public RemoteDesignerWorkspaceInfo updateBean() { WorkspaceConnection connection = new WorkspaceConnection( - this.remoteEnvURL.getURL(), + this.remoteWorkspaceURL.getURL(), this.usernameInput.getText(), new String(this.passwordInput.getPassword()), this.certPathInput.getText(), @@ -576,7 +575,7 @@ public class RemoteEnvPane extends BasicBeanPane { */ private void fillRemoteEnvURLField() { remoteEnvURLInput.getDocument().removeDocumentListener(overallDocListener); - remoteEnvURLInput.setText(remoteEnvURL.getURL()); + remoteEnvURLInput.setText(remoteWorkspaceURL.getURL()); remoteEnvURLInput.getDocument().addDocumentListener(overallDocListener); } @@ -584,14 +583,14 @@ public class RemoteEnvPane extends BasicBeanPane { * 自动填充子条目输入框 */ private void fillIndividualField() { - if (remoteEnvURL == null) { + if (remoteWorkspaceURL == null) { return; } disableSubDocListener(); - hostNameInput.setText(remoteEnvURL.hasDefaultHostName() ? StringUtils.EMPTY : remoteEnvURL.getHost()); - portInput.setText(remoteEnvURL.getPort()); - webAppNameInput.setText(remoteEnvURL.getWeb()); - servletNameInput.setText(remoteEnvURL.getServlet()); + hostNameInput.setText(remoteWorkspaceURL.hasDefaultHostName() ? StringUtils.EMPTY : remoteWorkspaceURL.getHost()); + portInput.setText(remoteWorkspaceURL.getPort()); + webAppNameInput.setText(remoteWorkspaceURL.getWeb()); + servletNameInput.setText(remoteWorkspaceURL.getServlet()); enableSubDocListener(); } @@ -601,11 +600,11 @@ public class RemoteEnvPane extends BasicBeanPane { String port = portInput.getText(); String web = webAppNameInput.getText(); String servlet = servletNameInput.getText(); - remoteEnvURL.setHttps(isHttps); - remoteEnvURL.setHost(host); - remoteEnvURL.setPort(port); - remoteEnvURL.setWeb(web); - remoteEnvURL.setServlet(servlet); + remoteWorkspaceURL.setHttps(isHttps); + remoteWorkspaceURL.setHost(host); + remoteWorkspaceURL.setPort(port); + remoteWorkspaceURL.setWeb(web); + remoteWorkspaceURL.setServlet(servlet); } @@ -617,10 +616,10 @@ public class RemoteEnvPane extends BasicBeanPane { } private void actionURLInputChange() { - remoteEnvURL = new RemoteEnvURL(remoteEnvURLInput.getText()); + remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText()); fillIndividualField(); - httpsCheckbox.setSelected(remoteEnvURL.getHttps()); + httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps()); boolean isHttps = httpsCheckbox.isSelected(); DesignerEnvManager.getEnvManager().setHttps(isHttps); fileChooserButton.setEnabled(isHttps); diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java similarity index 90% rename from designer-base/src/main/java/com/fr/env/RemoteEnvURL.java rename to designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 717dc05845..069541f355 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -8,7 +8,7 @@ import java.util.Objects; /** * @author yaohwu */ -public class RemoteEnvURL implements FCloneable { +public class RemoteWorkspaceURL implements FCloneable { /** * 默认 hostname @@ -29,8 +29,8 @@ public class RemoteEnvURL implements FCloneable { private static final String HTTPS = "https://"; private static final String HTTP = "http://"; - public static final RemoteEnvURL DEFAULT_URL = - new RemoteEnvURL( + public static final RemoteWorkspaceURL DEFAULT_URL = + new RemoteWorkspaceURL( false, DEFAULT_HOST_NAME, DEFAULT_PORT, @@ -45,12 +45,12 @@ public class RemoteEnvURL implements FCloneable { /** - * 解析 url 字符串 生成 RemoteEnvURL 对象 + * 解析 url 字符串 生成 RemoteWorkspaceURL 对象 * url 字符串格式 (http(s)://)host(:port)/+web/+servlet/+(others) * * @param url x:x/x/x/x */ - public RemoteEnvURL(String url) { + public RemoteWorkspaceURL(String url) { // 没有写协议名称 默认 使用 http 协议 if (!url.startsWith(HTTPS) && !url.startsWith(HTTP)) { @@ -102,12 +102,12 @@ public class RemoteEnvURL implements FCloneable { return DEFAULT_HOST_NAME.equals(host); } - public static RemoteEnvURL createDefaultURL() { + public static RemoteWorkspaceURL createDefaultURL() { return DEFAULT_URL.clone(); } - public RemoteEnvURL(boolean isHttps, String host, String port, String web, String servlet) { + public RemoteWorkspaceURL(boolean isHttps, String host, String port, String web, String servlet) { this.isHttps = isHttps; this.host = host != null ? host.trim() : StringUtils.EMPTY; this.port = port != null ? port.trim() : StringUtils.EMPTY; @@ -172,7 +172,7 @@ public class RemoteEnvURL implements FCloneable { if (o == null || getClass() != o.getClass()) { return false; } - RemoteEnvURL that = (RemoteEnvURL) o; + RemoteWorkspaceURL that = (RemoteWorkspaceURL) o; return isHttps == that.isHttps && Objects.equals(host, that.host) && Objects.equals(port, that.port) && @@ -188,7 +188,7 @@ public class RemoteEnvURL implements FCloneable { @Override public String toString() { - return "RemoteEnvURL{" + + return "RemoteWorkspaceURL{" + "isHttps=" + isHttps + ", host='" + host + '\'' + ", port='" + port + '\'' + @@ -198,10 +198,10 @@ public class RemoteEnvURL implements FCloneable { } @Override - public RemoteEnvURL clone() { - RemoteEnvURL cloned; + public RemoteWorkspaceURL clone() { + RemoteWorkspaceURL cloned; try { - cloned = (RemoteEnvURL) super.clone(); + cloned = (RemoteWorkspaceURL) super.clone(); return cloned; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable diff --git a/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java b/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java index f86720fc8d..2c6a0ab39a 100644 --- a/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java +++ b/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java @@ -14,71 +14,71 @@ public class RemoteEnvURLTest { public void testURLParser() { String a; - RemoteEnvURL b; + RemoteWorkspaceURL b; // https or http begin a = "www.baidu.com:9090/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); Assert.assertFalse(b.getHttps()); a = "http://www.baidu.com:9090/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); Assert.assertFalse(b.getHttps()); a = "https://www.baidu.com:9090/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); Assert.assertTrue(b.getHttps()); // https or http end // host begin a = "https://www.baidu.com/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("www.baidu.com", b.getHost()); a = "https://baidu.com/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("baidu.com", b.getHost()); a = "https://192.168.1/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("192.168.1", b.getHost()); a = "https://中文·o((⊙﹏⊙))o囖/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getHost()); a = "https://a.b.c.d.e.f/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a.b.c.d.e.f", b.getHost()); // host end //port begin a = "https://www.baidu.com:9090/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("9090", b.getPort()); a = "https://www.baidu.com:/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getPort()); a = "https://www.baidu.com/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getPort()); a = "https://www.baidu.com:kk/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("kk", b.getPort()); a = "https://www.baidu.com:中文·o((⊙﹏⊙))o囖/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getPort()); a = "https://www.baidu.com:中文·o((⊙﹏⊙))o囖"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getPort()); a = "https://www.baidu.com:中文·o((⊙﹏⊙))o囖///////"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getPort()); //port end @@ -86,109 +86,109 @@ public class RemoteEnvURLTest { //web begin a = "https://www.baidu.com:9090///"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getWeb()); a = "https://www.baidu.com:9090"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getWeb()); a = "https://www.baidu.com:9090/"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getWeb()); a = "https://www.baidu.com:9090///web///servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("web", b.getWeb()); a = "https://www.baidu.com:9090/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("web", b.getWeb()); a = "https://www.baidu.com:9090/中文·o((⊙﹏⊙))o囖/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getWeb()); a = "https://www.baidu.com:9090/web///servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("web", b.getWeb()); a = "https://www.baidu.com:9090///web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("web", b.getWeb()); //web end //servlet begin a = "https://www.baidu.com:9090///web////servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("servlet", b.getServlet()); a = "https://www.baidu.com:9090"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090/"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//web"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//web//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//web/"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//web//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com:9090//web/a/"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); a = "https://www.baidu.com:9090//web/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); a = "https://www.baidu.com:9090//web/a//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); a = "https://www.baidu.com:9090//web/中文·o((⊙﹏⊙))o囖//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("中文·o((⊙﹏⊙))o囖", b.getServlet()); a = "https://www.baidu.com//web//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("", b.getServlet()); a = "https://www.baidu.com//web/a/"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); a = "https://www.baidu.com//web/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); a = "https://www.baidu.com//web/a//"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); assertEquals("a", b.getServlet()); // servlet end //others begin a = "https://www.baidu.com/web/servlet/ahttps://www.baidu.com/web/servlet/a"; - b = new RemoteEnvURL(a); + b = new RemoteWorkspaceURL(a); Assert.assertTrue(b.getHttps()); assertEquals("www.baidu.com", b.getHost()); assertEquals("", b.getPort());