%@page import="kr.co.kihyun.text.html.TagFilter"%>
<%
/**********************************************************************************
프로그램명 : board_list.jsp
프로그램설명 :
작 성 자 :
작 성 일 :
최신변경일 :
***********************************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8"
import="java.net.URLEncoder" import="java.text.SimpleDateFormat"
import="java.util.Date" import="java.util.List"
import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction"
import="javax.jdo.Query" import="kr.co.kihyun.beans.entity.*"
import="kr.co.kihyun.beans.entity.util.*"
import="kr.co.kihyun.beans.user.HttpSSOLogin"
import="kr.co.kihyun.beans.user.User"
import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.lang.MString"
import="kr.co.kihyun.service.*" import="kr.co.kihyun.service.vo.*" import="java.util.*"
import="java.text.SimpleDateFormat"
import="kr.co.kihyun.moumi.Moumi"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%
response.setBufferSize(1024*8);
PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
Transaction tx = pm.currentTransaction();
try{
String usID = HttpSSOLogin.getLoginID(request);
int sysAuth = HttpSSOLogin.getSysAuth(request);
String dtID = HttpSSOLogin.getDeptID(request);
/************ Parameter ************/
String boardGroupID = request.getParameter("boardGroupID");
String strPage = clearXSS(request.getParameter("strPage"),"");
String findOption = clearXSS(request.getParameter("findOption"),null);
String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")),null);
String boardType = "";
Category category = pm.getObjectById(Category.class, boardGroupID);
////////////////////////
String method = clearXSS(request.getParameter("method"),"");
if(method.equals("GET")) findWord = URLDecoder.decode(MString.checkNull(request.getParameter("findWord")), "UTF-8");
//String uri = URLEncoder.encode("board_list.jsp?boardGroupID="+boardGroupID+"&findOption="+MString.checkNull(findOption),"UTF-8")+"&method=GET";
if(findWord != null){
String[] filter_word= {"--", "\\(", "\\)", "\\'", "\\\""};
for(int ii=0; ii< filter_word.length;ii++){
findWord = findWord.replaceAll(filter_word[ii], "");
}
}
/************ 리스트 페이지 구성 ************/
int endPage=0;
int pageSize=0;
int currentPage=0;
int absolutePage=0;
int currentPageSetUp=0;
int recordSize=10;
if(strPage == null || strPage.length()<=0){
currentPage = 1;
}else if(strPage.equals("null")){
currentPage = 1;
}else{
try{
currentPage=Integer.parseInt(strPage);
}catch(NumberFormatException ex){
System.out.println(ex);
}
}
//======================================================================
BoardService boardService = new BoardService(pm);
//검색조건파라미터
Map params = new HashMap();
params.put("findOption", findOption);
params.put("findWord", findWord);
params.put("groupId", boardGroupID);
//검색메인쿼리와 레코드갯수조회쿼리를 생성 후 멤버변수로 저장
boardService.createBoardListQuery(params);
//레코드갯수조회쿼리를 실행하여 레코드갯수를 구함
int count = boardService.getCountFromMainQuery();
if((count%recordSize) == 0) {
pageSize = (int)(count/recordSize);
} else {
pageSize = (int)(count/recordSize)+1;
}
if( currentPage > pageSize ) currentPage = pageSize;
currentPageSetUp = (int)(currentPage/10)*10;
if (currentPage%10 == 0){
currentPageSetUp-=10;
}
int startNo = (currentPage - 1) * recordSize + 1;
int endNo = currentPage * recordSize;
List list = null;
//검색목록조회쿼리 실행
if( count > 0 ) {
//페이징처리를 위한 추가파라미터 설정
boardService.getParams().put("startNo", startNo);
boardService.getParams().put("endNo", endNo);
//검색메인쿼리를 페이징처리를 위한 쿼리로 변환
boardService.convertToPagenatingQuery();
//만족하는 레코드가 존재하면 조회
list = boardService.executeQuery(BoardVO.class);
}
//======================================================================
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
session.setAttribute("envTagetURL", "/totsys/common/inc/sysadm/top/top.jsp");
session.setAttribute("homeTagetURL", "/totsys/sysadm/board/board_list.jsp");
if("ID_SYSTEM_NOTICE".equals(boardGroupID)){
boardType = Moumi.getMessageBundle().getString("moumi.message.board.notice");
}else if("ID_FAQ".equals(boardGroupID)){
boardType = Moumi.getMessageBundle().getString("moumi.message.board.faq");
}else if("ID_QNA".equals(boardGroupID)){
boardType = Moumi.getMessageBundle().getString("moumi.message.board.qna");
}else if("ID_PDS".equals(boardGroupID)){
boardType = Moumi.getMessageBundle().getString("moumi.message.board.pds");
}
%>
<%@page import="java.net.URLDecoder"%>
<%=Moumi.getTitle()%>
날짜검색시 10-12-01 형식으로 입력
<%if(sysAuth == Moumi.TOTPER && ("ID_QNA".equals(boardGroupID) )){ %>
<%}else if(sysAuth == Moumi.SYSADM){%>
<%}%>
<%if(count > 0){%>
<%}else{%>
<%}%>
<%
}catch(Exception ex){
//38.오류메세지를 통한 정보 노출(getMessage)_CWE-209 : Update by YOUNGJUN,CHO
ex.printStackTrace();
//out.println(ex);//앤개
//out.println("Can't contact servlet runner Message : "+ex.getMessage()+"");
//out.println(" ");
//================================================
}finally{
if(tx.isActive())
tx.rollback();
pm.close();
}
%>