package kccf.res.web;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kccf.res.service.ResourcesService;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cmm.Constant;
import cmm.service.CmmAmsAssetMediaVO;
import cmm.service.CmmCouncilInfoVO;
import cmm.service.CmmMetaVO;
import cmm.service.CmmService;
import cmm.util.CmmUtil;
import cmm.util.CmmVO;
import cmm.util.DataMap;
import cmm.util.DateUtil;
import egovframework.com.cmm.ComDefaultCodeVO;
import egovframework.com.cmm.service.EgovCmmUseService;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;

/**  
 * 이용문의에 대한 controller 클래스를 구현한다.
 * @Class Name : ResourcesController.java
 * @author ecplaza 
 * @since 2018-04-19
 * @version 1.0
 */

@Controller
public class ResourcesController {
	
	/** LOGGER */
	@SuppressWarnings("unused")
	private static final Logger LOGGER = LoggerFactory.getLogger(ResourcesController.class);

    /** ResourcesService */
	@Resource(name = "resourcesService")
    private ResourcesService resourcesService;
    
    /** CmmService */
   	@Resource(name = "cmmService")
    private CmmService cmmService;
   	
    /** EgovCmmUseService */
	@Resource(name="EgovCmmUseService")
	private EgovCmmUseService cmmUseService;
    
