+ "<TD class=tdline28 width=\"1%\"> </TD><TD class=tdline28><B>消息</B></TD><TD class=tdline28 width=\"15%\"><B>发送时间</B></TD></TR>";
// 生成消息标题行
SysUserCache userCache = (SysUserCache) request.getSession()
.getAttribute(Globals.SYS_USER_CACHE);
SysUser user = userCache.getUser();
Message message = new Message();
ArrayList messageList = new ArrayList();
// 查询好友发送的信息
if (choose.equals("1")) {
Object o = BeanUtil
.getEmptyObject("cn.edu.pku.dr.requirement.elicitation.data.Message");
Class clazz = o.getClass();
SelectCommand scmd = DAOFactory.getSelectCommand(clazz);
Filter filter1 = DAOFactory.getFilter();
Filter filter2 = DAOFactory.getFilter("messageReceiver",
SQLOperator.EQUAL, user.getUserId());
Filter filter3 = DAOFactory.getFilter("creatorId",
SQLOperator.NOT_EQUAL, "3");
Filter filter4 = DAOFactory.getFilter("useState",
SQLOperator.EQUAL, "Y");
filter1.addFilter(filter2);
filter1.addFilter(filter3, LogicOperator.AND);
filter1.addFilter(filter4, LogicOperator.AND);
scmd.setFilter(filter1);
Session session = SessionFactory.openSession();
messageList = session.query(scmd);
}
// 查询系统发送的消息
else if (choose.equals("2")) {
message.setMessageReceiver(user.getUserId());
Long sys = new Long("3");
message.setCreatorId(sys);
message.setUseState("Y");
messageList = dp.query(message);
}
// 处理我发送的信息
else if (choose.equals("3")) {
message.setCreatorId(user.getUserId());
message.setUseState("Y");
messageList = dp.query(message);
}
for (int i = 0; i < messageList.size(); i++) {
message = (Message) messageList.get(i);
content = content
+ "<TR id=trBG"
+ i
+ "><TD class=tdline28 noWrap align=left><INPUT onclick=\"Message.changeTRbg(this,'trBG"
+ i + "')\" type=\"checkbox\" value=\""
+ message.getMessageId()
+ "\" name=\"delete_messgaeId\"></TD>";
if (choose.equals("1")) {
content = content + "<TD class=tdline28 align=left>"
+ message.getUserName() + "</TD>";
} else if (choose.equals("2")) {
content = content + "<TD class=tdline28 align=left>"
+ message.getUserName() + "</TD>";
} else {
content = content + "<TD class=tdline28 align=left>"
+ message.getMessageReceiverName() + "</TD>";
}
content = content + "<TD class=tdline28 align=right> </TD>";
content = content
+ "<TD class=tdline28 align=left><A class=\"bluelink \" onclick=; href=\"javascript:Message.newsShowHide('news"
+ i + "');Message.setRead(" + message.getMessageId()
+ ");Message.showMSG(" + i + "," + message.getMessageId()
+ ");\">" + message.getMessageTitle() + "</A></TD>";
content = content + "<TD class=tdline28 noWrap align=left>"
+ message.getBuildTime() + "</TD></TR>";
content = content
+ "<TR ><TD class=tdline28 id=news"
+ i
+ " style=\"DISPLAY: none\" noWrap align=left colSpan=5><BR><TABLE class=zh cellSpacing=0 cellPadding=0 width=\"96%\" align=center border=0><TBODY><TR>";
if (choose.equals("1")) {
content = content + "<TD><DIV id=MSGcontent" + i
+ "></DIV><BR><FONT id=replyLink" + i
+ "><A class=bluelink href=\"javascript:Message.reply("
+ i + "," + message.getMessageId() + ","
+ message.getMessageReceiver() + ",'"
+ message.getMessageTitle() + "',"
+ message.getCreatorId() + ")\">回复此消息</A> </FONT></TD>";
} else {
content = content + "<TD><DIV id=MSGcontent" + i
+ "></DIV></TD>";
}
content = content