<% /************************************************************@@ * Program Name : list.jsp * Description : /집계자/공지사항 * Author : 강원중 * Create Date : 2004.10.11 * History : @@************************************************************/ %> <%@ page contentType="text/html; charset=UTF-8" import="java.util.Date" import="java.net.URLEncoder" import="java.util.List" import="kr.co.kihyun.lang.MString" import="kr.co.kihyun.lang.MInteger" import="kr.co.kihyun.util.MDate" import="kr.co.kihyun.text.html.TagFilter" import="kr.co.kihyun.lang.MLong" import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction" import="kr.co.kihyun.beans.entity.util.*" import="kr.co.kihyun.beans.entity.*"%> <%@ page import="java.util.Map.Entry"%> <%@ page import="java.util.List"%> <%@ page import="kr.co.kihyun.text.html.ServletUtil"%> <%@ page import="kr.co.kihyun.moumi.Moumi"%> <%@ page import="kr.co.kihyun.lang.StringConverter"%> <%@ page import="kr.co.kihyun.beans.user.HttpSSOLogin"%> <%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> <% PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try { /****** Parameter ******/ Long docID = MLong.parseLong(request.getParameter("docID")); String boardGroupID = Category.ID_TOT_DOC_COMMENT; String url = clearXSS(request.getParameter("url"), ""); int sysAuth; if (url == null) { url = ""; } TotDoc totDoc = pm.getObjectById(TotDoc.class, docID); Category category = pm.getObjectById(Category.class, boardGroupID); List boardList = totDoc.getBoards(pm, category); if (boardList.size() < 1) { // return; } %> <% /*********** User HttpSSOLogin check ***********/ if (!HttpSSOLogin.isLogin(request)) { String connURL = "opener.location='/totsys/login/login.jsp';"; out.println(ServletUtil.getJavaScript(connURL)); out.println(ServletUtil.getJavaScript("window.close();")); return; } /********** session내의 userId **********/ String usID = HttpSSOLogin.getLoginID(request); /*********** Parameter values ***********/ Long boardID = null; if (boardList.size() > 0) { boardID = boardList.get(0).getId(); } /*********** Board View vlaues ***********/ Board board = null; String regID = ""; String boardContents = ""; String usrFilenames = ""; String svrFilenames = ""; int visit = 0; if (boardList.size() > 0) { tx.begin(); board = boardID == null ? null : pm.getObjectById(Board.class, boardID); regID = board.getUser(pm) == null ? null : board.getUser(pm).getId(); boardContents = TagFilter.convertSpace(board.getContents()); for (Entry> entry : board.getAttachments().entrySet()) { usrFilenames += entry.getKey() + ";"; svrFilenames += entry.getKey() + ";"; } docID = board.getTotDoc() == null ? null : board.getTotDoc().getId(); boardGroupID = board.getCategory().getId(); visit = board.getVisit(); board.setVisit(visit + 1); pm.makePersistent(board); tx.commit(); } /****** Doc list data get ******/ String docName = totDoc.getName(); /*********** append file name vlaues ***********/ String[] usrFilenameList = usrFilenames.split(";"); String[] svrFilenameList = svrFilenames.split(";"); /****** 본인 유무 처리 ******/ boolean isManager = false; if (usID.equals(regID)) { isManager = true; } /***** 버튼 처리 ******/ String buttonPrss = (String) session.getAttribute("homeTagetURL"); %>
[입력요령 및 관련<%=Moumi.getMessageBundle().getString("moumi.message.doc")%>] 숨기기  
<% int i = 0; for (i = 0; i < svrFilenameList.length; i++) { if (svrFilenameList[i] != null && !svrFilenameList[i].equals("")) { %> <% } } %>
+<%= Moumi.getMessageBundle().getString("moumi.message.file")%> <%= (i + 1)%>   &fileName=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&docID=<%=docID%>" target="hiddenIframe"><%= usrFilenameList[i]%>
<% if (boardList.size() > 0) { %>
<% if (url.equals("prss") | url.equals("reg")) {%> <% }%>
<%= boardContents%>
<%} else {%>
등록된 글이 없습니다.
<% } %>
<% } catch (Exception ex) { ex.printStackTrace(); out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';")); } finally { if (tx.isActive()) { tx.rollback(); } pm.close(); } %>