<%-- Document : template-list Created on : 2011. 1. 18, ¿ÀÈÄ 3:28:08 Author : bhs --%> <%@page contentType="text/html" pageEncoding="EUC-KR"%> <%@page import="java.net.URLEncoder"%> <%@page import="java.util.List"%> <%@page import="javax.jdo.PersistenceManager"%> <%@page import="javax.jdo.Transaction"%> <%@page import="kr.co.kihyun.lang.MInteger"%> <%@page import="kr.co.kihyun.lang.MString"%> <%@page import="kr.co.kihyun.moumi.MoumiConfig"%> <%@page import="kr.co.kihyun.beans.entity.MUser"%> <%@page import="kr.co.kihyun.beans.entity.TotDoc"%> <%@page import="kr.co.kihyun.beans.entity.util.PMF"%> <%@page import="kr.co.kihyun.beans.entity.util.MPersistenceManager"%> <%@page import="kr.co.kihyun.beans.user.HttpSSOLogin"%> <%@page import="org.slf4j.Logger"%> <%@page import="org.slf4j.LoggerFactory"%> <% Logger LOG = LoggerFactory.getLogger(this.getClass()); request.setCharacterEncoding("UTF-8"); String filterOption = request.getParameter("filterOption"); String filterValue = request.getParameter("filterValue"); String uri = URLEncoder.encode("template-list.jsp?filterOption=" + MString.checkNull(filterOption) + "&filterValue=" + MString.checkNull(filterValue), "UTF-8"); MUser mUser = null; List onGoingDocs = null; PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try { tx.begin(); mUser = pm.getObjectById(MUser.class, HttpSSOLogin.getLoginID(request)); onGoingDocs = mUser.getOnGoingDocs(pm, filterOption, filterValue); tx.rollback(); int strPage = MInteger.parseInt(request.getParameter("strPage"), 1); int recordSize = 15; int currentPage = strPage; int pageSize = (int) Math.ceil(onGoingDocs.size() / (float) recordSize); int currentPageSetUp = currentPage / 10 * 10; %> <%=MoumiConfig.getTitle()%>
  <% int index = 0; int nextCount = 0; if (currentPage > 1) nextCount = (currentPage - 1) * recordSize; tx.begin(); for (int i = 0; i < recordSize && nextCount+i < onGoingDocs.size(); i++) { index = nextCount+i; TotDoc currentDoc = onGoingDocs.get(index); %> <% } tx.rollback(); %> <% if (onGoingDocs.isEmpty()) { %> <% } else { %> <% } %>
<%= MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.document") + MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.name") %> <%= MoumiConfig.getMessageBundle().getString("moumi.message.doc.Devision") %>
<%= currentDoc.getName() %> <%= currentDoc.getDept(pm).getName() %>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.notPrssDoc")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.button_large.next")%>
<% } catch (Exception e) { throw new ServletException(e); } finally { if(tx.isActive()) tx.rollback(); pm.close(); } %>