package nlib.sch.web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.activation.MimetypesFileTypeMap;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.poi.util.SystemOutLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import egovframework.rte.fdl.cmmn.exception.EgovBizException;
import nlib.cmm.NlibCommonController;
import nlib.cmm.service.CodeService;
import nlib.cmm.service.NlibProperty;
import nlib.cmm.service.PagingVO;
import nlib.col.service.CartService;
import nlib.col.service.CollectionService;
import nlib.col.service.CollectionVO;
import nlib.col.service.InterestService;
import nlib.col.service.RisService;
import nlib.sch.service.NlibSearchService;
import nlib.sch.service.NlibSearchVO;
import nlib.sch.util.DataMap;
import nlib.sch.util.NlibCmmUtil;
import nlib.util.StringUtil;
/**
*
* @Class Name : NlibSearchController.java
*
* @Description : 소장자료 Controller
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
*
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 7. 21. JSYOO 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP JSYOO
* @since 2021. 7. 21.
* @version 1.0
*
*/
@Controller
public class NlibSearchController extends NlibCommonController {
private static final Logger log = LoggerFactory.getLogger(NlibSearchController.class);
@Value("#{properties['list.paging.page.size']}")
private String DEFUALT_PAGE_SIZE;
@Resource(name = "cartService")
private CartService cartService;
@Resource(name = "codeService")
private CodeService codeService;
@Resource(name="risService")
private RisService risService;
@Resource(name = "interestService")
private InterestService interestService;
@Resource(name = "nlibProperty")
protected NlibProperty nlibProperty;
@Resource(name = "collectionService")
private CollectionService collectionService;
@Resource(name = "nlibSearchService")
private NlibSearchService nlibSearchService;
/**
* 소장자료 화면을 호출한다.
*
* @param req
* @return
*/
@RequestMapping(value = {"/search/searchList.do"} )
public String searchList(
HttpServletRequest req
, Authentication authentication
, ModelMap model
, @ModelAttribute("searchVO") NlibSearchVO searchVO
, HttpServletRequest request
, HttpServletResponse res
, String csrfToken) throws Exception {
HttpSession session = request.getSession();
String councilCd = (String)session.getAttribute("councilCd");
//검색엔진파라미터로 문화원코드
searchVO.setMngOrgCd(councilCd);
List operList = new ArrayList();
// 페이징 사이즈 코드 목록 조회 (DB방식으로 변경 2021.08.06 KNKIM)
List