NC单点登录设置默认界面
单点登录默认打开消息中心
package nc.sso.demo;
import nc.bs.framework.common.NCLocator;
import nc.bs.logging.Logger;
import nc.desktop.ui.Workbench;
import nc.desktop.ui.WorkbenchEnvironment;
import nc.funcnode.ui.FuncletInitData;
import nc.funcnode.ui.FuncletWindowLauncher;
import nc.itf.uap.bbd.func.IFuncRegisterQueryService;
import nc.login.sso.ui.SSOLoader;
import nc.sfbase.client.ClientToolKit;
import nc.ui.pub.msg.PfLinkData;
import nc.vo.pub.BusinessException;
import nc.vo.sm.funcreg.FuncRegisterVO;
public class DemoSSOUILoader extends SSOLoader {
@Override
public void appletInited() {
// TODO Auto-generated method stub
// 父窗体
Workbench parent = WorkbenchEnvironment.getInstance().getWorkbench();
String param = ClientToolKit.getAppletParam("nodeid");
//nodeid=messagecenter 单点登录打开至消息中心
if("messagecenter".equals(param)) {
/* FuncRegisterVO frvo = new FuncRegisterVO();
frvo.setFuncode("消息中心");
frvo.setOwn_module("10");
frvo.setIsbuttonpower(UFBoolean.FALSE);
frvo.setClass_name("nc.message.reconstruction.NCMessageMainUI");
FuncletWindowLauncher.openFuncNodeInTabbedPane(parent, frvo,
new FuncletInitData(1, pflink), null, true); */
parent.getWorkSpaceTabbedPane().getModel().setSelectedIndex(1);
}else {
String systemcode = "local";// 默认系统编码
// 功能注册节点
String funCode = param;
//pk
String pk = ClientToolKit.getAppletParam("pk");
if (param.contains(":")) {
funCode = param.split(":")[0];
systemcode = param.split(":")[1];
}
IFuncRegisterQueryService service = NCLocator.getInstance().lookup(
IFuncRegisterQueryService.class);
FuncRegisterVO FrvO = null;
try {
FrvO = service.queryFunctionByCode(funCode);// 功能节点编号
} catch (BusinessException e) {
}
// **********第一种:打开流程单据卡片界面*********************************************************************
PfLinkData pflink = new PfLinkData();
Logger.debug("pk=" + pk);
pflink.setBillID(pk); // 本单据ID
//pflink.setBillType("6403"); // 本单据类型
// pflink.setSourceBillType("SALE"); // 上游单据类型
// pflink.setPkOrg("0001A6100000000009OU"); // 公司
//int height = ClientToolKit.getUserHeight() - 40;
//int width = ClientToolKit.getUserWidth() - 40;
// 卡片形式打开
/*
* FuncletWindowLauncher.openFuncNodeForceModalDialog(null, FrvO, new
* FuncletInitData(1, pflink), null, true, new Dimension( width,
* height), null);
*/
// 页签形式打开
//parent.firePropertyChange(propertyName, oldValue, newValue);
FuncletWindowLauncher.openFuncNodeInTabbedPane(null, FrvO,
new FuncletInitData(1, pflink), null, true);
Logger.debug("页签已打开");
String[] script = new String[] { "if(opener)opener.ncNodeAppletMap.put('"
+ systemcode + "',findNCApplet())" };
ClientToolKit.callJavaScript("eval", script);
}
}
}
写一个DemoSSOUILoader继承原有的SSOLoader重写appletInited方法0代表功能导航,1是消息中心
Workbench parent = WorkbenchEnvironment.getInstance().getWorkbench();
parent.getWorkSpaceTabbedPane().getModel().setSelectedIndex(1);
如使用上面参考代码使用此链接进行登录进行测试
uclient://start/http://127.0.0.1:80/?ssoKey=1596097658238-9096791302285095722&uiloader=nc.sso.demo.DemoSSOUILoader&nodeid=messagecenter
登录时消息中心默认工作任务
在nc.message.reconstruction.NCMessageMainUI这个类里面的setDefaultSelectedNode方法如下设置,也可更改为其它默认值
private void setDefaultSelectedNode()
{
setMsgBoxTreeSelected(IMessageBoxCode.WORKLIST);
}
消息中心默认显示三个月
在nc.message.msgcenter.msgbox.AbstractMessageBox类中,getMsgQueryInfo方法里面把7天更改为90天即可
public MsgQueryInfo getMsgQueryInfo()
{
if (qryinfo == null)
{
qryinfo = new MsgQueryInfo();
qryinfo.setQuikdate("90");
qryinfo.setHandle(false);
qryinfo.setShowQry(false);
}
return qryinfo;
}
原文出处:https://blog.csdn.net/qq_38888284/article/details/116839702