ju 6 years ago
parent
commit
63b215df84
  1. 5
      designer-base/src/com/fr/design/DesignerEnvManager.java
  2. 32
      designer-base/src/com/fr/design/actions/file/LocalePane.java
  3. 2
      designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  4. 3
      designer-base/src/com/fr/design/data/BasicTableDataTreePane.java
  5. 3
      designer-base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  6. 2
      designer-base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java
  7. 2
      designer-base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureManagerPane.java
  8. 2
      designer-base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java
  9. 4
      designer-base/src/com/fr/design/extra/WebViewDlgHelper.java
  10. 2
      designer-base/src/com/fr/design/file/TemplateTreePane.java
  11. 6
      designer-base/src/com/fr/design/formula/FunctionManagerPane.java
  12. 3
      designer-base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java
  13. 10
      designer-base/src/com/fr/design/gui/itree/filetree/FileNodeComparator.java
  14. 2
      designer-base/src/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  15. 4
      designer-base/src/com/fr/design/mainframe/DesignerFrame.java
  16. 2
      designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  17. 2
      designer-base/src/com/fr/design/mainframe/JTemplate.java
  18. 4
      designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  19. 2
      designer-base/src/com/fr/design/parameter/ParameterManagerPane.java
  20. 74
      designer-base/src/com/fr/design/remote/action/RemoteDesignAuthorityManagerAction.java
  21. 8
      designer-base/src/com/fr/design/utils/DesignUtils.java
  22. 16
      designer-base/src/com/fr/file/FILEChooserPane.java
  23. 8
      designer-base/src/com/fr/file/FILEFactory.java
  24. 14
      designer-base/src/com/fr/file/FileNodeFILE.java
  25. 6
      designer-base/src/com/fr/start/server/FineEmbedServerActivator.java
  26. 18
      designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java
  27. 2
      designer-realize/src/com/fr/design/actions/server/StyleManagerPane.java
  28. 3
      designer-realize/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  29. 2
      designer-realize/src/com/fr/design/mainframe/JWorkBook.java
  30. 16
      designer-realize/src/com/fr/design/report/share/ShareButton.java
  31. 2
      designer-realize/src/com/fr/design/webattr/EditReportServerParameterPane.java
  32. 2
      designer-realize/src/com/fr/design/webattr/WidgetManagerPane.java
  33. 15
      designer-realize/src/com/fr/start/Designer.java

5
designer-base/src/com/fr/design/DesignerEnvManager.java

