Browse Source

Merge pull request #17 in BA/design from ~NEIL/design:dev to dev

* commit '2b15a96f92f9a209e9895cb60de1f5526f925f30':
  注释
  cas url接口
master
neil 9 years ago
parent
commit
05b1ade42f
  1. 7
      designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java
  2. 4
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java
  3. 15
      designer_base/src/com/fr/design/utils/DesignUtils.java

7
designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java

@ -21,4 +21,11 @@ public interface DesignerEnvProcessor extends Level{
* @return 修改后的jsessionid
*/
String changeEnvPathBeforeConnect(String userName, String password, String path);
/**
* web端预览的时候不需要jsessionid, 他会默认跳转到登陆页面, 如果带上了, 反而会因为里面资源文件加载不到而出问题.
*
* @return web端预览地址
*/
String getWebBrowserURL(String envPath);
}

4
designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java

@ -15,4 +15,8 @@ public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcess
return path;
}
public String getWebBrowserURL(String envPath){
return envPath;
}
}

15
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -5,6 +5,8 @@ import com.fr.base.remote.RemoteDeziConstants;
import com.fr.dav.DavXMLUtils;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.env.RemoteEnv;
@ -303,7 +305,8 @@ public class DesignUtils {
postfixOfUri = isUserPrivilege ? postfixOfUri + "&fr_check_url=" + time + "&id=" + FRContext.getCurrentEnv().getUserID(): postfixOfUri ;
}
Desktop.getDesktop().browse(new URI(FRContext.getCurrentEnv().getPath() + postfixOfUri));
String urlPath = getWebBrowserPath();
Desktop.getDesktop().browse(new URI(urlPath + postfixOfUri));
} catch (Exception e) {
FRContext.getLogger().error("cannot open the url Successful", e);
}
@ -319,6 +322,16 @@ public class DesignUtils {
}
}
private static String getWebBrowserPath() {
String urlPath = FRContext.getCurrentEnv().getPath();
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getEnvProcessor();
if (processor != null) {
//cas访问的时候, url要处理下.
urlPath = processor.getWebBrowserURL(urlPath);
}
return urlPath;
}
//TODO:august:下个版本,要把下面的图片都放在一个preload文件夹下,表示可以预先加载。然后遍历一下就可以了,不用这么一个一个的写了
/**

Loading…
Cancel
Save