Browse Source

REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 完善部分代码+屏蔽frm入口

mss/2.0
Destiny.Lin 4 months ago
parent
commit
e4a1d49870
  1. 4
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 17
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  3. 35
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  4. 3
      designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java
  5. 4
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java

4
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -1,5 +1,6 @@
package com.fr.design.actions.file;
import com.fanruan.workplace.http.HttpConstants;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.i18n.Toolkit;
@ -158,7 +159,8 @@ public final class WebPreviewUtils {
DesignUtils.visitEnvServerByParameters(
baseRoute,
parameterNameList.toArray(new String[0]),
parameterValueList.toArray(new String[0])
parameterValueList.toArray(new String[0]),
HttpConstants.FR
);
} else {
int selVal = showConfirmDialog(

17
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -405,6 +405,16 @@ public class DesignUtils {
* @param values 参数值
*/
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values) {
visitEnvServerByParameters(baseRoute, names, values, HttpConstants.PUBLIC);
}
/**
* 访问服务器环境
*
* @param names 参数名字
* @param values 参数值
*/
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values, String serverType) {
int len = Math.min(ArrayUtils.getLength(names), ArrayUtils.getLength(values));
String[] nameValuePairs = new String[len];
for (int i = 0; i < len; i++) {
@ -417,10 +427,9 @@ public class DesignUtils {
"=" + CommonCodeUtils.encodeURIComponent(CommonCodeUtils.encodeURIComponent(value));
}
String postfixOfUri = (nameValuePairs.length > 0 ? "?" + StableUtils.join(nameValuePairs, "&") : StringUtils.EMPTY);
if (!WorkContext.getCurrent().isLocal()) {
try {
String urlPath = getWebBrowserPath();
String urlPath = getWebBrowserPath(serverType);
Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri));
} catch (Exception e) {
FineLoggerFactory.getLogger().error("cannot open the url Successful", e);
@ -437,8 +446,8 @@ public class DesignUtils {
}
}
private static String getWebBrowserPath() {
String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC;
private static String getWebBrowserPath(String serverPath) {
String urlPath = WorkContext.getCurrent().getPath() + serverPath;
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
if (processor != null) {
//cas访问的时候, url要处理下.

35
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -113,23 +113,24 @@ public class VersionCheckUtils {
}
public static void showVersionCheckDialog(String envName) {
new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() {
return !VersionCheckUtils.versionCheck(envName);
}
@Override
protected void done() {
try {
if (get()) {
showNotificationDialog(envName);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().warn(e.getMessage(), e);
}
}
}.execute();
/// 环境检测类都先屏蔽
// new SwingWorker<Boolean, Void>() {
// @Override
// protected Boolean doInBackground() {
// return !VersionCheckUtils.versionCheck(envName);
// }
//
// @Override
// protected void done() {
// try {
// if (get()) {
// showNotificationDialog(envName);
// }
// } catch (Exception e) {
// FineLoggerFactory.getLogger().warn(e.getMessage(), e);
// }
// }
// }.execute();
}
private static void showNotificationDialog(String envName) {

3
designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java

@ -2,6 +2,7 @@ package com.fr.start.server;
import com.fanruan.carina.Carina;
import com.fr.event.EventDispatcher;
import com.fr.workspace.WorkContext;
/**
* Created by juhaoyu on 2018/6/6.
@ -38,7 +39,7 @@ public abstract class FineEmbedServer {
public static boolean isRunning() {
return Carina.partition("fine_report") != null && Carina.partition("fine_report").getReady();
return (Carina.partition("fine_report") != null && Carina.partition("fine_report").getReady()) || !WorkContext.getCurrent().isLocal();
}
public static boolean isOnStarting() {

4
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java vendored

@ -455,8 +455,8 @@ public class DesignComponent {
private static void formDesignerRegister() {
StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance());
DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
/// REPORT-127453 屏蔽frm入口
// DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class);
DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class);
DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);

Loading…
Cancel
Save