|
|
|
@ -9,9 +9,6 @@ import com.fr.design.file.NodeAuthProcessor;
|
|
|
|
|
import com.fr.design.gui.itree.filetree.FileNodeComparator; |
|
|
|
|
import com.fr.design.gui.itree.filetree.FileTreeIcon; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.io.EncryptUtils; |
|
|
|
@ -20,11 +17,9 @@ import com.fr.stable.CoreConstants;
|
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
import com.fr.workspace.WorkspaceEvent; |
|
|
|
|
import com.fr.workspace.server.entity.WorkResourceTempRenameStream; |
|
|
|
|
import com.fanruan.entity.template.TemplateListBean; |
|
|
|
|
import com.fr.workspace.server.repository.system.WorkspaceSystemInfo; |
|
|
|
|
import com.fr.workspace.server.repository.WorkplaceConstants; |
|
|
|
|
import com.fanruan.repository.TemplateRepository; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
@ -35,20 +30,17 @@ import java.util.Arrays;
|
|
|
|
|
public class FileNodeFILE implements FILE { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String webRootPath = WorkspaceSystemInfo.getINSTANCE().getWebRootPath(); |
|
|
|
|
private static String[] supportTypes = TemplateRepository.getInstance().getSupportedTypes(); |
|
|
|
|
public static String webRootPath = WorkplaceConstants.getWebRootPath(); |
|
|
|
|
public static String[] supportTypes = TemplateRepository.getInstance().getSupportedTypes(); |
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
|
|
|
|
@Override |
|
|
|
|
public void on(Event event, Workspace workspace) { |
|
|
|
|
webRootPath = WorkspaceSystemInfo.getINSTANCE().getWebRootPath(); |
|
|
|
|
supportTypes = TemplateRepository.getInstance().getSupportedTypes(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 环境切换时更新下 |
|
|
|
|
*/ |
|
|
|
|
public static void updateFileInfo() { |
|
|
|
|
webRootPath = WorkplaceConstants.getWebRootPath(); |
|
|
|
|
supportTypes = WorkplaceConstants.getSupportTypes(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected FileNode node; |
|
|
|
|
|
|
|
|
|
//记录下FILE对应的运行环境,每次创建都设置下当前的运行环境
|
|
|
|
@ -382,9 +374,9 @@ public class FileNodeFILE implements FILE {
|
|
|
|
|
} |
|
|
|
|
InputStream in = TemplateResourceManager.getResource().readTemplate( |
|
|
|
|
StableUtils.pathJoin( |
|
|
|
|
ProjectConstants.REPORTLETS_NAME, |
|
|
|
|
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) |
|
|
|
|
)); |
|
|
|
|
ProjectConstants.REPORTLETS_NAME, |
|
|
|
|
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
return envPath.endsWith(".cpt") || envPath.endsWith(".frm") |
|
|
|
|
? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in; |
|
|
|
|