	@RequestMapping(value="/res/resourcesList.do")
 	public String selectResourcesList (
 			@ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO
 			, BindingResult bindingResult
 			, ModelMap model
 			,HttpServletRequest req
 			) throws Exception {
		
		cmmAmsAssetMediaVO.setSearchType(CmmUtil.clearXSS(cmmAmsAssetMediaVO.getSearchType()));	// XSS 방지
		cmmAmsAssetMediaVO.setSearchType3(CmmUtil.clearXSS(cmmAmsAssetMediaVO.getSearchType3()));	// XSS 방지
		cmmAmsAssetMediaVO.setSearchKeyword(CmmUtil.clearXSS(cmmAmsAssetMediaVO.getSearchKeyword()));	// XSS 방지
		cmmAmsAssetMediaVO.setSearchKeyword2(CmmUtil.clearXSS(cmmAmsAssetMediaVO.getSearchKeyword2()));	// XSS 방지
		cmmAmsAssetMediaVO.setReSearch(CmmUtil.clearXSS(cmmAmsAssetMediaVO.getReSearch()));	// XSS 방지
		
		if(!StringUtils.isBlank(cmmAmsAssetMediaVO.getParameter1())){
   			if(StringUtils.defaultString(cmmAmsAssetMediaVO.getParameter1()).indexOf(",") > -1) {
   				cmmAmsAssetMediaVO.setCouncilList(cmmAmsAssetMediaVO.getParameter1().split(","));
   			}else{
   				cmmAmsAssetMediaVO.setCouncilList(new String[]{cmmAmsAssetMediaVO.getParameter1()});
   			}
   			
   		}
   		
		if(!StringUtils.isBlank(cmmAmsAssetMediaVO.getParameter2())){
   			if(StringUtils.defaultString(cmmAmsAssetMediaVO.getParameter2()).indexOf(",") > -1) {
   				cmmAmsAssetMediaVO.setCategoryList(cmmAmsAssetMediaVO.getParameter2().split(","));
   			}else{
   				cmmAmsAssetMediaVO.setCategoryList(new String[]{cmmAmsAssetMediaVO.getParameter2()});
   			}
   			
   		}
		
		CmmUtil.setNfsPathModelMap(req,model);
		
		/**** paging ****/		
		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit30());
		paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize());
		
		cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex());
		cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
   		/**** paging ****/
							
		//cmmAmsAssetMediaVO.setSearchUseYn(Constant.RES_SEARCHTYPE);
		//cmmAmsAssetMediaVO.setAssetClassArray(Constant.ASSETS_CLASS_ARRAY);
		int totCnt = 0;
		if((cmmAmsAssetMediaVO.getSearchStartStr() == null && cmmAmsAssetMediaVO.getSearchEndStr() == null) || StringUtils.isEmpty(cmmAmsAssetMediaVO.getTitle())){
			totCnt = resourcesService.selectResourcesListTotCnt(cmmAmsAssetMediaVO);
		}else{
			totCnt = resourcesService.selectResourcesListSchTotCnt(cmmAmsAssetMediaVO);
		}
		
		paginationInfo.setTotalRecordCount(totCnt);	
		
		List<CmmAmsAssetMediaVO> resultList = resourcesService.selectResourcesList(cmmAmsAssetMediaVO);		
		
		for(int i = 0 ; i < resultList.size() ; i++){
			CmmAmsAssetMediaVO res = resultList.get(i);
			res.setLinkUrl(CmmUtil.getLinkUrl(res.getAssetId(), res.getMediaId()));
		}
		
		List<DataMap> councilList = resourcesService.selectCouncilList();		
		
		ComDefaultCodeVO CodeVO = new ComDefaultCodeVO();
		CodeVO.setCodeId(Constant.CODE_ID_FMS014);
        model.addAttribute("firstCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
        
        CodeVO.setCodeId(Constant.CODE_ID_FMS015);
    	model.addAttribute("secondCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
    	
    	CodeVO = new ComDefaultCodeVO();
        CodeVO.setCodeId(Constant.CODE_ID_FMS018);
        model.addAttribute("couSidoList", cmmUseService.selectCmmCodeDetail(CodeVO));
        
		model.addAttribute("resultList", resultList);
		model.addAttribute("paginationInfo", paginationInfo);
		model.addAttribute("totalCnt", totCnt);
//		model.addAttribute("filterList", filterList);	
		model.addAttribute("paramVO", cmmAmsAssetMediaVO);
		model.addAttribute("councilList", councilList);	
		model.addAttribute("isMobile", CmmUtil.isMobile(req));	
//		model.addAttribute("councilFilterList", councilFilterList);
		
		// 메타태그정보
    	CmmMetaVO metaVO = new CmmMetaVO();
    	metaVO.setTitle("지방문화원자료");
    	metaVO.setDescription("전국 지방문화원에서 소장하고 있는 지역문화자료 데이터를 자유롭게 열람할 수 있습니다.");
    	metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/res/resourcesList.do");
    	metaVO.setImage(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/images/kccf/bg/bg-subvisual-resources.jpg");
    	model.addAttribute("metaResult", metaVO);
    	
		return "kccf/res/resourcesList.kccf";
	}
	
/*	@RequestMapping(value="/res/resourceInfo.do")
 	public String selectResourceInfo (
 			@ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO
 			, BindingResult bindingResult
 			, ModelMap model
 			,HttpServletRequest req
 			) throws EgovBizException {
		
		CmmUtil.setNfsPathModelMap(req,model);
		
		if("".equals(cmmAmsAssetMediaVO.getSojangCouncil())){
			return "redirect:/man/main.do";
		}

		*//**** paging ****//*		
		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit30());
		paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize());
		
		cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex());
		cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
   		*//**** paging ****//*

		int totCnt = 0;
		if(cmmAmsAssetMediaVO.getSearchStartStr() == null && cmmAmsAssetMediaVO.getSearchEndStr() == null && cmmAmsAssetMediaVO.getFirstClass().equals("") && cmmAmsAssetMediaVO.getSecondClass().equals("")){
			totCnt = resourcesService.selectResourcesListTotCnt2(cmmAmsAssetMediaVO);
		}else{
			totCnt = resourcesService.selectResourcesListSchTotCnt2(cmmAmsAssetMediaVO);
		}
		paginationInfo.setTotalRecordCount(totCnt);	
		
		CmmCouncilInfoVO result = resourcesService.selectCouncilInfo(cmmAmsAssetMediaVO);
		
		List<CmmAmsAssetMediaVO> resultList = resourcesService.selectResourcesList2(cmmAmsAssetMediaVO);		

		model.addAttribute("result", result);
		model.addAttribute("resultList", resultList);
		model.addAttribute("paginationInfo", paginationInfo);
		model.addAttribute("totalCnt", totCnt);
		model.addAttribute("paramVO", cmmAmsAssetMediaVO);
		
		// 메타태그정보
    	CmmMetaVO metaVO = new CmmMetaVO();
    	if (result != null) {
    		if (StringUtils.isNotEmpty(result.getCouncilNm())) metaVO.setTitle(result.getCouncilNm()+ " 소장자료");
    	}
    	if (result != null) {
    		if (StringUtils.isNotEmpty(cmmAmsAssetMediaVO.getSojangCouncil())) metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/res/resourceInfo.do?sojangCouncil="+cmmAmsAssetMediaVO.getSojangCouncil());
    	}
    	metaVO.setDescription("지방문화원이 생산,발굴한 독특하고 고유한 지역문화 콘텐츠 및 소장자료를 모든 국민이 향유할수 있도록 제공하는 지역문화 대표 포털");
    	metaVO.setOgType("website");
    	metaVO.setImage("https://www.nculture.org/images/cmm/open-graph-image.jpg");
    	metaVO.setImageType("image/jpeg");
    	model.addAttribute("metaResult", metaVO);
		
		return "kccf/res/resourceInfo.kccf_res";
	}*/
	
	@RequestMapping(value="/cou/{link_nm}")
 	public String selectResourceInfo2 (
 			@ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO
 			, @PathVariable("link_nm") String link_nm
 			, BindingResult bindingResult
 			, ModelMap model
 			,HttpServletRequest req
 			) throws Exception {
		
		CmmUtil.setNfsPathModelMap(req,model);
		
		if(StringUtils.isEmpty(link_nm)){
			return "redirect:/man/main.do";
		}
		
		//문화원 정보
		cmmAmsAssetMediaVO.setLinkNm(link_nm);
		CmmCouncilInfoVO result = resourcesService.selectCouncilInfo(cmmAmsAssetMediaVO);
		model.addAttribute("result", result);
		
		if(result == null){
			return "redirect:/man/main.do";
		}
		
		//배너정보
		DataMap paramMap= new DataMap(); 
		paramMap.setString("councilCd", result.getCouncilCd());
		paramMap.setString("menuCd", Constant.CODE_ID_FMS017_M99);
		paramMap.put("bannerNowStr", DateUtil.getNowString("yyyyMMddHHmm"));
		model.addAttribute("bannerList", resourcesService.selectCouMainBannerList(paramMap));

		//주요키워드
		model.addAttribute("resTagList", resourcesService.selectCouMainResTagList(paramMap));
		
		//많이 본 자료
		List<CmmAmsAssetMediaVO> seeResList = resourcesService.selectCouMainSeeResList(paramMap);
		
		for(int i = 0 ; i < seeResList.size() ; i++){
			CmmAmsAssetMediaVO res = seeResList.get(i);
			res.setLinkUrl(CmmUtil.getLinkUrl(res.getAssetId(), res.getMediaId()));
		}
		model.addAttribute("seeResList", seeResList);
		
		
		//많이 본 자료
		List<CmmAmsAssetMediaVO> recommendResList = resourcesService.selectCouMainRecommendResList(paramMap);
		
		for(int i = 0 ; i < recommendResList.size() ; i++){
			CmmAmsAssetMediaVO res = recommendResList.get(i);
			res.setLinkUrl(CmmUtil.getLinkUrl(res.getAssetId(), res.getMediaId()));
		}
		model.addAttribute("recommendResList", recommendResList);
		
		//연도별 인기자료(년도)
		model.addAttribute("bestYearList", resourcesService.selectCouMainBestYearList(paramMap));
		
		ComDefaultCodeVO CodeVO = new ComDefaultCodeVO();
		CodeVO.setCodeId(Constant.CODE_ID_FMS014);
        model.addAttribute("firstCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
        
        CodeVO = new ComDefaultCodeVO();
		CodeVO.setCodeId(Constant.CODE_ID_FMS012);
        model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO));
		
		model.addAttribute("paramVO", cmmAmsAssetMediaVO);
		
		// 메타태그정보
    	CmmMetaVO metaVO = new CmmMetaVO();
    	if (result != null) {
    		if (StringUtils.isNotEmpty(result.getCouncilNm())) metaVO.setTitle(result.getCouncilNm()+ " 소장자료");
    	}
    	if (result != null) {
    		if (StringUtils.isNotEmpty(result.getCouncilNm())) metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/cou/"+link_nm);
    	}
    	metaVO.setDescription("지방문화원이 생산,발굴한 독특하고 고유한 지역문화 콘텐츠 및 소장자료를 모든 국민이 향유할수 있도록 제공하는 지역문화 대표 포털");
    	metaVO.setOgType("website");
    	metaVO.setImage("https://www.nculture.org/images/cmm/open-graph-image.jpg");
    	metaVO.setImageType("image/jpeg");
    	model.addAttribute("metaResult", metaVO);
		
		return "kccf/res/resourceInfo.kccf_res";
	}
	
    @RequestMapping(value="/res/mainYearBestList-data.do")
   	public String selectLocalCultureListAjax (
   		  @ModelAttribute("cmmVO") CmmVO cmmVO
 			, ModelMap model
			, @RequestParam Map<String, Object> commandMap
			, HttpServletRequest req
			, HttpServletResponse res
   			) throws Exception  {
    	
    	model.addAttribute("paramVO", cmmVO);
   		
   		DataMap paramMap = new DataMap();
   		paramMap.setString("councilCd", cmmVO.getsCouncilCd());
   		paramMap.setString("yyyy", cmmVO.getSearchCondition());

   	    //년도별 인기자료
		List<CmmAmsAssetMediaVO> yearDataList = resourcesService.selectCouMainYearDataList(paramMap);
		
		for(int i = 0 ; i < yearDataList.size() ; i++){
			CmmAmsAssetMediaVO yearData = yearDataList.get(i);
			yearData.setLinkUrl(CmmUtil.getLinkUrl(yearData.getAssetId(), yearData.getMediaId()));
		}
		model.addAttribute("yearDataList", yearDataList);
		
		paramMap.setString("jsessionId", CmmUtil.getCookieId(req)); 
		CmmUtil.setAmsPathModelMap(req,model);
		
   		return "kccf/res/resourceYearBestListAjax";
   	}
	
	@RequestMapping(value="/res/resourceCouList.do")
 	public String selectResourceCouList (
 			@ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO
 			, BindingResult bindingResult
 			, ModelMap model
 			,HttpServletRequest req
 			) throws Exception {
		
		CmmUtil.setNfsPathModelMap(req,model);
		
		//태그검색 후 일반검색시 태그검색값 초기화
		if(!StringUtils.isBlank(cmmAmsAssetMediaVO.getSearchKeyword())){
			cmmAmsAssetMediaVO.setTagsName("");
		}
		
		if("".equals(cmmAmsAssetMediaVO.getSojangCouncil())){
			return "redirect:/man/main.do";
		}

		/**** paging ****/		
		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit30());
		paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize());
		
		cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex());
		cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
   		/**** paging ****/
		
		if(!StringUtils.isBlank(cmmAmsAssetMediaVO.getParameter1())){
   			if(StringUtils.defaultString(cmmAmsAssetMediaVO.getParameter1()).indexOf(",") > -1) {
   				cmmAmsAssetMediaVO.setCategoryList(cmmAmsAssetMediaVO.getParameter1().split(","));
   			}else{
   				cmmAmsAssetMediaVO.setCategoryList(new String[]{cmmAmsAssetMediaVO.getParameter1()});
   			}
   		}
   		
		if(!StringUtils.isBlank(cmmAmsAssetMediaVO.getParameter2())){
   			if(StringUtils.defaultString(cmmAmsAssetMediaVO.getParameter2()).indexOf(",") > -1) {
   				cmmAmsAssetMediaVO.setClassList(cmmAmsAssetMediaVO.getParameter2().split(","));
   			}else{
   				cmmAmsAssetMediaVO.setClassList(new String[]{cmmAmsAssetMediaVO.getParameter2()});
   			}
   		}

		int totCnt = 0;
		if(cmmAmsAssetMediaVO.getParameter1().equals("") && cmmAmsAssetMediaVO.getParameter2().equals("") && cmmAmsAssetMediaVO.getSearchKeyword().equals("") && cmmAmsAssetMediaVO.getTagsName().equals("")){
			totCnt = resourcesService.selectResourcesCouListTotCnt(cmmAmsAssetMediaVO);
		}else{
			totCnt = resourcesService.selectResourcesCouListSchTotCnt(cmmAmsAssetMediaVO);
		}
		paginationInfo.setTotalRecordCount(totCnt);	
		
		CmmCouncilInfoVO result = resourcesService.selectCouncilInfo(cmmAmsAssetMediaVO);
		
		List<CmmAmsAssetMediaVO> resultList = resourcesService.selectResourcesCouList(cmmAmsAssetMediaVO);
		for(int i = 0 ; i < resultList.size() ; i++){
			CmmAmsAssetMediaVO res = resultList.get(i);
			res.setLinkUrl(CmmUtil.getLinkUrl(res.getAssetId(), res.getMediaId()));
		}
		
		ComDefaultCodeVO CodeVO = new ComDefaultCodeVO();
		CodeVO.setCodeId(Constant.CODE_ID_FMS014);
        model.addAttribute("firstCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
        
        CodeVO = new ComDefaultCodeVO();
		CodeVO.setCodeId(Constant.CODE_ID_FMS012);
        model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO));

		model.addAttribute("result", result);
		model.addAttribute("resultList", resultList);
		model.addAttribute("paginationInfo", paginationInfo);
		model.addAttribute("totalCnt", totCnt);
		model.addAttribute("paramVO", cmmAmsAssetMediaVO);
		
		// 메타태그정보
    	CmmMetaVO metaVO = new CmmMetaVO();
    	if (result != null) {
    		if (StringUtils.isNotEmpty(result.getCouncilNm())) metaVO.setTitle(result.getCouncilNm()+ " 소장자료");
    	}
    	if (result != null) {
    		if (StringUtils.isNotEmpty(cmmAmsAssetMediaVO.getSojangCouncil())) metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/res/resourceCouList.do?sojangCouncil="+cmmAmsAssetMediaVO.getSojangCouncil());
    	}
    	metaVO.setDescription("지방문화원이 생산,발굴한 독특하고 고유한 지역문화 콘텐츠 및 소장자료를 모든 국민이 향유할수 있도록 제공하는 지역문화 대표 포털");
    	metaVO.setOgType("website");
    	metaVO.setImage("https://www.nculture.org/images/cmm/open-graph-image.jpg");
    	metaVO.setImageType("image/jpeg");
    	model.addAttribute("metaResult", metaVO);
		
		return "kccf/res/resourceCouList.kccf_res";
	}
	
	
	
	
