From ff271147c1f325967b4ce02ac00bebd08d1618f4 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 26 Jul 2018 10:24:30 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-9958=20=E5=8F=82=E8=80=83=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=88=AA=E5=9B=BE=EF=BC=8C=E7=82=B9=E5=A1=AB=E6=8A=A5?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=86=85=E7=BD=AEsql=E5=8F=B3=E8=BE=B9=E6=98=AF?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/frpane/LoadingBasicPane.java | 17 +++++++++++++---- .../fr/design/webattr/ReportWriteAttrPane.java | 12 ++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java index db89371fd5..f29707fd7b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java @@ -7,10 +7,14 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.general.Inter; +import com.fr.locale.InterProviderFactory; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; /** * @author richer @@ -23,6 +27,10 @@ public abstract class LoadingBasicPane extends BasicPane { private JProgressBar progressBar; public LoadingBasicPane() { initCards(); + initPane(); + } + + protected void initPane(){ new SwingWorker() { @Override @@ -42,13 +50,14 @@ public abstract class LoadingBasicPane extends BasicPane { } + private void initCards() { card = new CardLayout(); setLayout(card); JPanel loadingDisPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); String[] message = {"Loading","Please-Wait"}; String[] operator = {",","..."}; - UILabel loadingPane = new UILabel(Inter.getLocText(message,operator) , SwingConstants.CENTER); + UILabel loadingPane = new UILabel(InterProviderFactory.getProvider().getLocText(message,operator) , SwingConstants.CENTER); loadingDisPane.add(loadingPane, BorderLayout.CENTER); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java index 48a62660c3..62ce611e43 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java @@ -11,8 +11,11 @@ import com.fr.general.Inter; import com.fr.report.worksheet.WorkSheet; import com.fr.report.write.ReportWriteAttr; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; + public class ReportWriteAttrPane extends LoadingBasicPane { private SubmitVisitorListPane submiterListPane; @@ -25,6 +28,11 @@ public class ReportWriteAttrPane extends LoadingBasicPane { } public ReportWriteAttrPane(ElementCasePane ePane){ this.ePane = ePane; + super.initPane(); + } + + protected void initPane(){ + } @Override From fd2563bfe4bd603b577e56033d4cf5a0721e639d Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 26 Jul 2018 10:30:34 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/frpane/LoadingBasicPane.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java index 015e1c85aa..0633c14062 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPane.java @@ -8,9 +8,13 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.LayoutUtils; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; -import javax.swing.*; -import java.awt.*; /** * @author richer @@ -23,6 +27,10 @@ public abstract class LoadingBasicPane extends BasicPane { private JProgressBar progressBar; public LoadingBasicPane() { initCards(); + initPane(); + } + + protected void initPane(){ new SwingWorker() { @Override @@ -42,6 +50,7 @@ public abstract class LoadingBasicPane extends BasicPane { } + private void initCards() { card = new CardLayout(); setLayout(card); From e0a4242f0cc057fdf995fcc754d49d94f878d580 Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 26 Jul 2018 11:45:20 +0800 Subject: [PATCH 03/14] =?UTF-8?q?CORE-116=20DataModel=E5=92=8CTableData?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=84=E8=8C=83=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 67 +------------------ 1 file changed, 1 insertion(+), 66 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 84335dd917..7082268d29 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -1,13 +1,9 @@ package com.fr.design.utils; import com.fr.base.BaseUtils; -import com.fr.base.EnvException; import com.fr.base.FRContext; import com.fr.base.FeedBackInfo; import com.fr.base.ServerConfig; -import com.fr.base.Utils; -import com.fr.base.remote.RemoteDeziConstants; -import com.fr.dav.DavXMLUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.DesignerEnvProcessor; @@ -17,8 +13,6 @@ import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; - -import com.fr.general.http.HttpClient; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.CodeUtils; @@ -32,16 +26,12 @@ import javax.swing.*; import java.awt.*; import java.io.BufferedReader; import java.io.BufferedWriter; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; import java.net.ServerSocket; import java.net.Socket; import java.net.URI; @@ -417,61 +407,6 @@ public class DesignUtils { * @throws Exception 异常 */ public static boolean sendFeedBack(FeedBackInfo feedBackInfo) throws Exception { - - ByteArrayOutputStream out = new ByteArrayOutputStream(); - - // 把tableData写成xml文件到out - DavXMLUtils.writeXMLFeedBackInfo(feedBackInfo, out); - InputStream input = postBytes2ServerB(out.toByteArray()); - return input != null; - - } - - - private static InputStream postBytes2ServerB(byte[] bytes) throws Exception { - HttpClient client = new HttpClient("http://114.215.175.35:8080/WebReport/product_advice.jsp"); - client.asGet(); - client.setContent(bytes); - return execute4InputStream(client); - } - - - /** - * execute method之后,取返回的inputstream - */ - private static ByteArrayInputStream execute4InputStream(HttpClient client) throws Exception { - int statusCode = client.getResponseCode(); - if (statusCode != HttpURLConnection.HTTP_OK) { - throw new EnvException("Method failed: " + statusCode); - } - InputStream in = client.getResponseStream(); - if (in == null) { - return null; - } - ByteArrayOutputStream out = new ByteArrayOutputStream(); - try { - Utils.copyBinaryTo(in, out); - - // 看一下传过来的byte[]是不是DesignProcessor.INVALID,如果是的话,就抛Exception - byte[] bytes = out.toByteArray(); - // carl:格式一致传中文 - String message = new String(bytes, EncodeConstants.ENCODING_UTF_8); - if (ComparatorUtils.equals(message, RemoteDeziConstants.NO_SUCH_RESOURCE)) { - return null; - } else if (ComparatorUtils.equals(message, RemoteDeziConstants.INVALID_USER)) { - throw new EnvException(RemoteDeziConstants.INVALID_USER); - } else if (ComparatorUtils.equals(message, RemoteDeziConstants.FILE_LOCKED)) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("FR-Designer_file-is-locked")); - return null; - } else if (message.startsWith(RemoteDeziConstants.RUNTIME_ERROR_PREFIX)) { - } - return new ByteArrayInputStream(bytes); - } finally { - in.close(); - out.close(); - client.release(); - } + return true; } - - } From 4d2296b607ec889b5e9bbaf05612a16519c906fc Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 26 Jul 2018 12:49:05 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/webattr/ReportWriteAttrPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java index 3b442b33ad..ab7aab51c2 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java @@ -28,9 +28,11 @@ public class ReportWriteAttrPane extends LoadingBasicPane { } public ReportWriteAttrPane(ElementCasePane ePane){ this.ePane = ePane; + //REPORT-9958 这边需要赋值后再初始化面板 super.initPane(); } + @Override protected void initPane(){ } From d31ce253360f95366d8805fd8316160b7a9cba4a Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 26 Jul 2018 13:50:42 +0800 Subject: [PATCH 05/14] =?UTF-8?q?REPORT-10066=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=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 06/14] . --- 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 07/14] . --- .../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()); From 4a0bb32a04227e1bff56876e1b0af3638a3b8fa2 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 26 Jul 2018 15:27:07 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-9407=20=E3=80=9010.0=E4=B8=80?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=97=B6alphafine=E6=90=9C=E7=B4=A2=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/impl/FileSearchManager.java | 187 ++++-------------- 1 file changed, 34 insertions(+), 153 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index ea32a4427a..b3aa48d188 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.base.FRContext; +import com.fr.base.extension.FileExtension; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; @@ -11,21 +12,11 @@ import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; - +import com.fr.general.Inter; import com.fr.json.JSONObject; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.workspace.WorkContext; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; /** * Created by XiaXiang on 2017/3/27. @@ -40,7 +31,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { private SearchResult lessModelList; private SearchResult moreModelList; private String searchText; - private List fileNodes = null; + private FileNode[] fileNodes = null; //停止搜索 private boolean stopSearch = false; //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 @@ -58,9 +49,6 @@ public class FileSearchManager implements AlphaFineSearchProvider { return instance; } - public synchronized static void init() { - - } /** * 根据文件路径获取文件模型 @@ -81,55 +69,55 @@ public class FileSearchManager implements AlphaFineSearchProvider { this.moreModelList = new SearchResult(); this.searchText = dealWithSearchText(searchText); if (StringUtils.isBlank(this.searchText) || ComparatorUtils.equals(this.searchText, DS_NAME)) { - lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"))); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates"))); return lessModelList; } - fileNodes = new ArrayList<>(); - fileNodes = listTpl(ProjectConstants.REPORTLETS_NAME, true); AlphaFineHelper.checkCancel(); + fileNodes = FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); isContainCpt = true; isContainFrm = true; - doSearch(this.searchText, true); - if (stopSearch) { - lessModelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); - lessModelList.addAll(filterModelList.subList(0, AlphaFineConstants.SHOW_SIZE)); - stopSearch = false; - return this.lessModelList; - } + doSearch(this.searchText); if (filterModelList.isEmpty()) { return new SearchResult(); + } else if (filterModelList.size() < AlphaFineConstants.SHOW_SIZE + 1) { + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); + lessModelList.addAll(filterModelList); + } else { + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); + lessModelList.addAll(filterModelList.subList(0, AlphaFineConstants.SHOW_SIZE)); + moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size())); + } - lessModelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_AlphaFine_ShowAll"), false, CellType.FILE)); - lessModelList.addAll(filterModelList); return lessModelList; } @Override public SearchResult getMoreSearchResult(String searchText) { - if (moreModelList != null && !moreModelList.isEmpty()) { - return moreModelList; - } - this.filterModelList = new SearchResult(); - this.moreModelList = new SearchResult(); - AlphaFineHelper.checkCancel(); - isContainCpt = true; - isContainFrm = true; - doSearch(this.searchText, false); - moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size())); return moreModelList; } - private void doSearch(String searchText, boolean needMore) { - for (FileNode node : fileNodes) { - boolean isAlreadyContain = false; - isAlreadyContain = searchFile(searchText, node, isAlreadyContain, needMore); - if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent() && node.getLock() == null) { - searchFileContent(searchText, node, isAlreadyContain, needMore); + private void doSearch(String searchText) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) { + for (FileNode node : fileNodes) { + if (node.getName().toLowerCase().contains(searchText)) { + FileModel model = new FileModel(node.getName(), node.getEnvPath()); + if (!AlphaFineHelper.getFilterResult().contains(model)) { + AlphaFineHelper.checkCancel(); + filterModelList.add(model); + } + } + } - if (filterModelList.size() > AlphaFineConstants.SHOW_SIZE && stopSearch) { - return; + } + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { + FileNode[] fileNodes = FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); + for (FileNode node : fileNodes) { + FileModel model = new FileModel(node.getName(), node.getEnvPath()); + if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { + AlphaFineHelper.checkCancel(); + filterModelList.add(model); + } } - } } @@ -144,113 +132,6 @@ public class FileSearchManager implements AlphaFineSearchProvider { return searchText; } - /** - * 搜索文件内容 - * - * @param searchText - * @param node - * @param isAlreadyContain - */ - private void searchFileContent(String searchText, FileNode node, boolean isAlreadyContain, boolean needMore) { - try { - InputStream inputStream = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, node.getEnvPath().substring(ProjectConstants.REPORTLETS_NAME.length() + 1)))); - InputStreamReader isr = new InputStreamReader(inputStream, "UTF-8"); - BufferedReader reader = new BufferedReader(isr); - String line; - int columnNumber; - boolean isFoundInContent = false; - while ((line = reader.readLine()) != null) { - columnNumber = line.toLowerCase().indexOf(searchText); - if (columnNumber != -1) { - isFoundInContent = true; - break; - } - } - if (isFoundInContent && !isAlreadyContain) { - FileModel model = new FileModel(node.getName(), node.getEnvPath()); - if (!AlphaFineHelper.getFilterResult().contains(model)) { - AlphaFineHelper.checkCancel(); - filterModelList.add(model); - } - if (this.filterModelList.size() > AlphaFineConstants.SHOW_SIZE && needMore) { - stopSearch = true; - } - } - isr.close(); - reader.close(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error("file read error: " + e.getMessage()); - } - } - - /** - * 搜索模板 - * - * @param searchText - * @param node - * @param isAlreadyContain - * @return - */ - private boolean searchFile(String searchText, FileNode node, boolean isAlreadyContain, boolean needMore) { - if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) { - if (node.getName().toLowerCase().contains(searchText)) { - FileModel model = new FileModel(node.getName(), node.getEnvPath()); - if (!AlphaFineHelper.getFilterResult().contains(model)) { - AlphaFineHelper.checkCancel(); - filterModelList.add(model); - } - if (filterModelList.size() > AlphaFineConstants.SHOW_SIZE && needMore) { - stopSearch = true; - } - isAlreadyContain = true; - } - } - return isAlreadyContain; - } - - /** - * 获取工作目录下所有符合要求的模板 - * - * @param rootFilePath - * @param recurse - * @return - */ - private List listTpl(String rootFilePath, boolean recurse) { - List fileNodeList = new ArrayList(); - try { - listAll(rootFilePath, fileNodeList, recurse); - } catch (Exception e) { - FRContext.getLogger().error("file search error: " + e.getMessage(), e); - } - return fileNodeList; - } - - /** - * 获取当前工作目录下所有模板 - * - * @param rootFilePath - * @param nodeList - * @param recurse - * @throws Exception - */ - private void listAll(String rootFilePath, List nodeList, boolean recurse) throws Exception { - - FileNode[] fns = FRContext.getFileNodes().list(rootFilePath); - for (int i = 0; i < fns.length; i++) { - FileNode fileNode = fns[i]; - if (fileNode.isDirectory()) { - if (recurse) { - listAll(rootFilePath + File.separator + fns[i].getName(), nodeList, true); - } else { - nodeList.add(fns[i]); - } - } else if (isContainCpt && fileNode.isFileType("cpt")) { - nodeList.add(fileNode); - } else if (isContainFrm && fileNode.isFileType("frm")) { - nodeList.add(fileNode); - } - } - } /** * 是否包含cpt From 3a202903cc2ee3e36119ce243693e1b3a8eda81a Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 26 Jul 2018 17:37:50 +0800 Subject: [PATCH 09/14] =?UTF-8?q?REPORT-7941=20=E5=AD=90=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9C=89=E5=85=A8=E9=83=A8=E6=9D=83=E9=99=90=E7=88=B6=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E9=83=A8=E5=88=86=E6=9D=83=E9=99=90=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/TemplateFileTree.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index 70f29e48eb..4ac6141c7e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -222,22 +222,18 @@ public class TemplateFileTree extends EnvFileTree { String fileName = fileNode.getEnvPath(); String[] auPaths = auPath.split(CoreConstants.SEPARATOR); String[] nodePaths = fileName.split(CoreConstants.SEPARATOR); - - if (auPaths.length == nodePaths.length) { + // 待判断目录是有权限目录或者有权限目录的子目录,全部权限 + if (auPaths.length <= nodePaths.length) { for (int i = 0; i < auPaths.length; i++) { if (!auPaths[i].equals(nodePaths[i])) { return false; } } return fileNode.isDirectory(); - } else { - int len = Math.min(auPaths.length, nodePaths.length); - for (int i = 0; i < len; i++) { - if (!auPaths[i].equals(nodePaths[i])) { - return false; - } - } - return true; + } + // 其他情况半权限 + else { + return false; } } From b5a17d313e4cc0d49784db7aef8d9e9b3ce68a8f Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 26 Jul 2018 19:10:18 +0800 Subject: [PATCH 10/14] rt --- .../alphafine/search/manager/impl/FileSearchManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index b3aa48d188..0c2ac63aee 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -14,6 +14,7 @@ import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.json.JSONObject; +import com.fr.locale.InterProviderFactory; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -33,7 +34,6 @@ public class FileSearchManager implements AlphaFineSearchProvider { private String searchText; private FileNode[] fileNodes = null; //停止搜索 - private boolean stopSearch = false; //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 private boolean isContainCpt = true; private boolean isContainFrm = true; @@ -80,10 +80,10 @@ public class FileSearchManager implements AlphaFineSearchProvider { if (filterModelList.isEmpty()) { return new SearchResult(); } else if (filterModelList.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); + lessModelList.add(0, new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"))); lessModelList.addAll(filterModelList); } else { - lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); + lessModelList.add(0, new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); lessModelList.addAll(filterModelList.subList(0, AlphaFineConstants.SHOW_SIZE)); moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size())); From 3871b1d1031a7f140541da268dbd8b2030fae765 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 26 Jul 2018 19:27:23 +0800 Subject: [PATCH 11/14] rt --- .../alphafine/search/manager/impl/FileSearchManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 0c2ac63aee..c2b5aa5470 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -33,6 +33,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { private SearchResult moreModelList; private String searchText; private FileNode[] fileNodes = null; + //停止搜索 //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 private boolean isContainCpt = true; @@ -69,7 +70,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { this.moreModelList = new SearchResult(); this.searchText = dealWithSearchText(searchText); if (StringUtils.isBlank(this.searchText) || ComparatorUtils.equals(this.searchText, DS_NAME)) { - lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates"))); + lessModelList.add(new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"))); return lessModelList; } AlphaFineHelper.checkCancel(); From 55a6f0a622c113446f00574dd17f91530189a027 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 26 Jul 2018 19:57:18 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/FileSearchManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index c2b5aa5470..5262046a8d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -12,9 +12,7 @@ import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; -import com.fr.general.Inter; import com.fr.json.JSONObject; -import com.fr.locale.InterProviderFactory; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -33,7 +31,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { private SearchResult moreModelList; private String searchText; private FileNode[] fileNodes = null; - + //停止搜索 //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 private boolean isContainCpt = true; @@ -70,7 +68,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { this.moreModelList = new SearchResult(); this.searchText = dealWithSearchText(searchText); if (StringUtils.isBlank(this.searchText) || ComparatorUtils.equals(this.searchText, DS_NAME)) { - lessModelList.add(new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"))); + lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"))); return lessModelList; } AlphaFineHelper.checkCancel(); @@ -81,10 +79,10 @@ public class FileSearchManager implements AlphaFineSearchProvider { if (filterModelList.isEmpty()) { return new SearchResult(); } else if (filterModelList.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"))); + lessModelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"))); lessModelList.addAll(filterModelList); } else { - lessModelList.add(0, new MoreModel(InterProviderFactory.getProvider().getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); + lessModelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Templates"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); lessModelList.addAll(filterModelList.subList(0, AlphaFineConstants.SHOW_SIZE)); moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size())); From 2f4dd467b099fcac9a94c4999884d3bdf2e79732 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 27 Jul 2018 10:27:44 +0800 Subject: [PATCH 13/14] =?UTF-8?q?CORE-116=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/TableDataPaneListPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 75f318208f..d5e52586d1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -103,7 +103,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } private boolean isIncludeUnderline(String name) { - return ComparatorUtils.equals(name.indexOf(StoreProcedureAssist.GROUP_MARKER), -1) ? false : true; + return name.contains(StoreProcedureAssist.GROUP_MARKER); } /** From 73eab99c2c2fb514e588dd27925a010e5c3c29f9 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 27 Jul 2018 11:43:56 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-9133=20=E5=A1=AB=E6=8A=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/controlpane/ObjectJControlPane.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java index 05d7019d1c..2fd680a9c5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java @@ -23,7 +23,10 @@ public abstract class ObjectJControlPane extends JListControlPane { @Override protected BasicBeanPane createPaneByCreators(NameableCreator creator) { - return Reflect.on(creator.getUpdatePane()).create(object).get(); + try { + return Reflect.on(creator.getUpdatePane()).create(object).get(); + } catch (Exception e) { + return super.createPaneByCreators(creator); + } } - } \ No newline at end of file