|

楼主 |
发表于 2016-11-12 08:49:09
|
显示全部楼层
原5.2时有管理员在帖子里提供过一个放在demo的插件。那时是好用的,3.6这个版本就不能用了。- public void execute(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- String oldPath = request.getParameter("old");
- String realOldPath = ResourceManagerWrapper.instance().getRealPath(oldPath);
-
- DefaultXMLDocument window;
- FileInputStream inputStream = new FileInputStream(new File(realOldPath));
- try {
- XMLContentHandler contentHandler = new XMLContentHandler();
- XMLUtils.inputStreamToSAX(inputStream, realOldPath, contentHandler, false, false);
- window = contentHandler.getDocument();
- } finally {
- inputStream.close();
- }
-
-
- window.setDocumentURL(oldPath);
- WindowExtendsEngine.execute(window,new Stack<String>());
- if (window.getRootElement().attribute("extends") != null)
- window.getRootElement().attribute("extends").detach();
-
-
- String newPath = request.getParameter("new");
- String realNewPath = ResourceManagerWrapper.instance().getRealPath(newPath);
- XMLWriter writer = new XMLWriter(new FileOutputStream(realNewPath));
- writer.write(window);
- writer.close();
- }
复制代码
如果一个流程有十几个继承的环节,在中间、后面环节不断调整过程中会遇到各种组件找不到id找不到之类的问题。
WindowExtendsEngine.execute(window,null, new Stack<String>()); 改成这个出来的也不对。。
管理员是否能根据3.6的特性再补一个demo提供给大家呢? |
|