起步软件技术论坛-X3

 找回密码
 立即注册
搜索
楼主: huixiangtao

【结贴】business.jsp的修改问题**

[复制链接]
 楼主| 发表于 2009-4-27 22:02:04 | 显示全部楼层
哦,这个功能现在算基本实现了。但还有问题得继续请教。
我在组件库中修改了LoadFuncs函数,为了实现business登陆进去之后,显示一个业务空间下的所有功能。同时,我在标准风格主窗体上做了这个帖子上所说的修改。运行的时候,是不是标准风格主窗体和组件库上的代码都要执行呢?
这两种修改是不是会相互冲突呢?
我感觉似乎是发了冲突。
回复 支持 反对

使用道具 举报

发表于 2009-4-28 08:53:21 | 显示全部楼层
当然会冲突了,一个参数传递的是空间的url,一个是功能的url,如果2者一起使用的效果应该是业务功能树中只显示这一个功能,并且平台运行起来以后会把这个功能运行起来。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-28 09:17:06 | 显示全部楼层
我现在的运行效果正如你所说的那样,平台运行起来以后,这个功能也运行起来了,功能窗体也打开了,2秒钟之后,工作台的界面又接着把这个功能窗体的界面给覆盖了,不过只是显示界面的覆盖,功能窗体还是打开的。
那对于一个X3系统,这个问题有办法解决吗?能不能解决这个冲突呢?
让我运行http://127.0.0.1:8081/x3/business1.jsp  的时候,是显示TXK的业务空间,
而我运行http://127.0.0.1:8081/x3/business2.jsp  的时候,是显示YWKJ1下面的,业务功能1。
回复 支持 反对

使用道具 举报

发表于 2009-4-28 09:28:06 | 显示全部楼层
1.修改标准风格主窗体事件代码 RunFirstFuncTimerTimer
procedure TSTANDARDSTYLEMAINFORM.RunFirstFuncTimerTimer(Sender: TObject);
begin
  RunFirstFuncTimer.Enabled := False;
  if FConfig.ActiveFunc <> '' then
    //RunFunc(FConfig.ActiveFunc, False)
  else if (Length(TFunc(Context.Owner).Parameters)>0) then
      ShowContainer(FFuncContainers[FFuncContainers.Count-1] as TFuncContainer)
  else if FFuncContainers.Count > 0 then
      ShowContainer(FFuncContainers[0] as TFuncContainer);
回复 支持 反对

使用道具 举报

发表于 2009-4-28 09:30:46 | 显示全部楼层
那你就在uirunfunc之前判断一下参数类型,如果是空间就不运行,如果是功能就运行
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-28 12:48:54 | 显示全部楼层
1.我照着24楼改了代码,并且在调用uirunfunc之前做了判断,如果是功能就调用,如果不是功能就不调用。显示的时候,参数是功能的显示一些正常,平台运行起来后,功能也就运行起来了,功能窗体也打开了,参数是空间id的,功能就没有显示,但是显示的也不是工作台,而是日程,日程的“详细”那个标签页显示出来了。
2.别的机器上装的X3系统,http://127.0.0.1:8081/x3/Business1.jsp?username=ry1&pwd=
就能直接进入平台,跳过输入用户名和密码这一界面。
我的机器上,http://127.0.0.1:8081/x3/Business1.jsp 是进入平台了,它显示了登陆界面,需要输入用户名和密码。 我的机器上输入 http://127.0.0.1:8081/x3/Business1.jsp?username=ry1&pwd=
却还是显示登录界面,还需要输入用户名和密码,这怎么跟别人机器上的X3系统不一样呢,是不是我做过的这些修改影响到了什么呢?
回复 支持 反对

使用道具 举报

发表于 2009-4-28 13:25:19 | 显示全部楼层
1.
else if (Length(TFunc(Context.Owner).Parameters)>0) then
      ShowContainer(FFuncContainers[FFuncContainers.Count-1] as TFuncContainer)
这句代码要加个条件,如果参数是功能就执行,如果是空间就执行else if
2.应该是你本机每次都需要输入用户名密码那么说明Business.jsp里面不正确,应该X3X.logon那个函数没有接收到你ie地址栏中传入的用户名和密码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-28 14:19:34 | 显示全部楼层
我在business.jsp 中都没有写logon函数,还需要写这个函数吗?
回复 支持 反对

使用道具 举报