/*	@RequestMapping(value="/cou/{link_nm}")
 	public String selectResourceInfo2 (
 			@ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO
 			, @PathVariable("link_nm") String link_nm
 			, BindingResult bindingResult
 			, ModelMap model
 			,HttpServletRequest req
 			) throws EgovBizException {
		
		CmmUtil.setNfsPathModelMap(req,model);
		
		if(StringUtils.isEmpty(link_nm)){
			return "redirect:/man/main.do";
		}
		cmmAmsAssetMediaVO.setLinkNm(link_nm);
		*//**** paging ****//*		
		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit30());
		paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize());
		
		cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex());
		cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
   		*//**** paging ****//*

		int totCnt = 0;
		if(cmmAmsAssetMediaVO.getSearchStartStr() == null && cmmAmsAssetMediaVO.getSearchEndStr() == null && cmmAmsAssetMediaVO.getFirstClass().equals("") && cmmAmsAssetMediaVO.getSecondClass().equals("")){
			totCnt = resourcesService.selectResourcesListTotCnt2(cmmAmsAssetMediaVO);
		}else{
			totCnt = resourcesService.selectResourcesListSchTotCnt2(cmmAmsAssetMediaVO);
		}
		paginationInfo.setTotalRecordCount(totCnt);	
		
		CmmCouncilInfoVO result = resourcesService.selectCouncilInfo(cmmAmsAssetMediaVO);
		
		List<CmmAmsAssetMediaVO> resultList = resourcesService.selectResourcesList2(cmmAmsAssetMediaVO);		

		model.addAttribute("result", result);
		model.addAttribute("resultList", resultList);
		model.addAttribute("paginationInfo", paginationInfo);
		model.addAttribute("totalCnt", totCnt);
		model.addAttribute("paramVO", cmmAmsAssetMediaVO);
		
		// 메타태그정보
    	CmmMetaVO metaVO = new CmmMetaVO();
    	if (result != null) {
    		if (StringUtils.isNotEmpty(result.getCouncilNm())) metaVO.setTitle(result.getCouncilNm()+ " 소장자료");
    	}
    	if (result != null) {
    		if (StringUtils.isNotEmpty(cmmAmsAssetMediaVO.getSojangCouncil())) metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/res/resourceInfo.do?sojangCouncil="+cmmAmsAssetMediaVO.getSojangCouncil());
    	}
    	metaVO.setDescription("지방문화원이 생산,발굴한 독특하고 고유한 지역문화 콘텐츠 및 소장자료를 모든 국민이 향유할수 있도록 제공하는 지역문화 대표 포털");
    	metaVO.setOgType("website");
    	metaVO.setImage("https://www.nculture.org/images/cmm/open-graph-image.jpg");
    	metaVO.setImageType("image/jpeg");
    	model.addAttribute("metaResult", metaVO);
		
		return "kccf/res/resourceInfo.kccf_res";
	}*/

}