@ -190,9 +190,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return;
}
String installHome = StableUtils.getInstallHome();
if (installHome != null && !".".equals(installHome)) {
if (installHome != null) {
String name = Inter.getLocText("FR-Engine_DEFAULT");
String envPath = StableUtils.pathJoin(new String[]{installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME});
// String envPath = StableUtils.pathJoin(new String[]{installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME});
String envPath = "/Users/juhaoyu/finereport/finereport-maven/env/webroot/WEB-INF";
designerEnvManager.putEnv(name, DesignerWorkspaceInfo.createLocal(name, envPath));
designerEnvManager.setCurEnvName(name);
}

32
designer-base/src/com/fr/design/actions/file/LocalePane.java

@ -10,9 +10,9 @@ import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode;
import com.fr.general.Env;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.bridge.StableFactory;
@ -27,6 +27,7 @@ import javax.swing.table.TableRowSorter;
import java.awt.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -205,8 +206,8 @@ public class LocalePane extends BasicPane {
for (String key : sortKeys) {
Vector<String> vector = new Vector<String>();
vector.add(key);
for (int i = 0; i < list.size(); i ++) {
vector.add(list.get(i).getProperty(key));
for (Properties aList : list) {
vector.add(aList.getProperty(key));
}
customTableModel.addRow(vector);
}
@ -218,8 +219,7 @@ public class LocalePane extends BasicPane {
*/
public void save() {
Env env = FRContext.getCurrentEnv();
if (env == null) {
if (WorkContext.getCurrent() == null) {
return;
}
if (customTable.getCellEditor() == null) {
@ -232,17 +232,17 @@ public class LocalePane extends BasicPane {
for (int j = 0, rowCount = customTableModel.getRowCount(); j < rowCount; j ++) {
properties.setProperty(GeneralUtils.objectToString(customTableModel.getValueAt(j, 0)), GeneralUtils.objectToString(customTableModel.getValueAt(j, i)));
}
// OutputStream out = null;
// try {
// out = env.writeBean(PREFIX + fileName + ".properties", ProjectConstants.LOCALE_NAME);
// properties.store(out, null);
//
// out.flush();
// out.close();
// } catch (Exception e) {
// FineLoggerFactory.getLogger().info(e.getMessage());
// }
OutputStream out = null;
try {
out = FRContext.getCommonOperator().writeBean(PREFIX + fileName + ".properties", ProjectConstants.LOCALE_NAME);
properties.store(out, null);
out.flush();
out.close();
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}
}
}

2
designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -75,7 +75,7 @@ public class AlphaFineConfigManager implements XMLable {
public static boolean isALPHALicAvailable() {
return FRContext.getCurrentEnv() != null && VT4FR.AlphaFine.isSupport();
return FRContext.getCommonOperator() != null && VT4FR.AlphaFine.isSupport();
}
@Override

3
designer-base/src/com/fr/design/data/BasicTableDataTreePane.java

@ -29,6 +29,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.event.CellEditorListener;
@ -152,7 +153,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
protected void checkButtonEnabled(UpdateAction editAction, UpdateAction previewTableDataAction, UpdateAction removeAction, TableDataSourceOP op, TableDataTree dataTree) {
// august:BUG 9344
addMenuDef.setEnabled(true);
connectionTableAction.setEnabled(FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot());
connectionTableAction.setEnabled(WorkContext.getCurrent() != null && WorkContext.getCurrent().isRoot());
if (op == null || op.interceptButtonEnabled()) {
addMenuDef.setEnabled(false);
editAction.setEnabled(false);

3
designer-base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -15,6 +15,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.event.ItemEvent;
@ -127,7 +128,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
* @param connection 数据库链接
*/
public void populate(Connection connection) {
editButton.setEnabled(FRContext.getCurrentEnv().isRoot());
editButton.setEnabled(WorkContext.getCurrent().isRoot());
if (connection instanceof NameDatabaseConnection) {
this.setSelectedItem(((NameDatabaseConnection) connection).getName());
} else {

2
designer-base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -46,7 +46,7 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
}
public void populate(ConnectionConfig datasourceManager) {
// this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// this.connectionTextField.setText(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager);
}

2
designer-base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureManagerPane.java

@ -37,7 +37,7 @@ public class ProcedureManagerPane extends LoadingBasicPane {
public void populate(ProcedureConfig procedureConfig) {
//todo 原来界面上显示的xml路径
// this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// this.connectionTextField.setText(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.procedureListPane.populate(procedureConfig);
}

2
designer-base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java

@ -76,7 +76,7 @@ public class TableDataManagerPane extends LoadingBasicPane {
public void populate(TableDataConfig tableDataConfig) {
//todo 原来界面上显示的xml路径
// this.tableDataTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// this.tableDataTextField.setText(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
// + File.separator + datasourceManager.fileName());
this.tableDataPane.populate(tableDataConfig);
}

4
designer-base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -44,7 +44,7 @@ public class WebViewDlgHelper {
private static final String LATEST = "latest";
private static final String SHOP_SCRIPTS = "shop_scripts";
private static final int VERSION_8 = 8;
private static String installHome = FRContext.getCurrentEnv().getWebReportPath();
private static String installHome = FRContext.getCommonOperator().getWebReportPath();
private static final String MAIN_JS_PATH = "/scripts/plugin.html";
private static final String ENV_VERSION = "ENV_VERSION";
@ -52,7 +52,7 @@ public class WebViewDlgHelper {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override
public void envChanged() {
installHome = FRContext.getCurrentEnv().getWebReportPath();
installHome = FRContext.getCommonOperator().getWebReportPath();
}
});
}

2
designer-base/src/com/fr/design/file/TemplateTreePane.java

@ -98,7 +98,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
* 刷新
*/
public void refreshDockingView() {
reportletsTree.setFileNodeFilter(new IOFileNodeFilter(FRContext.getCurrentEnv().getSupportedTypes()));
reportletsTree.setFileNodeFilter(new IOFileNodeFilter(FRContext.getFileOperator().getSupportedTypes()));
reportletsTree.refreshEnv();
}

6
designer-base/src/com/fr/design/formula/FunctionManagerPane.java

@ -1,6 +1,5 @@
package com.fr.design.formula;
import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane;
import com.fr.design.dialog.BasicDialog;
@ -22,6 +21,7 @@ import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.script.FunctionDef;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
@ -64,7 +64,7 @@ public class FunctionManagerPane extends BasicPane {
*/
public void populate(FunctionConfig functionManager) {
//todo 原来界面上显示的xml路径
// this.functionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator
// this.functionTextField.setText(WorkContext.getCurrent().getPath() + File.separator
// + ProjectConstants.RESOURCES_NAME
// + File.separator + functionManager.fileName());
@ -162,7 +162,7 @@ public class FunctionManagerPane extends BasicPane {
northPane.add(descriptionArea);
String path1 = getEscapePath(File.separator + ProjectConstants.WEBINF_NAME + File.separator + ProjectConstants.CLASSES_NAME);
String path2 = getEscapePath(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.CLASSES_NAME);
String path2 = getEscapePath(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.CLASSES_NAME);
descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", path1, path2));
JPanel descriptionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //Description Pane

3
designer-base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java

@ -11,6 +11,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;
@ -189,7 +190,7 @@ public class EnvFileTree extends RefreshableJTree {
FileNode[] res_fns = null;
try {
res_fns = FRContext.getCurrentEnv() == null ? new FileNode[0] : FRContext.getFileOperator().list(filePath);
res_fns = WorkContext.getCurrent() == null ? new FileNode[0] : FRContext.getFileOperator().list(filePath);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}

10
designer-base/src/com/fr/design/gui/itree/filetree/FileNodeComparator.java

@ -1,7 +1,7 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.operator.file.LocalFileOperator;
import com.fr.file.filetree.FileNode;
import com.fr.general.adaptor.WorkspaceAdaptor;
import java.util.Comparator;
@ -59,13 +59,13 @@ public class FileNodeComparator implements Comparator<FileNode> {
private int groupByFileType(FileNode nameNode1, FileNode nameNode2,
int i) {
if (i < WorkspaceAdaptor.FILE_TYPE.length) {
if (nameNode1.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
if (nameNode2.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
if (i < LocalFileOperator.FILE_TYPE.length) {
if (nameNode1.isFileType(LocalFileOperator.FILE_TYPE[i]))
if (nameNode2.isFileType(LocalFileOperator.FILE_TYPE[i]))
return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase());
else
return-1;
else if (nameNode2.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
else if (nameNode2.isFileType(LocalFileOperator.FILE_TYPE[i]))
return 1;
else{
return groupByFileType(nameNode1, nameNode2, i+1);

2
designer-base/src/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -115,7 +115,7 @@ public class FileTreeIcon {
}
public static Icon getIcon(FileNode node, boolean isShowLock) {
String path = StableUtils.pathJoin(new String[]{FRContext.getCurrentEnv().getPath(), node.getEnvPath()});
String path = StableUtils.pathJoin(new String[]{WorkContext.getCurrent().getPath(), node.getEnvPath()});
if (WorkContext.getCurrent().isLocal()) {
File ff = new File(path);
if (ff.exists()) {

4
designer-base/src/com/fr/design/mainframe/DesignerFrame.java

@ -837,8 +837,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void openTemplate(FILE tplFile) {
// 测试连接,如果连接失败,则提示
try {
if (FRContext.getCurrentEnv() != null
&& !FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) {
if (FRContext.getCommonOperator() != null
&& !FRContext.getCommonOperator().testServerConnectionWithOutShowMessagePane()) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"FR-Chart-Server_disconnected", "FR-Server-Design_template_unopened"}, new String[]{

2
designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -265,7 +265,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
@Override
public void stateChange() {
//当前环境为远程环境时
if (FRContext.getCurrentEnv() != null) {
if (FRContext.getCommonOperator() != null) {
//当前环境为本地环境时
if (selectedOperation.getSelectedTemplatePath() != null) {
openReportAction.setEnabled(true);

2
designer-base/src/com/fr/design/mainframe/JTemplate.java

@ -525,7 +525,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
//检查一下连接是否成功
try {
if (FRContext.getCurrentEnv() != null && !FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) {
if (FRContext.getCommonOperator() != null && !FRContext.getCommonOperator().testServerConnectionWithOutShowMessagePane()) {
//连接不成功,提示
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"server_disconnected", "template_unsaved"}, new String[]{",", "!"})

4
designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -217,7 +217,7 @@ public abstract class ToolBarMenuDock {
menuList.addAll(Arrays.asList(menuDefs));
// 添加服务器菜单
if (FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot()) {
if (WorkContext.getCurrent() != null && WorkContext.getCurrent().isRoot()) {
menuList.add(createServerMenuDef(plus));
}
@ -435,7 +435,7 @@ public abstract class ToolBarMenuDock {
private boolean shouldShowRemotePermission() {
return WorkContext.getCurrent() != null && !WorkContext.getCurrent().isLocal() && FRContext.getCurrentEnv().isRoot();
return WorkContext.getCurrent() != null && !WorkContext.getCurrent().isLocal() && WorkContext.getCurrent().isRoot();
}
private boolean shouldShowPlugin() {

2
designer-base/src/com/fr/design/parameter/ParameterManagerPane.java

@ -39,7 +39,7 @@ public class ParameterManagerPane extends BasicPane {
public void populate(Parameter[] parameters) {
//todo 原来界面上显示的xml路径
// this.parameterTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// this.parameterTextField.setText(WorkContext.getCurrent().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName());
this.parameterArrayPane.populate(parameters);

74
designer-base/src/com/fr/design/remote/action/RemoteDesignAuthorityManagerAction.java

@ -3,9 +3,14 @@ package com.fr.design.remote.action;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.remote.ui.AuthorityManagerPane;
import com.fr.env.operator.authority.AuthorityOperator;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.report.DesignAuthority;
import com.fr.workspace.WorkContext;
import java.awt.event.ActionEvent;
@ -27,39 +32,42 @@ public class RemoteDesignAuthorityManagerAction extends UpdateAction {
final AuthorityManagerPane managerPane = new AuthorityManagerPane();
BasicDialog dialog = managerPane.showWindow(DesignerContext.getDesignerFrame());
// if (!FRContext.getCurrentEnv().isLocalEnv()) {
// try {
// // 远程设计获取全部设计成员的权限列表
// DesignAuthority[] authorities = EnvProxy.get(AuthorityOperator.class).getAuthorities();
// if (authorities != null && authorities.length != 0) {
// managerPane.populate(authorities);
// }
// } catch (Exception exception) {
// FineLoggerFactory.getLogger().error(exception.getMessage(), exception);
// }
// }
//
// dialog.addDialogActionListener(new DialogActionAdapter() {
// @Override
// public void doOk() {
// DesignAuthority[] authorities = managerPane.update();
// if (!FRContext.getCurrentEnv().isLocalEnv()) {
// boolean success = false;
// try {
// success = EnvProxy.get(AuthorityOperator.class).updateAuthorities(authorities);
// } catch (Exception e) {
// FineLoggerFactory.getLogger().error(e.getMessage(), e);
// }
// FRContext.getLogger().info("update remote design authority: " + success);
// }
// }
//
// @Override
// public void doCancel() {
// super.doCancel();
// }
// });
if (!WorkContext.getCurrent().isLocal()) {
try {
// 远程设计获取全部设计成员的权限列表
DesignAuthority[] authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities();
if (authorities != null && authorities.length != 0) {
managerPane.populate(authorities);
}
} catch (Exception exception) {
FineLoggerFactory.getLogger().error(exception.getMessage(), exception);
}
}
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
DesignAuthority[] authorities = managerPane.update();
if (!WorkContext.getCurrent().isLocal()) {
boolean success = false;
try {
success = WorkContext.getCurrent().get(AuthorityOperator.class).updateAuthorities(authorities);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
FineLoggerFactory.getLogger().info("update remote design authority: " + success);
}
}
@Override
public void doCancel() {
super.doCancel();
}
});
dialog.setModal(true);
dialog.setVisible(true);
}

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

@ -304,12 +304,12 @@ public class DesignUtils {
try {
if (Utils.isEmbeddedParameter(postfixOfUri)) {
String time = Calendar.getInstance().getTime().toString().replaceAll(" ", "");
// boolean isUserPrivilege = FRContext.getCurrentEnv()).writePrivilegeMap(time, postfixOfUri);
// boolean isUserPrivilege = FRContext.getCommonOperator()).writePrivilegeMap(time, postfixOfUri);
boolean isUserPrivilege = false;
postfixOfUri = isUserPrivilege ? postfixOfUri + "&fr_check_url=" + time + "&id=" + FRContext.getCurrentEnv().getUserID() : postfixOfUri;
postfixOfUri = isUserPrivilege ? postfixOfUri + "&fr_check_url=" + time + "&id=" + FRContext.getCommonOperator().getUserID() : postfixOfUri;
}
// 加参数给远程设计校验权限。
String design = JwtUtils.createDefaultJWT(FRContext.getCurrentEnv().getUser());
String design = JwtUtils.createDefaultJWT(FRContext.getCommonOperator().getUser());
postfixOfUri = postfixOfUri + "&design=" + design;
String urlPath = getWebBrowserPath();
@ -331,7 +331,7 @@ public class DesignUtils {
}
private static String getWebBrowserPath() {
String urlPath = FRContext.getCurrentEnv().getPath();
String urlPath = WorkContext.getCurrent().getPath();
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
if (processor != null) {
//cas访问的时候, url要处理下.

16
designer-base/src/com/fr/file/FILEChooserPane.java

@ -3,6 +3,7 @@ package com.fr.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.base.operator.file.LocalFileOperator;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicPane;
@ -25,7 +26,6 @@ import com.fr.file.filter.FILEFilter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.adaptor.WorkspaceAdaptor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem;
@ -545,10 +545,10 @@ public class FILEChooserPane extends BasicPane {
return;
}
if (editing == null || !editing.isChartBook()) {
String[] fileSuffix_local = WorkspaceAdaptor.FILE_TYPE;
String[] fileSuffix_local = LocalFileOperator.FILE_TYPE;
EnumSet<FileExtension> fileExtensions = EnumSet.of(FileExtension.CPT, FileExtension.CPTX, FileExtension.FRM, FileExtension.FRMX, FileExtension.CHT);
if (type == JFileChooser.OPEN_DIALOG) {
if (FRContext.getCurrentEnv().isSupportLocalFileOperate()) { //本地连接
if (FRContext.getFileOperator().isSupportLocalFileOperate()) { //本地连接
this.addChooseFILEFilter(new ChooseFileFilter(fileSuffix_local, appName + Inter.getLocText(new String[]{"FR-App-Report_Template", "FR-App-All_File"})));
} else {
this.addChooseFILEFilter(new ChooseFileFilter(fileExtensions, appName + Inter.getLocText(new String[]{"FR-App-Report_Template", "FR-App-All_File"})));
@ -569,7 +569,7 @@ public class FILEChooserPane extends BasicPane {
}
// 添加 xls 文件类型过滤 kt
if (FRContext.getCurrentEnv().isSupportLocalFileOperate()) { //本地连接
if (FRContext.getFileOperator().isSupportLocalFileOperate()) { //本地连接
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.XLS, Inter.getLocText("Import-Excel_Source")));
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.XLSX, Inter.getLocText("Import-Excel2007_Source")));
}
@ -592,7 +592,7 @@ public class FILEChooserPane extends BasicPane {
for (FILEFilter aFilterList : filterList) {
defaultComboBoxModel.addElement(aFilterList);
}
if (FRContext.getCurrentEnv().isSupportLocalFileOperate()) { //本地连接
if (FRContext.getFileOperator().isSupportLocalFileOperate()) { //本地连接
if (!showWebReport) {
defaultComboBoxModel.addElement(Inter.getLocText("FR-Utils-App_AllFiles") + "(*.*)");
}
@ -786,10 +786,10 @@ public class FILEChooserPane extends BasicPane {
}
if (FILEChooserPane.this.showWebReport) {
// webReportFILE = new FileFILE(new
// File(FRContext.getCurrentEnv().getWebReportPath()));
webReportFILE = new FileNodeFILE(FRContext.getCurrentEnv().getWebReportPath());
// File(FRContext.getCommonOperator().getWebReportPath()));
webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebReportPath());
// String webReportPath =
// FRContext.getCurrentEnv().getWebReportPath();
// FRContext.getCommonOperator().getWebReportPath();
// String webReportParentPath = new
// File(webReportPath).getParent();
// webReportFILE = new FileNodeFILE(new FileNode("WebReport",

8
designer-base/src/com/fr/file/FILEFactory.java

@ -2,6 +2,7 @@ package com.fr.file;
import com.fr.base.FRContext;
import com.fr.file.filetree.FileNode;
import com.fr.workspace.WorkContext;
public class FILEFactory {
public static final String MEM_PREFIX = "mem://";
@ -18,7 +19,8 @@ public class FILEFactory {
* 也有可能就是一个普通的路径d:/foo/bar
*/
public static FILE createFILE(String path) {
String envPath = FRContext.getCurrentEnv().getPath().replaceAll("/", "\\\\");
String envPath = WorkContext.getCurrent().getPath().replaceAll("/", "\\\\");
if (path == null) {
return null;
} else if (path.startsWith(MEM_PREFIX)) {
@ -29,7 +31,7 @@ public class FILEFactory {
return new FileNodeFILE(new FileNode(path.substring(envPath.length() + 1), false));
} else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), false),
FRContext.getCurrentEnv().getWebReportPath());
FRContext.getCommonOperator().getWebReportPath());
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else {
@ -46,7 +48,7 @@ public class FILEFactory {
return new FileNodeFILE(new FileNode(path.substring(ENV_PREFIX.length()), true));
} else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), true),
FRContext.getCurrentEnv().getWebReportPath());
FRContext.getCommonOperator().getWebReportPath());
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else {

14
designer-base/src/com/fr/file/FileNodeFILE.java

@ -37,12 +37,12 @@ public class FileNodeFILE implements FILE {
this.node = new FileNode(StableUtils.pathJoin(new String[]{
parentDir, name
}), isDir);
this.envPath = FRContext.getCurrentEnv().getPath();
this.envPath = WorkContext.getCurrent().getPath();
}
public FileNodeFILE(FileNode node) {
this.node = node;
this.envPath = FRContext.getCurrentEnv().getPath();
this.envPath = WorkContext.getCurrent().getPath();
}
public FileNodeFILE(String envPath) {
@ -61,7 +61,7 @@ public class FileNodeFILE implements FILE {
* @return 返回后缀
*/
public String prefix() {
if (ComparatorUtils.equals(getEnvPath(), FRContext.getCurrentEnv().getWebReportPath())) {
if (ComparatorUtils.equals(getEnvPath(), FRContext.getCommonOperator().getWebReportPath())) {
return FILEFactory.WEBREPORT_PREFIX;
}
return FILEFactory.ENV_PREFIX;
@ -218,7 +218,7 @@ public class FileNodeFILE implements FILE {
}
try {
return FRContext.getCurrentEnv().fileLocked(node.getEnvPath());
return FRContext.getCommonOperator().fileLocked(node.getEnvPath());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
return false;
@ -253,7 +253,7 @@ public class FileNodeFILE implements FILE {
* @return 是报表当前环境返回true
*/
public boolean isCurrentEnv() {
return ComparatorUtils.equals(FRContext.getCurrentEnv().getPath(), envPath);
return ComparatorUtils.equals(WorkContext.getCurrent().getPath(), envPath);
}
/**
@ -313,7 +313,7 @@ public class FileNodeFILE implements FILE {
if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
return null;
}
return FRContext.getCurrentEnv().writeBean(
return FRContext.getCommonOperator().writeBean(
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1),
ProjectConstants.REPORTLETS_NAME
);
@ -335,7 +335,7 @@ public class FileNodeFILE implements FILE {
return;
}
FRContext.getCurrentEnv().unlockTemplate(
FRContext.getCommonOperator().unlockTemplate(
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1));
}

6
designer-base/src/com/fr/start/server/FineEmbedServerActivator.java

@ -2,13 +2,13 @@ package com.fr.start.server;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.event.EventDispatcher;
import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator;
import com.fr.module.ModuleRole;
import com.fr.startup.FineWebApplicationInitializer;
import com.fr.third.springframework.web.SpringServletContainerInitializer;
import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import com.fr.workspace.WorkContext;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
@ -55,8 +55,8 @@ public class FineEmbedServerActivator extends Activator {
tomcat = new Tomcat();
tomcat.setPort(DesignerEnvManager.getEnvManager().getEmbedServerPort());
String docBase = new File(FRContext.getCurrentEnv().getPath()).getParent();
String appName = "/" + FRContext.getCurrentEnv().getAppName();
String docBase = new File(WorkContext.getCurrent().getPath()).getParent();
String appName = "/" + FRContext.getCommonOperator().getAppName();
Context context = tomcat.addContext(appName, docBase);
addDefaultServlet(context);
//覆盖tomcat的WebAppClassLoader

18
designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -1,6 +1,5 @@
package com.fr.van.chart;
import com.fr.base.FRContext;
import com.fr.chart.base.ChartConstants;
import com.fr.design.RestartHelper;
import com.fr.design.extra.PluginConstants;
@ -12,16 +11,10 @@ import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Rectangle;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
@ -70,7 +63,8 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
}
public void addSiteInfo(String siteKind, String localDir, double megaBits) {
if (new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), localDir)).exists()) {
if (new File(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), localDir)).exists()) {
//本地有这个资源,不下载
return;
}
@ -145,7 +139,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
if (result) {
//安装文件
IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), siteInfo.localDir));
IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(WorkContext.getCurrent().getPath(), siteInfo.localDir));
}
} else {
result = false;

2
designer-realize/src/com/fr/design/actions/server/StyleManagerPane.java

@ -37,7 +37,7 @@ public class StyleManagerPane extends BasicPane {
public void populate(ServerPreferenceConfig configManager) {
//todo 原来界面上显示的xml路径
// this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// this.StyleTextField.setText(WorkContext.getCurrent().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + configManager.fileName());
this.styleArrayPane.populate(configManager);

3
designer-realize/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -23,6 +23,7 @@ import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.stable.ArrayUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
@ -182,7 +183,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
private void checkToolBarPaneEnable() {
List<ToolBarButton> toolBarButtons = toolBarPane.getToolBarButtons();
boolean isnotEnable = ComparatorUtils.equals(title.getText(), Inter.getLocText(new String[]{"Server", "ReportServerP-Toolbar", "Choose_Role"}))
&& !FRContext.getCurrentEnv().isRoot();
&& !WorkContext.getCurrent().isRoot();
for (ToolBarButton button : toolBarButtons) {
button.setEnabled(!isnotEnable);
}

2
designer-realize/src/com/fr/design/mainframe/JWorkBook.java

@ -1098,7 +1098,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
java.util.Map<String, Object> parameterMap = inputParameters(tpl);
try {
String fullPath = StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), newFile.getPath());
String fullPath = StableUtils.pathJoin(WorkContext.getCurrent().getPath(), newFile.getPath());
FileOutputStream fileOutputStream = new FileOutputStream(fullPath);
EmbeddedTableDataExporter exporter = new EmbeddedTableDataExporter();
exporter.export(fileOutputStream, (WorkBook) tpl, parameterMap);

16
designer-realize/src/com/fr/design/report/share/ShareButton.java

@ -23,11 +23,21 @@ import com.fr.general.SiteCenter;
import com.fr.io.exporter.ImageExporter;
import com.fr.main.TemplateWorkBook;
import com.fr.main.workbook.ResultWorkBook;
import com.fr.stable.*;
import com.fr.stable.ActorConstants;
import com.fr.stable.ActorFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.FileOutputStream;
import java.net.URI;
@ -84,7 +94,7 @@ public class ShareButton extends UIButton{
//获取默认导出图片位置
private String getImagePath(JTemplate<?, ?> jt){
FILE file = jt.getEditingFILE();
String envPath = FRContext.getCurrentEnv().getPath();
String envPath = WorkContext.getCurrent().getPath();
String folderPath = file.getParent().getPath();
String imageName = file.getName().replaceAll(ProjectConstants.CPT_SUFFIX, StringUtils.EMPTY) + ".png";

2
designer-realize/src/com/fr/design/webattr/EditReportServerParameterPane.java

@ -81,7 +81,7 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
public void populate(ServerPreferenceConfig reportServerPreferenceConfig) {
//todo 原来界面上显示的xml路径
// this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// this.configFileTextField.setText(WorkContext.getCurrent().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + reportServerPreferenceConfig.fileName());

2
designer-realize/src/com/fr/design/webattr/WidgetManagerPane.java

@ -42,7 +42,7 @@ public class WidgetManagerPane extends LoadingBasicPane {
public void populate(WidgetInfoConfig widgetManager) {
//todo 原来界面上显示的xml路径
// this.widgetTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// this.widgetTextField.setText(WorkContext.getCurrent().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + widgetManager.fileName());
this.widgetConfigPane.populate(widgetManager);

15
designer-realize/src/com/fr/start/Designer.java

@ -56,14 +56,9 @@ import com.fr.start.preload.ImagePreLoader;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.*;
import javax.swing.border.MatteBorder;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@ -182,14 +177,14 @@ public class Designer extends BaseDesigner {
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = super.createServerMenuDef(plus);
if (FRContext.getCurrentEnv() == null) {
if (WorkContext.getCurrent() == null) {
return menuDef;
}
if (!BaseUtils.isAuthorityEditing()) {
menuDef.addShortCut(SeparatorDef.DEFAULT);
if (FRContext.getCurrentEnv().isRoot()) {
if (WorkContext.getCurrent().isRoot()) {
menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction());
if (ActionFactory.getChartPreStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartPreStyleAction());

Loading…
Cancel
Save