发表于 2009-4-28 14:23:01 | 显示全部楼层
是啊,我就奇怪你上面说的直接就可以进入主界面没有输入用户和密码呢,两个Business.jsp是一样的么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-28 14:55:41 | 显示全部楼层
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.justep.loader.LibContext"%>
<%@ page import="java.lang.reflect.Method" %>
<%
Class pclass = LibContext.getInstance().getLoader().loadClass("com.justep.web.SysServerProvider");
Object pobj = pclass.newInstance();
Method getBXClassIDMethod = pclass.getMethod("getBXClassID",new Class[]{});
Method getBXCodeMethod = pclass.getMethod("getBXCodebase",new Class[]{});
Method getSysServerURLMethod = pclass.getMethod("getSysServerURL",new Class[]{});
Method getClientPathMethod = pclass.getMethod("getClientPath",new Class[]{});
Method getVersionMethod = pclass.getMethod("getVersion",new Class[]{});
Method getVersionKeyMethod = pclass.getMethod("getVersionKey",new Class[]{});
Method getVersionHashMethod = pclass.getMethod("getVersionHash",new Class[]{});

String classId = (String)getBXClassIDMethod.invoke(pobj,new Object[]{});
String codeBase = (String)getBXCodeMethod.invoke(pobj,new Object[]{});
String url = (String)getSysServerURLMethod.invoke(pobj,new Object[]{});
String clientPath = (String)getClientPathMethod.invoke(pobj,new Object[]{});
String version = (String)getVersionMethod.invoke(pobj,new Object[]{});
String versionKey = (String)getVersionKeyMethod.invoke(pobj,new Object[]{});
String versionHash = (String)getVersionHashMethod.invoke(pobj,new Object[]{});
String params = " -s" + url;
if (clientPath != null && !"".equals(clientPath))
  params = params + " -p" + clientPath;

if (version != null && !"".equals(version))
  params = params + " -vid" + version;

if (versionKey != null && !"".equals(versionKey))
  params = params + " -vk" + versionKey;

if (versionHash != null && !"".equals(versionHash))
  params = params + " -vh" + versionHash;
%>


<%//通过request获取登录帐号、密码
String username = request.getParameter("username");
String pwd = request.getParameter("pwd");
if(username.contains("\'")) {
        username = username.substring(username.indexOf("\'")+1,username.lastIndexOf("\'"));
}
if(username.contains("\"")) {
        username = username.substring(username.indexOf("\"")+1,username.lastIndexOf("\""));
}
if(pwd.contains("\'")) {
        pwd = pwd.substring(pwd.indexOf("\'")+1,pwd.lastIndexOf("\'"));
}
if(pwd.contains("\"")) {
        pwd = pwd.substring(pwd.indexOf("\"")+1,pwd.lastIndexOf("\""));
}


%>

<HTML>
<HEAD>
<title>X3 协同管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</HEAD>

<BODY leftmargin="0" topmargin="0" scroll="no">

<script type="text/javascript">
  AC_AX_RunContent("id", "X3X", "classid", "<%= classId%>", "codebase", "<%= codeBase%>", "width", "100%", "height", "100%", "align", "center", "hspace", "0", "vspace", "0");
</script>
<noscript><OBJECT  id = "X3X"
          classid="<%= classId%>"
          codebase="<%= codeBase%>"
          width="100%"
          height="100%"
          align=center
          hspace=0
          vspace=0
>
</OBJECT></noscript>

<script type="text/javascript">
  AC_AX_RunContent("id", "WebBrowser", "width", "0", "height", "0", "classid", "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2");
</script>
<noscript><object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object></noscript>

<script ID="BusinessCloseEventHandler" language="javascript" FOR="X3X" EVENT="OnTerminate">
  top.window.opener=null;
  top.window.close();
  //WebBrowser.ExecWB(45,1); // close window
</script>
<script ID="RTEventHandler" language="javascript" FOR="X3X" EVENT="OnRTEvent(Param)">
  //X3脚本事件
  //可以在脚本中执行RTEvent.Execute('Param1');最终调用会执行到这里,Param1的内容格式可以自定义
  //Param变量的内容就是传出的字符串(Param1)。
</script>

<script type="text/javascript">
  function BeforeClose()
  {
    if(!X3X.TerminateQuery())
    {
      event.returnValue = "";
    }
  }

  document.title = X3X.DisplayName;
  X3X.Params = "<%= params%>";
  X3X.UpdateVersion();
// X3X.ShowSplash();
  X3X.Init();
// X3X.CloseSplash();
// X3X.Run("", "", "", "");
  X3X.Logon("<%=username%>","<%=pwd%>");  //自动登录
  X3X.Run("Biz:\\System\\Init.Func", "", "", "");  //必须要传入参数系统初始化功能
  document.body.onbeforeunload=BeforeClose;
  document.title = X3X.DisplayName;
</script>

</BODY>
</HTML>
这是别人机器上的那个business.jsp  它跟我的不一样, 我按照它的,把它的run函数略作修改用在我的机器上,也行。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-22 02:51 , Processed in 0.045312 second(s), 13 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表