diff --git a/src/main/java/cmm/service/CmmActivityHstVO.java b/src/main/java/cmm/service/CmmActivityHstVO.java deleted file mode 100644 index 9f9afcff..00000000 --- a/src/main/java/cmm/service/CmmActivityHstVO.java +++ /dev/null @@ -1,203 +0,0 @@ -package cmm.service; - -import java.util.Date; - -import cmm.util.CmmUtil; -import cmm.util.CmmVO; - -@SuppressWarnings("serial") -public class CmmActivityHstVO extends CmmVO { - - private int Id; - private String jsessionId; - private int contentId; - private String contentType; - private String linkUrl; - private String mainImg = ""; - private String title = ""; - private String summary = ""; - private String theme = ""; - private String series = ""; - private String firstTopic = ""; - private String secondTopic = ""; - private String firstClass = ""; - private String secondClass = ""; - private String firstCategory = ""; - private String secondCategory = ""; - private String sidoName = ""; - private String sigunguName = ""; - private String couName = ""; - private String groupName = ""; - private String tags = ""; - private Date createDt; - private String useAt = ""; - private String uaType = ""; - private String copyright = ""; - private String zipCode = ""; - private String tel = ""; - public int getId() { - return Id; - } - public void setId(int id) { - Id = id; - } - public String getJsessionId() { - return jsessionId; - } - public void setJsessionId(String jsessionId) { - this.jsessionId = jsessionId; - } - public int getContentId() { - return contentId; - } - public void setContentId(int contentId) { - this.contentId = contentId; - } - public String getContentType() { - return contentType; - } - public void setContentType(String contentType) { - this.contentType = contentType; - } - public String getLinkUrl() { - return linkUrl; - } - public void setLinkUrl(String linkUrl) { - this.linkUrl = linkUrl; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getTheme() { - return theme; - } - public void setTheme(String theme) { - this.theme = theme; - } - public String getSeries() { - return series; - } - public void setSeries(String series) { - this.series = series; - } - public String getFirstTopic() { - return firstTopic; - } - public void setFirstTopic(String firstTopic) { - this.firstTopic = firstTopic; - } - public String getSecondTopic() { - return secondTopic; - } - public void setSecondTopic(String secondTopic) { - this.secondTopic = secondTopic; - } - public String getFirstClass() { - return firstClass; - } - public void setFirstClass(String firstClass) { - this.firstClass = firstClass; - } - public String getSecondClass() { - return secondClass; - } - public void setSecondClass(String secondClass) { - this.secondClass = secondClass; - } - public String getFirstCategory() { - return firstCategory; - } - public void setFirstCategory(String firstCategory) { - this.firstCategory = firstCategory; - } - public String getSecondCategory() { - return secondCategory; - } - public void setSecondCategory(String secondCategory) { - this.secondCategory = secondCategory; - } - public String getSidoName() { - return sidoName; - } - public void setSidoName(String sidoName) { - this.sidoName = sidoName; - } - public String getSigunguName() { - return sigunguName; - } - public void setSigunguName(String sigunguName) { - this.sigunguName = sigunguName; - } - public String getCouName() { - return couName; - } - public void setCouName(String couName) { - this.couName = couName; - } - public String getGroupName() { - return groupName; - } - public void setGroupName(String groupName) { - this.groupName = groupName; - } - public String getTags() { - return tags; - } - public void setTags(String tags) { - this.tags = tags; - } - public Date getCreateDt() { - return createDt; - } - public void setCreateDt(Date createDt) { - this.createDt = createDt; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public String getUaType() { - return uaType; - } - public void setUaType(String uaType) { - this.uaType = uaType; - } - public String getCopyright() { - return copyright; - } - public void setCopyright(String copyright) { - this.copyright = copyright; - } - public String getZipCode() { - return zipCode; - } - public void setZipCode(String zipCode) { - this.zipCode = zipCode; - } - public String getTel() { - return tel; - } - public void setTel(String tel) { - this.tel = tel; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmAmsAssetCouncilVO.java b/src/main/java/cmm/service/CmmAmsAssetCouncilVO.java deleted file mode 100644 index 69317151..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetCouncilVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cmm.service; - -import cmm.util.CmmUtil; -import cmm.util.CmmVO; - -@SuppressWarnings("serial") -public class CmmAmsAssetCouncilVO extends CmmVO { - - private String id = null; - private String mediaId = null; - private String couName = ""; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - public String getMediaId() { - return mediaId; - } - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - public String getCouName() { - return couName; - } - public void setCouName(String couName) { - this.couName = couName; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmAmsAssetKeywordsVO.java b/src/main/java/cmm/service/CmmAmsAssetKeywordsVO.java deleted file mode 100644 index aa311536..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetKeywordsVO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cmm.service; - - -public class CmmAmsAssetKeywordsVO{ - - private String id = null; - private String dataType =""; - private String refId = ""; - private String keyName = ""; - - private String mediaId = null; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getDataType() { - return dataType; - } - public void setDataType(String dataType) { - this.dataType = dataType; - } - public String getRefId() { - return refId; - } - public void setRefId(String refId) { - this.refId = refId; - } - public String getKeyName() { - return keyName; - } - public void setKeyName(String keyName) { - this.keyName = keyName; - } - public String getMediaId() { - return mediaId; - } - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - - - -} diff --git a/src/main/java/cmm/service/CmmAmsAssetMediaOcrVO.java b/src/main/java/cmm/service/CmmAmsAssetMediaOcrVO.java deleted file mode 100644 index 80d295ce..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetMediaOcrVO.java +++ /dev/null @@ -1,82 +0,0 @@ -package cmm.service; - -import java.util.Date; -import java.util.List; - -import cmm.util.CmmVO; - -/** - * @Class Name : CmmAmsAssetMediaOcrVO.java - * @author ecplaza - * @since 2019-10-14 - * @version 1.0 - */ - -@SuppressWarnings("serial") -public class CmmAmsAssetMediaOcrVO extends CmmVO { - - private String id=""; - private String mediaId = ""; - private String firstPageNum=""; - private String lastPageNum=""; - private String orderNum=""; - private String fileName=""; - private String ocrText=""; - private String createdAt = ""; - private String updatedAt = ""; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getMediaId() { - return mediaId; - } - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - public String getFirstPageNum() { - return firstPageNum; - } - public void setFirstPageNum(String firstPageNum) { - this.firstPageNum = firstPageNum; - } - public String getLastPageNum() { - return lastPageNum; - } - public void setLastPageNum(String lastPageNum) { - this.lastPageNum = lastPageNum; - } - public String getOrderNum() { - return orderNum; - } - public void setOrderNum(String orderNum) { - this.orderNum = orderNum; - } - public String getFileName() { - return fileName; - } - public void setFileName(String fileName) { - this.fileName = fileName; - } - public String getOcrText() { - return ocrText; - } - public void setOcrText(String ocrText) { - this.ocrText = ocrText; - } - public String getCreatedAt() { - return createdAt; - } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - public String getUpdatedAt() { - return updatedAt; - } - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } -} diff --git a/src/main/java/cmm/service/CmmAmsAssetMediaVO.java b/src/main/java/cmm/service/CmmAmsAssetMediaVO.java deleted file mode 100644 index 033f5769..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetMediaVO.java +++ /dev/null @@ -1,811 +0,0 @@ -package cmm.service; - -import java.util.Date; -import java.util.List; - -import cmm.util.CmmVO; - -/** - * @Class Name : CmmAmsAssetMediaVO.java - * @author ecplaza - * @since 2018-05-11O - * @version 1.0 - */ - -@SuppressWarnings("serial") -public class CmmAmsAssetMediaVO extends CmmVO { - - private String id = ""; - private String assetId = ""; - private String interfaceId = ""; - private String mgntNo = ""; - private String assetType = ""; - private String title = ""; - private String firstClass = ""; - private String secondClass = ""; - private String firstClassNm = ""; - private String secondClassNm = ""; - private String subtitle = ""; - private String mainImg = ""; - private String mainImg2 = ""; - private String summary = ""; - private String addition = ""; - private String orignlFileName = ""; - private String streFileName = ""; - private String fileSize = ""; - private String width = ""; - private String height = ""; - private String imgAlt = ""; - private String mediaType = ""; - private String playerAt = ""; - private String playTime = ""; - private String volume = ""; - private String totalPage = ""; - private String isbn = ""; - private String linkData = ""; - private String websiteName = ""; - private String linkUseAt = ""; - private String makingDate = ""; - private String filmingLocation = ""; - private String subtitleAt = ""; - private String subtitleOrgFileName = ""; - private String subtitleStreFileName = ""; - private String subtitleDesc = ""; - private String publisher = ""; - private String genyear = ""; - private String author = ""; - private String provider = ""; - private String sourceAt = ""; - private String source = ""; - private String copyright = ""; - private String retentionPeriod = ""; - private String copyrightMgntDepart = ""; - private String thirdCopyright = ""; - private String cclType = ""; - private String orgOpenAt = ""; - private Date createdAt = null; - private Date updatedAt = null; - private Date deletedAt = null; - private String useAt = ""; - private String remarksDesc = ""; - private String recommendYn = ""; - private String sidoName = ""; - private String sigunguName = ""; - - private String mediaId = ""; - private String assetClass = ""; - private String firstCategoryNm = ""; - private String secondCategoryNm = ""; - private String couName = ""; - private String keyName = ""; - private String tags = ""; - private String tagsName = ""; - private String trsAge = ""; - private String age = ""; - private String chronologicalStart = ""; - private String chronologicalEnd = ""; - private String firstCategory = ""; - private String secondCategory = ""; - private String theme = ""; - private String series = ""; - private String sojangCouncil = ""; - private String sojangCouncilNm = ""; - private String sojangCouncilNmTot = ""; - private String sojangLocation = ""; - private String linkNm = ""; - - private String assetTypeNm = ""; - private String groupId = ""; - private String groupName = ""; - private String mcnt = ""; - private String ocrSplitNum = ""; - private List ocrList = null; - private String tableOfContents = ""; - private List tableOfContentsList = null; - private String contentId = ""; - private String linkUrl = ""; - private String orderIdx = ""; - - List sidoList = null; - List contentIdList; - private String [] codeIdList; - private String [] assetTypeList; - //private String [] userGroupList; - //private String [] ageList; - //private String [] assetClassList; - private String [] councilList; - private String [] categoryList; - private String [] classList; - private String [] assetClassArray; - private String [] pickAssetTypeArray; - private String reSearch; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getAssetId() { - return assetId; - } - public void setAssetId(String assetId) { - this.assetId = assetId; - } - public String getInterfaceId() { - return interfaceId; - } - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - public String getAssetType() { - return assetType; - } - public void setAssetType(String assetType) { - this.assetType = assetType; - } - - public String getMgntNo() { - return mgntNo; - } - public void setMgntNo(String mgntNo) { - this.mgntNo = mgntNo; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getFirstClass() { - return firstClass; - } - public void setFirstClass(String firstClass) { - this.firstClass = firstClass; - } - public String getSecondClass() { - return secondClass; - } - public void setSecondClass(String secondClass) { - this.secondClass = secondClass; - } - public String getFirstClassNm() { - return firstClassNm; - } - public void setFirstClassNm(String firstClassNm) { - this.firstClassNm = firstClassNm; - } - public String getSecondClassNm() { - return secondClassNm; - } - public void setSecondClassNm(String secondClassNm) { - this.secondClassNm = secondClassNm; - } - public String getSubtitle() { - return subtitle; - } - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getMainImg2() { - return mainImg2; - } - public void setMainImg2(String mainImg2) { - this.mainImg2 = mainImg2; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getAddition() { - return addition; - } - public void setAddition(String addition) { - this.addition = addition; - } - public String getOrignlFileName() { - return orignlFileName; - } - public void setOrignlFileName(String orignlFileName) { - this.orignlFileName = orignlFileName; - } - public String getStreFileName() { - return streFileName; - } - public void setStreFileName(String streFileName) { - this.streFileName = streFileName; - } - public String getFileSize() { - return fileSize; - } - public void setFileSize(String fileSize) { - this.fileSize = fileSize; - } - public String getWidth() { - return width; - } - public void setWidth(String width) { - this.width = width; - } - public String getHeight() { - return height; - } - public void setHeight(String height) { - this.height = height; - } - public String getImgAlt() { - return imgAlt; - } - public void setImgAlt(String imgAlt) { - this.imgAlt = imgAlt; - } - public String getMediaType() { - return mediaType; - } - public void setMediaType(String mediaType) { - this.mediaType = mediaType; - } - public String getPlayerAt() { - return playerAt; - } - public void setPlayerAt(String playerAt) { - this.playerAt = playerAt; - } - public String getPlayTime() { - return playTime; - } - public void setPlayTime(String playTime) { - this.playTime = playTime; - } - public String getVolume() { - return volume; - } - public void setVolume(String volume) { - this.volume = volume; - } - public String getTotalPage() { - return totalPage; - } - public void setTotalPage(String totalPage) { - this.totalPage = totalPage; - } - public String getIsbn() { - return isbn; - } - public void setIsbn(String isbn) { - this.isbn = isbn; - } - public String getLinkData() { - return linkData; - } - public void setLinkData(String linkData) { - this.linkData = linkData; - } - public String getWebsiteName() { - return websiteName; - } - public void setWebsiteName(String websiteName) { - this.websiteName = websiteName; - } - public String getLinkUseAt() { - return linkUseAt; - } - public void setLinkUseAt(String linkUseAt) { - this.linkUseAt = linkUseAt; - } - public String getMakingDate() { - return makingDate; - } - public void setMakingDate(String makingDate) { - this.makingDate = makingDate; - } - public String getFilmingLocation() { - return filmingLocation; - } - public void setFilmingLocation(String filmingLocation) { - this.filmingLocation = filmingLocation; - } - public String getSubtitleAt() { - return subtitleAt; - } - public void setSubtitleAt(String subtitleAt) { - this.subtitleAt = subtitleAt; - } - public String getSubtitleOrgFileName() { - return subtitleOrgFileName; - } - public void setSubtitleOrgFileName(String subtitleOrgFileName) { - this.subtitleOrgFileName = subtitleOrgFileName; - } - public String getSubtitleStreFileName() { - return subtitleStreFileName; - } - public void setSubtitleStreFileName(String subtitleStreFileName) { - this.subtitleStreFileName = subtitleStreFileName; - } - public String getSubtitleDesc() { - return subtitleDesc; - } - public void setSubtitleDesc(String subtitleDesc) { - this.subtitleDesc = subtitleDesc; - } - public String getPublisher() { - return publisher; - } - public void setPublisher(String publisher) { - this.publisher = publisher; - } - public String getGenyear() { - return genyear; - } - public void setGenyear(String genyear) { - this.genyear = genyear; - } - public String getAuthor() { - return author; - } - public void setAuthor(String author) { - this.author = author; - } - public String getProvider() { - return provider; - } - public void setProvider(String provider) { - this.provider = provider; - } - public String getSourceAt() { - return sourceAt; - } - public void setSourceAt(String sourceAt) { - this.sourceAt = sourceAt; - } - public String getSource() { - return source; - } - public void setSource(String source) { - this.source = source; - } - public String getCopyright() { - return copyright; - } - public void setCopyright(String copyright) { - this.copyright = copyright; - } - public String getRetentionPeriod() { - return retentionPeriod; - } - public void setRetentionPeriod(String retentionPeriod) { - this.retentionPeriod = retentionPeriod; - } - public String getCopyrightMgntDepart() { - return copyrightMgntDepart; - } - public void setCopyrightMgntDepart(String copyrightMgntDepart) { - this.copyrightMgntDepart = copyrightMgntDepart; - } - public String getThirdCopyright() { - return thirdCopyright; - } - public void setThirdCopyright(String thirdCopyright) { - this.thirdCopyright = thirdCopyright; - } - public String getCclType() { - return cclType; - } - public void setCclType(String cclType) { - this.cclType = cclType; - } - public String getOrgOpenAt() { - return orgOpenAt; - } - public void setOrgOpenAt(String orgOpenAt) { - this.orgOpenAt = orgOpenAt; - } - public Date getCreatedAt() { - return createdAt; - } - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - public Date getUpdatedAt() { - return updatedAt; - } - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - public Date getDeletedAt() { - return deletedAt; - } - public void setDeletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public String getRemarksDesc() { - return remarksDesc; - } - public void setRemarksDesc(String remarksDesc) { - this.remarksDesc = remarksDesc; - } - public String getRecommendYn() { - return recommendYn; - } - public void setRecommendYn(String recommendYn) { - this.recommendYn = recommendYn; - } - public String getSidoName() { - return sidoName; - } - public void setSidoName(String sidoName) { - this.sidoName = sidoName; - } - public String getSigunguName() { - return sigunguName; - } - public void setSigunguName(String sigunguName) { - this.sigunguName = sigunguName; - } - public String getMediaId() { - return mediaId; - } - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - public String getAssetClass() { - return assetClass; - } - public void setAssetClass(String assetClass) { - this.assetClass = assetClass; - } - public String getFirstCategoryNm() { - return firstCategoryNm; - } - public void setFirstCategoryNm(String firstCategoryNm) { - this.firstCategoryNm = firstCategoryNm; - } - public String getSecondCategoryNm() { - return secondCategoryNm; - } - public void setSecondCategoryNm(String secondCategoryNm) { - this.secondCategoryNm = secondCategoryNm; - } - public List getSidoList() { - return sidoList; - } - public void setSidoList(List sidoList) { - this.sidoList = sidoList; - } - public List getContentIdList() { - return contentIdList; - } - public void setContentIdList(List contentIdList) { - this.contentIdList = contentIdList; - } - public String[] getCodeIdList() { - String[] ret = null; - if (this.codeIdList != null) { - ret = new String[codeIdList.length]; - for (int i = 0; i < codeIdList.length; i++) { - ret[i] = this.codeIdList[i]; - } - } - return ret; - } - - public void setCodeIdList(String[] codeIdList) { - // 수정 - this.codeIdList = new String[codeIdList.length]; - for(int i = 0; i < codeIdList.length; ++i) - this.codeIdList[i] = codeIdList[i]; - } - - public String[] getAssetTypeList() { - String[] ret = null; - if (this.assetTypeList != null) { - ret = new String[assetTypeList.length]; - for (int i = 0; i < assetTypeList.length; i++) { - ret[i] = this.assetTypeList[i]; - } - } - return ret; - } - public void setAssetTypeList(String[] assetTypeList) { - // 수정 - this.assetTypeList = new String[assetTypeList.length]; - for(int i = 0; i < assetTypeList.length; ++i) - this.assetTypeList[i] = assetTypeList[i]; - } -// public String[] getUserGroupList() { -// return userGroupList; -// } -// public void setUserGroupList(String[] userGroupList) { -// this.userGroupList = userGroupList; -// } -// public String[] getAgeList() { -// return ageList; -// } -// public void setAgeList(String[] ageList) { -// this.ageList = ageList; -// } -// public String[] getAssetClassList() { -// return assetClassList; -// } -// public void setAssetClassList(String[] assetClassList) { -// this.assetClassList = assetClassList; -// } - public String[] getCouncilList() { - String[] ret = null; - if (this.councilList != null) { - ret = new String[councilList.length]; - for (int i = 0; i < councilList.length; i++) { - ret[i] = this.councilList[i]; - } - } - return ret; - } - public void setCouncilList(String[] councilList) { - // 수정 - this.councilList = new String[councilList.length]; - for(int i = 0; i < councilList.length; ++i) - this.councilList[i] = councilList[i]; - } - - public String[] getCategoryList() { - String[] ret = null; - if (this.categoryList != null) { - ret = new String[categoryList.length]; - for (int i = 0; i < categoryList.length; i++) { - ret[i] = this.categoryList[i]; - } - } - return ret; - } - public void setCategoryList(String[] categoryList) { - // 수정 - this.categoryList = new String[categoryList.length]; - for(int i = 0; i < categoryList.length; ++i) - this.categoryList[i] = categoryList[i]; - } - - public String[] getClassList() { - String[] ret = null; - if (this.classList != null) { - ret = new String[classList.length]; - for (int i = 0; i < classList.length; i++) { - ret[i] = this.classList[i]; - } - } - return ret; - } - public void setClassList(String[] classList) { - this.classList = new String[classList.length]; - for(int i = 0; i < classList.length; ++i) - this.classList[i] = classList[i]; - } - - public String[] getAssetClassArray() { - String[] ret = null; - if (this.assetClassArray != null) { - ret = new String[assetClassArray.length]; - for (int i = 0; i < assetClassArray.length; i++) { - ret[i] = this.assetClassArray[i]; - } - } - return ret; - } - public void setAssetClassArray(String[] assetClassArray) { - // 수정 - this.assetClassArray = new String[assetClassArray.length]; - for(int i = 0; i < assetClassArray.length; ++i) - this.assetClassArray[i] = assetClassArray[i]; - } - - - public String[] getPickAssetTypeArray() { - String[] ret = null; - if (this.pickAssetTypeArray != null) { - ret = new String[pickAssetTypeArray.length]; - for (int i = 0; i < pickAssetTypeArray.length; i++) { - ret[i] = this.pickAssetTypeArray[i]; - } - } - return ret; - } - public void setPickAssetTypeArray(String[] pickAssetTypeArray) { - this.pickAssetTypeArray = new String[pickAssetTypeArray.length]; - for(int i = 0; i < pickAssetTypeArray.length; ++i) - this.pickAssetTypeArray[i] = pickAssetTypeArray[i]; - } - - public String getCouName() { - return couName; - } - public void setCouName(String couName) { - this.couName = couName; - } - public String getKeyName() { - return keyName; - } - public void setKeyName(String keyName) { - this.keyName = keyName; - } - public String getTags() { - return tags; - } - public void setTags(String tags) { - this.tags = tags; - } - public String getTagsName() { - return tagsName; - } - public void setTagsName(String tagsName) { - this.tagsName = tagsName; - } - public String getTrsAge() { - return trsAge; - } - public void setTrsAge(String trsAge) { - this.trsAge = trsAge; - } - public String getAge() { - return age; - } - public void setAge(String age) { - this.age = age; - } - public String getChronologicalStart() { - return chronologicalStart; - } - public void setChronologicalStart(String chronologicalStart) { - this.chronologicalStart = chronologicalStart; - } - public String getChronologicalEnd() { - return chronologicalEnd; - } - public void setChronologicalEnd(String chronologicalEnd) { - this.chronologicalEnd = chronologicalEnd; - } - public String getFirstCategory() { - return firstCategory; - } - public void setFirstCategory(String firstCategory) { - this.firstCategory = firstCategory; - } - public String getSecondCategory() { - return secondCategory; - } - public void setSecondCategory(String secondCategory) { - this.secondCategory = secondCategory; - } - public String getTheme() { - return theme; - } - public void setTheme(String theme) { - this.theme = theme; - } - public String getSeries() { - return series; - } - public void setSeries(String series) { - this.series = series; - } - public String getSojangCouncil() { - return sojangCouncil; - } - public void setSojangCouncil(String sojangCouncil) { - this.sojangCouncil = sojangCouncil; - } - public String getSojangCouncilNm() { - return sojangCouncilNm; - } - public void setSojangCouncilNm(String sojangCouncilNm) { - this.sojangCouncilNm = sojangCouncilNm; - } - - public String getSojangCouncilNmTot() { - return sojangCouncilNmTot; - } - public void setSojangCouncilNmTot(String sojangCouncilNmTot) { - this.sojangCouncilNmTot = sojangCouncilNmTot; - } - public String getSojangLocation() { - return sojangLocation; - } - public void setSojangLocation(String sojangLocation) { - this.sojangLocation = sojangLocation; - } - - public String getGroupId() { - return groupId; - } - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public String getGroupName() { - return groupName; - } - public void setGroupName(String groupName) { - this.groupName = groupName; - } - public String getMcnt() { - return mcnt; - } - public void setMcnt(String mcnt) { - this.mcnt = mcnt; - } - public String getOcrSplitNum() { - return ocrSplitNum; - } - public void setOcrSplitNum(String ocrSplitNum) { - this.ocrSplitNum = ocrSplitNum; - } - public List getOcrList() { - return ocrList; - } - public void setOcrList(List ocrList) { - this.ocrList = ocrList; - } - public String getTableOfContents() { - return tableOfContents; - } - public void setTableOfContents(String tableOfContents) { - this.tableOfContents = tableOfContents; - } - public List getTableOfContentsList() { - return tableOfContentsList; - } - public void setTableOfContentsList( - List tableOfContentsList) { - this.tableOfContentsList = tableOfContentsList; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getLinkNm() { - return linkNm; - } - public void setLinkNm(String linkNm) { - this.linkNm = linkNm; - } - public String getAssetTypeNm() { - return assetTypeNm; - } - public void setAssetTypeNm(String assetTypeNm) { - this.assetTypeNm = assetTypeNm; - } - public String getLinkUrl() { - return linkUrl; - } - public void setLinkUrl(String linkUrl) { - this.linkUrl = linkUrl; - } - public String getOrderIdx() { - return orderIdx; - } - public void setOrderIdx(String orderIdx) { - this.orderIdx = orderIdx; - } - public String getReSearch() { - return reSearch; - } - public void setReSearch(String reSearch) { - this.reSearch = reSearch; - } - -} diff --git a/src/main/java/cmm/service/CmmAmsAssetTagsVO.java b/src/main/java/cmm/service/CmmAmsAssetTagsVO.java deleted file mode 100644 index 3e424e95..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetTagsVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package cmm.service; - -import cmm.util.CmmUtil; - -public class CmmAmsAssetTagsVO { - private String id = null; - private String dataType = ""; - private String refId = ""; - private String tagsName = ""; - - private String mediaId = null; - - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getDataType() { - return dataType; - } - public void setDataType(String dataType) { - this.dataType = dataType; - } - public String getRefId() { - return refId; - } - public void setRefId(String refId) { - this.refId = refId; - } - public String getTagsName() { - return tagsName; - } - public void setTagsName(String tagsName) { - this.tagsName = tagsName; - } - public String getMediaId() { - return mediaId; - } - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmAmsAssetsVO.java b/src/main/java/cmm/service/CmmAmsAssetsVO.java deleted file mode 100644 index 95a98b2b..00000000 --- a/src/main/java/cmm/service/CmmAmsAssetsVO.java +++ /dev/null @@ -1,500 +0,0 @@ -package cmm.service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import cmm.util.CmmVO; - -/** - * @Class Name : CmmAmsAssetsVO.java - * @author ecplaza - * @since 2018-05-11O - * @version 1.0 - */ - -@SuppressWarnings("serial") -public class CmmAmsAssetsVO extends CmmVO { - - private String id = ""; - private String interfaceId = ""; - private String assetClass = ""; - private String firstCategory = ""; - private String secondCategory = ""; - private String firstCategoryNm = ""; - private String secondCategoryNm = ""; - private String mainImg = ""; - private String copyright = ""; - private String title = ""; - private String summary = ""; - private String volume = ""; - private String amount = ""; - private String trsAge = ""; - private String age = ""; - private String chronologicalStart = ""; - private String chronologicalEnd = ""; - private String theme = ""; - private String series = ""; - private String sojangCouncil = ""; - private String sojangLocation = ""; - private String remarksDesc = ""; - private Date createdAt = null; - private Date updatedAt = null; - private Date deletedAt = null; - private String useAt = ""; - - - private String assetId = ""; - private String tags = ""; - private String mcnt = ""; - private String sojangCouncilNm = ""; - - private String imgCnt = ""; - private String vedioCnt = ""; - private String audioCnt = ""; - private String docCnt = ""; - private String linkCnt = ""; - - - List sidoList = null; - List contentIdList; - private String [] codeIdList; - private String [] assetTypeList; - private String [] userGroupList; - private String [] ageList; - private String [] assetClassList; - private String [] councilList; - private String [] assetClassArray; - - - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInterfaceId() { - return interfaceId; - } - - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - - public String getAssetClass() { - return assetClass; - } - - public void setAssetClass(String assetClass) { - this.assetClass = assetClass; - } - - public String getFirstCategory() { - return firstCategory; - } - - public void setFirstCategory(String firstCategory) { - this.firstCategory = firstCategory; - } - - public String getSecondCategory() { - return secondCategory; - } - - public void setSecondCategory(String secondCategory) { - this.secondCategory = secondCategory; - } - - public String getFirstCategoryNm() { - return firstCategoryNm; - } - - public void setFirstCategoryNm(String firstCategoryNm) { - this.firstCategoryNm = firstCategoryNm; - } - - public String getSecondCategoryNm() { - return secondCategoryNm; - } - - public void setSecondCategoryNm(String secondCategoryNm) { - this.secondCategoryNm = secondCategoryNm; - } - - public String getMainImg() { - return mainImg; - } - - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - - public String getCopyright() { - return copyright; - } - - public void setCopyright(String copyright) { - this.copyright = copyright; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getSummary() { - return summary; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public String getVolume() { - return volume; - } - - public void setVolume(String volume) { - this.volume = volume; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public String getTrsAge() { - return trsAge; - } - - public void setTrsAge(String trsAge) { - this.trsAge = trsAge; - } - - public String getAge() { - return age; - } - - public void setAge(String age) { - this.age = age; - } - - public String getChronologicalStart() { - return chronologicalStart; - } - - public void setChronologicalStart(String chronologicalStart) { - this.chronologicalStart = chronologicalStart; - } - - public String getChronologicalEnd() { - return chronologicalEnd; - } - - public void setChronologicalEnd(String chronologicalEnd) { - this.chronologicalEnd = chronologicalEnd; - } - - public String getTheme() { - return theme; - } - - public void setTheme(String theme) { - this.theme = theme; - } - - public String getSeries() { - return series; - } - - public void setSeries(String series) { - this.series = series; - } - - public String getSojangCouncil() { - return sojangCouncil; - } - - public void setSojangCouncil(String sojangCouncil) { - this.sojangCouncil = sojangCouncil; - } - - public String getSojangLocation() { - return sojangLocation; - } - - public void setSojangLocation(String sojangLocation) { - this.sojangLocation = sojangLocation; - } - - public String getRemarksDesc() { - return remarksDesc; - } - - public void setRemarksDesc(String remarksDesc) { - this.remarksDesc = remarksDesc; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - public Date getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - - public Date getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - } - - public String getUseAt() { - return useAt; - } - - public void setUseAt(String useAt) { - this.useAt = useAt; - } - - - public String getAssetId() { - return assetId; - } - - public void setAssetId(String assetId) { - this.assetId = assetId; - } - - public String getTags() { - return tags; - } - - public void setTags(String tags) { - this.tags = tags; - } - - - - public String getMcnt() { - return mcnt; - } - - public void setMcnt(String mcnt) { - this.mcnt = mcnt; - } - - public String getSojangCouncilNm() { - return sojangCouncilNm; - } - - public void setSojangCouncilNm(String sojangCouncilNm) { - this.sojangCouncilNm = sojangCouncilNm; - } - - public String getImgCnt() { - return imgCnt; - } - - public void setImgCnt(String imgCnt) { - this.imgCnt = imgCnt; - } - - public String getVedioCnt() { - return vedioCnt; - } - - public void setVedioCnt(String vedioCnt) { - this.vedioCnt = vedioCnt; - } - - public String getAudioCnt() { - return audioCnt; - } - - public void setAudioCnt(String audioCnt) { - this.audioCnt = audioCnt; - } - - public String getDocCnt() { - return docCnt; - } - - public void setDocCnt(String docCnt) { - this.docCnt = docCnt; - } - - public String getLinkCnt() { - return linkCnt; - } - - public void setLinkCnt(String linkCnt) { - this.linkCnt = linkCnt; - } - - public List getSidoList() { - List ret = null; - if(this.sidoList != null){ - ret = new ArrayList(); - ret = this.sidoList; - } - return ret; - } - - public void setSidoList(ArrayList cmmCmsSidoList) { - this.sidoList = new ArrayList (cmmCmsSidoList.size()); - for(int i=0; i getContentIdList() { - List ret = null; - if(this.contentIdList != null){ - ret = new ArrayList(); - ret = this.contentIdList; - } - return ret; - } - - public void setContentIdList(List contentIdList) { - this.contentIdList = new ArrayList (contentIdList.size()); - for(int i=0; i getToolsApiNews(DataMap paramMap); - DataMap getGiaList(DataMap paramMap); - DataMap getGiaDetailCommon(DataMap paramMap); - DataMap getGiaDetailIntro(DataMap paramMap); - DataMap getGiaDetailInfo(DataMap paramMap); - DataMap getGiaDetailImage(DataMap paramMap); -} diff --git a/src/main/java/cmm/service/CmmBbsService.java b/src/main/java/cmm/service/CmmBbsService.java deleted file mode 100644 index dfcf3d97..00000000 --- a/src/main/java/cmm/service/CmmBbsService.java +++ /dev/null @@ -1,26 +0,0 @@ -package cmm.service; - - -import java.io.IOException; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.cmmn.exception.FdlException; - - -public interface CmmBbsService { - int selectCmmBbsListTotCnt(CmmBbsVO cmmBbsVO) throws EgovBizException; - List selectCmmBbsList(CmmBbsVO cmmBbsVO) throws EgovBizException; - List selectCmmBbsTopList(CmmBbsVO cmmBbsVO) throws EgovBizException; - List selectCmmBbsCnList(CmmBbsVO cmmBbsVO) throws EgovBizException; - List selectCmmBbsMainList(CmmBbsVO cmmBbsVO) throws EgovBizException; - CmmBbsVO selectCmmBbsDetail(CmmBbsVO cmmBbsVO) throws EgovBizException; - List selectPrevNextCmmBbsDetailList(CmmBbsVO cmmBbsVO) throws EgovBizException; - String insertCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws IOException, FdlException, EgovBizException; - void updateCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws IOException, EgovBizException; - void deleteCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws EgovBizException; - - void updateLocalCultureRecommend(CmmBbsVO cmmBbsVO) throws EgovBizException; -} diff --git a/src/main/java/cmm/service/CmmBbsVO.java b/src/main/java/cmm/service/CmmBbsVO.java deleted file mode 100644 index 3fefa7ec..00000000 --- a/src/main/java/cmm/service/CmmBbsVO.java +++ /dev/null @@ -1,422 +0,0 @@ -package cmm.service; - - -import java.util.Date; -import java.util.List; - -import cmm.util.CmmUtil; -import cmm.util.CmmVO; - - - - -@SuppressWarnings("serial") -public class CmmBbsVO extends CmmVO { - - - private String nttId = ""; - private String bbsId = ""; - private long nttNo = 0L; - private String nttSj = ""; - private String nttCn = ""; - private String answerAt = "N"; - private String answerCn = ""; - private String overview = ""; - private String parntscttNo = "0"; - private String answerLc = "0"; - private long sortOrdr = 0L; - private int rdcnt = 0; - private String useAt = ""; - private String ntceBgnde = ""; - private String ntceEndde = ""; - private String ntcrId = ""; - private String ntcrNm = ""; - private String password = ""; - private String atchFileId = ""; - private String atchFileNm = ""; - private Date frstRegistPnttm = null; - private String frstRegisterId = ""; - private String frstRegisterNm = ""; - private Date lastUpdtPnttm = null; - private String lastUpdusrId = ""; - private String lastUpdusrNm = ""; - private String gubun = ""; - private String topYn = ""; - private int topCnt = 0; - private String notice = ""; - private String nttType =""; - private String[] nttTypes ; - - private String tel =""; - private String zipCode=""; - private String address=""; - private String sidoName=""; - private String sigunguName=""; - private String latitude=""; - private String longitude=""; - private String mainImg=""; - private String mainImgOrignlFileNm=""; - private String thumAtchCtrl =""; - List nttIdList; - - public String getNttType() { - return nttType; - } - - public void setNttType(String nttType) { - this.nttType = nttType; - } - - public String getNotice() { - return notice; - } - - public void setNotice(String notice) { - this.notice = notice; - } - - public String getNttId() { - return this.nttId; - } - - public void setNttId(String nttId) { - this.nttId = nttId; - } - - public String getBbsId() { - return this.bbsId; - } - - public void setBbsId(String bbsId) { - this.bbsId = bbsId; - } - - public long getNttNo() { - return this.nttNo; - } - - public void setNttNo(long nttNo) { - this.nttNo = nttNo; - } - - public String getNttSj() { - return this.nttSj; - } - - public void setNttSj(String nttSj) { - this.nttSj = nttSj; - } - - public String getNttCn() { - return this.nttCn; - } - - public void setNttCn(String nttCn) { - this.nttCn = nttCn; - } - - public String getAnswerAt() { - return this.answerAt; - } - - public void setAnswerAt(String answerAt) { - this.answerAt = answerAt; - } - - public String getAnswerCn() { - return answerCn; - } - - public void setAnswerCn(String answerCn) { - this.answerCn = answerCn; - } - - public String getOverview() { - return overview; - } - - public void setOverview(String overview) { - this.overview = overview; - } - - public String getParntscttNo() { - return this.parntscttNo; - } - - public void setParntscttNo(String parntscttNo) { - this.parntscttNo = parntscttNo; - } - - public String getAnswerLc() { - return this.answerLc; - } - - public void setAnswerLc(String answerLc) { - this.answerLc = answerLc; - } - - public long getSortOrdr() { - return this.sortOrdr; - } - - public void setSortOrdr(long sortOrdr) { - this.sortOrdr = sortOrdr; - } - - public int getRdcnt() { - return this.rdcnt; - } - - public void setRdcnt(int rdcnt) { - this.rdcnt = rdcnt; - } - - public String getUseAt() { - return this.useAt; - } - - public void setUseAt(String useAt) { - this.useAt = useAt; - } - - public String getNtceBgnde() { - return this.ntceBgnde; - } - - public void setNtceBgnde(String ntceBgnde) { - this.ntceBgnde = ntceBgnde; - } - - public String getNtceEndde() { - return this.ntceEndde; - } - - public void setNtceEndde(String ntceEndde) { - this.ntceEndde = ntceEndde; - } - - public String getNtcrId() { - return this.ntcrId; - } - - public void setNtcrId(String ntcrId) { - this.ntcrId = ntcrId; - } - - public String getNtcrNm() { - return this.ntcrNm; - } - - public void setNtcrNm(String ntcrNm) { - this.ntcrNm = ntcrNm; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getAtchFileId() { - return this.atchFileId; - } - - public void setAtchFileId(String atchFileId) { - this.atchFileId = atchFileId; - } - - public String getAtchFileNm() { - return atchFileNm; - } - - public void setAtchFileNm(String atchFileNm) { - this.atchFileNm = atchFileNm; - } - - public Date getFrstRegistPnttm() { - return this.frstRegistPnttm; - } - - public void setFrstRegistPnttm(Date frstRegistPnttm) { - this.frstRegistPnttm = frstRegistPnttm; - } - - public String getFrstRegisterId() { - return this.frstRegisterId; - } - - public void setFrstRegisterId(String frstRegisterId) { - this.frstRegisterId = frstRegisterId; - } - - public String getFrstRegisterNm() { - return frstRegisterNm; - } - - public void setFrstRegisterNm(String frstRegisterNm) { - this.frstRegisterNm = frstRegisterNm; - } - - public Date getLastUpdtPnttm() { - return this.lastUpdtPnttm; - } - - public void setLastUpdtPnttm(Date lastUpdtPnttm) { - this.lastUpdtPnttm = lastUpdtPnttm; - } - - public String getLastUpdusrId() { - return this.lastUpdusrId; - } - - public void setLastUpdusrId(String lastUpdusrId) { - this.lastUpdusrId = lastUpdusrId; - } - - - public String getLastUpdusrNm() { - return lastUpdusrNm; - } - - public void setLastUpdusrNm(String lastUpdusrNm) { - this.lastUpdusrNm = lastUpdusrNm; - } - - public String getGubun() { - return gubun; - } - - public void setGubun(String gubun) { - this.gubun = gubun; - } - - public String getTopYn() { - return topYn; - } - - public void setTopYn(String topYn) { - this.topYn = topYn; - } - - public int getTopCnt() { - return topCnt; - } - - public void setTopCnt(int topCnt) { - this.topCnt = topCnt; - } - - public String[] getNttTypes() { - String[] ret = null; - if(this.nttTypes != null){ - ret = new String[nttTypes.length]; - ret = this.nttTypes; - } - return ret; - } - - public void setNttTypes(String[] nttTypes) { - this.nttTypes = new String[nttTypes.length]; - for(int i=0; i getNttIdList() { - return nttIdList; - } - - public void setNttIdList(List nttIdList) { - this.nttIdList = nttIdList; - } - - /** - * toString() - * @return String - */ - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmBbsValidator.java b/src/main/java/cmm/service/CmmBbsValidator.java deleted file mode 100644 index 0d168278..00000000 --- a/src/main/java/cmm/service/CmmBbsValidator.java +++ /dev/null @@ -1,23 +0,0 @@ -package cmm.service; - -import org.springframework.stereotype.Component; -import org.springframework.validation.Errors; -import org.springframework.validation.ValidationUtils; -import org.springframework.validation.Validator; - - -@Component("cmmBbsValidator") -public class CmmBbsValidator implements Validator { - - @SuppressWarnings("rawtypes") - public boolean supports(Class clazz) { - return clazz.equals(CmmBbsVO.class); - } - @SuppressWarnings("unused") - public void validate(Object obj, Errors errors) { - CmmBbsVO vo = (CmmBbsVO) obj; - ValidationUtils.rejectIfEmpty(errors, "nttSj", "field.required", "제목을 입력해주세요."); - ValidationUtils.rejectIfEmpty(errors, "nttCn", "field.required", "내용을 입력해주세요."); - } - -} diff --git a/src/main/java/cmm/service/CmmCmsAssetsVO.java b/src/main/java/cmm/service/CmmCmsAssetsVO.java deleted file mode 100644 index fd6c85b4..00000000 --- a/src/main/java/cmm/service/CmmCmsAssetsVO.java +++ /dev/null @@ -1,555 +0,0 @@ -package cmm.service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import cmm.util.CmmVO; - -/** - * @Class Name : CmmAmsAssetMediaVO.java - * @author ecplaza - * @since 2018-05-11O - * @version 1.0 - */ - -@SuppressWarnings("serial") -public class CmmCmsAssetsVO extends CmmVO { - - private String id = ""; - private String contentId = ""; - private String interfaceId = ""; - private String assetType = ""; - private String mainImg = ""; - private String orignlFileName = ""; - private String streFileName = ""; - private String title = ""; - private String subtitle = ""; - private String fileSize = ""; - private String filePath = ""; - private String fileExt = ""; - private String assetAlt = ""; - private String subtitleAt = ""; - private String subtitleOrgFileName = ""; - private String subtitleStreFileName = ""; - private String subtitleDesc = ""; - private String isSeries = ""; - private String firstClassNm = ""; - private String secondClassNm = ""; - private String summary = ""; - private String addition = ""; - private String lang = ""; - private String field = ""; - private String age = ""; - private String chronological = ""; - private String category = ""; - private String publisher = ""; - private String genyear = ""; - private String author = ""; - private String provider = ""; - private String sourceAt = ""; - private String source = ""; - private String sojangCouncil = ""; - private String sojangLocation = ""; - private String remarksDesc = ""; - private String copyright = ""; - private String retentionPeriod = ""; - private String copyrightMgntDepart = ""; - private String thirdCopyright = ""; - private String cclType = ""; - private String orgOpenAt = ""; - private String listOpenAt = ""; - private Date createdAt = null; - private Date updatedAt = null; - private Date deletedAt = null; - private String useAt = ""; - private String linkData = ""; - private String assetClass = ""; - private String recommendYn = ""; - private String couName = ""; - private String address = ""; - private String userGroup = ""; - private String mgmtNo = ""; - List sidoList = null; - List contentIdList; - private String [] codeIdList; - private String [] assetTypeList; - private String [] userGroupList; - private String [] ageList; - private String [] assetClassList; - private String [] councilList; - private String [] assetClassArray; - - public String getAssetClass() { - return assetClass; - } - public void setAssetClass(String assetClass) { - this.assetClass = assetClass; - } - public String getLinkData() { - return linkData; - } - public void setLinkData(String linkData) { - this.linkData = linkData; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getInterfaceId() { - return interfaceId; - } - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - public String getAssetType() { - return assetType; - } - public void setAssetType(String assetType) { - this.assetType = assetType; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getOrignlFileName() { - return orignlFileName; - } - public void setOrignlFileName(String orignlFileName) { - this.orignlFileName = orignlFileName; - } - public String getStreFileName() { - return streFileName; - } - public void setStreFileName(String streFileName) { - this.streFileName = streFileName; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getSubtitle() { - return subtitle; - } - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - public String getFileSize() { - return fileSize; - } - public void setFileSize(String fileSize) { - this.fileSize = fileSize; - } - public String getFilePath() { - return filePath; - } - public void setFilePath(String filePath) { - this.filePath = filePath; - } - public String getFileExt() { - return fileExt; - } - public void setFileExt(String fileExt) { - this.fileExt = fileExt; - } - public String getAssetAlt() { - return assetAlt; - } - public void setAssetAlt(String assetAlt) { - this.assetAlt = assetAlt; - } - public String getSubtitleAt() { - return subtitleAt; - } - public void setSubtitleAt(String subtitleAt) { - this.subtitleAt = subtitleAt; - } - public String getSubtitleOrgFileName() { - return subtitleOrgFileName; - } - public void setSubtitleOrgFileName(String subtitleOrgFileName) { - this.subtitleOrgFileName = subtitleOrgFileName; - } - public String getSubtitleStreFileName() { - return subtitleStreFileName; - } - public void setSubtitleStreFileName(String subtitleStreFileName) { - this.subtitleStreFileName = subtitleStreFileName; - } - public String getSubtitleDesc() { - return subtitleDesc; - } - public void setSubtitleDesc(String subtitleDesc) { - this.subtitleDesc = subtitleDesc; - } - public String getIsSeries() { - return isSeries; - } - public void setIsSeries(String isSeries) { - this.isSeries = isSeries; - } - public String getFirstClassNm() { - return firstClassNm; - } - public void setFirstClassNm(String firstClassNm) { - this.firstClassNm = firstClassNm; - } - public String getSecondClassNm() { - return secondClassNm; - } - public void setSecondClassNm(String secondClassNm) { - this.secondClassNm = secondClassNm; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getAddition() { - return addition; - } - public void setAddition(String addition) { - this.addition = addition; - } - public String getLang() { - return lang; - } - public void setLang(String lang) { - this.lang = lang; - } - public String getField() { - return field; - } - public void setField(String field) { - this.field = field; - } - public String getAge() { - return age; - } - public void setAge(String age) { - this.age = age; - } - public String getChronological() { - return chronological; - } - public void setChronological(String chronological) { - this.chronological = chronological; - } - public String getCategory() { - return category; - } - public void setCategory(String category) { - this.category = category; - } - public String getPublisher() { - return publisher; - } - public void setPublisher(String publisher) { - this.publisher = publisher; - } - public String getGenyear() { - return genyear; - } - public void setGenyear(String genyear) { - this.genyear = genyear; - } - public String getAuthor() { - return author; - } - public void setAuthor(String author) { - this.author = author; - } - public String getProvider() { - return provider; - } - public void setProvider(String provider) { - this.provider = provider; - } - public String getSourceAt() { - return sourceAt; - } - public void setSourceAt(String sourceAt) { - this.sourceAt = sourceAt; - } - public String getSource() { - return source; - } - public void setSource(String source) { - this.source = source; - } - public String getSojangCouncil() { - return sojangCouncil; - } - public void setSojangCouncil(String sojangCouncil) { - this.sojangCouncil = sojangCouncil; - } - public String getSojangLocation() { - return sojangLocation; - } - public void setSojangLocation(String sojangLocation) { - this.sojangLocation = sojangLocation; - } - - public String getRemarksDesc() { - return remarksDesc; - } - public void setRemarksDesc(String remarksDesc) { - this.remarksDesc = remarksDesc; - } - public String getCopyright() { - return copyright; - } - public void setCopyright(String copyright) { - this.copyright = copyright; - } - public String getRetentionPeriod() { - return retentionPeriod; - } - public void setRetentionPeriod(String retentionPeriod) { - this.retentionPeriod = retentionPeriod; - } - public String getCopyrightMgntDepart() { - return copyrightMgntDepart; - } - public void setCopyrightMgntDepart(String copyrightMgntDepart) { - this.copyrightMgntDepart = copyrightMgntDepart; - } - public String getThirdCopyright() { - return thirdCopyright; - } - public void setThirdCopyright(String thirdCopyright) { - this.thirdCopyright = thirdCopyright; - } - public String getCclType() { - return cclType; - } - public void setCclType(String cclType) { - this.cclType = cclType; - } - public String getOrgOpenAt() { - return orgOpenAt; - } - public void setOrgOpenAt(String orgOpenAt) { - this.orgOpenAt = orgOpenAt; - } - public String getListOpenAt() { - return listOpenAt; - } - public void setListOpenAt(String listOpenAt) { - this.listOpenAt = listOpenAt; - } - public Date getCreatedAt() { - return createdAt; - } - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - public Date getUpdatedAt() { - return updatedAt; - } - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - public Date getDeletedAt() { - return deletedAt; - } - public void setDeletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public String getRecommendYn() { - return recommendYn; - } - public void setRecommendYn(String recommendYn) { - this.recommendYn = recommendYn; - } - public String getCouName() { - return couName; - } - public void setCouName(String couName) { - this.couName = couName; - } - public String getAddress() { - return address; - } - public void setAddress(String address) { - this.address = address; - } - public String getUserGroup() { - return userGroup; - } - public void setUserGroup(String userGroup) { - this.userGroup = userGroup; - } - - - public String getMgmtNo() { - return mgmtNo; - } - public void setMgmtNo(String mgmtNo) { - this.mgmtNo = mgmtNo; - } - public List getSidoList() { - List ret = null; - if(this.sidoList != null){ - ret = new ArrayList(); - ret = this.sidoList; - } - return ret; - } - - public void setSidoList(ArrayList cmmCmsSidoList) { - this.sidoList = new ArrayList (cmmCmsSidoList.size()); - for(int i=0; i getContentIdList() { - List ret = null; - if(this.contentIdList != null){ - ret = new ArrayList(); - ret = this.contentIdList; - } - return ret; - } - - public void setContentIdList(List contentIdList) { - this.contentIdList = new ArrayList (contentIdList.size()); - for(int i=0; i contentIdList; - List tagsList; - List topicList; - List councilList; - - private String [] categoryArray1; - private String [] categoryArray2; - private String [] categoryArray3; - private String [] topicArray; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTheme() { - return theme; - } - - public void setTheme(String theme) { - this.theme = theme; - } - - public String getThemeCd() { - return themeCd; - } - - public void setThemeCd(String themeCd) { - this.themeCd = themeCd; - } - - public String getThemeNm() { - return themeNm; - } - - public void setThemeNm(String themeNm) { - this.themeNm = themeNm; - } - - public String getSeries() { - return series; - } - - public void setSeries(String series) { - this.series = series; - } - - public String getSeriesCd() { - return seriesCd; - } - - public void setSeriesCd(String seriesCd) { - this.seriesCd = seriesCd; - } - - public String getSeriesNm() { - return seriesNm; - } - - public void setSeriesNm(String seriesNm) { - this.seriesNm = seriesNm; - } - - public String getFirstTopic() { - return firstTopic; - } - - public void setFirstTopic(String firstTopic) { - this.firstTopic = firstTopic; - } - - public String getSecondTopic() { - return secondTopic; - } - - public void setSecondTopic(String secondTopic) { - this.secondTopic = secondTopic; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getFirstClass() { - return firstClass; - } - - public void setFirstClass(String firstClass) { - this.firstClass = firstClass; - } - - public String getFirstClassNm() { - return firstClassNm; - } - - public void setFirstClassNm(String firstClassNm) { - this.firstClassNm = firstClassNm; - } - - public String getSecondClass() { - return secondClass; - } - - public void setSecondClass(String secondClass) { - this.secondClass = secondClass; - } - - public String getSecondClassNm() { - return secondClassNm; - } - - public void setSecondClassNm(String secondClassNm) { - this.secondClassNm = secondClassNm; - } - - public String getFirstCategory() { - return firstCategory; - } - - public void setFirstCategory(String firstCategory) { - this.firstCategory = firstCategory; - } - - public String getFirstCategoryNm() { - return firstCategoryNm; - } - - public void setFirstCategoryNm(String firstCategoryNm) { - this.firstCategoryNm = firstCategoryNm; - } - - public String getSecondCategory() { - return secondCategory; - } - - public void setSecondCategory(String secondCategory) { - this.secondCategory = secondCategory; - } - - public String getSecondCategoryNm() { - return secondCategoryNm; - } - - public void setSecondCategoryNm(String secondCategoryNm) { - this.secondCategoryNm = secondCategoryNm; - } - - public String getSidoName1() { - return sidoName1; - } - - public void setSidoName1(String sidoName1) { - this.sidoName1 = sidoName1; - } - - public String getSigunguName1() { - return sigunguName1; - } - - public void setSigunguName1(String sigunguName1) { - this.sigunguName1 = sigunguName1; - } - - public String getDongName1() { - return dongName1; - } - - public void setDongName1(String dongName1) { - this.dongName1 = dongName1; - } - - public String getSidoName2() { - return sidoName2; - } - - public void setSidoName2(String sidoName2) { - this.sidoName2 = sidoName2; - } - - public String getSigunguName2() { - return sigunguName2; - } - - public void setSigunguName2(String sigunguName2) { - this.sigunguName2 = sigunguName2; - } - - public String getDongName2() { - return dongName2; - } - - public void setDongName2(String dongName2) { - this.dongName2 = dongName2; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getTrsSidoName() { - return trsSidoName; - } - - public void setTrsSidoName(String trsSidoName) { - this.trsSidoName = trsSidoName; - } - - public String getTrsSigunguName() { - return trsSigunguName; - } - - public void setTrsSigunguName(String trsSigunguName) { - this.trsSigunguName = trsSigunguName; - } - - public String getTrsDongName() { - return trsDongName; - } - - public void setTrsDongName(String trsDongName) { - this.trsDongName = trsDongName; - } - - public String getTrsAge() { - return trsAge; - } - - public void setTrsAge(String trsAge) { - this.trsAge = trsAge; - } - - public String getAge() { - return age; - } - - public void setAge(String age) { - this.age = age; - } - - public String getChronologicalStart() { - return chronologicalStart; - } - - public void setChronologicalStart(String chronologicalStart) { - this.chronologicalStart = chronologicalStart; - } - - public String getChronologicalEnd() { - return chronologicalEnd; - } - - public void setChronologicalEnd(String chronologicalEnd) { - this.chronologicalEnd = chronologicalEnd; - } - - public String getSummary() { - return summary; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getAddInformation() { - return addInformation; - } - - public void setAddInformation(String addInformation) { - this.addInformation = addInformation; - } - - public String getWriterOpinion() { - return writerOpinion; - } - - public void setWriterOpinion(String writerOpinion) { - this.writerOpinion = writerOpinion; - } - - public String getWriter() { - return writer; - } - - public void setWriter(String writer) { - this.writer = writer; - } - - public String getCclType() { - return cclType; - } - - public void setCclType(String cclType) { - this.cclType = cclType; - } - - public String getGenyear() { - return genyear; - } - - public void setGenyear(String genyear) { - this.genyear = genyear; - } - - public Date getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - } - - public Date getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - public String getInterfaceId() { - return interfaceId; - } - - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - - public String getLinkData() { - return linkData; - } - - public void setLinkData(String linkData) { - this.linkData = linkData; - } - - public String getUseAt() { - return useAt; - } - - public void setUseAt(String useAt) { - this.useAt = useAt; - } - - public String getMainImg() { - return mainImg; - } - - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - - public String getRecommendYn() { - return recommendYn; - } - - public void setRecommendYn(String recommendYn) { - this.recommendYn = recommendYn; - } - - public String getTags() { - return tags; - } - - public void setTags(String tags) { - this.tags = tags; - } - - public String getCouName() { - return couName; - } - - public void setCouName(String couName) { - this.couName = couName; - } - - public int getCnt() { - return cnt; - } - - public void setCnt(int cnt) { - this.cnt = cnt; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getRefType() { - return refType; - } - - public void setRefType(String refType) { - this.refType = refType; - } - - public String getRefDesc() { - return refDesc; - } - - public void setRefDesc(String refDesc) { - this.refDesc = refDesc; - } - - public String getSupLinkData() { - return supLinkData; - } - - public void setSupLinkData(String supLinkData) { - this.supLinkData = supLinkData; - } - - public String getKeyName() { - return keyName; - } - - public void setKeyName(String keyName) { - this.keyName = keyName; - } - - public String getTagsName() { - return tagsName; - } - - public void setTagsName(String tagsName) { - this.tagsName = tagsName; - } - - public String getSupType() { - return supType; - } - - public void setSupType(String supType) { - this.supType = supType; - } - - public String getRelDesc() { - return relDesc; - } - - public void setRelDesc(String relDesc) { - this.relDesc = relDesc; - } - - public String getCopyright() { - return copyright; - } - - public void setCopyright(String copyright) { - this.copyright = copyright; - } - - public List getContentIdList() { - List ret = null; - if(this.contentIdList != null){ - ret = new ArrayList(); - ret = this.contentIdList; - } - return ret; - } - - public void setContentIdList(List contentIdList) { - this.contentIdList = new ArrayList (contentIdList.size()); - for(int i=0; i getTagsList() { - List ret = null; - if(this.tagsList != null){ - ret = new ArrayList(); - ret = this.tagsList; - } - return ret; - } - - public void setTagsList(List tagsList) { - this.tagsList = new ArrayList (tagsList.size()); - for(int i=0; i getTopicList() { - List ret = null; - if(this.topicList != null){ - ret = new ArrayList(); - ret = this.topicList; - } - return ret; - } - - public void setTopicList(List topicList) { - this.topicList = new ArrayList (topicList.size()); - for(int i=0; i getCouncilList() { - List ret = null; - if(this.councilList != null){ - ret = new ArrayList(); - ret = this.councilList; - } - return ret; - } - - public void setCouncilList(List councilList) { - this.councilList = new ArrayList (councilList.size()); - for(int i=0; i selectCmmActivityHstOpList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - List selectCmmScrapList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - int selectCmmScrapListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - int selectCmmActivityHstOpListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - List selectCmmCmsKeywordsList(List result) throws EgovBizException; - List selectCmmCmsTagsList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - List selectCmmCmsPopularList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - void deleteAllCmmScrapInfo(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; -} diff --git a/src/main/java/cmm/service/CmmCmsSupplementDataVO.java b/src/main/java/cmm/service/CmmCmsSupplementDataVO.java deleted file mode 100644 index c825bdf4..00000000 --- a/src/main/java/cmm/service/CmmCmsSupplementDataVO.java +++ /dev/null @@ -1,54 +0,0 @@ -package cmm.service; - -import cmm.util.CmmUtil; - -public class CmmCmsSupplementDataVO { - private String id = null; - private String contentId = null; - private String contentGroupId = ""; - private String supType = ""; - private String linkData = ""; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getContentGroupId() { - return contentGroupId; - } - - public void setContentGroupId(String contentGroupId) { - this.contentGroupId = contentGroupId; - } - - public String getSupType() { - return supType; - } - - public void setSupType(String supType) { - this.supType = supType; - } - - public String getLinkData() { - return linkData; - } - - public void setLinkData(String linkData) { - this.linkData = linkData; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmCmsTagsVO.java b/src/main/java/cmm/service/CmmCmsTagsVO.java deleted file mode 100644 index 7e71e27a..00000000 --- a/src/main/java/cmm/service/CmmCmsTagsVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cmm.service; - -import cmm.util.CmmUtil; - -public class CmmCmsTagsVO { - private String id = null; - private String contentId = null; - private String tagsName = ""; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getTagsName() { - return tagsName; - } - public void setTagsName(String tagsName) { - this.tagsName = tagsName; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmCmsUserGroupVO.java b/src/main/java/cmm/service/CmmCmsUserGroupVO.java deleted file mode 100644 index af7bf89d..00000000 --- a/src/main/java/cmm/service/CmmCmsUserGroupVO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cmm.service; - -import cmm.util.CmmUtil; - -public class CmmCmsUserGroupVO { - private String id = null; - private String contentId = null; - private String userType = ""; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getUserType() { - return userType; - } - - public void setUserType(String userType) { - this.userType = userType; - } - public String toString() { - return CmmUtil.reflectionToString(this); - } -} diff --git a/src/main/java/cmm/service/CmmCmsVO.java b/src/main/java/cmm/service/CmmCmsVO.java deleted file mode 100644 index 0cd8f605..00000000 --- a/src/main/java/cmm/service/CmmCmsVO.java +++ /dev/null @@ -1,571 +0,0 @@ -package cmm.service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import cmm.util.CmmUtil; -import cmm.util.CmmVO; - - -@SuppressWarnings("serial") -public class CmmCmsVO extends CmmVO { - - private String id = null; - private String contentId = null; - private String theme = ""; - private String series = ""; - private String firstTopic = ""; - private String secondTopic = ""; - private String title = ""; - private String sidoName1 = ""; - private String sigunguName1 = ""; - private String dongName1 = ""; - private String sidoName2 = ""; - private String sigunguName2 = ""; - private String dongName2 = ""; - private String latitude = ""; - private String longitude = ""; - private String trsSidoName = ""; - private String trsSigunguName = ""; - private String trsDongName = ""; - private String field = ""; - private String age = ""; - private String chronological = ""; - private String summary = ""; - private String description = ""; - private String addInformation = ""; - private String writerOpinion = ""; - private String writer = ""; - private Date deletedAt = null; - private Date updatedAt = null; - private Date createdAt = null; - private String interfaceId = ""; - private String linkData = ""; - private String recommendYn =""; - private String useAt = "Y"; - private String mainImg = ""; - private String rdcnt = ""; - private String etcCol1; - private String etcCol2; - private String council = ""; - private String volume = ""; - private String author = ""; - private String publisher = ""; - private String genyear = ""; - private String amount = ""; - private String sidoName = ""; - private String sigunguName = ""; - private String category = ""; - private String keywords = ""; - private String count = ""; - private String haveFile = ""; - private String needDigital = ""; - private String desc = ""; - private String location = ""; - private String scan1 = ""; - private String scan1History = ""; - private String writerSelect = ""; - private String contentType = ""; - private String joinCnt = ""; - private String satisAvg = ""; - private String couName = ""; - private String orgOpenAt = ""; - private String listOpenAt = ""; - private String assetType = ""; - private String assetClass = ""; - private String uaType=""; - - - private String mediaId = null; - - List cmmCmsKeywordsList = null; - List cmmCmsTagsList = null; - List cmmCouncilInfoList = null; - List cmmCmsSupplementDataList = null; - List cmmCmsReferenceDataList = null; - List cmmCmsRelatedDataList = null; - - - - - public String getRecommendYn() { - return recommendYn; - } - public void setRecommendYn(String recommendYn) { - this.recommendYn = recommendYn; - } - public String getAssetType() { - return assetType; - } - public void setAssetType(String assetType) { - this.assetType = assetType; - } - public String getOrgOpenAt() { - return orgOpenAt; - } - public void setOrgOpenAt(String orgOpenAt) { - this.orgOpenAt = orgOpenAt; - } - public String getListOpenAt() { - return listOpenAt; - } - public void setListOpenAt(String listOpenAt) { - this.listOpenAt = listOpenAt; - } - public String getCouName() { - return couName; - } - public void setCouName(String couName) { - this.couName = couName; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getTheme() { - return theme; - } - public void setTheme(String theme) { - this.theme = theme; - } - public String getSeries() { - return series; - } - public void setSeries(String series) { - this.series = series; - } - public String getFirstTopic() { - return firstTopic; - } - public void setFirstTopic(String firstTopic) { - this.firstTopic = firstTopic; - } - public String getSecondTopic() { - return secondTopic; - } - public void setSecondTopic(String secondTopic) { - this.secondTopic = secondTopic; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getSidoName1() { - return sidoName1; - } - public void setSidoName1(String sidoName1) { - this.sidoName1 = sidoName1; - } - public String getSigunguName1() { - return sigunguName1; - } - public void setSigunguName1(String sigunguName1) { - this.sigunguName1 = sigunguName1; - } - public String getDongName1() { - return dongName1; - } - public void setDongName1(String dongName1) { - this.dongName1 = dongName1; - } - public String getSidoName2() { - return sidoName2; - } - public void setSidoName2(String sidoName2) { - this.sidoName2 = sidoName2; - } - public String getSigunguName2() { - return sigunguName2; - } - public void setSigunguName2(String sigunguName2) { - this.sigunguName2 = sigunguName2; - } - public String getDongName2() { - return dongName2; - } - public void setDongName2(String dongName2) { - this.dongName2 = dongName2; - } - public String getLatitude() { - return latitude; - } - public void setLatitude(String latitude) { - this.latitude = latitude; - } - public String getLongitude() { - return longitude; - } - public void setLongitude(String longitude) { - this.longitude = longitude; - } - public String getTrsSidoName() { - return trsSidoName; - } - public void setTrsSidoName(String trsSidoName) { - this.trsSidoName = trsSidoName; - } - public String getTrsSigunguName() { - return trsSigunguName; - } - public void setTrsSigunguName(String trsSigunguName) { - this.trsSigunguName = trsSigunguName; - } - public String getTrsDongName() { - return trsDongName; - } - public void setTrsDongName(String trsDongName) { - this.trsDongName = trsDongName; - } - public String getField() { - return field; - } - public void setField(String field) { - this.field = field; - } - public String getAge() { - return age; - } - public void setAge(String age) { - this.age = age; - } - public String getChronological() { - return chronological; - } - public void setChronological(String chronological) { - this.chronological = chronological; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public String getAddInformation() { - return addInformation; - } - public void setAddInformation(String addInformation) { - this.addInformation = addInformation; - } - public String getWriterOpinion() { - return writerOpinion; - } - public void setWriterOpinion(String writerOpinion) { - this.writerOpinion = writerOpinion; - } - public String getWriter() { - return writer; - } - public void setWriter(String writer) { - this.writer = writer; - } - public String getInterfaceId() { - return interfaceId; - } - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - public String getLinkData() { - return linkData; - } - public void setLinkData(String linkData) { - this.linkData = linkData; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getRdcnt() { - return rdcnt; - } - public void setRdcnt(String rdcnt) { - this.rdcnt = rdcnt; - } - public List getCmmCmsKeywordsList() { - List ret = null; - if(this.cmmCmsKeywordsList != null){ - ret = new ArrayList(); - ret = this.cmmCmsKeywordsList; - } - return ret; - } - public void setCmmCmsKeywordsList(ArrayList cmmCmsKeywordsList) { - this.cmmCmsKeywordsList = new ArrayList (cmmCmsKeywordsList.size()); - for(int i=0; i getCmmCmsTagsList() { - List ret = null; - if(this.cmmCmsTagsList != null){ - ret = new ArrayList(); - ret = this.cmmCmsTagsList; - } - return ret; - } - public void setCmmCmsTagsList(ArrayList cmmCmsTagsList) { - this.cmmCmsTagsList = new ArrayList (cmmCmsTagsList.size()); - for(int i=0; i getCmmCouncilInfoList() { - List ret = null; - if(this.cmmCouncilInfoList != null){ - ret = new ArrayList(); - ret = this.cmmCouncilInfoList; - } - return ret; - } - public void setCmmCouncilInfoList(ArrayList cmmCouncilInfoList) { - this.cmmCouncilInfoList = new ArrayList (cmmCouncilInfoList.size()); - for(int i=0; i getCmmCmsSupplementDataList() { - List ret = null; - if(this.cmmCmsSupplementDataList != null){ - ret = new ArrayList(); - ret = this.cmmCmsSupplementDataList; - } - return ret; - } - public void setCmmCmsSupplementDataList(ArrayList cmmCmsSupplementDataList) { - this.cmmCmsSupplementDataList = new ArrayList (cmmCmsSupplementDataList.size()); - for(int i=0; i getCmmCmsReferenceDataList() { - List ret = null; - if(this.cmmCmsReferenceDataList != null){ - ret = new ArrayList(); - ret = this.cmmCmsReferenceDataList; - } - return ret; - } - public void setCmmCmsReferenceDataList(ArrayList cmmCmsReferenceDataList) { - this.cmmCmsReferenceDataList = new ArrayList (cmmCmsReferenceDataList.size()); - for(int i=0; i getCmmCmsRelatedDataList() { - List ret = null; - if(this.cmmCmsRelatedDataList != null){ - ret = new ArrayList(); - ret = this.cmmCmsRelatedDataList; - } - return ret; - } - public void setCmmCmsRelatedDataList(ArrayList cmmCmsRelatedDataList) { - this.cmmCmsRelatedDataList = new ArrayList (cmmCmsRelatedDataList.size()); - for(int i=0; i kdmCulturePostContentList = null; - List culturePostContentList = null; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getMainImgOrignlFileNm() { - return mainImgOrignlFileNm; - } - public void setMainImgOrignlFileNm(String mainImgOrignlFileNm) { - this.mainImgOrignlFileNm = mainImgOrignlFileNm; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public String getBeginAt() { - return beginAt; - } - public void setBeginAt(String beginAt) { - this.beginAt = beginAt; - } - public String getEndAt() { - return endAt; - } - public void setEndAt(String endAt) { - this.endAt = endAt; - } - public Date getCreateDt() { - return createDt; - } - public void setCreateDt(Date createDt) { - this.createDt = createDt; - } - public Date getUpdateDt() { - return updateDt; - } - public void setUpdateDt(Date updateDt) { - this.updateDt = updateDt; - } - public String[] getContentIds() { - String[] ret = null; - if (this.contentIds != null) { - ret = new String[contentIds.length]; - for (int i = 0; i < contentIds.length; i++) { - ret[i] = this.contentIds[i]; - } - } - return ret; - } - public void setContentIds(String[] contentIds) { - // 수정 - this.contentIds = new String[contentIds.length]; - for(int i = 0; i < contentIds.length; ++i) - this.contentIds[i] = contentIds[i]; - } - - public String getTags() { - return tags; - } - public void setTags(String tags) { - this.tags = tags; - } - public List getKdmCulturePostContentList() { - List cpc = null; - if(this.kdmCulturePostContentList != null){ - cpc = new ArrayList(); - cpc = this.kdmCulturePostContentList; - } - - return cpc; - } - public void setKdmCulturePostContentList(ArrayList kdmCulturePostContentList) { - this.kdmCulturePostContentList = new ArrayList (kdmCulturePostContentList.size()); - for(int i=0; i getCulturePostContentList() { - List cpc = null; - if(this.culturePostContentList != null){ - cpc = new ArrayList(); - cpc = this.culturePostContentList; - } - return cpc; - } - public void setCulturePostContentList(ArrayList culturePostContentList) { - this.culturePostContentList = new ArrayList (culturePostContentList.size()); - for(int i=0; i contentIdList; - - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - public Date getCreateDt() { - return createDt; - } - public void setCreateDt(Date createDt) { - this.createDt = createDt; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - - public List getContentIdList() { - List ret = null; - if(this.contentIdList != null){ - ret = new ArrayList(); - ret = this.contentIdList; - } - return ret; - } - - public void setContentIdList(List contentIdList) { - this.contentIdList = new ArrayList (contentIdList.size()); - for(int i=0; i selectFileDetailList(String fileMstNo) throws IOException, EgovBizException; - public FileDetailVO selectFileDetail(FileDetailVO fileDetailVO) throws IOException, EgovBizException; - public FileDetailVO selectFileDetailFirst(String fileMstNo) throws IOException, EgovBizException; - public boolean deleteAllFileDetailAndMaster(String fileMstNo) throws IOException, EgovBizException; - public List selectIconFileDownLoad(String atchFileId) throws IOException, EgovBizException; - public String uploadFileOneAttMulti(HttpServletRequest request, FileManagementVO fileManagementVO, int cnt) throws IOException, EgovBizException; - String uploadFileOneAttMulti(MultipartFile multipartFile, FileManagementVO fileManagementVO, int fileSn, String fileMstNo, String ctrlStr, String fileDtlNo, String path) throws IOException, EgovBizException; -} \ No newline at end of file diff --git a/src/main/java/cmm/service/CmmMenuManageService.java b/src/main/java/cmm/service/CmmMenuManageService.java deleted file mode 100644 index b14537bc..00000000 --- a/src/main/java/cmm/service/CmmMenuManageService.java +++ /dev/null @@ -1,12 +0,0 @@ -package cmm.service; - -import java.util.List; - -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - - -public interface CmmMenuManageService { - List selectMenuHead(String authorCode) throws EgovBizException; - List selectMenuLeft(String authorCode) throws EgovBizException; -} diff --git a/src/main/java/cmm/service/CmmMetaVO.java b/src/main/java/cmm/service/CmmMetaVO.java deleted file mode 100644 index d3df71cb..00000000 --- a/src/main/java/cmm/service/CmmMetaVO.java +++ /dev/null @@ -1,90 +0,0 @@ -package cmm.service; - -import cmm.Constant; -import cmm.util.CmmUtil; - -@SuppressWarnings("serial") -public class CmmMetaVO { - - private String title = "지역N문화"; - private String url = "http://www.nculture.org"; - private String image = "http://www.nculture.org/images/cmm/open-graph-image.jpg"; - private String imageType = "image/jpeg"; - private Integer imageWidth = null; - private Integer imageHeight = null; - private String description = "지방문화원이 생산,발굴한 독특하고 고유한 지역문화 콘텐츠 및 소장자료를 모든 국민이 향유할수 있도록 제공하는 지역문화 대표 포털"; - private String ogType = Constant.META_OG_TYPE.article.toString(); - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public String getImageType() { - return imageType; - } - - public void setImageType(String imageType) { - this.imageType = imageType; - } - - public Integer getImageWidth() { - return imageWidth; - } - - public void setImageWidth(Integer imageWidth) { - this.imageWidth = imageWidth; - } - - public Integer getImageHeight() { - return imageHeight; - } - - public void setImageHeight(Integer imageHeight) { - this.imageHeight = imageHeight; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOgType() { - return ogType; - } - - public void setOgType(String ogType) { - this.ogType = ogType; - } - - /** - * toString() - * @return String - */ - public String toString() { - return CmmUtil.reflectionToString(this); - } - -} diff --git a/src/main/java/cmm/service/CmmPmsMapContentsService.java b/src/main/java/cmm/service/CmmPmsMapContentsService.java deleted file mode 100644 index 5214742e..00000000 --- a/src/main/java/cmm/service/CmmPmsMapContentsService.java +++ /dev/null @@ -1,20 +0,0 @@ -package cmm.service; - -import java.util.List; - -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -/** - * 맵 콘텐츠에 대한 서비스 인터페이스 클래스를 정의한다 - * @Class Name : CmmPmsMapContentsService.java - * @author ecplaza - * @since 2018-06-26 - * @version 1.0 - */ -public interface CmmPmsMapContentsService { - int selectCmmPmsMapCntnsStoryCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException; - int selectCmmPmsMapLocalCultureCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException; - List selectCmmPmsMapAoiCouncilInfoList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException; - List selectCmmPmsMapContentsList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException; - List selectCmmPmsMapContentsSearchList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException; -} diff --git a/src/main/java/cmm/service/CmmPmsMapContentsVO.java b/src/main/java/cmm/service/CmmPmsMapContentsVO.java deleted file mode 100644 index 064fb9f0..00000000 --- a/src/main/java/cmm/service/CmmPmsMapContentsVO.java +++ /dev/null @@ -1,508 +0,0 @@ -package cmm.service; - -import java.util.ArrayList; -import java.util.List; - -import cmm.util.CmmUtil; -import cmm.util.CmmVO; - - -/** - * @Class Name : CmmPmsMapContentsVO.java - * @author ecplaza - * @since 2018-06-26 - * @version 1.0 - */ -@SuppressWarnings("serial") -public class CmmPmsMapContentsVO extends CmmVO { - - private String id = ""; - private String contentType = ""; - private String contentId = ""; - private String contentTypeId = ""; - private String contentTypeName = ""; - private String copyright = ""; - private String title = ""; - private String summary = ""; - private String mainImage = ""; - private String linkData = ""; - private String latitude = ""; - private String longitude = ""; - private String sidoName = ""; - private String sigunguName = ""; - private String cat1 = ""; - private String cat1Name = ""; - private String cat2 = ""; - private String cat2Name = ""; - private String cat3 = ""; - private String cat3Name = ""; - private String zipCode = ""; - private String tel = ""; - private String firstTopic = ""; - private String secondTopic = ""; - private String firstClass = ""; - private String secondClass = ""; - private String age = ""; - private String genyear = ""; - private String chronologicalStart = ""; - private String chronologicalEnd = ""; - private String themeCd = ""; - private String themeNm = ""; - private String seriesCd = ""; - private String seriesNm = ""; - private String firstCategory = ""; - private String firstCategoryNm = ""; - private String secondCategory = ""; - private String secondCategoryNm = ""; - private String interfaceId = ""; - private String recommendYn = ""; - private String tagsName = ""; - private String addr1 = ""; - private String addr2 = ""; - private String ntceBgnde = ""; - private String ntceEndde = ""; - private String website = ""; - private String createdAt = ""; - private String updatedAt = ""; - private String councilCd = ""; - private String councilNm = ""; - private String councilCnt = "0"; - - - // 문화원 정보 목록 - List cmmCouncilInfoList = null; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getContentTypeId() { - return contentTypeId; - } - - public void setContentTypeId(String contentTypeId) { - this.contentTypeId = contentTypeId; - } - - public String getContentTypeName() { - return contentTypeName; - } - - public void setContentTypeName(String contentTypeName) { - this.contentTypeName = contentTypeName; - } - - public String getCopyright() { - return copyright; - } - - public void setCopyright(String copyright) { - this.copyright = copyright; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getSummary() { - return summary; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public String getMainImage() { - return mainImage; - } - - public void setMainImage(String mainImage) { - this.mainImage = mainImage; - } - - public String getLinkData() { - return linkData; - } - - public void setLinkData(String linkData) { - this.linkData = linkData; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getSidoName() { - return sidoName; - } - - public void setSidoName(String sidoName) { - this.sidoName = sidoName; - } - - public String getSigunguName() { - return sigunguName; - } - - public void setSigunguName(String sigunguName) { - this.sigunguName = sigunguName; - } - - public String getCat1() { - return cat1; - } - - public void setCat1(String cat1) { - this.cat1 = cat1; - } - - public String getCat1Name() { - return cat1Name; - } - - public void setCat1Name(String cat1Name) { - this.cat1Name = cat1Name; - } - - public String getCat2() { - return cat2; - } - - public void setCat2(String cat2) { - this.cat2 = cat2; - } - - public String getCat2Name() { - return cat2Name; - } - - public void setCat2Name(String cat2Name) { - this.cat2Name = cat2Name; - } - - public String getCat3() { - return cat3; - } - - public void setCat3(String cat3) { - this.cat3 = cat3; - } - - public String getCat3Name() { - return cat3Name; - } - - public void setCat3Name(String cat3Name) { - this.cat3Name = cat3Name; - } - - public String getZipCode() { - return zipCode; - } - - public void setZipCode(String zipCode) { - this.zipCode = zipCode; - } - - public String getTel() { - return tel; - } - - public void setTel(String tel) { - this.tel = tel; - } - - public String getFirstTopic() { - return firstTopic; - } - - public void setFirstTopic(String firstTopic) { - this.firstTopic = firstTopic; - } - - public String getSecondTopic() { - return secondTopic; - } - - public void setSecondTopic(String secondTopic) { - this.secondTopic = secondTopic; - } - - public String getFirstClass() { - return firstClass; - } - - public void setFirstClass(String firstClass) { - this.firstClass = firstClass; - } - - public String getSecondClass() { - return secondClass; - } - - public void setSecondClass(String secondClass) { - this.secondClass = secondClass; - } - - public String getAge() { - return age; - } - - public void setAge(String age) { - this.age = age; - } - - public String getGenyear() { - return genyear; - } - - public void setGenyear(String genyear) { - this.genyear = genyear; - } - - public String getChronologicalStart() { - return chronologicalStart; - } - - public void setChronologicalStart(String chronologicalStart) { - this.chronologicalStart = chronologicalStart; - } - - public String getChronologicalEnd() { - return chronologicalEnd; - } - - public void setChronologicalEnd(String chronologicalEnd) { - this.chronologicalEnd = chronologicalEnd; - } - - public String getThemeCd() { - return themeCd; - } - - public void setThemeCd(String themeCd) { - this.themeCd = themeCd; - } - - public String getThemeNm() { - return themeNm; - } - - public void setThemeNm(String themeNm) { - this.themeNm = themeNm; - } - - public String getSeriesCd() { - return seriesCd; - } - - public void setSeriesCd(String seriesCd) { - this.seriesCd = seriesCd; - } - - public String getSeriesNm() { - return seriesNm; - } - - public void setSeriesNm(String seriesNm) { - this.seriesNm = seriesNm; - } - - public String getFirstCategory() { - return firstCategory; - } - - public void setFirstCategory(String firstCategory) { - this.firstCategory = firstCategory; - } - - public String getFirstCategoryNm() { - return firstCategoryNm; - } - - public void setFirstCategoryNm(String firstCategoryNm) { - this.firstCategoryNm = firstCategoryNm; - } - - public String getSecondCategory() { - return secondCategory; - } - - public void setSecondCategory(String secondCategory) { - this.secondCategory = secondCategory; - } - - public String getSecondCategoryNm() { - return secondCategoryNm; - } - - public void setSecondCategoryNm(String secondCategoryNm) { - this.secondCategoryNm = secondCategoryNm; - } - - public String getInterfaceId() { - return interfaceId; - } - - public void setInterfaceId(String interfaceId) { - this.interfaceId = interfaceId; - } - - public String getRecommendYn() { - return recommendYn; - } - - public void setRecommendYn(String recommendYn) { - this.recommendYn = recommendYn; - } - - public String getTagsName() { - return tagsName; - } - - public void setTagsName(String tagsName) { - this.tagsName = tagsName; - } - - public String getAddr1() { - return addr1; - } - - public void setAddr1(String addr1) { - this.addr1 = addr1; - } - - public String getAddr2() { - return addr2; - } - - public void setAddr2(String addr2) { - this.addr2 = addr2; - } - - public String getNtceBgnde() { - return ntceBgnde; - } - - public void setNtceBgnde(String ntceBgnde) { - this.ntceBgnde = ntceBgnde; - } - - public String getNtceEndde() { - return ntceEndde; - } - - public void setNtceEndde(String ntceEndde) { - this.ntceEndde = ntceEndde; - } - - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public String getCouncilCd() { - return councilCd; - } - - public void setCouncilCd(String councilCd) { - this.councilCd = councilCd; - } - - public String getCouncilNm() { - return councilNm; - } - - public void setCouncilNm(String councilNm) { - this.councilNm = councilNm; - } - - public String getCouncilCnt() { - return councilCnt; - } - - public void setCouncilCnt(String councilCnt) { - this.councilCnt = councilCnt; - } - - - public List getCmmCouncilInfoList() { - List ret = null; - if(this.cmmCouncilInfoList != null){ - ret = new ArrayList(); - ret = this.cmmCouncilInfoList; - } - return ret; - } - - public void setCmmCouncilInfoList(List cmmCouncilInfoList) { - this.cmmCouncilInfoList = new ArrayList (cmmCouncilInfoList.size()); - for(int i=0; i selectCmmActivityHstAllListTotCnt(DataMap paramMap) throws EgovBizException; - int selectSatisfactionTotCnt(DataMap paramMap) throws EgovBizException; - int selectCmmPscHstTotCnt(DataMap paramMap) throws EgovBizException; - DataMap selectCmmPscHstDetail(DataMap paramMap) throws EgovBizException; - DataMap selectCmmPmsPostRandom(DataMap paramMap) throws EgovBizException; - /** - * 에셋 상세정보 - * pick 레이어 사용(좌측 상단) - * @param paramMap - * @return - * @throws EgovBizException - */ - DataMap selectCmmAmsAssetsDetail(DataMap paramMap) throws EgovBizException; - /** - * 에셋 미디어 그룹 목록 Cnt - * pick 레이어 사용(좌측 목록)Cnt - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsMediaGroupListCnt(DataMap paramMap) throws EgovBizException; - /** - * 에셋 미디어 그룹 목록 - * pick 레이어 사용(좌측 목록) - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsMediaGroupList(DataMap paramMap) throws EgovBizException; - List selectCmmAmsAssetsMediaList(DataMap paramMap) throws EgovBizException; - /** - * 에셋 미디어 상세정보 - * pick 레이어 사용(완문보기 상세정보) - * @param paramMap - * @return - * @throws EgovBizException - */ - DataMap selectCmmAmsAssetsMediaDetail(DataMap paramMap) throws EgovBizException; - /** - * 에셋 미디어 상세정보 (미디어의 INTERFACE_ID 값으로 조회) - * pick 레이어 사용(완문보기 상세정보) - * @param paramMap - * @return - * @throws EgovBizException - */ - DataMap selectCmmAmsAssetsMediaDetailByInterfaceId(DataMap paramMap) throws EgovBizException; - /** - * 에셋 미디어 OCR 목록 - * pick 레이어 사용(문서 완문보기) - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsMediaOcrList(DataMap paramMap) throws EgovBizException; - /** - * 에셋 상세 연관태그 목록 - * pick 레이어 사용(상세 정보의 연관태그) - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsTagsList(DataMap paramMap) throws EgovBizException; - /** - * 에셋 상세 연속자료 목록 총 수 - * pick 레이어 사용(상세 정보의 연속자료 목록 총 수) - * @param param - * @return - * @throws EgovBizException - */ - int selectCmmAmsAssetsContinueListTotCnt(CmmVO param) throws EgovBizException; - /** - * 에셋 상세 연속자료 목록 - * pick 레이어 사용(상세 정보의 연속자료 목록) - * @param param - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsContinueList(CmmVO param) throws EgovBizException; - /** - * 에셋 상세 연관 지역문화이야기 목록 - * pick 레이어 사용(지역문화이야기 목록) - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsThemesContentsList(List paramMap) throws EgovBizException; - /** - * 에셋 상세 다른문화원 소장자료 목록 - * pick 레이어 사용(다른문화원 소장자료 목록) - * @param paramMap - * @return - * @throws EgovBizException - */ - List selectCmmAmsAssetsDiffSojangList(DataMap paramMap) throws EgovBizException; - List selectCmmAmsAssetsOriginViewList(DataMap paramMap) throws EgovBizException; - - int selectCmmAmsAssetsOriginViewListAjaxCnt(DataMap paramMap) throws EgovBizException; - List selectCmmAmsAssetsOriginViewListAjax(DataMap paramMap) throws EgovBizException; - - DataMap selectCmmAmsAssetsOriginViewDetail(DataMap paramMap) throws EgovBizException; - int selectCmmScrapCnt(DataMap paramMap) throws EgovBizException; - void insertSatisfaction(DataMap paramMap) throws EgovBizException; - void insertCmmSchedulerHst(DataMap paramMap) throws FdlException ,EgovBizException; - void insertCmmPscHst(DataMap paramMap) throws EgovBizException; - void updateCmmPscHst(DataMap paramMap) throws EgovBizException; - void insertCmmScrap(DataMap paramMap) throws EgovBizException; - void insertCmmActivityHst(DataMap paramMap) throws EgovBizException; - void updateCmmActivityHst(DataMap paramMap) throws EgovBizException; - void deleteCmmScrapInfo(DataMap paramMap) throws EgovBizException; - - /** - * 모바일 디바이스 정보 목록 - * @param paramMap - * @return - * @throws EgovBizException - */ - List selecCmmMobileDeviceInfoList(DataMap paramMap) throws EgovBizException; - - void insertCmmActivityMediaHst(DataMap paramMap) throws EgovBizException; - - List selectCmmAmsAssetsTagKeyList(DataMap paramMap) throws EgovBizException; - - DataMap selectCmmAmsAssetsMediaDetail2(DataMap paramMap) throws EgovBizException; - - int selectCmmWebzineCnfirm(DataMap paramMap) throws EgovBizException; - void insertCmmWebzineSubScribe(DataMap paramMap) throws EgovBizException; - - void insertCmmMainData(String gubun) throws FdlException ,EgovBizException; - DataMap insertCmmExtGiaMainInfo(String contentType) throws FdlException; - - DataMap selectCmmPscHst(String jsessionId) throws EgovBizException; - - public DataMap getMainLogo() throws EgovBizException; - -} diff --git a/src/main/java/cmm/service/CmmThemeVO.java b/src/main/java/cmm/service/CmmThemeVO.java deleted file mode 100644 index 4b48aa5d..00000000 --- a/src/main/java/cmm/service/CmmThemeVO.java +++ /dev/null @@ -1,111 +0,0 @@ -package cmm.service; - -import java.util.Date; - -import cmm.util.CmmVO; - -@SuppressWarnings("serial") -public class CmmThemeVO extends CmmVO { - private String id = null; - private String themeCd = ""; - private String themeNm = ""; - private String seriesCd = ""; - private String seriesNm = ""; - private String seriesDesc = ""; - private String mainImg = ""; - private String mainImgOrignlFileNm = ""; - private String mainDesc = ""; - private String linkUrl = ""; - private String useAt = ""; - private Date createDt; - private Date updateDt; - private String atchCtrl = ""; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getThemeCd() { - return themeCd; - } - public void setThemeCd(String themeCd) { - this.themeCd = themeCd; - } - public String getThemeNm() { - return themeNm; - } - public void setThemeNm(String themeNm) { - this.themeNm = themeNm; - } - public String getSeriesCd() { - return seriesCd; - } - public void setSeriesCd(String seriesCd) { - this.seriesCd = seriesCd; - } - - public String getSeriesNm() { - return seriesNm; - } - public void setSeriesNm(String seriesNm) { - this.seriesNm = seriesNm; - } - public String getSeriesDesc() { - return seriesDesc; - } - public void setSeriesDesc(String seriesDesc) { - this.seriesDesc = seriesDesc; - } - public String getMainImg() { - return mainImg; - } - public void setMainImg(String mainImg) { - this.mainImg = mainImg; - } - public String getMainImgOrignlFileNm() { - return mainImgOrignlFileNm; - } - public void setMainImgOrignlFileNm(String mainImgOrignlFileNm) { - this.mainImgOrignlFileNm = mainImgOrignlFileNm; - } - public String getMainDesc() { - return mainDesc; - } - public void setMainDesc(String mainDesc) { - this.mainDesc = mainDesc; - } - public String getLinkUrl() { - return linkUrl; - } - public void setLinkUrl(String linkUrl) { - this.linkUrl = linkUrl; - } - public String getUseAt() { - return useAt; - } - public void setUseAt(String useAt) { - this.useAt = useAt; - } - public Date getCreateDt() { - return createDt; - } - public void setCreateDt(Date createDt) { - this.createDt = createDt; - } - public Date getUpdateDt() { - return updateDt; - } - public void setUpdateDt(Date updateDt) { - this.updateDt = updateDt; - } - - public String getAtchCtrl() { - return atchCtrl; - } - - public void setAtchCtrl(String atchCtrl) { - this.atchCtrl = atchCtrl; - } -} diff --git a/src/main/java/cmm/service/ExtService.java b/src/main/java/cmm/service/ExtService.java deleted file mode 100644 index 1ac85072..00000000 --- a/src/main/java/cmm/service/ExtService.java +++ /dev/null @@ -1,24 +0,0 @@ -package cmm.service; - -import java.util.List; - -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - - -public interface ExtService { - List selectExtSigunguList(DataMap paramMap) throws EgovBizException; - List selectExtSigunguList2(DataMap paramMap) throws EgovBizException; - List selectExtGisSigunguList(DataMap paramMap) throws EgovBizException; - List selectExtGisDongList(DataMap paramMap) throws EgovBizException; - List selectExtSidoMapMappingList(DataMap paramMap) throws EgovBizException; - List selectExtDfInfoList(DataMap paramMap) throws EgovBizException; - List selectExtAisInfoList(String sido, String sigungu) throws EgovBizException; - List selectExtFtdInfoList(DataMap paramMap) throws EgovBizException; - List selectCulRelatedNews(DataMap paramMap) throws EgovBizException; - DataMap selectExtGiaDetail(String contentId, String contentTypeId) throws EgovBizException; - DataMap insertExtDfInfo(); - DataMap insertExtFdInfo(); - DataMap insertExtGiaInfo(String contentTypeId); - DataMap insertMediaHstInfo(); -} diff --git a/src/main/java/cmm/service/FileDetailVO.java b/src/main/java/cmm/service/FileDetailVO.java deleted file mode 100644 index 10cf4375..00000000 --- a/src/main/java/cmm/service/FileDetailVO.java +++ /dev/null @@ -1,142 +0,0 @@ -package cmm.service; - -import java.io.Serializable; -import java.math.BigDecimal; - -import org.apache.commons.lang3.builder.ToStringBuilder; - - -@SuppressWarnings("serial") -public class FileDetailVO implements Serializable { - - private String atchFileId; - - private String fileSn; - - private String fileStreCours; - - private String streFileNm; - - private String orignlFileNm; - - private String fileExtsn; - - private String fileCn; - - private String fileTyp; - - private BigDecimal fileSize; - - private byte[] fileData; - - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - - public String getAtchFileId() { - return atchFileId; - } - - - public void setAtchFileId(String atchFileId) { - this.atchFileId = atchFileId; - } - - - public String getFileSn() { - return fileSn; - } - - - public void setFileSn(String fileSn) { - this.fileSn = fileSn; - } - - - public String getFileStreCours() { - return fileStreCours; - } - - - public void setFileStreCours(String fileStreCours) { - this.fileStreCours = fileStreCours; - } - - - public String getStreFileNm() { - return streFileNm; - } - - - public void setStreFileNm(String streFileNm) { - this.streFileNm = streFileNm; - } - - - public String getOrignlFileNm() { - return orignlFileNm; - } - - - public void setOrignlFileNm(String orignlFileNm) { - this.orignlFileNm = orignlFileNm; - } - - - public String getFileExtsn() { - return fileExtsn; - } - - - public void setFileExtsn(String fileExtsn) { - this.fileExtsn = fileExtsn; - } - - - public String getFileCn() { - return fileCn; - } - - - public void setFileCn(String fileCn) { - this.fileCn = fileCn; - } - - - public String getFileTyp() { - return fileTyp; - } - - - public void setFileTyp(String fileTyp) { - this.fileTyp = fileTyp; - } - - - public BigDecimal getFileSize() { - return fileSize; - } - - - public void setFileSize(BigDecimal fileSize) { - this.fileSize = fileSize; - } - - public byte[] getFileData() { - byte[] ret = null; - if(this.fileData != null){ - ret = new byte[fileData.length]; - ret = this.fileData; - } - return ret; - } - - public void setFileData(byte[] fileData) { - this.fileData = new byte[fileData.length]; - for(int i=0; i fdFileArray = null; - - public FileManagementVO(){ - } - - public FileManagementVO (boolean isMulti){ - this.isMulti = isMulti; - } - public String getFdMstNo() { - return fdMstNo; - } - public void setFdMstNo(String fdMstNo) { - this.fdMstNo = fdMstNo; - } - public String getFdDtlNo() { - return fdDtlNo; - } - public void setFdDtlNo(String fdDtlNo) { - this.fdDtlNo = fdDtlNo; - } - public String getFdFile() { - return fdFile; - } - public void setFdFile(String fdFile) { - this.fdFile = fdFile; - } - public String getFdTitle() { - return fdTitle; - } - public void setFdTitle(String fdTitle) { - this.fdTitle = fdTitle; - } - public String getFdCtrl() { - return fdCtrl; - } - public void setFdCtrl(String fdCtrl) { - this.fdCtrl = fdCtrl; - } - public boolean isMulti() { - return isMulti; - } - public void setMulti(boolean isMulti) { - this.isMulti = isMulti; - } - public String getFileClssCd() { - return fileClssCd; - } - public void setFileClssCd(String fileClssCd) { - this.fileClssCd = fileClssCd; - } - public String getFileAuthCd() { - return fileAuthCd; - } - public void setFileAuthCd(String fileAuthCd) { - this.fileAuthCd = fileAuthCd; - } - public int getIndex() { - return index; - } - public void setIndex(int index) { - this.index = index; - } - public boolean isSaveToDisk() { - return isSaveToDisk; - } - public void setSaveToDisk(boolean isSaveToDisk) { - this.isSaveToDisk = isSaveToDisk; - } - - public ArrayList getFdFileArray() { - ArrayList ret = null; - if(this.fdFileArray != null){ - ret = new ArrayList(); - ret = this.fdFileArray; - } - return ret; - } - - public void setFdFileArray(ArrayList fdFileArray) { - this.fdFileArray = new ArrayList (fdFileArray.size()); - for(int i=0; i keySet = paramMap.keySet(); - Iterator keys = keySet.iterator(); - int cnt = 0; - while (keys.hasNext()) { - String key = keys.next(); - String value = paramMap.getString(key); - if(cnt>0){ - url += "&"; - }else{ - url += "?"; - } - url += key; - url += "="; - url += value; - - cnt++; - } - return url; - } - @Override - public JSONObject getDissForecastInfoList(DataMap paramMap){ - String resultXml = ""; - JSONObject xmlJSONObj = null; - try { - String addr = propertiesService.getString("openapi.apis.data.url"); - paramMap.setString("serviceKey", propertiesService.getString("openapi.apis.data.serviceKey")); - paramMap.setString("pageNo", "1"); - paramMap.setString("numOfRows", "2000"); - paramMap.setString("type", "xml"); - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+this.getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - } catch (org.json.JSONException jsoe) { - LOGGER.error("fail in getDissForecastInfoList() String xml to JSON Parsing error", jsoe); - } - }else{ - // 통신오류 - xmlJSONObj = new JSONObject(); - JSONObject jsonObjResponse = new JSONObject(); - JSONObject jsonObjComMsgHeader = new JSONObject(); - jsonObjComMsgHeader.put("ErrMsg", "통신 오류상태입니다."); - jsonObjComMsgHeader.put("returnReasonCode", statusCode); - jsonObjComMsgHeader.put("returnAuthMsg", "통신 오류상태입니다."); - jsonObjResponse.put("cmmMsgHeader", jsonObjComMsgHeader); - xmlJSONObj.put("OpenAPI_ServiceResponse",jsonObjResponse); - } - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in getDissForecastInfoList()", e); - } catch (HttpException e) { - LOGGER.error("fail in getDissForecastInfoList()", e); - } catch (IOException e) { - LOGGER.error("fail in getDissForecastInfoList()", e); - } catch (Exception e) { - LOGGER.error("fail in getDissForecastInfoList()", e); - } - return xmlJSONObj; - } - @Override - @Cacheable(value="ctprvnMesureCache", key="{#sido, #dataTime}") - public DataMap getCtprvnMesureSidoList(String sido, String dataTime) { - - String resultXml = "", resultCode = "", resultMsg = ""; - int useTimeout = 5; - boolean isSuccess = true; - DataMap paramMap = new DataMap(); - DataMap rsMap = new DataMap(); - List resultList = new ArrayList(); - JSONObject xmlJSONObj = null; - - try { - String addr = propertiesService.getString("openapi.airkorea.url"); - paramMap.setString("serviceKey", propertiesService.getString("openapi.airkorea.serviceKey")); - paramMap.setString("pageNo", "1"); - paramMap.setString("numOfRows", "2000"); - paramMap.setString("searchCondition", propertiesService.getString("openapi.airkorea.searchCondition.hour")); - paramMap.setString("ver", propertiesService.getString("openapi.airkorea.ver")); - paramMap.setString("sidoName", URLEncoder.encode(CmmUtil.getAisSidoName(sido),"UTF-8")); - - HttpClient httpClient = new HttpClient(); - httpClient.getParams().setParameter("http.connection.timeout", useTimeout * 1000);// 원격 호스트와 연결을 설정하는 시간 - httpClient.getParams().setParameter("http.socket.timeout", useTimeout * 1000);//데이터를 기다리는 시간 - //httpClient.getParams().setParameter("http.connection-manager.timeout", useTimeout * 1000);// 연결 및 소켓 시간 초과 - //httpClient.getParams().setParameter("http.protocol.head-body-timeout", useTimeout * 1000); - - HttpMethod getMethod = new GetMethod(addr+this.getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - } catch (org.json.JSONException jsoe) { - LOGGER.error("fail in getCtprvnMesureSidoLIst() String xml to JSON Parsing error", jsoe); - } - }else{ - // 통신오류 - rsMap.setString("resultMsg","통신 오류상태입니다."); - rsMap.setString("resultCode",String.valueOf(statusCode)); - isSuccess = false; - } - - } catch (ConnectTimeoutException e) { - LOGGER.error("fail in getCtprvnMesureSidoLIst()", e); - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in getCtprvnMesureSidoLIst()", e); - } catch (HttpException e) { - LOGGER.error("fail in getCtprvnMesureSidoLIst()", e); - } catch (IOException e) { - LOGGER.error("fail in getCtprvnMesureSidoLIst()", e); - } catch (Exception e) { - LOGGER.error("fail in getCtprvnMesureSidoLIst()", e); - } finally{ - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - JSONObject jsonItems = null; - - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - - if(jsonBody.has("items") && jsonBody.get("items") instanceof JSONObject){ - jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONObject){ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - }else{ - jsonArray =jsonItems.getJSONArray("item"); - } - for(int i=0; i 2018.07.01 일자로 미추홀구로 변경 - if(map.getString("cityName").indexOf("남구") != -1){ - map.setString("sigungu", "미추홀구"); - }else{ - map.setString("sigungu", map.getString("cityName")); - } - }else{ - map.setString("sigungu", map.getString("cityName")); - } - - map.setString("so2Value", map.getString("so2Value").replaceAll("-", "0")); - map.setString("coValue", map.getString("coValue").replaceAll("-", "0")); - map.setString("o3Value", map.getString("o3Value").replaceAll("-", "0")); - map.setString("no2Value", map.getString("no2Value").replaceAll("-", "0")); - map.setString("pm10Value", map.getString("pm10Value").replaceAll("-", "0")); - map.setString("pm25Value", map.getString("pm25Value").replaceAll("-", "0")); - resultList.add(map); - - if(dataTime.equals(map.getString("dataTime"))){ - break; - } - } - }else{ - rsMap.setString("resultMsg","[데이터 가공오류]item 미존재"); - rsMap.setString("resultCode","11"); - } - }else{ - rsMap.setString("resultMsg","[데이터 가공오류]item 미존재"); - rsMap.setString("resultCode","11"); - } - } catch (org.json.JSONException jsoe) { - LOGGER.error("fail in getCtprvnMesureSidoLIst() JSON Parsing error", jsoe); - } - } - } - if(isSuccess){ - rsMap.setString("resultCode",resultCode); - rsMap.setString("resultMsg",resultMsg); - } - rsMap.put("resultList", resultList); - return rsMap; - } - @Override - @Cacheable(value="forecastCache", key="{#baseDate, #baseTime, #nx, #ny}") - public DataMap getForecastTimeDataList(String baseDate, String baseTime, String nx, String ny) { - - String resultXml = "", resultCode = "", resultMsg = ""; - DataMap paramMap = new DataMap(); - DataMap rsMap = new DataMap(); - List resultList = new ArrayList(); - JSONObject xmlJSONObj = null; - - try { - String addr = propertiesService.getString("openapi.kma.forecastTimeData.url"); - paramMap.setString("serviceKey", propertiesService.getString("openapi.kma.serviceKey")); - paramMap.setString("base_date", baseDate); - paramMap.setString("base_time", baseTime); - paramMap.setString("nx", nx); - paramMap.setString("ny", ny); - paramMap.setString("pageNo", "1"); - paramMap.setString("numOfRows", "1000"); - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+this.getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - } catch (org.json.JSONException jsoe) { - LOGGER.error("fail in getForecastTimeDataList() String xml to JSON Parsing error", jsoe); - } - }else{ - xmlJSONObj = new JSONObject(); - JSONObject jsonObjResponse = new JSONObject(); - JSONObject jsonObjComMsgHeader = new JSONObject(); - jsonObjComMsgHeader.put("resultMsg", "통신 오류상태입니다."); - jsonObjComMsgHeader.put("resultCode", statusCode); - jsonObjResponse.put("header", jsonObjComMsgHeader); - xmlJSONObj.put("response",jsonObjResponse); - } - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in getForecastTimeDataList()", e); - } catch (HttpException e) { - LOGGER.error("fail in getForecastTimeDataList()", e); - } catch (IOException e) { - LOGGER.error("fail in getForecastTimeDataList()", e); - } catch (Exception e) { - LOGGER.error("fail in getForecastTimeDataList()", e); - } finally{ - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - try { - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - if(jsonBody.has("items")){ - if(jsonBody.get("items") instanceof JSONObject){ - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONObject){ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - }else{ - jsonArray =jsonItems.getJSONArray("item"); - } - for(int i=0; i 0){ - // 데이터 존재 - if(jsonObj.has("addresses") && jsonObj.get("addresses") instanceof JSONArray){ - // 결과값이 JSONArray - JSONArray addresses = jsonObj.getJSONArray("addresses"); - if(addresses != null && addresses.length() > 0){ - JSONObject result = addresses.getJSONObject(0); - if(result.has("x") && result.has("y")){ - rtnMap.setString("mapX", result.getString("x")); - rtnMap.setString("mapY", result.getString("y")); - - total = 1; - } - } - } - } - } - } - rtnMap.setInt("total", total); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } catch (MalformedURLException e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } catch (ProtocolException e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } catch (IOException e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } catch (JSONException e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } catch (Exception e) { - LOGGER.error("Error in getNaverApiGeocode()", e); - } finally{ - try { - if(isr != null){ - isr.close(); - } - if(br != null){ - br.close(); - } - } catch (IOException e) { - LOGGER.error("Error in getNaverApiGeocode() close", e); - } - } - return rtnMap; - } - @Override - public DataMap getNaverApiReversegeocode(DataMap paramMap) { - JSONObject jsonObj = null; - DataMap rtnMap = new DataMap(); - BufferedReader br = null; - InputStreamReader isr = null; - int total = 0; - - try { - String apiURL = propertiesService.getString("openapi.naver.map.reversegeocode.url") + "?request=coordsToaddr&sourcecrs=epsg:4326&output=json"; - String clientId = propertiesService.getString("openapi.naver.map.clientId"); - String clientSecret = propertiesService.getString("openapi.naver.map.clientSecret"); - - String xy = paramMap.getString("xy"); - URL url = new URL(apiURL+"&coords=" + xy); - HttpURLConnection con = (HttpURLConnection)url.openConnection(); - con.setRequestMethod("GET"); - con.setRequestProperty("X-NCP-APIGW-API-KEY-ID", clientId); - con.setRequestProperty("X-NCP-APIGW-API-KEY", clientSecret); - int responseCode = con.getResponseCode(); - if(responseCode==200) { - isr = new InputStreamReader(con.getInputStream(),"UTF-8"); - br = new BufferedReader(isr); - } else { - isr = new InputStreamReader(con.getErrorStream(),"UTF-8"); - br = new BufferedReader(isr); - } - - String inputLine; - StringBuffer response = new StringBuffer(); - while ((inputLine = br.readLine()) != null) { - response.append(inputLine); - } - if(responseCode==200) { - jsonObj = new JSONObject(response.toString()); - jsonObj.put("successYn","Y"); - } else { - JSONObject errObj = new JSONObject(response.toString()); - jsonObj = new JSONObject(); - jsonObj.put("result", errObj); - jsonObj.put("successYn","N"); - } - if("Y".equals(jsonObj.get("successYn").toString()) ){ - if(jsonObj.has("status")){ - JSONObject status = jsonObj.getJSONObject("status"); - if(status.getInt("code") == 0){ - // 데이터 존재 - if(jsonObj.has("results") && jsonObj.get("results") instanceof JSONArray){ - // 결과값이 JSONArray - JSONArray results = jsonObj.getJSONArray("results"); - if(results != null && results.length() > 0){ - JSONObject result = results.getJSONObject(0); - if(result != null && result.has("region")){ - JSONObject region = result.getJSONObject("region"); - if(region.has("area2")){ - // 세종시일경우 안나옴. - if(region.getJSONObject("area2").has("name")){ - rtnMap.setString("sigugun", region.getJSONObject("area2").getString("name")); - } - } - if(region.has("area1")){ - if(region.getJSONObject("area1").has("name")){ - rtnMap.setString("sido", region.getJSONObject("area1").getString("name")); - if(rtnMap.getString("sido").indexOf("세종") > -1){ - // 세종인경우 시군구에 담는다. - rtnMap.setString("sigugun", rtnMap.getString("sido")); - } - total = 1; - } - } - } - } - } - } - } - } - - rtnMap.setInt("total", total); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } catch (MalformedURLException e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } catch (ProtocolException e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } catch (IOException e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } catch (JSONException e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } catch (Exception e) { - LOGGER.error("Error in getNaverApiReversegeocode()", e); - } finally{ - try { - if(isr != null){ - isr.close(); - } - if(br != null){ - br.close(); - } - } catch (IOException e) { - LOGGER.error("Error in getNaverApiGeocode() close", e); - } - } - return rtnMap; - } - @Override - public DataMap getNaverApiJuso(DataMap paramMap) { - - JSONObject jsonObj = null; - DataMap rtnMap = new DataMap(); - BufferedReader br = null; - InputStreamReader isr = null; - int total = 0; - - try { - String apiURL = propertiesService.getString("openapi.naver.map.geocode.url"); - String clientId = propertiesService.getString("openapi.naver.map.clientId"); - String clientSecret = propertiesService.getString("openapi.naver.map.clientSecret"); - - String addr = URLEncoder.encode(paramMap.getString("juso"), "UTF-8"); - URL url = new URL(apiURL+"?query=" + addr); - HttpURLConnection con = (HttpURLConnection)url.openConnection(); - con.setRequestMethod("GET"); - con.setRequestProperty("X-NCP-APIGW-API-KEY-ID", clientId); - con.setRequestProperty("X-NCP-APIGW-API-KEY", clientSecret); - int responseCode = con.getResponseCode(); - if(responseCode==200) { - isr = new InputStreamReader(con.getInputStream(),"UTF-8"); - br = new BufferedReader(isr); - } else { - isr = new InputStreamReader(con.getErrorStream(),"UTF-8"); - br = new BufferedReader(isr); - } - - String inputLine; - StringBuffer response = new StringBuffer(); - while ((inputLine = br.readLine()) != null) { - response.append(inputLine); - } - - if(responseCode==200) { - jsonObj = new JSONObject(response.toString()); - jsonObj.put("successYn","Y"); - } else { - JSONObject errObj = new JSONObject(response.toString()); - jsonObj = new JSONObject(); - jsonObj.put("result", errObj); - jsonObj.put("successYn","N"); - } - if("Y".equals(jsonObj.get("successYn").toString()) ){ - if(jsonObj.has("status") && jsonObj.has("meta")){ - JSONObject meta = jsonObj.getJSONObject("meta"); - if("OK".equals(jsonObj.getString("status")) && meta.getInt("count") > 0){ - // 데이터 존재 - if(jsonObj.has("addresses") && jsonObj.get("addresses") instanceof JSONArray){ - // 결과값이 JSONArray - JSONArray addresses = jsonObj.getJSONArray("addresses"); - if(addresses != null && addresses.length() > 0){ - JSONObject result = addresses.getJSONObject(0); - if(result.has("x") && result.has("y")){ - rtnMap.setString("point_x", result.getString("x")); - rtnMap.setString("point_y", result.getString("y")); - - total = 1; - } - if(result.has("jibunAddress")){ - // ex) "jibunAddress":"전라남도 완도군 완도읍" - // "jibunAddress":"제주특별자치도 제주시 노형동 245" - // "jibunAddress":"울산광역시 동구" - String [] jibunAddress = result.getString("jibunAddress").split(" ",5); - rtnMap.setString("sido", jibunAddress[0]); - if (jibunAddress.length >= 2) rtnMap.setString("sigugun", jibunAddress[1]); - if (jibunAddress.length >= 3) rtnMap.setString("dongmyun", jibunAddress[2]); - if (jibunAddress.length >= 4) rtnMap.setString("rest", jibunAddress[3]); - } - - } - } - } - } - } - rtnMap.setInt("total", total); - rtnMap.setString("successYn", jsonObj.getString("successYn")); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } catch (MalformedURLException e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } catch (ProtocolException e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } catch (IOException e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } catch (JSONException e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } catch (Exception e) { - LOGGER.error("Error in getNaverApiJuso() paramMap="+paramMap+", jsonObj="+jsonObj, e); - } finally{ - try { - if(isr != null){ - isr.close(); - } - if(br != null){ - br.close(); - } - } catch (IOException e) { - LOGGER.error("Error in getNaverApiJuso() close", e); - } - } - return rtnMap; - } - @Override - public DataMap getNaverApiSearch(DataMap paramMap) { - JSONObject jsonObj = null; - DataMap rtnMap = new DataMap(); - BufferedReader br = null; - InputStreamReader isr = null; - List resultList = new ArrayList(); - - String code = paramMap.getString("code"); // 01-관광지 , 02-맛집, 03-숙박 - //String [] sort = {"sim","date"}; // 정렬 옵션: sim (유사도순-기본값), date (날짜순) - String gubun = ""; - if("01".equals(code)){ - gubun = "관광지"; - }else if("02".equals(code)){ - gubun = "맛집"; - }else if("03".equals(code)){ - gubun = "숙박"; - } - String apiURL = propertiesService.getString("openapi.naver.search.url"); - String clientId = propertiesService.getString("openapi.naver.map.clientId"); - String clientSecret = propertiesService.getString("openapi.naver.map.clientSecret"); - - // 검색 인자 지역 + "공백 필수"+ 관광지, 맛집, 숙박 - try { - String text = URLEncoder.encode(paramMap.getString("addr")+" "+gubun, "UTF-8"); - apiURL = apiURL + "?query="+ text; - if(!StringUtils.isBlank(paramMap.getString("sort"))){ - apiURL += "&sort="+paramMap.getString("sort"); // 기본 sim - } - if(!StringUtils.isBlank(paramMap.getString("start"))){ - apiURL += "&start="+paramMap.getString("start"); // 기본 1 - } - if(!StringUtils.isBlank(paramMap.getString("display"))){ - apiURL += "&display="+paramMap.getString("display"); // 기본 10 - } - - URL url = new URL(apiURL); - HttpURLConnection con = (HttpURLConnection)url.openConnection(); - con.setRequestMethod("GET"); - con.setRequestProperty("X-Naver-Client-Id", clientId); - con.setRequestProperty("X-Naver-Client-Secret", clientSecret); - int responseCode = con.getResponseCode(); - if(responseCode==200) { - isr = new InputStreamReader(con.getInputStream()); - br = new BufferedReader(isr); - } else { - isr = new InputStreamReader(con.getErrorStream()); - br = new BufferedReader(isr); - } - String inputLine; - StringBuffer response = new StringBuffer(); - while ((inputLine = br.readLine()) != null) { - response.append(inputLine); - } - if(responseCode==200) { - jsonObj = new JSONObject(response.toString()); - jsonObj.put("successYn","Y"); - } else { - JSONObject errObj = new JSONObject(response.toString()); - jsonObj = new JSONObject(); - jsonObj.put("result", errObj); - jsonObj.put("successYn","N"); - } - if("Y".equals(jsonObj.getString("successYn")) ){ - rtnMap.setString("total", (jsonObj.has("total") ? jsonObj.get("total").toString() : "0")); - rtnMap.setString("start", (jsonObj.has("start") ? jsonObj.get("start").toString() : "0")); - rtnMap.setString("display", (jsonObj.has("display") ? jsonObj.get("display").toString() : "0")); - if(jsonObj.has("items")){ - JSONArray jsonArray = null; - if(jsonObj.get("items") instanceof JSONArray){ - jsonArray =jsonObj.getJSONArray("items"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonObj.getJSONObject("items")); - } - for(int i=0; i getToolsApiNews(DataMap paramMap) { - - BufferedReader br = null; - InputStreamReader isr = null; - OutputStream wr = null; - List mapList = new ArrayList(); - - try { - String access_key = propertiesService.getString("openapi.tools.kinds.accessKey"); - String apiURL = propertiesService.getString("openapi.tools.kinds.url"); - - JSONObject argument = new JSONObject(); - argument.put("query", paramMap.getString("query")); - argument.put("provider", paramMap.get("provider")); - argument.put("category", paramMap.get("category")); - argument.put("sort", paramMap.get("sort")); - argument.put("hilight", StringUtils.defaultIfEmpty(paramMap.getString("hilight"), "2000")); - argument.put("return_from", StringUtils.defaultIfEmpty(paramMap.getString("return_from"), "0")); - argument.put("return_size", StringUtils.defaultIfEmpty(paramMap.getString("return_size"), "15")); - argument.put("fields", paramMap.get("fields")); - - JSONObject paramJSON = new JSONObject(); - paramJSON.put("access_key", access_key); - paramJSON.put("argument", argument); - - String body = paramJSON.toString(); - - URL url = new URL(apiURL); - HttpURLConnection con = (HttpURLConnection)url.openConnection(); - - con.setDoOutput(true); - con.setRequestMethod("POST"); - con.setRequestProperty("Content-Type", "application/json;charset=utf-8"); - - wr = con.getOutputStream(); - wr.write(body.getBytes()); - wr.flush(); - - int responseCode = con.getResponseCode(); - if(responseCode==200) { // 정상 호출 - isr = new InputStreamReader(con.getInputStream()); - br = new BufferedReader(isr); - JSONObject json = new JSONObject(br.readLine()); - if(json !=null && json.has("return_object")){ - JSONObject return_object = (JSONObject) json.get("return_object"); - if(return_object.has("documents")){ - JSONArray newsArr = null; - if(return_object.get("documents") instanceof JSONArray){ - newsArr = (JSONArray) return_object.get("documents"); - - for(int i=0; i resultList = new ArrayList(); - - try { - String addr = propertiesService.getString("api.visitkorea.gia.list.url");; - paramMap.setString("serviceKey", propertiesService.getString("api.visitkorea.gia.serviceKey")); - // contentTypeId 필수 : 호출하는곳에서 맵핑해서 넘겨준다. - // 나머지는 픽스 - paramMap.setString("pageNo", "1"); - paramMap.setString("numOfRows", "20000"); - paramMap.setString("arrange", "A"); - paramMap.setString("listYN", "Y"); - paramMap.setString("MobileOS", "ETC"); - paramMap.setString("MobileApp", "TourAPI3.0_Guide"); - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - isSuccess = true; - } catch (org.json.JSONException jsoe) { - resultMsg = "[String xml to JSON Parsing error]"+ jsoe.getMessage(); - LOGGER.error("String xml to JSON Parsing error in getGiaList()", jsoe); - } - }else{ - // 통신오류 - resultMsg = "통신 오류상태입니다."; - } - } catch (ConnectTimeoutException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaList()", e); - } catch (UnsupportedEncodingException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaList()", e); - } catch (HttpException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaList()", e); - } catch (IOException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaList()", e); - } catch (Exception e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaList()", e); - } finally { - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONArray){ - jsonArray =jsonItems.getJSONArray("item"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - } - for(int i=0; i resultList = new ArrayList(); - - try { - String addr = propertiesService.getString("api.visitkorea.gia.detail.common.url");; - paramMap.setString("serviceKey", propertiesService.getString("api.visitkorea.gia.serviceKey")); - //paramMap.setString("contentId", "2518765"); - //paramMap.setString("contenttypeid", "12"); // 의미가 없는것 같음. - paramMap.setString("MobileOS", "ETC"); - paramMap.setString("MobileApp", "TourAPI3.0_Guide"); - paramMap.setString("defaultYN", "Y"); //기본정보조회 - paramMap.setString("firstImageYN", "Y"); //대표이미지조회 - paramMap.setString("areacodeYN", "Y"); // 지역코드조회 - paramMap.setString("catcodeYN", "Y"); // 서비스분류코드조회 - paramMap.setString("addrinfoYN", "Y"); // 주소조회 - paramMap.setString("mapinfoYN", "N"); // 좌표조회 - paramMap.setString("overviewYN", "Y"); //개요 조회 - paramMap.setString("transGuideYN", "Y"); //길안내조회 - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - isSuccess = true; - } catch (org.json.JSONException jsoe) { - resultMsg = "[String xml to JSON Parsing error]"+ jsoe.getMessage(); - LOGGER.error("String xml to JSON Parsing error in getGiaDetailCommon()", jsoe); - } - }else{ - // 통신오류 - resultMsg = "통신 오류상태입니다."; - } - } catch (ConnectTimeoutException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailCommon()", e); - } catch (UnsupportedEncodingException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailCommon()", e); - } catch (HttpException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailCommon()", e); - } catch (IOException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailCommon()", e); - } catch (Exception e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailCommon()", e); - } finally { - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - totalCount = jsonBody.getInt("totalCount"); - if(totalCount > 0){ - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONArray){ - jsonArray =jsonItems.getJSONArray("item"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - } - for(int i=0; i resultList = new ArrayList(); - - try { - String addr = propertiesService.getString("api.visitkorea.gia.detail.intro.url");; - paramMap.setString("serviceKey", propertiesService.getString("api.visitkorea.gia.serviceKey")); - //paramMap.setString("contentId", "570762"); - //paramMap.setString("contenttypeid", "39"); // 의미가 없는것 같음. - paramMap.setString("MobileOS", "ETC"); - paramMap.setString("MobileApp", "TourAPI3.0_Guide"); - paramMap.setString("introYN", "Y"); - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - isSuccess = true; - } catch (org.json.JSONException jsoe) { - resultMsg = "[String xml to JSON Parsing error]"+ jsoe.getMessage(); - LOGGER.error("String xml to JSON Parsing error in getGiaDetailIntro()", jsoe); - } - }else{ - // 통신오류 - resultMsg = "통신 오류상태입니다."; - } - } catch (ConnectTimeoutException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailIntro()", e); - } catch (UnsupportedEncodingException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailIntro()", e); - } catch (HttpException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailIntro()", e); - } catch (IOException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailIntro()", e); - } catch (Exception e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailIntro()", e); - } finally { - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - totalCount = jsonBody.getInt("totalCount"); - if(totalCount > 0){ - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONArray){ - jsonArray =jsonItems.getJSONArray("item"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - } - for(int i=0; i resultList = new ArrayList(); - - try { - String addr = propertiesService.getString("api.visitkorea.gia.detail.info.url");; - paramMap.setString("serviceKey", propertiesService.getString("api.visitkorea.gia.serviceKey")); - //paramMap.setString("contentTypeId", "26"); // 39 반복정보 , 25 코스정보 - //paramMap.setString("contentId", "2381406"); // 570762 반복정보 , 2381406 코스정보 - paramMap.setString("MobileOS", "ETC"); - paramMap.setString("MobileApp", "TourAPI3.0_Guide"); - paramMap.setString("listYN", "Y"); - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - isSuccess = true; - } catch (org.json.JSONException jsoe) { - resultMsg = "[String xml to JSON Parsing error]"+ jsoe.getMessage(); - LOGGER.error("String xml to JSON Parsing error in getGiaDetailInfo()", jsoe); - } - }else{ - // 통신오류 - resultMsg = "통신 오류상태입니다."; - } - } catch (ConnectTimeoutException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailInfo()", e); - } catch (UnsupportedEncodingException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailInfo()", e); - } catch (HttpException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailInfo()", e); - } catch (IOException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailInfo()", e); - } catch (Exception e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailInfo()", e); - } finally { - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - totalCount = jsonBody.getInt("totalCount"); - if(totalCount > 0){ - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONArray){ - jsonArray =jsonItems.getJSONArray("item"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - } - for(int i=0; i resultList = new ArrayList(); - - try { - String addr = propertiesService.getString("api.visitkorea.gia.detail.image.url");; - paramMap.setString("serviceKey", propertiesService.getString("api.visitkorea.gia.serviceKey")); - //paramMap.setString("contentTypeId", "39"); // 39 반복정보 , 25 코스정보 - //paramMap.setString("contentId", "570762"); // 570762 반복정보 , 2381406 코스정보 - paramMap.setString("MobileOS", "ETC"); - paramMap.setString("MobileApp", "TourAPI3.0_Guide"); - paramMap.setString("imageYN", StringUtils.defaultString(paramMap.getString("imageYN"), "Y")); // Y : 추가이미지, N : 메뉴이미지 - - HttpClient httpClient = new HttpClient(); - HttpMethod getMethod = new GetMethod(addr+getQueryString(paramMap)); - getMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); // encoding : UTF-8 - - int statusCode = httpClient.executeMethod(getMethod); - byte[] responseBody = getMethod.getResponseBody(); - resultXml = new String(responseBody, "UTF-8"); // encoding : UTF-8 - if(statusCode == 200){ - try { - xmlJSONObj = XML.toJSONObject(resultXml); - isSuccess = true; - } catch (org.json.JSONException jsoe) { - resultMsg = "[String xml to JSON Parsing error]"+ jsoe.getMessage(); - LOGGER.error("String xml to JSON Parsing error in getGiaDetailImage()", jsoe); - } - }else{ - // 통신오류 - resultMsg = "통신 오류상태입니다."; - } - } catch (ConnectTimeoutException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailImage()", e); - } catch (UnsupportedEncodingException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailImage()", e); - } catch (HttpException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailImage()", e); - } catch (IOException e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailImage()", e); - } catch (Exception e) { - resultMsg = e.getMessage(); - LOGGER.error("Error in getGiaDetailImage()", e); - } finally { - if(isSuccess){ - try { - JSONObject jsonResponse = xmlJSONObj.getJSONObject("response"); - JSONObject jsonHeader = jsonResponse.getJSONObject("header"); - resultCode = jsonHeader.get("resultCode").toString(); - resultMsg = jsonHeader.get("resultMsg").toString(); - if("0000".equals(resultCode)){ - JSONObject jsonBody = jsonResponse.getJSONObject("body"); - totalCount = jsonBody.getInt("totalCount"); - if(totalCount > 0){ - JSONObject jsonItems = jsonBody.getJSONObject("items"); - if(jsonItems.has("item")){ - JSONArray jsonArray = null; - if(jsonItems.get("item") instanceof JSONArray){ - jsonArray =jsonItems.getJSONArray("item"); - }else{ - jsonArray = new JSONArray(); - jsonArray.put(jsonItems.getJSONObject("item")); - } - for(int i=0; i selectCmmBbsList(CmmBbsVO cmmBbsVO) throws DataAccessException{ - return (List)list("cmmBbsDAO.selectCmmBbsList", cmmBbsVO); - } - @SuppressWarnings("unchecked") - public List selectCmmBbsTopList(CmmBbsVO cmmBbsVO) throws DataAccessException{ - return (List)list("cmmBbsDAO.selectCmmBbsTopList", cmmBbsVO); - } - @SuppressWarnings("unchecked") - public List selectCmmBbsCnList(CmmBbsVO cmmBbsVO) throws DataAccessException{ - return (List)list("cmmBbsDAO.selectCmmBbsCnList", cmmBbsVO); - } - @SuppressWarnings("unchecked") - public List selectCmmBbsMainList(CmmBbsVO cmmBbsVO) throws DataAccessException{ - return (List)list("cmmBbsDAO.selectCmmBbsMainList", cmmBbsVO); - } - public CmmBbsVO selectCmmBbsDetail(CmmBbsVO cmmBbsVO) throws DataAccessException{ - //return (CmmBbsVO)select("cmmBbsDAO.selectCmmBbsDetail", cmmBbsVO); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectPrevNextCmmBbsDetailList(CmmBbsVO cmmBbsVO) throws DataAccessException{ - return (List)list("cmmBbsDAO.selectPrevNextCmmBbsDetailList", cmmBbsVO); - } - public void insertCmmBbs(CmmBbsVO cmmBbsVO) throws TransactionException{ - insert("cmmBbsDAO.insertCmmBbs", cmmBbsVO); - } - public void updateCmmBbs(CmmBbsVO cmmBbsVO) throws TransactionException{ - update("cmmBbsDAO.updateCmmBbs", cmmBbsVO); - } - public void deleteCmmBbs(CmmBbsVO cmmBbsVO) throws TransactionException{ - update("cmmBbsDAO.deleteCmmBbs", cmmBbsVO); - } - public void updateCmmBbsReadCnt(CmmBbsVO cmmBbsVO) throws TransactionException{ - update("cmmBbsDAO.updateCmmBbsReadCnt", cmmBbsVO); - } - public void updateLocalCultureRecommend(CmmBbsVO cmmBbsVO) throws TransactionException{ - update("cmmBbsDAO.updateLocalCultureRecommend",cmmBbsVO); - } -} diff --git a/src/main/java/cmm/service/impl/CmmBbsServiceImpl.java b/src/main/java/cmm/service/impl/CmmBbsServiceImpl.java deleted file mode 100644 index 61d4b53d..00000000 --- a/src/main/java/cmm/service/impl/CmmBbsServiceImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -package cmm.service.impl; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import cmm.Constant; -import cmm.service.CmmBbsService; -import cmm.service.CmmBbsVO; -import cmm.service.CmmCmsContentsVO; -//import cmm.service.CmmFileService; -import cmm.service.FileManagementVO; -import cmm.util.CmmUtil; -import cmm.util.DateUtil; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.cmmn.exception.FdlException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; - - -/** - * 게시판 관리에 대한 서비스 클래스를 구현한다. - * @Class Name : CmmBbsServiceImpl.java - * @author ecplaza - * @since 2018-04-16 - * @version 1.0 - */ -@Service("cmmBbsService") -public class CmmBbsServiceImpl extends EgovAbstractServiceImpl implements CmmBbsService { - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmBbsServiceImpl.class); - - /** cmmBbsDAO */ - @Resource(name="cmmBbsDAO") - private CmmBbsDAO cmmBbsDAO; -// -// /** egovNttIdGnrService */ -// @Resource(name = "egovNttIdGnrService") -// private EgovIdGnrService nttIdgenService; - -// /** CmmFileService */ -// @Resource(name = "cmmFileService") -// private CmmFileService cmmFileService; - - public int selectCmmBbsListTotCnt(CmmBbsVO cmmBbsVO) throws EgovBizException{ - return (Integer)cmmBbsDAO.selectCmmBbsListTotCnt(cmmBbsVO); - } - public List selectCmmBbsList(CmmBbsVO cmmBbsVO) throws EgovBizException{ - return (List)cmmBbsDAO.selectCmmBbsList(cmmBbsVO); - } - public List selectCmmBbsTopList(CmmBbsVO cmmBbsVO) throws EgovBizException{ - return (List)cmmBbsDAO.selectCmmBbsTopList(cmmBbsVO); - } - public List selectCmmBbsCnList(CmmBbsVO cmmBbsVO) throws EgovBizException{ - return (List)cmmBbsDAO.selectCmmBbsCnList(cmmBbsVO); - } - public List selectCmmBbsMainList(CmmBbsVO cmmBbsVO) throws EgovBizException{ - cmmBbsVO.setSearchStartStr(DateUtil.getNowString("yyyyMMddHHmm"));// 쿼리에서 비교할 때는 분단위까지 비교 - return (List)cmmBbsDAO.selectCmmBbsMainList(cmmBbsVO); - } - public CmmBbsVO selectCmmBbsDetail(CmmBbsVO cmmBbsVO) throws EgovBizException{ - cmmBbsDAO.updateCmmBbsReadCnt(cmmBbsVO); - CmmBbsVO rsVo = (CmmBbsVO)cmmBbsDAO.selectCmmBbsDetail(cmmBbsVO); - if(rsVo != null && !rsVo.getBbsId().equals(Constant.BBS_ID_NOTICE)){ - if( !StringUtils.isBlank(rsVo.getNtceBgnde()) ){ - rsVo.setNtceBgnde(DateUtil.getDateFormatString(rsVo.getNtceBgnde())); - } - if( !StringUtils.isBlank(rsVo.getNtceEndde()) ){ - rsVo.setNtceEndde(DateUtil.getDateFormatString(rsVo.getNtceEndde())); - } - if(cmmBbsVO.isBr()){ - rsVo.setNttCn(CmmUtil.escapeNewlineToBr(rsVo.getNttCn())); - } - } - return rsVo; - } - public List selectPrevNextCmmBbsDetailList(CmmBbsVO cmmBbsVO) throws EgovBizException{ - return (List)cmmBbsDAO.selectPrevNextCmmBbsDetailList(cmmBbsVO); - } - public String insertCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws IOException, FdlException, EgovBizException{ - if( !StringUtils.isBlank(cmmBbsVO.getNtceBgnde()) ){ - cmmBbsVO.setNtceBgnde(cmmBbsVO.getNtceBgnde().replaceAll("-", "")); - } - if( !StringUtils.isBlank(cmmBbsVO.getNtceEndde()) ){ - cmmBbsVO.setNtceEndde(cmmBbsVO.getNtceEndde().replaceAll("-", "")); - } - cmmBbsVO.setNttSj(CmmUtil.unscript(cmmBbsVO.getNttSj())); // XSS 방지 - //cmmBbsVO.setAtchFileId(cmmFileService.uploadFile(request, new FileManagementVO(true))); - - //String id = String.valueOf(nttIdgenService.getNextLongId()).trim(); // TODO 필요여부 확인 DDDDDDDDDDDDDDDDDDDDDD 검색엔진 라이브러리 포함 처리하면서 들어온 모듈. - //cmmBbsVO.setNttId(id); - //cmmBbsDAO.insertCmmBbs(cmmBbsVO); - - //return id; - return null; - } - public void updateCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws IOException, EgovBizException{ - if( !StringUtils.isBlank(cmmBbsVO.getNtceBgnde()) ){ - cmmBbsVO.setNtceBgnde(cmmBbsVO.getNtceBgnde().replaceAll("-", "")); - } - if( !StringUtils.isBlank(cmmBbsVO.getNtceEndde()) ){ - cmmBbsVO.setNtceEndde(cmmBbsVO.getNtceEndde().replaceAll("-", "")); - } - cmmBbsVO.setNttSj(CmmUtil.unscript(cmmBbsVO.getNttSj())); // XSS 방지 - //cmmBbsVO.setAtchFileId(cmmFileService.uploadFile(request, new FileManagementVO(true))); - cmmBbsDAO.updateCmmBbs(cmmBbsVO); - } - public void deleteCmmBbs(CmmBbsVO cmmBbsVO, HttpServletRequest request) throws EgovBizException{ - cmmBbsDAO.deleteCmmBbs(cmmBbsVO); - } - - @Override - public void updateLocalCultureRecommend(CmmBbsVO cmmBbsVO) - throws EgovBizException { - String idStr = cmmBbsVO.getNttIdList().get(0).substring(0); - String idArr[] = idStr.split(","); - List idList = new ArrayList(); - for(int i=0; i - * << 개정이력(Modification Information) >> - * @ - * @ 수정일 수정자 수정내용 - * @ --------- --------- ------------------------------- - * @ 2018-05-11 ecplaza 최초생성 - * - * - */ -@Repository("cmmCmsDAO") -public class CmmCmsDAO extends EgovComAbstractDAO { - - @SuppressWarnings("unchecked") - public List selectCmmScrapList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException{ - return (List)list("cmmCmsDAO.selectCmmScrapList",cmmActivityHstVO); - } - @SuppressWarnings("unchecked") - public List selectCmmActivityHstOpList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - return (List)list("cmmCmsDAO.selectCmmActivityHstOpList",cmmActivityHstVO); - } - @SuppressWarnings("deprecation") - public int selectCmmScrapListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmCmsDAO.selectCmmScrapListTotCnt", cmmActivityHstVO); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectCmmActivityHstOpListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmCmsDAO.selectCmmActivityHstOpListTotCnt", cmmActivityHstVO); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectCmmCmsKeywordsList(List contentId) throws DataAccessException { - return (List)list("cmmCmsDAO.selectCmmCmsKeywordsList",contentId); - } - @SuppressWarnings("unchecked") - public List selectCmmCmsTagsList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - return (List)list("cmmCmsDAO.selectCmmCmsTagsList",cmmActivityHstVO); - } - @SuppressWarnings("unchecked") - public List selectCmmCmsPopularList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)list("cmmCmsDAO.selectCmmCmsPopularList",cmmActivityHstVO); - } - public void deleteAllCmmScrapInfo(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - delete("cmmDAO.deleteCmmScrapInfo", cmmActivityHstVO); - } -} diff --git a/src/main/java/cmm/service/impl/CmmCmsServiceImpl.java b/src/main/java/cmm/service/impl/CmmCmsServiceImpl.java deleted file mode 100644 index 53744f04..00000000 --- a/src/main/java/cmm/service/impl/CmmCmsServiceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package cmm.service.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import cmm.service.CmmActivityHstVO; -import cmm.service.CmmCmsService; -import cmm.util.DataMap; -import egovframework.com.cmm.service.impl.CmmUseDAO; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.property.EgovPropertyService; - - -/** - * CMS 콘텐츠관리에 대한 서비스 클래스를 구현한다 - * @Class Name : CmmCmsServiceImpl.java - * @author ecplaza - * @since 2018-05-11 - * @version 1.0 - */ -@Service("cmmCmsService") -public class CmmCmsServiceImpl extends EgovAbstractServiceImpl implements CmmCmsService { - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmCmsServiceImpl.class); - - /** EgovPropertyService */ - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - - /** cmmCmsDAO */ - @Resource(name="cmmCmsDAO") - private CmmCmsDAO cmmCmsDAO; - - /** cmmUseDAO */ - @Resource(name="cmmUseDAO") - private CmmUseDAO cmmUseDAO; - - public List selectCmmScrapList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)cmmCmsDAO.selectCmmScrapList(cmmActivityHstVO); - } - public List selectCmmActivityHstOpList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)cmmCmsDAO.selectCmmActivityHstOpList(cmmActivityHstVO); - } - public int selectCmmScrapListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (Integer)cmmCmsDAO.selectCmmScrapListTotCnt(cmmActivityHstVO); - } - public int selectCmmActivityHstOpListTotCnt(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (Integer)cmmCmsDAO.selectCmmActivityHstOpListTotCnt(cmmActivityHstVO); - } - public List selectCmmCmsKeywordsList(List result) throws EgovBizException{ - List contentId = new ArrayList(); - for(int i=0; i< result.size(); i++){ - contentId.add(result.get(i).getId()); - } - return cmmCmsDAO.selectCmmCmsKeywordsList(contentId); - } - public List selectCmmCmsTagsList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return cmmCmsDAO.selectCmmCmsTagsList(cmmActivityHstVO); - } - public List selectCmmCmsPopularList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return cmmCmsDAO.selectCmmCmsPopularList(cmmActivityHstVO); - } - - public void deleteAllCmmScrapInfo(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - cmmCmsDAO.deleteAllCmmScrapInfo(cmmActivityHstVO); - } -} diff --git a/src/main/java/cmm/service/impl/CmmDAO.java b/src/main/java/cmm/service/impl/CmmDAO.java deleted file mode 100644 index f99b2f8f..00000000 --- a/src/main/java/cmm/service/impl/CmmDAO.java +++ /dev/null @@ -1,339 +0,0 @@ -package cmm.service.impl; - -import java.util.List; - -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.TransactionException; - -import cmm.Constant; -import cmm.util.CmmVO; -import cmm.util.DataMap; -import egovframework.com.cmm.service.impl.EgovComAbstractDAO; - -/** - * 공통에 대한 데이터 접근 클래스를 정의한다. - * @Class Name : CmmDAO.java - * @author ecplaza - * @since 2018-04-16 - * @version 1.0 - */ -@Repository("cmmDAO") -public class CmmDAO extends EgovComAbstractDAO { - - @SuppressWarnings("unchecked") - public List selectMenuHead(String authorCode) throws DataAccessException { - return (List) list("cmmDAO.selectMenuHead", authorCode); - } - @SuppressWarnings("unchecked") - public List selectMenuLeft(String authorCode) throws DataAccessException { - return (List) list("cmmDAO.selectMenuLeft", authorCode); - } - @SuppressWarnings("unchecked") - public List selectCmmActivityHstAllListTotCnt(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmActivityHstAllListTotCnt",paramMap); - } - @SuppressWarnings("deprecation") - public int selectSatisfactionTotCnt(DataMap paramMap) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmDAO.selectSatisfactionTotCnt", paramMap); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - - } - @SuppressWarnings("deprecation") - public int selectCmmPscHstTotCnt(DataMap paramMap) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmDAO.selectCmmPscHstTotCnt", paramMap); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - public DataMap selectCmmPscHstDetail(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmPscHstDetail", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - public DataMap selectCmmPmsPostRandom(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmPmsPostRandom", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - /** - * 에셋 상세정보 - * pick 레이어 사용(좌측 상단 및 상세 정보) - * @param paramMap - * @return - * @throws DataAccessException - */ - public DataMap selectCmmAmsAssetsDetail(DataMap paramMap) throws DataAccessException { - paramMap.put("searchAssetClassArray", Constant.ASSETS_CLASS_ARRAY_PICK); - - //return (DataMap)select("cmmDAO.selectCmmAmsAssetsDetail", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - /** - * 에셋 미디어 그룹 목록 - * pick 레이어 사용(좌측 목록) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsMediaGroupListCnt(DataMap paramMap) throws DataAccessException { - paramMap.put("searchAssetClassArray", Constant.ASSETS_CLASS_ARRAY_PICK); - paramMap.put("searchAssetTypeArray", Constant.ASSETS_TYPE_ARRAY_PICK); - - return (List)list("cmmDAO.selectCmmAmsAssetsMediaGroupListCnt",paramMap); - } - /** - * 에셋 미디어 그룹 목록 - * pick 레이어 사용(좌측 목록) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsMediaGroupList(DataMap paramMap) throws DataAccessException { - paramMap.put("searchAssetClassArray", Constant.ASSETS_CLASS_ARRAY_PICK); - paramMap.put("searchAssetTypeArray", Constant.ASSETS_TYPE_ARRAY_PICK); - - return (List)list("cmmDAO.selectCmmAmsAssetsMediaGroupList",paramMap); - } - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsMediaList(DataMap paramMap) throws DataAccessException { - paramMap.put("searchAssetClassArray", Constant.ASSETS_CLASS_ARRAY_PICK); - paramMap.put("searchAssetTypeArray", Constant.ASSETS_TYPE_ARRAY_PICK); - - return (List)list("cmmDAO.selectCmmAmsAssetsMediaList",paramMap); - } - /** - * 에셋 미디어 상세정보 - * pick 레이어 사용(완문보기 상세정보) - * @param paramMap - * @return - * @throws DataAccessException - */ - public DataMap selectCmmAmsAssetsMediaDetail(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmAmsAssetsMediaDetail", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - /** - * 에셋 미디어 상세정보(미디어의 INTERFACE_ID 값으로 조회) - * pick 레이어 사용(완문보기 상세정보) - * @param paramMap - * @return - * @throws DataAccessException - */ - public DataMap selectCmmAmsAssetsMediaDetailByInterfaceId(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmAmsAssetsMediaDetailByInterfaceId", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - /** - * 에셋 미디어 OCR 목록 - * pick 레이어 사용(문서 완문보기) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsMediaOcrList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsMediaOcrList",paramMap); - } - /** - * 에셋 상세 연관태그 목록 - * pick 레이어 사용(상세 정보의 연관태그) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsTagsList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsTagsList",paramMap); - } - /** - * 에셋 상세 연속자료 목록 총 수 - * pick 레이어 사용(상세 정보의 연속자료 목록 총 수) - * @param param - * @return - * @throws DataAccessException - */ - public int selectCmmAmsAssetsContinueListTotCnt(CmmVO param) throws DataAccessException { - param.setSearchAssetClassArray(Constant.ASSETS_CLASS_ARRAY_PICK); - param.setSearchAssetTypeArray(Constant.ASSETS_TYPE_ARRAY_PICK); - - //return (Integer)select("cmmDAO.selectCmmAmsAssetsContinueListTotCnt",param); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - /** - * 에셋 상세 연속자료 목록 - * pick 레이어 사용(상세 정보의 연속자료 목록) - * @param param - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsContinueList(CmmVO param) throws DataAccessException { - param.setSearchAssetClassArray(Constant.ASSETS_CLASS_ARRAY_PICK); - param.setSearchAssetTypeArray(Constant.ASSETS_TYPE_ARRAY_PICK); - - return (List)list("cmmDAO.selectCmmAmsAssetsContinueList",param); - } - /** - * 에셋 상세 연관 지역문화이야기 목록 - * pick 레이어 사용(지역문화이야기 목록) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsThemesContentsList(List paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsThemesContentsList",paramMap); - } - /** - * 에셋 상세 다른문화원 소장자료 목록 - * pick 레이어 사용(다른문화원 소장자료 목록) - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsDiffSojangList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsDiffSojangList",paramMap); - } - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsOriginViewList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsOriginViewList",paramMap); - } - - public int selectCmmAmsAssetsOriginViewListAjaxCnt(DataMap paramMap) throws DataAccessException { - //return (Integer)select("cmmDAO.selectCmmAmsAssetsOriginViewListAjaxCnt", paramMap); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsOriginViewListAjax(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsOriginViewListAjax",paramMap); - } - - public DataMap selectCmmAmsAssetsOriginViewDetail(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmAmsAssetsOriginViewDetail",paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectCmmScrapCnt(DataMap paramMap) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmDAO.selectCmmScrapCnt", paramMap); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - public void insertSatisfaction(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertSatisfaction", paramMap); - } - public void insertCmmSchedulerHst(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmSchedulerHst", paramMap); - } - public void insertCmmPscHst(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmPscHst", paramMap); - } - public void updateCmmPscHst(DataMap paramMap) throws TransactionException { - update("cmmDAO.updateCmmPscHst", paramMap); - } - public void insertCmmScrapTypeA(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeA", paramMap); - } - public void insertCmmScrapTypeB(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeB", paramMap); - } - public void insertCmmScrapTypeC(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeC", paramMap); - } - public void insertCmmScrapTypeG(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeG", paramMap); - } - public void insertCmmScrapTypeI(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeI", paramMap); - } - public void insertCmmScrapTypeP(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeP", paramMap); - } - public void insertCmmScrapTypeT(DataMap paramMap) throws TransactionException{ - insert("cmmDAO.insertCmmScrapTypeT", paramMap); - } - public void insertCmmActivityHstTypeA(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeA", paramMap); - } - public void insertCmmActivityHstTypeB(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeB", paramMap); - } - public void insertCmmActivityHstTypeC(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeC", paramMap); - } - /* 미사용 주석처리 (2019.12.06) - public void insertCmmActivityHstTypeL(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeL", paramMap); - } - */ - public void insertCmmActivityHstTypeG(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeG", paramMap); - } - public void insertCmmActivityHstTypeI(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeI", paramMap); - } - public void insertCmmActivityHstTypeP(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeP", paramMap); - } - public void insertCmmActivityHstTypeT(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityHstTypeT", paramMap); - } - public void updateCmmActivityHst(DataMap paramMap) throws TransactionException { - delete("cmmDAO.updateCmmActivityHst", paramMap); - } - public void deleteCmmScrapInfo(DataMap paramMap) throws TransactionException{ - delete("cmmDAO.deleteCmmScrapInfo", paramMap); - } - - /** - * 모바일 디바이스 정보 목록 - * @param paramMap - * @return - * @throws DataAccessException - */ - @SuppressWarnings("unchecked") - public List selecCmmMobileDeviceInfoList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selecCmmMobileDeviceInfoList",paramMap); - } - - public void insertCmmActivityMediaHst(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmActivityMediaHst", paramMap); - } - - @SuppressWarnings("unchecked") - public List selectCmmAmsAssetsTagKeyList(DataMap paramMap) throws DataAccessException { - return (List)list("cmmDAO.selectCmmAmsAssetsTagKeyList",paramMap); - } - - public DataMap selectCmmAmsAssetsMediaDetail2(DataMap paramMap) throws DataAccessException { - //return (DataMap)select("cmmDAO.selectCmmAmsAssetsMediaDetail2", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public int selectCmmWebzineCnfirm(DataMap paramMap) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmDAO.selectCmmWebzineCnfirm", paramMap); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - public void insertCmmWebzineSubScribe(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmWebzineSubScribe", paramMap); - } - - @SuppressWarnings("unchecked") - public List selectMainExtGiaList(DataMap param) throws DataAccessException { - return (List)list("cmmDAO.selectMainExtGiaList", param); - } - - public void deleteCmmMainExtGiaData(DataMap paramMap) throws TransactionException{ - delete("cmmDAO.deleteCmmMainExtGiaData", paramMap); - } - - public void insertCmmMainData(DataMap paramMap) throws TransactionException { - insert("cmmDAO.insertCmmMainData", paramMap); - } - - public DataMap getMainLogo() throws DataAccessException { - //return (DataMap)select("cmmDAO.getMainLogo"); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - -} diff --git a/src/main/java/cmm/service/impl/CmmFileDAO.java b/src/main/java/cmm/service/impl/CmmFileDAO.java deleted file mode 100644 index 6bbd806b..00000000 --- a/src/main/java/cmm/service/impl/CmmFileDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -package cmm.service.impl; - -import java.math.BigDecimal; -import java.util.List; - -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.TransactionException; - -import cmm.service.FileDetailVO; -import cmm.service.FileMasterVO; -import egovframework.com.cmm.service.impl.EgovComAbstractDAO; - -/** - * CmmFileDAO - */ -@Repository("cmmFileDAO") -public class CmmFileDAO extends EgovComAbstractDAO -{ - public void insertFileMaster(FileMasterVO fileMasterVO) throws TransactionException - { - insert("cmmFileDAO.insertFileMasterXXX", fileMasterVO); - } - public int getMaxFileSN(FileDetailVO fileDetailVO) throws DataAccessException { - //return (Integer) select("cmmFileDAO.getMaxFileSN", fileDetailVO); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - public void deleteFileDetail(FileDetailVO fileDetailVO) throws TransactionException - { - delete("cmmFileDAO.deleteFileDetailXXX", fileDetailVO); - } - public void insertFileDetail(FileDetailVO fileDetailVO) throws TransactionException - { - insert("cmmFileDAO.insertFileDetailXXX", fileDetailVO); - } - - @SuppressWarnings("unchecked") - public List selectFileDetailList(String atchFileId) throws DataAccessException - { - return (List)list("cmmFileDAO.selectFileDetailList", atchFileId); - } - - @SuppressWarnings("deprecation") - public BigDecimal selectFileMasterCount(String atchFileId) throws DataAccessException - { - //return (BigDecimal)getSqlMapClientTemplate().queryForObject("cmmFileDAO.selectFileMasterCount", atchFileId); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public BigDecimal selectFileDetailCount(String atchFileId) throws DataAccessException - { - //return (BigDecimal)getSqlMapClientTemplate().queryForObject("cmmFileDAO.selectFileDetailCount", atchFileId); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - public FileDetailVO selectFileDetail(FileDetailVO fileDetailVOParam) throws DataAccessException{ - //return (FileDetailVO) select("cmmFileDAO.selectFileDetail", fileDetailVOParam); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - public FileDetailVO selectFileDetailFirst(String atchFileId) throws DataAccessException{ - //return (FileDetailVO)select("cmmFileDAO.selectFileDetailFirst", atchFileId); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - - public void alternateFileDetail(FileDetailVO fileDetailVO) throws TransactionException { - update("cmmFileDAO.alternateFileDetail", fileDetailVO); - } - - public void deleteFileMaster(String atchFileId) throws TransactionException { - delete("cmmFileDAO.deleteFileMasterXXX", atchFileId); - } - - @SuppressWarnings("unchecked") - public List selectIconFileDownLoad(String atchFileId) throws DataAccessException { - return (List) list("cmmFileDAO.selectFileDetailList", atchFileId); - } -} diff --git a/src/main/java/cmm/service/impl/CmmFileServiceImpl.java b/src/main/java/cmm/service/impl/CmmFileServiceImpl.java deleted file mode 100644 index e0f3342f..00000000 --- a/src/main/java/cmm/service/impl/CmmFileServiceImpl.java +++ /dev/null @@ -1,377 +0,0 @@ -package cmm.service.impl; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import cmm.service.CmmFileService; -import cmm.service.FileDetailVO; -import cmm.service.FileManagementVO; -import cmm.service.FileMasterVO; -import cmm.util.DateUtil; -import cmm.util.FileUtil; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.cmmn.exception.FdlException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import egovframework.rte.fdl.property.EgovPropertyService; - -@Service("cmmFileService") -public class CmmFileServiceImpl extends EgovAbstractServiceImpl implements CmmFileService { - - @Resource(name = "cmmFileDAO") - private CmmFileDAO cmmFileDAO; - -// @Resource(name = "egovFileIdGnrService") -// private EgovIdGnrService idgenService; - - /** EgovPropertyService */ - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - - private static final Logger LOGGER = LoggerFactory.getLogger(CmmFileServiceImpl.class); - - - @SuppressWarnings("unused") - public String uploadFile(HttpServletRequest request, FileManagementVO fileManagementVO) throws IOException, EgovBizException { - MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest)request; - - - final Map files = multiRequest.getFileMap(); - - String fileMstNo = null; - String path = propertiesService.getString("file.upload.path") + DateUtil.getNowString(DateUtil.DATE_DB_FORMAT)+"/"; - File file = new File(path); - file.setExecutable(false, true); - file.setReadable(true); - file.setWritable(false,true); - if (!file.exists()) { - file.mkdirs(); - } - List fileList = multiRequest.getFiles(fileManagementVO.getFdFile()); - - int index = fileManagementVO.getIndex(); - if (fileList == null) { - LOGGER.debug("No file attached."); - return null; - } - - LOGGER.debug("CHANG CHECK POINT FILE LIST : " + fileList + ", fdFile : " + fileManagementVO.getFdFile()); - if (StringUtils.isNotEmpty(fileManagementVO.getFdMstNo())) { - String[] fileMstNoArr = multiRequest.getParameterValues(fileManagementVO.getFdMstNo()); - if (fileMstNoArr != null) { - if (StringUtils.isNotEmpty(fileMstNoArr[index])) { - fileMstNo = fileMstNoArr[index]; - } - } - } - if (fileManagementVO.isMulti() == false) { - String ctrlStr = null; - String title = null; - if (fileManagementVO.getFdCtrl() != null) { - ctrlStr = multiRequest.getParameterValues(fileManagementVO.getFdCtrl())[index]; - } - if (fileManagementVO.getFdTitle() != null) { - title = multiRequest.getParameterValues(fileManagementVO.getFdTitle())[index]; - } - if (FileUtil.ORDER_FLAG_DELETE.equals(ctrlStr)) { - FileDetailVO fileDetailVO = cmmFileDAO.selectFileDetailFirst(fileMstNo); - if (fileDetailVO != null) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - this.deleteFileDetail(fileDetailVO); - } - } else if (FileUtil.ORDER_FLAG_RETRIEVE.equals(ctrlStr)) { - } else { - FileDetailVO fileDetailVONew = null; - if (fileList.size() > 0) { - MultipartFile multipartFile = fileList.get(index); - fileDetailVONew = this.saveFile(multipartFile, fileManagementVO, fileMstNo, path, null); - } - if (fileDetailVONew != null) { - fileMstNo = fileDetailVONew.getAtchFileId(); - FileDetailVO fileDetailVO = cmmFileDAO.selectFileDetailFirst(fileMstNo); - if (fileDetailVO != null) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - fileDetailVONew.setFileSn(fileDetailVO.getFileSn()); - this.alternateFileDetail(fileDetailVONew); - } else { - //fileDetailVONew.setAtchFileId(idgenService.getNextStringId()); - int newMaxFileSN = cmmFileDAO.getMaxFileSN(fileDetailVONew); - fileDetailVONew.setFileSn(Integer.toString(newMaxFileSN - 1)); - - this.createNewFileDetail(fileDetailVONew); - } - } - } - } else { - for (int i = 0; i < fileList.size(); i++) { - String ctrlStr = multiRequest.getParameterValues(fileManagementVO.getFdCtrl())[i]; - String title = null; - String fileDtlNo = null; - if (fileManagementVO.getFdTitle() != null) { - title = multiRequest.getParameterValues(fileManagementVO.getFdTitle())[i]; - } - if (fileManagementVO.getFdDtlNo() != null) { - fileDtlNo = multiRequest.getParameterValues(fileManagementVO.getFdDtlNo())[i]; - } - if (FileUtil.ORDER_FLAG_INSERT.equals(ctrlStr)) { - MultipartFile multipartFile = fileList.get(i); - FileDetailVO fileDetailVO = this.saveFile(multipartFile, fileManagementVO, fileMstNo, path, title); - if (fileDetailVO == null) { - continue; - } - fileMstNo = fileDetailVO.getAtchFileId(); - int newMaxFileSN = cmmFileDAO.getMaxFileSN(fileDetailVO); - fileDetailVO.setFileSn(Integer.toString(newMaxFileSN)); - this.createNewFileDetail(fileDetailVO); - } else if (FileUtil.ORDER_FLAG_UPDATE.equals(ctrlStr)) { - MultipartFile multipartFile = fileList.get(i); - FileDetailVO fileDetailVONew = this.saveFile(multipartFile, fileManagementVO, fileMstNo, path, title); - FileDetailVO fileDetailVO = null; - if (fileDetailVONew == null) { - - } else { - fileMstNo = fileDetailVONew.getAtchFileId(); - fileDetailVONew.setFileSn(fileDtlNo); - fileDetailVO = cmmFileDAO.selectFileDetail(fileDetailVONew); - if (fileDetailVO != null) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - fileDetailVONew.setAtchFileId(fileDetailVO.getAtchFileId()); - this.alternateFileDetail(fileDetailVONew); - } else { - int newMaxFileSN = cmmFileDAO.getMaxFileSN(fileDetailVONew); - fileDetailVONew.setFileSn(Integer.toString(newMaxFileSN - 1)); - this.createNewFileDetail(fileDetailVONew); - } - } - } else if (FileUtil.ORDER_FLAG_DELETE.equals(ctrlStr)) { - FileDetailVO fileDetailVO = new FileDetailVO(); - fileDetailVO.setAtchFileId(fileMstNo); - fileDetailVO.setFileSn(fileDtlNo); - fileDetailVO = cmmFileDAO.selectFileDetail(fileDetailVO); - if(fileManagementVO.isSaveToDisk()) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - } - this.deleteFileDetail(fileDetailVO); - } - } - } - return fileMstNo; - } - public String uploadFileOneAttMulti(HttpServletRequest request, FileManagementVO fileManagementVO, int cnt) throws IOException, EgovBizException { - MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest)request; - - String fileMstNo = null; - String fileReturnMstNo = null; - String path = propertiesService.getString("file.upload.path") + DateUtil.getNowString(DateUtil.DATE_DB_FORMAT)+"/"; - File file = new File(path); - file.setExecutable(false, true); - file.setReadable(true); - file.setWritable(false,true); - if (!file.exists()) { - file.mkdirs(); - } - - for(int i = 1; i <= cnt; i++){ - MultipartFile multipartFile = multiRequest.getFile("atchFile0"+i); - - String ctrlStr = multiRequest.getParameter("atchCtrl0"+i); - String fileDtlNo = null; - fileDtlNo = multiRequest.getParameter("atchDtlNo0"+i); - if(multipartFile != null){ - if((fileManagementVO.getFdMstNo() != null) && (!"".equals(fileManagementVO.getFdMstNo()))){ - fileMstNo = fileManagementVO.getFdMstNo(); - } - fileMstNo = uploadFileOneAttMulti(multipartFile, fileManagementVO, i, fileMstNo, ctrlStr, fileDtlNo, path); - - if(!"".equals(fileMstNo)){ - fileReturnMstNo = fileMstNo; - } - - } - } - - return fileReturnMstNo; - } - - public String uploadFileOneAttMulti(MultipartFile multipartFile, FileManagementVO fileManagementVO, int fileSn, String fileMstNo, String ctrlStr, String fileDtlNo, String path) throws IOException, EgovBizException { - - String fileReturnMstNo = fileMstNo; - if (FileUtil.ORDER_FLAG_DELETE.equals(ctrlStr)) { - FileDetailVO fileDetailVONew = new FileDetailVO(); - fileDetailVONew.setFileSn(Integer.toString(fileSn)); - fileDetailVONew.setAtchFileId(fileReturnMstNo); - FileDetailVO fileDetailVO = cmmFileDAO.selectFileDetail(fileDetailVONew); - if (fileDetailVO != null) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - this.deleteFileDetail(fileDetailVO); - } - } else if (FileUtil.ORDER_FLAG_RETRIEVE.equals(ctrlStr)) { - } else { - FileDetailVO fileDetailVONew = null; - fileDetailVONew = this.saveFile(multipartFile, fileManagementVO, fileReturnMstNo, path, null); - if (fileDetailVONew != null) { - fileDetailVONew.setFileSn(Integer.toString(fileSn)); - FileDetailVO fileDetailVO = cmmFileDAO.selectFileDetail(fileDetailVONew); - if (fileDetailVO != null) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - fileDetailVONew.setFileSn(Integer.toString(fileSn)); - this.alternateFileDetail(fileDetailVONew); - } else { - fileReturnMstNo = fileDetailVONew.getAtchFileId(); - fileDetailVONew.setFileSn(Integer.toString(fileSn)); - this.createNewFileDetail(fileDetailVONew); - } - } - } - return fileReturnMstNo; - } - private boolean deleteFile(String filePath, String fileNm) { - File file; - try { - file = new File(filePath, fileNm); - if (file.exists()) { - file.delete(); - } - } catch(NullPointerException ex) { - LOGGER.error("Error in deleteFile()" , ex); - return false; - } catch(SecurityException ex) { - LOGGER.error("Error in deleteFile()" , ex); - return false; - } - - return true; - } - - private FileDetailVO saveFile(MultipartFile multipartFile, FileManagementVO fileManagementVO, String fileMstNo, String path, String title) throws IOException, EgovBizException { - FileMasterVO fileMasterVO = null; - String saveFilename = ""; - @SuppressWarnings("unused") - File file = null; - String filename = multipartFile.getOriginalFilename(); - String filepath = ""; - - if (StringUtils.isEmpty(filename)) { - return null; - } - - String fileExt = filename.substring(filename.lastIndexOf(".") + 1); - - if (fileManagementVO.isSaveToDisk()) { - SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); - String today = formatter.format(new java.util.Date()); - saveFilename = today + UUID.randomUUID().toString() +"."+ fileExt; - filepath = path; - LOGGER.debug("["+ fileManagementVO.getFdFile() +"]: "+ multipartFile.getName() - +", "+ filename - +", "+ saveFilename - ); - - multipartFile.transferTo(new File(path, saveFilename)); - } - - if (fileMstNo == null) { - fileMasterVO = this.createNewFileMaster(fileManagementVO); - fileMstNo = fileMasterVO.getAtchFileId(); - } else { - BigDecimal cnt = cmmFileDAO.selectFileMasterCount(fileMstNo); - if (cnt.equals(BigDecimal.valueOf(0))) { - fileMasterVO = this.createNewFileMaster(fileManagementVO); - fileMstNo = fileMasterVO.getAtchFileId(); - } - } - - FileDetailVO fileDetailVO = new FileDetailVO(); - fileDetailVO.setAtchFileId(fileMstNo); - fileDetailVO.setOrignlFileNm(filename); - fileDetailVO.setFileStreCours(filepath); - fileDetailVO.setStreFileNm(saveFilename); - fileDetailVO.setFileExtsn(fileExt); - fileDetailVO.setFileSize(BigDecimal.valueOf(multipartFile.getSize())); - - if (fileManagementVO.isSaveToDisk() == false) { - fileDetailVO.setFileData(multipartFile.getBytes()); - } - - return fileDetailVO; - } - - public boolean deleteAllFileDetailAndMaster(String fileMstNo) throws IOException, EgovBizException { - - if (fileMstNo == null) { - return false; - } - List fileDetailVOList = cmmFileDAO.selectFileDetailList(fileMstNo); - for (FileDetailVO fileDetailVO : fileDetailVOList) { - this.deleteFile(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - this.deleteFileDetail(fileDetailVO); - } - this.deleteFileMaster(fileMstNo); - - return true; - } - - private void deleteFileMaster(String fileMstNo) throws IOException, EgovBizException { - cmmFileDAO.deleteFileMaster(fileMstNo); - } - - private void deleteFileDetail(FileDetailVO fileDetailVO) throws IOException, EgovBizException { - cmmFileDAO.deleteFileDetail(fileDetailVO); - } - - private void alternateFileDetail(FileDetailVO fileDetailVO) throws IOException, EgovBizException { - cmmFileDAO.alternateFileDetail(fileDetailVO); - } - - private void createNewFileDetail(FileDetailVO fileDetailVO) throws IOException, EgovBizException { - cmmFileDAO.insertFileDetail(fileDetailVO); - } - - private FileMasterVO createNewFileMaster(FileManagementVO fileManagementVO) throws IOException, EgovBizException { - FileMasterVO fileMasterVO = new FileMasterVO(); -// try { -// fileMasterVO.setAtchFileId(idgenService.getNextStringId()); -// } catch (FdlException e) { -// LOGGER.error("fail in createNewFileMaster() getNextStringId()", e); -// } - cmmFileDAO.insertFileMaster(fileMasterVO); - return fileMasterVO; - } - - public List selectFileDetailList(String atchFileId) throws IOException, EgovBizException { - if (atchFileId == null) { - return null; - } - return cmmFileDAO.selectFileDetailList(atchFileId); - } - public FileDetailVO selectFileDetail(FileDetailVO fileDetailVOParam) throws IOException, EgovBizException { - return cmmFileDAO.selectFileDetail(fileDetailVOParam); - } - public BigDecimal selectFileDetailCount(String fileMstNo) throws IOException, EgovBizException { - return cmmFileDAO.selectFileDetailCount(fileMstNo); - } - public FileDetailVO selectFileDetailFirst(String atchFileId) throws IOException, EgovBizException { - if (atchFileId == null) { - return null; - } - return cmmFileDAO.selectFileDetailFirst(atchFileId); - } - public List selectIconFileDownLoad(String atchFileId) throws IOException, EgovBizException { - return cmmFileDAO.selectIconFileDownLoad(atchFileId); - } -} diff --git a/src/main/java/cmm/service/impl/CmmMenuManageServiceImpl.java b/src/main/java/cmm/service/impl/CmmMenuManageServiceImpl.java deleted file mode 100644 index e219d422..00000000 --- a/src/main/java/cmm/service/impl/CmmMenuManageServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package cmm.service.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; - -import cmm.service.CmmMenuManageService; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -@Service("cmmMenuManageService") -public class CmmMenuManageServiceImpl extends EgovAbstractServiceImpl implements CmmMenuManageService{ - - @Resource(name="cmmDAO") - private CmmDAO cmmDAO; - - @Override - @Cacheable(value="menu", key="{#authorCode}") - public List selectMenuHead(String authorCode) throws EgovBizException{ - return cmmDAO.selectMenuHead(authorCode); - } - @Override - @Cacheable(value="menu", key="{#authorCode}") - public List selectMenuLeft(String authorCode) throws EgovBizException{ - return cmmDAO.selectMenuLeft(authorCode); - } -} \ No newline at end of file diff --git a/src/main/java/cmm/service/impl/CmmPmsMapContentsDAO.java b/src/main/java/cmm/service/impl/CmmPmsMapContentsDAO.java deleted file mode 100644 index 1a40be26..00000000 --- a/src/main/java/cmm/service/impl/CmmPmsMapContentsDAO.java +++ /dev/null @@ -1,59 +0,0 @@ -package cmm.service.impl; - -import java.util.List; - -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Repository; - -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmCouncilInfoVO; -import cmm.service.CmmPmsMapContentsVO; -import egovframework.com.cmm.service.impl.EgovComAbstractDAO; - -/** - * 맵 콘텐츠에 대한 데이터 접근 클래스를 정의한다 - * @Class Name : CmmPmsMapContentsDAO.java - * @author ecplaza - * @since 2018-06-26 - * @version 1.0 - * @see - * - *
- * << 개정이력(Modification Information) >>
- * @
- * @ 수정일		수정자		수정내용
- * @ ---------	---------	-------------------------------
- * @ 2018-06-26	ecplaza		최초생성
- * 
- * 
- */ -@Repository("cmmPmsMapContentsDAO") -public class CmmPmsMapContentsDAO extends EgovComAbstractDAO { - @SuppressWarnings("unchecked") - public String selectCouncilNm(String councilCd) throws DataAccessException{ - //return (String)getSqlMapClientTemplate().queryForObject("cmmPmsMapContentsDAO.selectCouncilNm", councilCd); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectCmmPmsMapCntnsStoryCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmPmsMapContentsDAO.selectCmmPmsMapCntnsStoryCnt", cmmPmsMapContentsVO); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectCmmPmsMapLocalCultureCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("cmmPmsMapContentsDAO.selectCmmPmsMapLocalCultureCnt", cmmPmsMapContentsVO); - return 0; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectCmmPmsMapAoiCouncilInfoList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws DataAccessException{ - return (List)list("cmmPmsMapContentsDAO.selectCmmPmsMapAoiCouncilInfoList", cmmPmsMapContentsVO); - } - @SuppressWarnings("unchecked") - public List selectCmmPmsMapContentsList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws DataAccessException{ - return (List)list("cmmPmsMapContentsDAO.selectCmmPmsMapContentsList", cmmPmsMapContentsVO); - } - @SuppressWarnings("unchecked") - public List selectCmmPmsMapContentsSearchList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws DataAccessException{ - return (List)list("cmmPmsMapContentsDAO.selectCmmPmsMapContentsSearchList", cmmPmsMapContentsVO); - } -} \ No newline at end of file diff --git a/src/main/java/cmm/service/impl/CmmPmsMapContentsServiceImpl.java b/src/main/java/cmm/service/impl/CmmPmsMapContentsServiceImpl.java deleted file mode 100644 index 53630769..00000000 --- a/src/main/java/cmm/service/impl/CmmPmsMapContentsServiceImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -package cmm.service.impl; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmCouncilInfoVO; -import cmm.service.CmmPmsMapContentsService; -import cmm.service.CmmPmsMapContentsVO; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - - -/** - * 맵 콘텐츠에 대한 서비스 클래스를 구현한다 - * @Class Name : CmmPmsMapContentsServiceImpl.java - * @author ecplaza - * @since 2018-06-26 - * @version 1.0 - */ -@Service("cmmPmsMapContentsService") -public class CmmPmsMapContentsServiceImpl extends EgovAbstractServiceImpl implements CmmPmsMapContentsService { - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmPmsMapContentsServiceImpl.class); - - /** cmmPmsMapContentsDAO */ - @Resource(name="cmmPmsMapContentsDAO") - private CmmPmsMapContentsDAO cmmPmsMapContentsDAO; - - @Override - public int selectCmmPmsMapCntnsStoryCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException { - return cmmPmsMapContentsDAO.selectCmmPmsMapCntnsStoryCnt(cmmPmsMapContentsVO); - } - - @Override - public int selectCmmPmsMapLocalCultureCnt(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException { - return cmmPmsMapContentsDAO.selectCmmPmsMapLocalCultureCnt(cmmPmsMapContentsVO); - } - - @Override - public List selectCmmPmsMapAoiCouncilInfoList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException{ - return (List)cmmPmsMapContentsDAO.selectCmmPmsMapAoiCouncilInfoList(cmmPmsMapContentsVO); - } - @Override - public List selectCmmPmsMapContentsList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException{ - List cmmPmsMapContentsList = (List)cmmPmsMapContentsDAO.selectCmmPmsMapContentsList(cmmPmsMapContentsVO); - - /* - * 쿼리에서 문화원명 구하도록 수정되어 주석처리 (2020.02.06) - * - // COUNTIL_CD 값이 '||' 로 연결되어 있는 경우 각각의 문화원명 구하기 (2020.02.05) - DataMap councilData = new DataMap(); // 문화원코드-문화원명 맵 (불필요한 DB 호출을 방지하기 위하여 사용) - for (int i=0; cmmPmsMapContentsList != null && i 0) { - boolean isNumberDiff = true; - String[] cdArr = councilCd.split("\\|\\|"); // 문화원 코드 배열 - if (StringUtils.isNotEmpty(councilNm)) { - String[] nmArr = councilNm.split(","); // 문화원명 배열 - if (cdArr.length == nmArr.length) { // 문화원 코드 개수와 문화원명 개수가 동일한 경우 (쿼리에서 문화원명 구한 경우) - isNumberDiff = false; - } - } - if (isNumberDiff) { - councilNm = ""; - for (int j=0; cdArr!=null && j 0) councilNm += ","; - councilNm += councilData.getString(currCouncilCd); - } - } - LOGGER.info("selectCmmPmsMapContentsList() i={}, cdArr={}, councilNm={}",i, cdArr==null ? cdArr : Arrays.toString(cdArr), councilNm); - vo.setCouncilNm(councilNm); - } - } - */ - - return cmmPmsMapContentsList; - } - - @Override - public List selectCmmPmsMapContentsSearchList(CmmPmsMapContentsVO cmmPmsMapContentsVO) throws EgovBizException{ - List cmmPmsMapContentsList = (List)cmmPmsMapContentsDAO.selectCmmPmsMapContentsSearchList(cmmPmsMapContentsVO); - return cmmPmsMapContentsList; - } -} diff --git a/src/main/java/cmm/service/impl/CmmServiceImpl.java b/src/main/java/cmm/service/impl/CmmServiceImpl.java deleted file mode 100644 index 1fcf5034..00000000 --- a/src/main/java/cmm/service/impl/CmmServiceImpl.java +++ /dev/null @@ -1,559 +0,0 @@ -package cmm.service.impl; - - -import java.util.List; -import java.util.StringTokenizer; - -import javax.annotation.Resource; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.TransactionException; - -import cmm.Constant; -import cmm.service.CmmService; -import cmm.util.CmmUtil; -import cmm.util.CmmVO; -import cmm.util.DataMap; -import cmm.util.DateUtil; -import egovframework.com.cmm.service.impl.CmmUseDAO; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.cmmn.exception.FdlException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import egovframework.rte.fdl.property.EgovPropertyService; - -/** - * 공통 서비스 클래스를 구현한다. - * @Class Name : CmmServiceImpl.java - * @author ecplaza - * @since 2018-04-18 - * @version 1.0 - */ -@Service("cmmService") -public class CmmServiceImpl extends EgovAbstractServiceImpl implements CmmService { - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmServiceImpl.class); - - /** EgovPropertyService */ - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - - /** cmmDAO */ - @Resource(name="cmmDAO") - private CmmDAO cmmDAO; - - /** cmmUseDAO */ - @Resource(name="cmmUseDAO") - private CmmUseDAO cmmUseDAO; - -// /** egovSchedulerHstIdGnrService */ -// @Resource(name = "egovSchedulerHstIdGnrService") -// private EgovIdGnrService schedulerHstIdGnrService; - - @Override - public List selectCmmActivityHstAllListTotCnt(DataMap paramMap) throws EgovBizException{ - return (List)cmmDAO.selectCmmActivityHstAllListTotCnt(paramMap); - } - @Override - public int selectSatisfactionTotCnt(DataMap paramMap) throws EgovBizException{ - return (Integer)cmmDAO.selectSatisfactionTotCnt(paramMap); - } - @Override - public int selectCmmPscHstTotCnt(DataMap paramMap) throws EgovBizException{ - return (Integer)cmmDAO.selectCmmPscHstTotCnt(paramMap); - } - @Override - public DataMap selectCmmPscHstDetail(DataMap paramMap) throws EgovBizException{ - return cmmDAO.selectCmmPscHstDetail(paramMap); - } - @Override - public DataMap selectCmmPmsPostRandom(DataMap paramMap) throws EgovBizException{ - if(StringUtils.isBlank(paramMap.getString("today"))){ - paramMap.setString("today", DateUtil.getNowString(DateUtil.DATE_DB_FORMAT)); - } - return cmmDAO.selectCmmPmsPostRandom(paramMap); - } - /** - * 에셋 상세정보 - * pick 레이어 사용(좌측 상단) - */ - @Override - public DataMap selectCmmAmsAssetsDetail(DataMap paramMap) throws EgovBizException { - return cmmDAO.selectCmmAmsAssetsDetail(paramMap); - } - - /** - * 에셋 미디어 그룹 목록 - * pick 레이어 사용(좌측 목록) - */ - @Override - public List selectCmmAmsAssetsMediaGroupListCnt(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsMediaGroupListCnt(paramMap); - } - /** - * 에셋 미디어 그룹 목록 - * pick 레이어 사용(좌측 목록) - */ - @Override - public List selectCmmAmsAssetsMediaGroupList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsMediaGroupList(paramMap); - } - @Override - public List selectCmmAmsAssetsMediaList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsMediaList(paramMap); - } - /** - * 에셋 미디어 상세정보 - * pick 레이어 사용(완문보기 상세정보) - */ - @Override - public DataMap selectCmmAmsAssetsMediaDetail(DataMap paramMap) throws EgovBizException{ - return cmmDAO.selectCmmAmsAssetsMediaDetail(paramMap); - } - /** - * 에셋 미디어 상세정보 (미디어의 INTERFACE_ID 값으로 조회) - * pick 레이어 사용(완문보기 상세정보) - */ - @Override - public DataMap selectCmmAmsAssetsMediaDetailByInterfaceId(DataMap paramMap) throws EgovBizException{ - return cmmDAO.selectCmmAmsAssetsMediaDetailByInterfaceId(paramMap); - } - /** - * 에셋 미디어 OCR 목록 - * pick 레이어 사용(문서 완문보기) - */ - @Override - public List selectCmmAmsAssetsMediaOcrList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsMediaOcrList(paramMap); - } - /** - * 에셋 상세 연관태그 목록 - * pick 레이어 사용(상세 정보의 연관태그) - */ - @Override - public List selectCmmAmsAssetsTagsList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsTagsList(paramMap); - } - /** - * 에셋 상세 연속자료 목록 총 수 - * pick 레이어 사용(상세 정보의 연속자료 목록 총 수) - */ - @Override - public int selectCmmAmsAssetsContinueListTotCnt(CmmVO param) throws EgovBizException{ - return (Integer)cmmDAO.selectCmmAmsAssetsContinueListTotCnt(param); - } - /** - * 에셋 상세 연속자료 목록 - * pick 레이어 사용(상세 정보의 연속자료 목록) - */ - @Override - public List selectCmmAmsAssetsContinueList(CmmVO param) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsContinueList(param); - } - /** - * 에셋 상세 연관 지역문화이야기 목록 - * pick 레이어 사용(지역문화이야기 목록) - */ - @Override - public List selectCmmAmsAssetsThemesContentsList(List paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsThemesContentsList(paramMap); - } - /** - * 에셋 상세 다른문화원 소장자료 목록 - * pick 레이어 사용(다른문화원 소장자료 목록) - */ - public List selectCmmAmsAssetsDiffSojangList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsDiffSojangList(paramMap); - } - @Override - public List selectCmmAmsAssetsOriginViewList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsOriginViewList(paramMap); - } - - @Override - public int selectCmmAmsAssetsOriginViewListAjaxCnt(DataMap paramMap) throws EgovBizException{ - return (Integer)cmmDAO.selectCmmAmsAssetsOriginViewListAjaxCnt(paramMap); - } - @Override - public List selectCmmAmsAssetsOriginViewListAjax(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsOriginViewListAjax(paramMap); - } - - @Override - public DataMap selectCmmAmsAssetsOriginViewDetail(DataMap paramMap) throws EgovBizException { - return cmmDAO.selectCmmAmsAssetsOriginViewDetail(paramMap); - } - @Override - public int selectCmmScrapCnt(DataMap paramMap) throws EgovBizException { - return (Integer)cmmDAO.selectCmmScrapCnt(paramMap); - } - @Override - public void insertSatisfaction(DataMap paramMap) throws EgovBizException { - cmmDAO.insertSatisfaction(paramMap); - } - @Override - public void insertCmmSchedulerHst(DataMap paramMap) throws FdlException, EgovBizException { - //paramMap.setString("schedulerHstId", schedulerHstIdGnrService.getNextStringId()); - cmmDAO.insertCmmSchedulerHst(paramMap); - } - @Override - public void insertCmmPscHst(DataMap paramMap) throws EgovBizException{ - cmmDAO.insertCmmPscHst(paramMap); - } - @Override - public void updateCmmPscHst(DataMap paramMap) throws EgovBizException{ - cmmDAO.updateCmmPscHst(paramMap); - } - @Override - public void insertCmmScrap(DataMap paramMap) throws EgovBizException{ - if(Constant.CONTENT_TYPE_A.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeA(paramMap); - }else if(Constant.CONTENT_TYPE_B.equals(paramMap.getString("contentType"))){ - paramMap.setString("bbsId", Constant.BBS_ID_CUL); - cmmDAO.insertCmmScrapTypeB(paramMap); - }else if(Constant.CONTENT_TYPE_C.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeC(paramMap); - }else if(Constant.CONTENT_TYPE_G.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeG(paramMap); - }else if(Constant.CONTENT_TYPE_I.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeI(paramMap); - }else if(Constant.CONTENT_TYPE_P.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeP(paramMap); - }else if(Constant.CONTENT_TYPE_T.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmScrapTypeT(paramMap); - } - } - @Override - public void insertCmmActivityHst(DataMap paramMap) throws EgovBizException { - - // 사용구분(W:웹,M:모바일웹,A앱,I:API,R:RIS) - String uaType = paramMap.getString("uaType"); - if (StringUtils.isEmpty(uaType)) { - paramMap.setString("uaType", Constant.UA_TYPE_W); - } - - if(Constant.CONTENT_TYPE_A.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeA(paramMap); - }else if(Constant.CONTENT_TYPE_B.equals(paramMap.getString("contentType"))){ - paramMap.setString("bbsId", Constant.BBS_ID_CUL); - cmmDAO.insertCmmActivityHstTypeB(paramMap); - }else if(Constant.CONTENT_TYPE_C.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeC(paramMap); - }else if(Constant.CONTENT_TYPE_G.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeG(paramMap); - }else if(Constant.CONTENT_TYPE_I.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeI(paramMap); - }else if(Constant.CONTENT_TYPE_P.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeP(paramMap); - }else if(Constant.CONTENT_TYPE_T.equals(paramMap.getString("contentType"))){ - cmmDAO.insertCmmActivityHstTypeT(paramMap); - } - } - @Override - public void updateCmmActivityHst(DataMap paramMap) throws EgovBizException { - if(paramMap.get("ids") != null){ - String [] ids = null; - String [] contentTypes = null; - if(paramMap.get("ids") instanceof String[]){ - ids = (String[]) paramMap.get("ids"); - contentTypes = paramMap.getString("contentTypes").split(","); - }else{ - ids = new String[1]; - ids[0] = paramMap.getString("ids"); - contentTypes = new String[1]; - contentTypes[0] = paramMap.getString("contentTypes"); - } - for(String temp : ids){ - paramMap.setString("contentId", temp); - cmmDAO.updateCmmActivityHst(paramMap); - paramMap.remove("contentId"); - } - } - } - @Override - public void deleteCmmScrapInfo(DataMap paramMap) throws EgovBizException{ - if(paramMap.get("ids") != null){ - String [] ids = null; - String [] contentTypes = null; - if(paramMap.get("ids") instanceof String[]){ - ids = (String[]) paramMap.get("ids"); - contentTypes = paramMap.getString("contentTypes").split(","); - }else{ - ids = new String[1]; - ids[0] = paramMap.getString("ids"); - contentTypes = new String[1]; - contentTypes[0] = paramMap.getString("contentTypes"); - } - for(String temp : ids){ - paramMap.setString("id", temp); - cmmDAO.deleteCmmScrapInfo(paramMap); - paramMap.remove("id"); - } - }else{ - cmmDAO.deleteCmmScrapInfo(paramMap); - } - } - - /** - * 모바일 디바이스 정보 목록 - */ - @Override - public List selecCmmMobileDeviceInfoList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selecCmmMobileDeviceInfoList(paramMap); - } - - @Override - public void insertCmmActivityMediaHst(DataMap paramMap) throws EgovBizException { - cmmDAO.insertCmmActivityMediaHst(paramMap); - } - - @Override - public List selectCmmAmsAssetsTagKeyList(DataMap paramMap) throws EgovBizException { - return (List)cmmDAO.selectCmmAmsAssetsTagKeyList(paramMap); - } - @Override - public DataMap selectCmmAmsAssetsMediaDetail2(DataMap paramMap) throws EgovBizException{ - return cmmDAO.selectCmmAmsAssetsMediaDetail2(paramMap); - } - - @Override - public int selectCmmWebzineCnfirm(DataMap paramMap) throws EgovBizException{ - return (Integer)cmmDAO.selectCmmWebzineCnfirm(paramMap); - } - - @Override - public void insertCmmWebzineSubScribe(DataMap paramMap) throws EgovBizException{ - cmmDAO.insertCmmWebzineSubScribe(paramMap); - } - - @Override - public void insertCmmMainData(String gubun) throws EgovBizException, FdlException{ - String toDay = DateUtil.getNowString(DateUtil.DATE_DB_FORMAT); - String tomorrow = DateUtil.getAddDayFormat(1,DateUtil.DATE_DB_FORMAT); - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = false; - String msg = ""; - int dataCnt = 0; - - try { - DataMap paramMap= new DataMap(); - - if(gubun.equals("G")){ // 이달의 지역문화정보 - paramMap.put("gubun", "G"); //구분 (C:이야기, A:지역문화PICK, G:지역문화정보, P:포스트) - - List extGiaList = cmmDAO.selectMainExtGiaList(paramMap); - if(extGiaList.size()> 0){ - cmmDAO.deleteCmmMainExtGiaData(paramMap); - for(DataMap extGia : extGiaList){ - extGia.put("gubun", "G"); - cmmDAO.insertCmmMainData(extGia); - dataCnt++; - } - isSuccess = true; - }else{ - msg = "[데이터 조회오류]조회된 데이터 size:0"; - } - } - - } catch (TransactionException ex1) { - LOGGER.error("fail in insertCmmMainData()", ex1); - msg = dataLimit(ex1.toString()); - } catch (Exception ex2) { - LOGGER.error("fail in insertCmmMainData()", ex2); - msg = dataLimit(ex2.toString()); - } finally{ - schedulerHstMap.setString("schedulerMethodNm", "setMainInfo"); - - String schedulerNm = ""; - if(gubun.equals("A")){ - schedulerNm = Constant.SCHEDULER_MAIN_A_INFO; - }else if (gubun.equals("C")){ - schedulerNm = Constant.SCHEDULER_MAIN_C_INFO; - }else if (gubun.equals("G")){ - schedulerNm = Constant.SCHEDULER_MAIN_G_INFO; - }else{ - schedulerNm = Constant.SCHEDULER_MAIN_P_INFO; - } - schedulerHstMap.setString("schedulerNm", schedulerNm); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - } - - //schedulerHstMap.setString("schedulerHstId", schedulerHstIdGnrService.getNextStringId()); - cmmDAO.insertCmmSchedulerHst(schedulerHstMap); - } - - @Override - public DataMap insertCmmExtGiaMainInfo(String contentType) throws FdlException { - - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = false; - String msg = ""; - int dataCnt = 0; - - try { - DataMap paramMap= new DataMap(); - - if(contentType.equals("G")){ // 이달의 지역문화정보 - paramMap.put("gubun", "G"); //구분 (C:이야기, A:지역문화PICK, G:지역문화정보, P:포스트) - - List extGiaList = cmmDAO.selectMainExtGiaList(paramMap); - if(extGiaList.size()> 0){ - cmmDAO.deleteCmmMainExtGiaData(paramMap); - for(DataMap extGia : extGiaList){ - extGia.put("gubun", "G"); - cmmDAO.insertCmmMainData(extGia); - dataCnt++; - } - isSuccess = true; - }else{ - msg = "[데이터 조회오류]조회된 데이터 size:0"; - } - } - - } catch (TransactionException ex1) { - LOGGER.error("fail in insertCmmMainData()", ex1); - msg = dataLimit(ex1.toString()); - } catch (Exception ex2) { - LOGGER.error("fail in insertCmmMainData()", ex2); - msg = dataLimit(ex2.toString()); - } finally{ - schedulerHstMap.setString("schedulerMethodNm", "setMainInfo"); - - String schedulerNm = ""; - if(contentType.equals("A")){ - schedulerNm = Constant.SCHEDULER_MAIN_A_INFO; - }else if (contentType.equals("C")){ - schedulerNm = Constant.SCHEDULER_MAIN_C_INFO; - }else if (contentType.equals("G")){ - schedulerNm = Constant.SCHEDULER_MAIN_G_INFO; - }else{ - schedulerNm = Constant.SCHEDULER_MAIN_P_INFO; - } - schedulerHstMap.setString("schedulerNm", schedulerNm); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - } - - //schedulerHstMap.setString("schedulerHstId", schedulerHstIdGnrService.getNextStringId()); - cmmDAO.insertCmmSchedulerHst(schedulerHstMap); - return schedulerHstMap; - } - - @Override - public DataMap selectCmmPscHst(String jsessionId) throws EgovBizException { - DataMap paramMap = new DataMap(); - paramMap.setString("jsessionId", jsessionId); - paramMap.setInt("sortOrdr", 1); - DataMap pscHstMap1 = cmmDAO.selectCmmPscHstDetail(paramMap); - - paramMap.setInt("sortOrdr", 2); - DataMap pscHstMap2 = cmmDAO.selectCmmPscHstDetail(paramMap); - - paramMap.setInt("sortOrdr", 3); - DataMap pscHstMap3 = cmmDAO.selectCmmPscHstDetail(paramMap); - - String pscHstAddr = propertiesService.getString("kccf.default.pscHst"); - String[] addrArr = pscHstAddr.split("\\^"); - String addr = ""; - String sidoName = ""; - String sigunguName = ""; - - if(pscHstMap1 == null){ - if(!StringUtils.isBlank(addrArr[0])){ - addr = addrArr[0].replaceAll("\\|", " "); - StringTokenizer st = new StringTokenizer(addr," "); - if(st.hasMoreElements()){ - if(st.hasMoreTokens()){ - sidoName = st.nextToken(); - } - if(st.hasMoreTokens()){ - sigunguName = st.nextToken(); - } - } - } - pscHstMap1 = new DataMap(); - pscHstMap1.setString("sidoName", sidoName); - pscHstMap1.setString("sigunguName", sigunguName); - } - - if(pscHstMap2 == null){ - if(!StringUtils.isBlank(addrArr[1])){ - addr = addrArr[1].replaceAll("\\|", " "); - StringTokenizer st = new StringTokenizer(addr," "); - if(st.hasMoreElements()){ - if(st.hasMoreTokens()){ - sidoName = st.nextToken(); - } - if(st.hasMoreTokens()){ - sigunguName = st.nextToken(); - } - } - } - pscHstMap2 = new DataMap(); - pscHstMap2.setString("sidoName", sidoName); - pscHstMap2.setString("sigunguName", sigunguName); - } - - if(pscHstMap3 == null){ - if(!StringUtils.isBlank(addrArr[2])){ - addr = addrArr[2].replaceAll("\\|", " "); - StringTokenizer st = new StringTokenizer(addr," "); - if(st.hasMoreElements()){ - if(st.hasMoreTokens()){ - sidoName = st.nextToken(); - } - if(st.hasMoreTokens()){ - sigunguName = st.nextToken(); - } - } - } - pscHstMap3 = new DataMap(); - pscHstMap3.setString("sidoName", sidoName); - pscHstMap3.setString("sigunguName", sigunguName); - } - - DataMap pscHstMap = new DataMap(); //관심지역 표시에 사용 - pscHstMap.put("pscHst1", pscHstMap1); - pscHstMap.put("pscHst2", pscHstMap2); - pscHstMap.put("pscHst3", pscHstMap3); - - return pscHstMap; - } - - private String dataLimit(String data){ - String rtnStr = ""; - if(CmmUtil.checkMaxbyte(data , 1000)){ - rtnStr = data.substring(0 , 1000); - }else{ - rtnStr = data; - } - return rtnStr; - } - - public DataMap getMainLogo() throws EgovBizException{ - return cmmDAO.getMainLogo(); - } - -} \ No newline at end of file diff --git a/src/main/java/cmm/service/impl/ExtDAO.java b/src/main/java/cmm/service/impl/ExtDAO.java deleted file mode 100644 index b57ca69e..00000000 --- a/src/main/java/cmm/service/impl/ExtDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -package cmm.service.impl; - -import java.util.List; - -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.TransactionException; - -import cmm.util.DataMap; -import egovframework.com.cmm.service.impl.EgovComAbstractDAO; - -/** - * 외부 API 데이터 관리에 대한 데이터 접근 클래스를 정의한다. - * @Class Name : ExtDAO.java - * @author ecplaza - * @since 2018-04-16 - * @version 1.0 - */ -@Repository("extDAO") -public class ExtDAO extends EgovComAbstractDAO { - - @SuppressWarnings("unchecked") - public List selectExtSigunguList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtSigunguList", paramMap); - } - @SuppressWarnings("unchecked") - public List selectExtSigunguList2(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtSigunguList2", paramMap); - } - @SuppressWarnings("unchecked") - public List selectExtGisSigunguList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtGisSigunguList", paramMap); - } - @SuppressWarnings("unchecked") - public List selectExtGisDongList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtGisDongList", paramMap); - } - @SuppressWarnings("unchecked") - public List selectExtSidoMapMappingList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtSidoMapMappingList", paramMap); - } - @SuppressWarnings("unchecked") - public List selectExtDfInfoList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectExtDfInfoList", paramMap); - } - public DataMap selectExtGiaDetail(DataMap paramMap) throws DataAccessException{ - //return (DataMap)select("extDAO.selectExtGiaDetail", paramMap); - return null; // DDDDDDDDDDDdddd 임시 처리 (2021.08.13) - } - public void insertExtDfInfo(DataMap paramMap) throws TransactionException{ - insert("extDAO.insertExtDfInfo", paramMap); - } - public void deleteExtDfInfo() throws TransactionException{ - delete("extDAO.deleteExtDfInfo"); - } - public void insertExtFdInfo(DataMap paramMap) throws TransactionException{ - insert("extDAO.insertExtFdInfo", paramMap); - } - public void deleteExtFdInfo(DataMap paramMap) throws TransactionException{ - delete("extDAO.deleteExtFdInfo",paramMap); - } - public void insertExtGiaInfo(DataMap paramMap) throws TransactionException{ - insert("extDAO.insertExtGiaInfo", paramMap); - } - public void deleteExtGiaInfo(DataMap paramMap) throws TransactionException{ - delete("extDAO.deleteExtGiaInfo",paramMap); - } - - @SuppressWarnings("unchecked") - public List selectActivityMediaList(DataMap paramMap) throws DataAccessException{ - return (List)list("extDAO.selectActivityMediaList", paramMap); - } - public void deleteMediaHstInfo(DataMap paramMap) throws TransactionException{ - delete("extDAO.deleteMediaHstInfo",paramMap); - } - public void insertMediaHstInfo(DataMap paramMap) throws TransactionException{ - insert("extDAO.insertMediaHstInfo", paramMap); - } -} diff --git a/src/main/java/cmm/service/impl/ExtServiceImpl.java b/src/main/java/cmm/service/impl/ExtServiceImpl.java deleted file mode 100644 index d3f618ce..00000000 --- a/src/main/java/cmm/service/impl/ExtServiceImpl.java +++ /dev/null @@ -1,1210 +0,0 @@ -package cmm.service.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import javax.annotation.Resource; - -import org.apache.commons.lang.math.NumberUtils; -import org.apache.commons.lang3.StringUtils; -import org.json.JSONArray; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.TransactionException; -import org.springframework.transaction.annotation.Transactional; - -import cmm.Constant; -import cmm.service.CmmApiService; -import cmm.service.CmmService; -import cmm.service.ExtService; -import cmm.util.CmmCodeUtil; -import cmm.util.CmmCodeVO; -import cmm.util.CmmUtil; -import cmm.util.DataMap; -import cmm.util.DateUtil; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import egovframework.rte.fdl.property.EgovPropertyService; - - -/** - * 외부 API를 통한 데이터 관리 서비스 클래스를 구현한다. - * @Class Name : EtServiceImpl.java - * @author ecplaza - * @since 2018-04-18 - * @version 1.0 - */ -@Service("extService") -public class ExtServiceImpl extends EgovAbstractServiceImpl implements ExtService { - - /** LOGGER */ - private static final Logger LOGGER = LoggerFactory.getLogger(ExtServiceImpl.class); - - /** EgovPropertyService */ - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - - /** cmmApiService */ - @Resource(name = "cmmApiService") - private CmmApiService cmmApiService; - - @Resource(name = "cmmService") - private CmmService cmmService; - - /** extDAO */ - @Resource(name="extDAO") - private ExtDAO extDAO; -// -// /** egovDfInfoIdGnrService */ -// @Resource(name = "egovDfInfoIdGnrService") -// private EgovIdGnrService dfInfoIdGnrService; - -// /** egovFdInfoIdGnrService */ -// @Resource(name = "egovFdInfoIdGnrService") -// private EgovIdGnrService fdInfoIdGnrService; - -// /** egovGiaInfoIdGnrService */ -// @Resource(name = "egovGiaInfoIdGnrService") -// private EgovIdGnrService giaInfoIdGnrService; - - /** 관광정보 api 카테고리 **/ - private List giaCat1List = null; - private List giaCat2List = null; - private List giaCat3List = null; - - - @Override - public List selectExtSigunguList(DataMap paramMap) throws EgovBizException{ - return extDAO.selectExtSigunguList(paramMap); - } - @Override - public List selectExtSigunguList2(DataMap paramMap) throws EgovBizException{ - return extDAO.selectExtSigunguList2(paramMap); - } - @Override - public List selectExtGisSigunguList(DataMap paramMap) throws EgovBizException{ - return extDAO.selectExtGisSigunguList(paramMap); - } - @Override - public List selectExtGisDongList(DataMap paramMap) throws EgovBizException{ - return extDAO.selectExtGisDongList(paramMap); - } - @Override - public List selectExtSidoMapMappingList(DataMap paramMap) throws EgovBizException{ - if(!"".equals(paramMap.getString("sido")) && "".equals(paramMap.getString("sido2"))){ - paramMap.setString("sido2", paramMap.getString("sido")); - } - if( paramMap.getString("sido").indexOf("세종") != -1 - || paramMap.getString("sido1").indexOf("세종") != -1 - || paramMap.getString("sido2").indexOf("세종") != -1 ){ - paramMap.setString("sigungu", "세종특별자치시"); - } - return extDAO.selectExtSidoMapMappingList(paramMap); - } - @Override - public List selectExtDfInfoList(DataMap paramMap) throws EgovBizException{ - paramMap.setString("dfDt", DateUtil.getNowString(DateUtil.DATE_DB_FORMAT)); - if(paramMap.getString("sido").indexOf("세종") != -1){ - paramMap.setString("sigungu", "세종특별자치시"); - } - return extDAO.selectExtDfInfoList(paramMap); - } - @Override - @SuppressWarnings("unchecked") - public List selectExtAisInfoList(String sido, String sigungu) throws EgovBizException{ - List rtnList = null; - if(sido.indexOf("세종") != -1){ - sigungu = "세종시"; - } - String dataTime = DateUtil.getNowString(DateUtil.DATEHOUR_FORMAT2)+ ":00"; - DataMap rsMap = cmmApiService.getCtprvnMesureSidoList(sido,dataTime); - if("00".equals(rsMap.getString("resultCode"))){ - List resultList = (List) rsMap.get("resultList"); - if(resultList != null && resultList.size()>0){ - rtnList = new ArrayList(); - for(DataMap map : resultList){ - if(sigungu.equals(map.getString("sigungu"))){ - rtnList.add(map); - break; - } - } - if(rtnList == null || resultList.size() == 0){ - rtnList.add(resultList.get(0)); - } - } - } - return rtnList; - } - @Override - @SuppressWarnings("unchecked") - public List selectExtFtdInfoList(DataMap paramMap) throws EgovBizException{ - String nx="",ny=""; - boolean isNext = false; - if(paramMap.getString("sido").indexOf("세종") != -1){ - paramMap.setString("sigungu", "세종특별자치시"); - } - List xyList = this.selectExtSidoMapMappingList(paramMap); - if(xyList !=null && xyList.size()>0){ - DataMap sidoMap = xyList.get(0); - nx = sidoMap.getString("mapNx"); - ny = sidoMap.getString("mapNy"); - - isNext = true; - }else{ - paramMap.remove("dong"); - xyList = this.selectExtSidoMapMappingList(paramMap); - if(xyList !=null && xyList.size()>0){ - DataMap sidoMap = xyList.get(0); - nx = sidoMap.getString("mapNx"); - ny = sidoMap.getString("mapNy"); - - isNext = true; - } - } - List resultList = null; - if(isNext){ - int h = 0; - if(NumberUtils.toInt(DateUtil.currentDateHh()) < 45){ - h = -1; - } - String baseDate = DateUtil.getAddHourFormat(h,DateUtil.DATE_DB_FORMAT); - String baseTime = DateUtil.getAddHourFormat(h,DateUtil.TIMEHOUR_FORMAT3) +"00"; - DataMap resultMap = cmmApiService.getForecastTimeDataList(baseDate,baseTime,nx,ny); - if("0000".equals(resultMap.getString("resultCode"))){ - resultList = (List) resultMap.get("resultList"); - } - } - return resultList; - } - @Override - public List selectCulRelatedNews(DataMap paramMap) throws EgovBizException{ - - paramMap.put("provider", new String [] {"경향신문","국민일보","내일신문","문화일보","서울신문","세계일보","한겨레","한국일보","경기일보","경인일보","강원도민일보","대전일보","중도일보","중부매일","충북일보","충청일보","충청투데이","경남신문","경남도민일보","경상일보","국제신문","대구일보","매일신문","부산일보","영남일보","울산매일","광주일보","무등일보","전남일보","전북도민일보","전북일보","제민일보","한라일보","매일경제","서울경제","파이낸셜뉴스","한국경제","헤럴드경제","MBC","SBS","YTN","OBS","전자신문","디지털타임스"}); - paramMap.put("category", new String[] {"문화>영화","문화>요리_여행","문화>학술_문화재","문화>전시_공연","문화>출판","문화>미술_건축","문화>음악","문화>종교"}); - paramMap.put("fields", new String [] {"hilight","byline","category","category_incident","images"}); - /*paramMap.setString("hilight", "2000"); - paramMap.setString("return_from", "0"); - paramMap.setString("return_size", "15");*/ - paramMap.put("sort", new String [] {"date", "desc"}); - - List newsList = cmmApiService.getToolsApiNews(paramMap); - if(newsList != null){ - StringTokenizer stTokenizer = null; - for(int i=0; i 0){ - List resultList = (List) rsMap.get("resultList"); - if(resultList != null && resultList.size()>0){ - rtnMap.put("giaCommon",resultList.get(0)); - } - } - // 상세 소개정보 - rsMap = cmmApiService.getGiaDetailIntro(paramMap); - if(rsMap.getInt("totalCount") > 0){ - List resultList = (List) rsMap.get("resultList"); - if(resultList != null && resultList.size()>0){ - rtnMap.put("giaIntro",resultList.get(0)); - } - } - // 상세 반복 및 코스 정보 or 룸 이미지 - rsMap = cmmApiService.getGiaDetailInfo(paramMap); - rtnMap.put("giaInfoList",(List) rsMap.get("resultList")); - - // 상세 추가이미지 - rsMap = cmmApiService.getGiaDetailImage(paramMap); - rtnMap.put("giaImageList",(List) rsMap.get("resultList")); - - // 상세 메뉴이미지 - paramMap.setString("imageYN", "N"); - rsMap = cmmApiService.getGiaDetailImage(paramMap); - rtnMap.put("giaMenuImageList",(List) rsMap.get("resultList")); - - return rtnMap; - } - @Override - @Transactional - public DataMap insertExtDfInfo() { - - String toDay = DateUtil.getNowString(DateUtil.DATE_DB_FORMAT); - String tomorrow = DateUtil.getAddDayFormat(1,DateUtil.DATE_DB_FORMAT); - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = false; - String msg = ""; - int dataCnt = 0; - - try { - DataMap paramMap = new DataMap(); - List list = new ArrayList(); - boolean isParseErr = false; - for(int idx=0; idx 0){ - extDAO.deleteExtDfInfo(); - for(DataMap map : list){ - //map.setString("dfInfoId", dfInfoIdGnrService.getNextStringId()); - extDAO.insertExtDfInfo(map); - map.remove("dfInfoId"); - dataCnt++; - } - isSuccess = true; - }else{ - msg = "[데이터 가공오류]가공된 데이터 size:0"; - } - } - } catch (TransactionException ex1) { - LOGGER.error("fail in insertExtDfInfo()", ex1); - msg = dataLimit(ex1.toString()); - } catch (Exception ex2) { - LOGGER.error("fail in insertExtDfInfo()", ex2); - msg = dataLimit(ex2.toString()); - } finally{ - schedulerHstMap.setString("schedulerMethodNm", "setExtDfInfo"); - schedulerHstMap.setString("schedulerNm", Constant.SCHEDULER_EXT_DF_INFO); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - - try { - cmmService.insertCmmSchedulerHst(schedulerHstMap); - } catch (EgovBizException ex1) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex1); - } catch (Exception ex2) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex2); - } - - } - - return schedulerHstMap; - } - @Override - @Transactional - public DataMap insertExtFdInfo() { - - String fromDate = DateUtil.getNowString(DateUtil.DATE_DB_FORMAT); - String toDate = DateUtil.getAddDayFormat(30,DateUtil.DATE_DB_FORMAT); - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = true; - String msg = ""; - int dataCnt = 0; - - try { - DataMap paramMap = new DataMap(); - paramMap.setString("viewType", Constant.VIEW_TYPE_L); // 화면 타입(포탈에서만 사용하는 변수) - paramMap.setString("reqUrl", propertiesService.getString("cultureinfoApi.fd.period.url")); - paramMap.setString("serviceKey", propertiesService.getString("cultureinfoApi.serviceKey")); - paramMap.setString("cPage", "1"); - paramMap.setString("rows", "2000"); - paramMap.setString("from", fromDate); - paramMap.setString("to", toDate); - - JSONObject jsonObj = cmmApiService.getCultureinfoApiList(paramMap); - JSONObject jsonResponse = jsonObj.getJSONObject("response"); - JSONObject jsonComMsgHeader = jsonResponse.getJSONObject("comMsgHeader"); - - JSONObject jsonObjMsgBody = null; - List resultList = null; - if("Y".equals(jsonComMsgHeader.get("SuccessYN").toString())){ - if(jsonResponse.has("msgBody")){ - jsonObjMsgBody = jsonResponse.getJSONObject("msgBody"); - if(jsonObjMsgBody.has("perforList")){ - JSONArray jsonArray = null; - if(jsonObjMsgBody.get("perforList") instanceof JSONObject){ - jsonArray = new JSONArray(); - jsonArray.put(jsonObjMsgBody.getJSONObject("perforList")); - }else{ - jsonArray = jsonObjMsgBody.getJSONArray("perforList"); - } - resultList = CmmUtil.getListMapFromJsonArray(jsonArray); - }else{ - msg = "[데이터 가공오류][목록정보]perforList 미존재"; - isSuccess = false; - } - }else{ - msg = "[데이터 가공오류][목록정보]msgBody 미존재"; - isSuccess = false; - } - }else{ - msg = jsonComMsgHeader.get("ErrMsg").toString(); - isSuccess = false; - } - if(isSuccess && resultList != null && resultList.size()>0){ - DataMap pMap = null; - DataMap nMap = null; - DataMap jusoMap = null; - DataMap dMap = null; - - paramMap.setString("toDay", fromDate); - extDAO.deleteExtFdInfo(paramMap); - for(DataMap map :resultList){ - pMap = new DataMap(); - pMap.setString("seq",map.getString("seq")); - pMap.setString("viewType", Constant.VIEW_TYPE_D); // 화면 타입(포탈에서만 사용하는 변수) - pMap.setString("reqUrl", propertiesService.getString("cultureinfoApi.fd.period.url")); - pMap.setString("serviceKey", propertiesService.getString("cultureinfoApi.serviceKey")); - - jsonObj =cmmApiService.getCultureinfoApiList(pMap); - jsonResponse = jsonObj.getJSONObject("response"); - jsonComMsgHeader = jsonResponse.getJSONObject("comMsgHeader"); - if("Y".equals(jsonComMsgHeader.get("SuccessYN").toString())){ - if(jsonResponse.has("msgBody")){ - jsonObjMsgBody = jsonResponse.getJSONObject("msgBody"); - if(jsonObjMsgBody.has("perforInfo")){ - dMap = CmmUtil.getMapFromJsonObject(jsonObjMsgBody.getJSONObject("perforInfo")); - }else{ - msg = "[데이터 가공오류][상세정보]perforInfo 미존재"; - isSuccess = false; - break; - } - }else{ - msg = "[데이터 가공오류][상세정보]msgBody 미존재"; - isSuccess = false; - break; - } - }else{ - msg = jsonComMsgHeader.get("ErrMsg").toString(); - isSuccess = false; - break; - } - nMap = new DataMap(); - nMap.setString("xy", map.getString("gpsX") +","+ map.getString("gpsY")); - jusoMap = cmmApiService.getNaverApiReversegeocode(nMap); - - dMap.setString("seq", map.getString("seq")); - dMap.setString("gpsX", map.getString("gpsX")); - dMap.setString("gpsY", map.getString("gpsY")); - - dMap.setString("sido", jusoMap.getString("sido")); - dMap.setString("sigugun", jusoMap.getString("sigugun")); - dMap.setString("dong", jusoMap.getString("dongmyun")); - dMap.setString("rest", jusoMap.getString("rest")); - - //이미지 경로 및 파일에 공백이 들어있을경우 json파싱 후 문제생겨서 치환 - dMap.setString("imgUrl" , dMap.getString("imgUrl").replaceAll(" ","%20")); - - //dMap.setString("fdInfoId", fdInfoIdGnrService.getNextStringId()); - extDAO.insertExtFdInfo(dMap); - dataCnt++; - } - }else{ - msg = "[데이터 가공오류]가공된 데이터 size:0"; - isSuccess = false; - } - } catch (TransactionException ex1) { - LOGGER.error("fail in insertExtFdInfo()", ex1); - msg = dataLimit(ex1.toString()); - isSuccess = false; - } catch (Exception ex2) { - LOGGER.error("fail in insertExtFdInfo()", ex2); - msg = dataLimit(ex2.toString()); - isSuccess = false; - }finally{ - schedulerHstMap.setString("schedulerMethodNm", "setExtFdInfo"); - schedulerHstMap.setString("schedulerNm", Constant.SCHEDULER_EXT_FD_INFO); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - } - return schedulerHstMap; - } - @Override - @SuppressWarnings("unchecked") - public DataMap insertExtGiaInfo(String contentTypeId) { - - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = true, isUse = false, isRun = false; - String msg = ""; - int dataCnt = 0; - - DataMap paramMap = new DataMap(); - int len = Constant.GIA_COTENT_TYPE_ID_ARRAY.length; - for(int i=0;i resultList = (List) rtnMap.get("resultList"); - if(resultList != null && resultList.size()>0){ - dataCnt = resultList.size(); - extDAO.deleteExtGiaInfo(paramMap); // 해당하는 것만 삭제 - // 삭제 후 저장 - for(DataMap map :resultList){ - map.setString("contenttypename", Constant.GIA_COTENT_TYPE_NAME_ARRAY[i]); - if(!StringUtils.isBlank(map.getString("mapx")) && !StringUtils.isBlank(map.getString("mapy"))){ - paramMap.setString("xy", map.getString("mapx").trim()+ "," +map.getString("mapy").trim()); - DataMap nMap = cmmApiService.getNaverApiReversegeocode(paramMap); - if(nMap.getInt("total") > 0){ - // 좌표로 주소변환 - map.setString("sidoname", nMap.getString("sido")); - map.setString("sigunguname", nMap.getString("sigugun")); - if(!StringUtils.isBlank(nMap.getString("sido"))){ - if(nMap.getString("sido").indexOf("세종") > -1){ - map.setString("sigunguname", "세종특별자치시"); - } - } - paramMap.remove("xy"); - // 좌표 및 카운트는 정상으로 가져오지만 주소를 못가져오는 경우 - // 주소로 재확인 후 시도, 시군구만 맵핑 - if(StringUtils.isBlank(nMap.getString("sido"))){ - if(!StringUtils.isBlank(map.getString("addr1"))){ - nMap = null; - paramMap.setString("juso", map.getString("addr1").trim()); - nMap = cmmApiService.getNaverApiJuso(paramMap); - if(nMap.getInt("total") > 0){ - map.setString("sidoname", nMap.getString("sido")); - map.setString("sigunguname", nMap.getString("sigugun")); - if(!StringUtils.isBlank(nMap.getString("sido"))){ - if(nMap.getString("sido").indexOf("세종") > -1){ - map.setString("sigunguname", "세종특별자치시"); - } - } - } - paramMap.remove("juso"); - } - } - }else{ - // 주소 변환이 안됐을 경우 : 좌표가 네이버 맵에 찍지 못하는 좌표일 가능성이 크다. - // 시도, 시군구 변환 등록 및 좌표를 찍기 위해 재정의 - if(!StringUtils.isBlank(map.getString("addr1"))){ - nMap = null; - paramMap.setString("juso", map.getString("addr1").trim()); - nMap = cmmApiService.getNaverApiJuso(paramMap); - if(nMap.getInt("total") > 0){ - map.setString("mapx", nMap.getString("point_x")); - map.setString("mapy", nMap.getString("point_y")); - map.setString("sidoname", nMap.getString("sido")); - map.setString("sigunguname", nMap.getString("sigugun")); - if(!StringUtils.isBlank(nMap.getString("sido"))){ - if(nMap.getString("sido").indexOf("세종") > -1){ - map.setString("sigunguname", "세종특별자치시"); - } - } - } - paramMap.remove("juso"); - } - } - }else{ - // api에 좌표가 없는경우 : 주소로 시도, 시군구 변환 및 좌표 획득 - if(!StringUtils.isBlank(map.getString("addr1"))){ - paramMap.setString("juso", map.getString("addr1").trim()); - DataMap nMap = cmmApiService.getNaverApiJuso(paramMap); - if(nMap.getInt("total") > 0){ - map.setString("mapx", nMap.getString("point_x")); - map.setString("mapy", nMap.getString("point_y")); - map.setString("sidoname", nMap.getString("sido")); - map.setString("sigunguname", nMap.getString("sigugun")); - if(!StringUtils.isBlank(nMap.getString("sido"))){ - if(nMap.getString("sido").indexOf("세종") > -1){ - map.setString("sigunguname", "세종특별자치시"); - } - } - } - paramMap.remove("juso"); - } - } - - map.setString("cat1nm", this.getGiaCat1Name(map.getString("cat1"))); // 카테고리1 명 - map.setString("cat2nm", this.getGiaCat2Name(map.getString("cat2"))); // 카테고리2 명 - map.setString("cat3nm", this.getGiaCat3Name(map.getString("cat3"))); // 카테고리3 명 - // 지역명(축약) - map.setString("area", CmmUtil.getAisSidoName(map.getString("sidoname"))); - - // 이미지 URL https로 저장 - map.setString("firstimage", CmmUtil.changeSchemeToHttps(map.getString("firstimage"))); - map.setString("firstimage2", CmmUtil.changeSchemeToHttps(map.getString("firstimage2"))); - - - //map.setString("giaId", giaInfoIdGnrService.getNextStringId()); // key - - LOGGER.debug("insertExtGiaInfo() before insert... map={}", map); - extDAO.insertExtGiaInfo(map); - } - }else{ - msg = "[데이터 가공오류]가공된 데이터 size:0"; - isSuccess = false; - } - }else{ - msg = rtnMap.getString("resultMsg"); - isSuccess = false; - } - } catch (TransactionException ex1) { - LOGGER.error("fail in insertExtFdInfo() [" +Constant.GIA_COTENT_TYPE_NAME_ARRAY[i]+ "]", ex1); - msg = dataLimit(ex1.toString()); - isSuccess = false; - } catch (Exception ex2) { - LOGGER.error("fail in insertExtFdInfo() [" +Constant.GIA_COTENT_TYPE_NAME_ARRAY[i]+ "]", ex2); - msg = dataLimit(ex2.toString()); - isSuccess = false; - }finally{ - schedulerHstMap.setString("schedulerMethodNm", "setExtGiaInfo"); - schedulerHstMap.setString("schedulerNm", Constant.SCHEDULER_EXT_GIA_INFO + "["+ Constant.GIA_COTENT_TYPE_NAME_ARRAY[i] +"]"); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - - try { - cmmService.insertCmmSchedulerHst(schedulerHstMap); - } catch (EgovBizException ex1) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex1); - break; - } catch (Exception ex2) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex2); - break; - } - dataCnt = 0; - } - paramMap.clear(); // 파람 초기화 - } - if(isUse) break; - } - if(isSuccess){ - if(!isUse){ - schedulerHstMap.setString("schedulerNm", Constant.SCHEDULER_EXT_GIA_INFO); - } - } - - return schedulerHstMap; - } - private String getGiaCat1Name(String cat1){ - if(StringUtils.isBlank(cat1)) return ""; - String nm = ""; - if(giaCat1List == null){ - CmmCodeVO vo = null; - giaCat1List = new ArrayList(); - vo = new CmmCodeVO(); - vo.setCode("A01");vo.setCodeNm("자연");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02");vo.setCodeNm("인문(문화/예술/역사)");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01");vo.setCodeNm("추천코스");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03");vo.setCodeNm("레포츠");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02");vo.setCodeNm("숙박");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04");vo.setCodeNm("쇼핑");giaCat1List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05");vo.setCodeNm("음식");giaCat1List.add(vo); - } - for(CmmCodeVO vo :giaCat1List){ - if(vo.getCode().equals(cat1.trim())){ - nm = vo.getCodeNm(); - break; - } - } - return nm; - } - private String getGiaCat2Name(String cat2){ - if(StringUtils.isBlank(cat2)) return ""; - String nm = ""; - if(giaCat2List == null){ - CmmCodeVO vo = null; - giaCat2List = new ArrayList(); - vo = new CmmCodeVO(); - vo.setCode("A0101");vo.setCodeNm("자연관광지");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0102");vo.setCodeNm("관광자원");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0201");vo.setCodeNm("역사관광지");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0202");vo.setCodeNm("휴양관광지");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0203");vo.setCodeNm("체험관광지");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0204");vo.setCodeNm("산업관광지");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0205");vo.setCodeNm("건축/조형물");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0206");vo.setCodeNm("문화시설");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0207");vo.setCodeNm("축제");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0208");vo.setCodeNm("공연/행사");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0112");vo.setCodeNm("가족코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0113");vo.setCodeNm("나홀로코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0114");vo.setCodeNm("힐링코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0115");vo.setCodeNm("도보코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0116");vo.setCodeNm("캠핑코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C0117");vo.setCodeNm("맛코스");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0301");vo.setCodeNm("레포츠소개");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0302");vo.setCodeNm("육상 레포츠");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0303");vo.setCodeNm("수상 레포츠");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0304");vo.setCodeNm("항공 레포츠");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0305");vo.setCodeNm("복합 레포츠");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B0201");vo.setCodeNm("숙박시설");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0401");vo.setCodeNm("쇼핑");giaCat2List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0502");vo.setCodeNm("음식점");giaCat2List.add(vo); - } - for(CmmCodeVO vo :giaCat2List){ - if(vo.getCode().equals(cat2.trim())){ - nm = vo.getCodeNm(); - break; - } - } - return nm; - } - private String getGiaCat3Name(String cat3){ - if(StringUtils.isBlank(cat3)) return ""; - String nm = ""; - if(giaCat3List == null){ - CmmCodeVO vo = null; - giaCat3List = new ArrayList(); - vo = new CmmCodeVO(); - vo.setCode("A01010100");vo.setCodeNm("국립공원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010200");vo.setCodeNm("도립공원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010300");vo.setCodeNm("군립공원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010400");vo.setCodeNm("산");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010500");vo.setCodeNm("자연생태관광지");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010600");vo.setCodeNm("자연휴양림");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010700");vo.setCodeNm("수목원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010800");vo.setCodeNm("폭포");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01010900");vo.setCodeNm("계곡");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011000");vo.setCodeNm("약수터");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011100");vo.setCodeNm("해안절경");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011200");vo.setCodeNm("해수욕장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011300");vo.setCodeNm("섬");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011400");vo.setCodeNm("항구/포구");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011500");vo.setCodeNm("어촌");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011600");vo.setCodeNm("등대");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011700");vo.setCodeNm("호수");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011800");vo.setCodeNm("강");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01011900");vo.setCodeNm("동굴");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01020100");vo.setCodeNm("희귀동.식물");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A01020200");vo.setCodeNm("기암괴석");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010100");vo.setCodeNm("고궁");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010200");vo.setCodeNm("성");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010300");vo.setCodeNm("문");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010400");vo.setCodeNm("고택");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010500");vo.setCodeNm("생가");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010600");vo.setCodeNm("민속마을");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010700");vo.setCodeNm("유적지/사적지");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010800");vo.setCodeNm("사찰");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02010900");vo.setCodeNm("종교성지");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02011000");vo.setCodeNm("안보관광");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020100");vo.setCodeNm("유원지");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020200");vo.setCodeNm("관광단지");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020300");vo.setCodeNm("온천/욕장/스파");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020400");vo.setCodeNm("이색찜질방");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020500");vo.setCodeNm("헬스투어");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020600");vo.setCodeNm("테마공원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020700");vo.setCodeNm("공원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02020800");vo.setCodeNm("유람선/잠수함관광");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030100");vo.setCodeNm("농.산.어촌 체험");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030200");vo.setCodeNm("전통체험");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030300");vo.setCodeNm("산사체험");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030400");vo.setCodeNm("이색체험");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030500");vo.setCodeNm("관광농원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02030600");vo.setCodeNm("이색거리");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A0204010");vo.setCodeNm("제철소");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040200");vo.setCodeNm("조선소");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040300");vo.setCodeNm("공단");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040400");vo.setCodeNm("발전소");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040500");vo.setCodeNm("광산");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040600");vo.setCodeNm("식음료");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040700");vo.setCodeNm("화학/금속");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040800");vo.setCodeNm("기타");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02040900");vo.setCodeNm("전자/반도체");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02041000");vo.setCodeNm("자동차");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050100");vo.setCodeNm("다리/대교");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050200");vo.setCodeNm("기념탑/기념비/전망대");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050300");vo.setCodeNm("분수");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050400");vo.setCodeNm("동상");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050500");vo.setCodeNm("터널");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02050600");vo.setCodeNm("유명건물");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060100");vo.setCodeNm("박물관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060200");vo.setCodeNm("기념관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060300");vo.setCodeNm("전시관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060400");vo.setCodeNm("컨벤션센터");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060500");vo.setCodeNm("미술관/화랑");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060600");vo.setCodeNm("공연장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060700");vo.setCodeNm("문화원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060800");vo.setCodeNm("외국문화원");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02060900");vo.setCodeNm("도서관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02061000");vo.setCodeNm("대형서점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02061100");vo.setCodeNm("문화전수시설");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02061200");vo.setCodeNm("영화관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02061300");vo.setCodeNm("어학당");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02061400");vo.setCodeNm("학교");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02070100");vo.setCodeNm("문화관광축제");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02070200");vo.setCodeNm("일반축제");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080100");vo.setCodeNm("전통공연");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080200");vo.setCodeNm("연극");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080300");vo.setCodeNm("뮤지컬");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080400");vo.setCodeNm("오페라");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080500");vo.setCodeNm("전시회");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080600");vo.setCodeNm("박람회");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080700");vo.setCodeNm("컨벤션");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080800");vo.setCodeNm("무용");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02080900");vo.setCodeNm("클래식음악회");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02081000");vo.setCodeNm("대중콘서트");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02081100");vo.setCodeNm("영화");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02081200");vo.setCodeNm("스포츠경기");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A02081300");vo.setCodeNm("기타행사");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01120001");vo.setCodeNm("가족코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01130001");vo.setCodeNm("나홀로코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01140001");vo.setCodeNm("힐링코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01150001");vo.setCodeNm("도보코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01160001");vo.setCodeNm("캠핑코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("C01170001");vo.setCodeNm("맛코스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03010100");vo.setCodeNm("육상레포츠");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03010200");vo.setCodeNm("수상레포츠");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03010300");vo.setCodeNm("항공레포츠");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020100");vo.setCodeNm("스포츠센터");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020200");vo.setCodeNm("수련시설");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020300");vo.setCodeNm("경기장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020400");vo.setCodeNm("인라인(실내 인라인 포함)");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020500");vo.setCodeNm("자전거하이킹");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020600");vo.setCodeNm("카트");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020700");vo.setCodeNm("골프");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020800");vo.setCodeNm("경마");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03020900");vo.setCodeNm("경륜");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021000");vo.setCodeNm("카지노");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021100");vo.setCodeNm("승마");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021200");vo.setCodeNm("스키/스노보드");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021300");vo.setCodeNm("스케이트");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021400");vo.setCodeNm("썰매장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021500");vo.setCodeNm("수렵장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021600");vo.setCodeNm("사격장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021700");vo.setCodeNm("야영장,오토캠핑장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021800");vo.setCodeNm("암벽등반");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03021900");vo.setCodeNm("빙벽등반");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022000");vo.setCodeNm("서바이벌게임");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022100");vo.setCodeNm("ATV");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022200");vo.setCodeNm("MTB");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022300");vo.setCodeNm("오프로드");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022400");vo.setCodeNm("번지점프");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022500");vo.setCodeNm("자동차경주");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022600");vo.setCodeNm("스키(보드) 렌탈샵");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03022700");vo.setCodeNm("트래킹");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030100");vo.setCodeNm("윈드서핑/제트스키");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030200");vo.setCodeNm("카약/카누");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030300");vo.setCodeNm("요트");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030400");vo.setCodeNm("스노쿨링/스킨스쿠버다이빙");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030500");vo.setCodeNm("민물낚시");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030600");vo.setCodeNm("바다낚시");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030700");vo.setCodeNm("수영");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03030800");vo.setCodeNm("래프팅");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03040100");vo.setCodeNm("스카이다이빙");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03040200");vo.setCodeNm("초경량비행");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03040300");vo.setCodeNm("헹글라이딩/패러글라이딩");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03040400");vo.setCodeNm("열기구");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A03050100");vo.setCodeNm("복합 레포츠");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010100");vo.setCodeNm("관광호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010200");vo.setCodeNm("수상관광호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010300");vo.setCodeNm("전통호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010400");vo.setCodeNm("가족호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010500");vo.setCodeNm("콘도미니엄");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010600");vo.setCodeNm("유스호스텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010700");vo.setCodeNm("펜션");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010800");vo.setCodeNm("여관");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02010900");vo.setCodeNm("모텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011000");vo.setCodeNm("민박");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011100");vo.setCodeNm("게스트하우스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011200");vo.setCodeNm("홈스테이");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011300");vo.setCodeNm("서비스드레지던스");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011400");vo.setCodeNm("의료관광호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011500");vo.setCodeNm("소형호텔");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("B02011600");vo.setCodeNm("한옥스테이");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010100");vo.setCodeNm("5일장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010200");vo.setCodeNm("상설시장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010300");vo.setCodeNm("백화점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010400");vo.setCodeNm("면세점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010500");vo.setCodeNm("할인매장");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010600");vo.setCodeNm("전문상가");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010700");vo.setCodeNm("공예,공방");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010800");vo.setCodeNm("관광기념품점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A04010900");vo.setCodeNm("특산물판매점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020100");vo.setCodeNm("한식");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020200");vo.setCodeNm("서양식");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020300");vo.setCodeNm("일식");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020400");vo.setCodeNm("중식");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020500");vo.setCodeNm("아시아식");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020600");vo.setCodeNm("패밀리레스토랑");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020700");vo.setCodeNm("이색음식점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020800");vo.setCodeNm("채식전문점");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05020900");vo.setCodeNm("바/까페");giaCat3List.add(vo); - vo = new CmmCodeVO(); - vo.setCode("A05021000");vo.setCodeNm("클럽");giaCat3List.add(vo); - } - for(CmmCodeVO vo :giaCat3List){ - if(vo.getCode().equals(cat3.trim())){ - nm = vo.getCodeNm(); - break; - } - } - return nm; - } - - @Override - @Transactional - public DataMap insertMediaHstInfo() { - - String yyyy = DateUtil.getNowString(DateUtil.DATEYEAR_FORMAT); - String startDt = DateUtil.getNowString(DateUtil.DATETIME_FORMAT); - - String month = DateUtil.getNowString(DateUtil.DATEMONTH_ONLY_FORMAT); - - if(month.equals("01")){ - yyyy = DateUtil.getAddYearFormat(-1,DateUtil.DATEYEAR_FORMAT); - } - - DataMap schedulerHstMap = new DataMap(); - boolean isSuccess = false; - String msg = ""; - int dataCnt = 0; - - try { - DataMap paramMap = new DataMap(); - paramMap.put("yyyy", yyyy); - - List resultList = extDAO.selectActivityMediaList(paramMap); - - if(resultList.size()> 0){ - extDAO.deleteMediaHstInfo(paramMap); - for(DataMap map : resultList){ - extDAO.insertMediaHstInfo(map); - dataCnt++; - } - isSuccess = true; - }else{ - msg = "[데이터 가공오류]가공된 데이터 size:0"; - } - } catch (TransactionException ex1) { - LOGGER.error("fail in insertMediaHstInfo()", ex1); - msg = dataLimit(ex1.toString()); - } catch (Exception ex2) { - LOGGER.error("fail in insertMediaHstInfo()", ex2); - msg = dataLimit(ex2.toString()); - } finally{ - schedulerHstMap.setString("schedulerMethodNm", "setMediaHstInfo"); - schedulerHstMap.setString("schedulerNm", Constant.SCHEDULER_MEDIA_HST_INFO); - schedulerHstMap.setString("strTm", startDt); - schedulerHstMap.setString("endTm", DateUtil.getNowString(DateUtil.DATETIME_FORMAT)); - if(isSuccess){ - schedulerHstMap.setString("rstMsg", "등록성공"); - }else{ - schedulerHstMap.setString("rstMsg", "등록실패"); - schedulerHstMap.setString("etcCn", msg); - } - schedulerHstMap.setInt("dataCnt", dataCnt); - - try { - cmmService.insertCmmSchedulerHst(schedulerHstMap); - } catch (EgovBizException ex1) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex1); - } catch (Exception ex2) { - LOGGER.error("fail in insertCmmSchedulerHst()", ex2); - } - - } - - return schedulerHstMap; - } - private String dataLimit(String data){ - String rtnStr = ""; - if(CmmUtil.checkMaxbyte(data , 1000)){ - rtnStr = data.substring(0 , 1000); - }else{ - rtnStr = data; - } - return rtnStr; - } - -} diff --git a/src/main/java/cmm/taglibs/FunctionTag.java b/src/main/java/cmm/taglibs/FunctionTag.java deleted file mode 100644 index 4b94f985..00000000 --- a/src/main/java/cmm/taglibs/FunctionTag.java +++ /dev/null @@ -1,381 +0,0 @@ -package cmm.taglibs; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.math.NumberUtils; - -import cmm.Constant; -import cmm.util.CmmUtil; -import cmm.util.DataMap; -import cmm.util.DateUtil; - -//import com.unidocs.cipher.PDFInfoEncrypter; // DDDDDDDDDDDdddd 아직 관련 LIB 받지 못함 (2021.08.13) - - -public class FunctionTag { - - - static final String DELIMITER = "-"; - public static String toBr(String value) { - String str = ""; - if( org.apache.commons.lang3.StringUtils.isBlank(value) ){ - return str; - } - str = value; - if (str.indexOf("\\r") >= 0) str = str.replaceAll("\\\\r", "\r"); - if (str.indexOf("\\n") >= 0) str = str.replaceAll("\\\\n", "\n"); - if (str.indexOf("\r\n") >= 0 || str.indexOf("\n") >= 0 || str.indexOf("\r") >= 0) { - str = str.replaceAll("\\r\\n", "
"); - str = str.replaceAll("\\r", "
"); - str = str.replaceAll("\\n", "
"); - } - return str; - } - - public static String removeTag(String value) { - String str = ""; - if( org.apache.commons.lang3.StringUtils.isBlank(value) ){ - return str; - }else{ - str = value.replaceAll("<(/)?([a-zA-Z]*)(\\s[a-zA-Z]*=[^>]*)?(\\s)*(/)?>", ""); - } - return str; - } - - public static String dateFormatString(String strDate) throws IOException, InvocationTargetException, SQLException { - String formatDate = ""; - if( StringUtils.isBlank(strDate) ) return formatDate; - - String regExpNumber = "^[0-9]*$"; - strDate = strDate.trim(); - - Pattern p = Pattern.compile(regExpNumber); - Matcher m = p.matcher(strDate); - - if( !m.matches() ) { - return strDate; - } - - int strDateLen = strDate.length(); - if(strDateLen >= 4) { - formatDate = strDate.substring(0, 4); - } - if(strDateLen >= 6) { - formatDate += DELIMITER + strDate.substring(4, 6) ; - } - if(strDateLen >= 8) { - formatDate += DELIMITER + strDate.substring(6) ; - } - - return formatDate; - } - - - public static String[] dateSplitArrayString(String strDate, String type) throws IOException, InvocationTargetException, SQLException { - String formatDate [] = new String[3]; - if( StringUtils.isBlank(strDate) ) return formatDate; - - String regExpNumber = "^[0-9]*$"; - String rDate = strDate.replaceAll("-", "").trim(); - - Pattern p = Pattern.compile(regExpNumber); - Matcher m = p.matcher(rDate); - - if( !m.matches() ) { - for(int i=0;i= 4) { - formatDate[0] = rDate.substring(0, 4); - } - if(strDateLen >= 6) { - if( "M".equals(type) ){ - if(NumberUtils.toInt(rDate.substring(4, 6)) < 10){ - formatDate[1] = rDate.substring(5, 6); - }else{ - formatDate[1] = rDate.substring(4, 6); - } - }else{ - formatDate[1] = rDate.substring(4, 6); - } - } - if(strDateLen >= 8) { - formatDate[2] = rDate.substring(6) ; - } - - return formatDate; - } - - public static String moneyFormatString(String strMoney) throws IOException, InvocationTargetException, SQLException { - String formatMoney = ""; - if( StringUtils.isBlank(strMoney) ) return formatMoney; - if( !NumberUtils.isNumber(strMoney) ) return strMoney; - - DecimalFormat df = new DecimalFormat("#,###"); - formatMoney = df.format(NumberUtils.toLong(strMoney)); - - return formatMoney; - } - public static long getDday(String start, String end) throws ParseException, IOException, InvocationTargetException, SQLException { - - if( StringUtils.isBlank(start) || StringUtils.isBlank(end)){ - return -9999; - } - start = start.replaceAll("-", "").trim(); - end = end.replaceAll("-", "").trim(); - if( !NumberUtils.isNumber(start) || !NumberUtils.isNumber(end)){ - return -9999; - } - if( start.length() < 8 || end.length() < 8 ){ - return -9999; - } - - DateFormat df = new SimpleDateFormat("yyyyMMdd"); - Date s = df.parse(start); - Date e = df.parse(end); - - long diff = e.getTime() - s.getTime(); - return TimeUnit.MILLISECONDS.toDays(diff); - } - - public static boolean isIn(String to) throws ParseException, IOException, InvocationTargetException, SQLException { - if( StringUtils.isBlank(to)){ - return false; - } - to = to.replaceAll("-", "").replaceAll(".", "").trim(); - if( !NumberUtils.isNumber(to) ){ - return false; - } - if( to.length() < 8){ - return false; - } - DateFormat df = new SimpleDateFormat("yyyyMMdd"); - Date end = df.parse(to); - Date now = df.parse(df.format(new Date())); - - /*if(now.getTime() > end.getTime()){ - return false; - }else{ - return true; - }*/ - if(now.getTime() >= end.getTime()){ - return true; - }else{ - return false; - } - } - public static String getMonth(String target) throws IOException, InvocationTargetException, SQLException { - String mm = ""; - if( StringUtils.isBlank(target)){ - // 인자값을 빈값으로 보내면 현재월을 넘긴다. - Calendar cal = Calendar.getInstance(); - mm = String.valueOf(Integer.toString(cal.get(Calendar.MONTH)+1)); - } - mm = target.replaceAll("-", "").trim(); - if( !NumberUtils.isNumber(mm) ){ - return target; - } - if( mm.length() < 2){ - mm = "0"+mm; - } - return mm; - } - public static String getDay(String target) throws IOException, InvocationTargetException, SQLException { - String dd = ""; - if( StringUtils.isBlank(target)){ - // 인자값을 빈값으로 보내면 현재일을 넘긴다. - Calendar cal = Calendar.getInstance(); - dd = String.valueOf(cal.get(Calendar.DAY_OF_MONTH)); - } - dd = target.replaceAll("-", "").trim(); - if( !NumberUtils.isNumber(dd) ){ - return target; - } - if( dd.length() < 2){ - dd = "0"+dd; - } - return dd; - } - - public static boolean isWeekend(String date_yyyymmdd) throws IOException, InvocationTargetException, SQLException { - boolean rtnBoolean = false; - if( !StringUtils.isBlank(date_yyyymmdd) ){ - String date=date_yyyymmdd.replaceAll("-", "").trim(); - if(date.length() >= 8 && NumberUtils.isNumber(date) ){ - int year = Integer.parseInt(date.substring(0,4)); - int month = Integer.parseInt(date.substring(4,6)); - int day = Integer.parseInt(date.substring(6,8)); - Calendar cal = Calendar.getInstance(); - cal.set(year, month-1, day ); - int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); - if( dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY){ - // 주말 - rtnBoolean = true; - } - } - } - return rtnBoolean; - } - public static String getToDay() throws Exception { - return DateUtil.getDateString(new Date(), new SimpleDateFormat("yyyy-MM-dd", Locale.KOREA)); - } - public static String getToDay2() throws Exception { - return DateUtil.getDateString(new Date(), new SimpleDateFormat("yyyyMMdd", Locale.KOREA)); - } - public static String reverseSido(String sido){ - if(sido == null || "".equals(sido)) return ""; - String rtnSido = ""; - for(int i=0; i -1 ){ - rtnSido = Constant.AIS_SIDO_NAME_ARRAY[i]; - break; - } - if(sido.indexOf( Constant.AIS_SIDO_PARAM_NAME_ARRAY[i] ) > -1 ){ - rtnSido = Constant.AIS_SIDO_NAME_ARRAY[i]; - break; - } - } - return rtnSido; - } - public static boolean isAreaOfInterest(String sido, String sigungu , DataMap pscHst){ - boolean rtnBoolean = false; - if(sido == null || "".equals(sido)) return rtnBoolean; - if(sigungu == null || "".equals(sigungu)) return rtnBoolean; - - if(pscHst == null) return rtnBoolean; - - DataMap pscHst1 = (DataMap) pscHst.get("pscHst1"); - DataMap pscHst2 = (DataMap) pscHst.get("pscHst2"); - DataMap pscHst3 = (DataMap) pscHst.get("pscHst3"); - - if(sido.trim().equals(pscHst1.getString("sidoName").trim()) && sigungu.trim().equals(pscHst1.getString("sigunguName").trim())){ - rtnBoolean = true; - } - if(sido.trim().equals(pscHst2.getString("sidoName").trim()) && sigungu.trim().equals(pscHst2.getString("sigunguName").trim())){ - rtnBoolean = true; - } - if(sido.trim().equals(pscHst3.getString("sidoName").trim()) && sigungu.trim().equals(pscHst3.getString("sigunguName").trim())){ - rtnBoolean = true; - } - return rtnBoolean; - } - - - //unidocs Viewer - public static String unidocsViewer(String filePath, String fileNm) throws Exception { - //String path = "/apps/ezpdfwebviewer/WEB-INF/ezPDFWebViewer/releasecontents/sokcho_20180608.pdf"; - //String path = "/nfs/kccf_doc/cfba8b83e460323079b67be17ba6f96d.pdf"; - String path = filePath + fileNm; - String download = "false"; - String print = "false"; - String annotation = "false"; - String[] param = new String[]{ java.net.URLEncoder.encode( path, "UTF-8" ), download, print, annotation}; -// String encData = PDFInfoEncrypter.encrypt( param ); -// return encData; - return null; // DDDDDDDDDDDdddd 아직 관련 LIB 받지 못함 (2021.08.13) - } - - /** - * ASSET 이미지 URL - * jsp 파일에서 다음과 같이 사용하던 linkUrl 로직을 포함함 - * - - - * - * @param filePath - * @return - * @throws Exception - */ - public static String assetImgUrl(String filePath) throws Exception { - String url = ""; - if (StringUtils.isEmpty(filePath)) return url; - - String amsAssetsPath = CmmUtil.getPropertyStr(Constant.AMS_SERVER_KEY) + CmmUtil.getPropertyStr(Constant.AMS_ASSETS_PATH_KEY); - String amsThumbnailPath = CmmUtil.getPropertyStr(Constant.AMS_THUMBNAIL_PATH_KEY); - - if (filePath.startsWith("http")) { // http 포함한 전체 경로일 경우 ex) object storage 이미지 - url = filePath; - - } else if (filePath.indexOf("/") >= 0) { // ex) 2/2/7292_thumbnail.jpg - url = amsAssetsPath + "/" + filePath; - - } else { - url = amsAssetsPath + "/" + amsThumbnailPath + "/" + filePath; // ex) ac6be22ee9db4414aeb4dab6078d27feb723f1c0.jpg - } - - url = url.replaceAll("//", "/"); - url = url.replaceAll(":/", "://"); // ex) https:/ => https:// - - return url; - } - - /** - * 업로드 이미지 URL - * - * @param filePath - * @return - * @throws Exception - */ - public static String uploadImgUrl(String filePath) throws Exception { - String url = ""; - if (StringUtils.isEmpty(filePath)) return url; - - // 로컬 개발 시 개발서버 upload 하위 이미지를 바라보도록 설정, 운영에서는 운영 upload 폴더 바라봄 - String uploadHomePath = CmmUtil.getPropertyStr(Constant.UPLOAD_HOME_KEY); - - if (filePath.startsWith("/upload")) { // ex) /upload/post/20180921142754.png (포스트, 배너 등) - url = uploadHomePath + "/" + filePath; - - } else { - url = filePath; - } - - url = url.replaceAll("//", "/"); - url = url.replaceAll(":/", "://"); // ex) https:/ => https:// - - return url; - } - - /** - * 두개의 문자열을 delimiter로 연결하여 반환 - * - * ex) *, aaa, bbb => aaa*bbb - * *, aaa => aaa - * *, "", bbb => bbb - * *, "", "" => "" - * - * @param delimiter - * @param str1 - * @param str2 - * @return - * @throws Exception - */ - public static String joinWithDelimiter(String delimiter, String str1, String str2) throws Exception { - String result = ""; - - if (StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2)) return result; - result = str1; - if (StringUtils.isNotEmpty(str1) && StringUtils.isNotEmpty(str2)) result += delimiter; - result += str2; - - return result; - } - -} diff --git a/src/main/java/cmm/util/CmmCodeUtil.java b/src/main/java/cmm/util/CmmCodeUtil.java deleted file mode 100644 index 26b38696..00000000 --- a/src/main/java/cmm/util/CmmCodeUtil.java +++ /dev/null @@ -1,70 +0,0 @@ -package cmm.util; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import cmm.Constant; - -/** - * - * fix된 코드에 관한것만 사용하는 클래스 - */ -public class CmmCodeUtil { - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmCodeUtil.class); - - public static List getAreaCodeList() { - List rtnList = new ArrayList(); - Arrays.sort(Constant.AREA_CODE_ARRAY); // 지역번호 정렬 - CmmCodeVO vo = null; - for(String v : Constant.AREA_CODE_ARRAY){ - vo = new CmmCodeVO(); - vo.setCode(v); - vo.setCodeNm(v); - vo.setCodeDc(v); - rtnList.add(vo); - } - return rtnList; - } - public static List getMobileCodeList() { - List rtnList = new ArrayList(); - Arrays.sort(Constant.MOBILE_CODE_ARRAY); // 번호 정렬 - CmmCodeVO vo = null; - for(String v : Constant.MOBILE_CODE_ARRAY){ - vo = new CmmCodeVO(); - vo.setCode(v); - vo.setCodeNm(v); - vo.setCodeDc(v); - rtnList.add(vo); - } - return rtnList; - } - public static List getSidoCodeList() { - List rtnList = new ArrayList(); - CmmCodeVO vo = null; - for(int i=0;i getSidoCodeList2() { - List rtnList = new ArrayList(); - CmmCodeVO vo = null; - for(int i=0;i listRole = (List) EgovUserDetailsHelper.getAuthorities(); - for (String role : listRole) { - if (Constant.AUTH_ROLE_KDM.equals(role)) { - return true; - } - } - return false; - } - public static boolean isRoleSysKdm() { - List listRole = (List) EgovUserDetailsHelper.getAuthorities(); - for (String role : listRole) { - if (Constant.AUTH_ROLE_SYM.equals(role)) { - return true; - } - } - return false; - } - - public static String clearXSS(String value) { - if (value == null || value.trim().equals("")) { - return ""; - } - String returnValue = value; - returnValue = returnValue.replaceAll("&", "&"); - returnValue = returnValue.replaceAll("<", "<"); - returnValue = returnValue.replaceAll(">", ">"); - returnValue = returnValue.replaceAll("'", "'"); - returnValue = returnValue.replaceAll("eval\\((.*)\\)", ""); - returnValue = returnValue.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\""); - returnValue = returnValue.replaceAll("\"", """); - returnValue = returnValue.replaceAll("\\(", "(").replaceAll("\\)", ")"); - returnValue = returnValue.replaceAll("script", ""); - returnValue = returnValue.replaceAll("alert", ""); - return returnValue; - } - - public static String escapeNewlineToBr(String text) { - String str = text; - if (StringUtils.isEmpty(str)) return str; - - if (str.indexOf("\\r") >= 0) str = str.replaceAll("\\\\r", "\r"); - if (str.indexOf("\\n") >= 0) str = str.replaceAll("\\\\n", "\n"); - if (str.indexOf("\r\n") >= 0 || str.indexOf("\n") >= 0 || str.indexOf("\r") >= 0) { - str = str.replaceAll("\\r\\n", "
"); - str = str.replaceAll("\\r", "
"); - str = str.replaceAll("\\n", "
"); - } - return str; - } - public static String escapeNewlineToSpace(String text) { - String str = text; - if (StringUtils.isEmpty(str)) return str; - if (str.indexOf("\\r") >= 0) str = str.replaceAll("\\\\r", "\r"); - if (str.indexOf("\\n") >= 0) str = str.replaceAll("\\\\n", "\n"); - if (str.indexOf("\r\n") >= 0 || str.indexOf("\n") >= 0 || str.indexOf("\r") >= 0) { - str = str.replaceAll("\\r\\n", ""); - str = str.replaceAll("\\r", ""); - str = str.replaceAll("\\n", ""); - } - str = str.replaceAll("\"", ""); - str = str.replaceAll("'", ""); - return str; - } - public static String cut(String text, int size) { - return cut(text, size, ""); - } - public static String cut(String text, int size, String suffix) { - if (text == null) { - return ""; - } - if (text.length() < size) { - return text; - } - size = size - suffix.length(); - return StringUtils.substring(text, 0, size) + suffix; - } - public static boolean isConsecutive(String str, int n) { - int sumOfDifferences = 0; - int lastTemp = 0; - Boolean consecutive = false; - for (int i = 0; i < str.length() - 1; i++) { - int temp = str.charAt(i) - str.charAt(i + 1); - if (temp != lastTemp) { - sumOfDifferences = 0; - } - if (temp == 1 || temp == -1) { - sumOfDifferences += temp; - } else { - sumOfDifferences = 0; - } - if (sumOfDifferences == n - 1 || sumOfDifferences == ((n - 1) * -1)) { - consecutive = true; - break; - } - lastTemp = temp; - } - return consecutive; - } - public static boolean regexFind(String str, String regex) { - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(str); - return matcher.find(); - } - public static String generateRandomString(String allowed, int length) { - Random random = new Random(); - StringBuilder sb = new StringBuilder(length); - for (int i = 0; i < length; i++) { - sb.append(allowed.charAt(random.nextInt(allowed.length()))); - } - return sb.toString(); - } - public static String getIpAddress(HttpServletRequest req) { - String ipAddress = ""; - if (req.getHeader("X-Forwarded-For") == null) { - ipAddress = req.getRemoteAddr(); - } else { - ipAddress = req.getHeader("X-Forwarded-For"); - int idx = ipAddress.indexOf(','); - if (idx > -1) { - ipAddress = ipAddress.substring(0, idx); - } - } - return ipAddress; - } - public static String returnUrl(HttpServletRequest req, String parameterName) { - String url = req.getRequestURI(); - if (url.startsWith("/logout") || url.startsWith("/error") || "/".equals(url)) { - return ""; - } - String queryString = req.getQueryString(); - if (queryString != null) { - url += "?" + queryString; - try { - url = URLEncoder.encode(url, Constant.ENCODING_UTF8); - } catch (UnsupportedEncodingException e) { - url = ""; - } - } - return "?" + parameterName + "=" + url; - } - - public static String getUrl(HttpServletRequest req, String domain) { - final String uri = req.getRequestURI(); - final String queryString = req.getQueryString(); - String url = ""; - url = domain + uri; - if (StringUtils.isNotBlank(queryString)) { - url += "?" + queryString; - } - return url; - } - public static int getTridentVersion(String userAgent) { - String lowerUserAgent = userAgent.toLowerCase(); - int start = lowerUserAgent.indexOf("trident/"); - if (start == -1) { - return 0; - } - String trident = lowerUserAgent.substring(start + 8, start + 9); - return NumberUtils.toInt(trident); - } - public static String getPropertyStr(String key) { - String str = ""; - if (org.apache.commons.lang3.StringUtils.isNotBlank(key)) str = propertyService.getString(key); - return str; - } - public static String deleteChar(String str) { - if (StringUtils.isEmpty(str)) return str; - - String regExpNumber = "[^0-9]"; - return str.replaceAll(regExpNumber, ""); - } - @SuppressWarnings("rawtypes") - public static boolean isEmpty(Map map, String key) { - boolean isEmpty = true; - if (map == null) return isEmpty; - - Object obj = map.get(key); - if ( obj != null - && !StringUtils.isEmpty(obj.toString()) - && !(obj+"").equals("null")) { - - isEmpty = false; - } - return isEmpty; - } - public static boolean checkMaxbyte(String chkString, int maxbyte) { - boolean checkResult = true; - if (StringUtils.isBlank(chkString)) return checkResult; - int bytes = 0; - try { - bytes = chkString.getBytes(Constant.ENCODING_UTF8).length; - if (bytes > maxbyte) checkResult = false; - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in checkMaxbyte() maxbyte="+maxbyte+", bytes="+bytes+", chkString="+chkString, e); - checkResult = false; - } catch (Exception e) { - LOGGER.error("fail in checkMaxbyte() maxbyte="+maxbyte+", bytes="+bytes+", chkString="+chkString, e); - checkResult = false; - } - return checkResult; - } - public static String[] getValueArr(List list, String key) { - String[] exidArr = null; - if (list == null || list.size() == 0) return exidArr; - exidArr = new String[list.size()]; - for (int i=0; i max) - return false; - } - else - return false; - } - return true; - } - public static String getRandomNum(int size) { - String strRandom = ""; - Random rand = new Random(); - for (int i = 0; i < size; i++) { - strRandom += String.valueOf(rand.nextInt(10)); - } - return strRandom; - } - public static boolean isMobile(final HttpServletRequest req) { - String ua = StringUtils.defaultString(req.getHeader("User-Agent"), "").toLowerCase(); - if (ua.indexOf(Constant.ANDROID) > -1 || ua.indexOf(Constant.IOS) > -1 || ua.indexOf("mobile") > -1) { - return true; - } - return false; - } - public static String getContextPath(final HttpServletRequest req, final String path) { - //if (isApp(req)) { - return Constant.PREFIX_M + (path.startsWith("/") ? path : "/" + path); - //} - // return path; - } - public static String unscript(String data) { - if (data == null || data.trim().equals("")) { - return ""; - } - - String ret = data; - - ret = ret.replaceAll("<(S|s)(C|c)(R|r)(I|i)(P|p)(T|t)", "<script"); - ret = ret.replaceAll(" getListMapFromJsonArray( JSONArray jsonArray ) { - List list = new ArrayList(); - if( jsonArray != null ){ - int jsonSize = jsonArray.length(); - for( int i = 0; i < jsonSize; i++ ){ - DataMap map = CmmUtil.getMapFromJsonObject( ( JSONObject ) jsonArray.get(i) ); - list.add( map ); - } - } - return list; - } - public static String getAisSidoName(String sido) { - String rtnStr = ""; - for(int i=0;i 0){ - for(Cookie cookie : cookies){ - if(Name.equals(cookie.getName())){ - cookieValue = cookie.getValue(); - break; - } - } - } - return cookieValue; - } - public static String getDecoderCookie(final HttpServletRequest req, String Name){ - String cookieValue = ""; - Cookie[] cookies = req.getCookies(); - if(cookies != null && cookies.length > 0){ - for(Cookie cookie : cookies){ - if(Name.equals(cookie.getName())){ - try { - cookieValue = java.net.URLDecoder.decode(cookie.getValue(),Constant.ENCODING_UTF8); - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in getDecoderCookie()" , e); - } catch (Exception e) { - LOGGER.error("fail in getDecoderCookie()", e); - } - break; - } - } - } - return cookieValue; - } - public static String getCookieIdKey(){ - return propertyService.getString("kccf.cookie.id.key"); - } - - public static String getCookieId(final HttpServletRequest req){ - String cookieId = ""; - String key = getCookieIdKey(); - Cookie[] cookies = req.getCookies(); - if(cookies != null && cookies.length > 0){ - for(Cookie cookie : cookies){ - if(key.equals(cookie.getName())){ - try { - cookieId = java.net.URLDecoder.decode( cookie.getValue(),Constant.ENCODING_UTF8); - } catch (UnsupportedEncodingException e) { - LOGGER.error("fail in getCookieId()" , e); - } catch (Exception e) { - LOGGER.error("fail in getCookieId()", e); - } - break; - } - } - } - return cookieId; - } - public static String getNewCookieId(final HttpServletRequest req){ - String key = getCookieIdKey(); - String value = ""; - try { - value = java.net.URLEncoder.encode( encryptPassword(getPassStr(50), key) , Constant.ENCODING_UTF8 ); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in getNewCookieId()", e); - } catch (Exception e) { - LOGGER.error("Error in getNewCookieId()", e); - } - return value; - } - public static void setCookieId(final HttpServletRequest req, final HttpServletResponse res){ - String key = getCookieIdKey(); - String value = ""; - - try { - value = java.net.URLEncoder.encode( encryptPassword(getPassStr(50), key) , Constant.ENCODING_UTF8 ); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in setCookieId()", e); - } catch (Exception e) { - LOGGER.error("Error in setCookieId()", e); - } - - /* 2019.02.26 웹취약점 수정사항 => 1시간마다 쿠키 만료되고 있음 - String maxAge = String.valueOf((60*60*24*365)*10); - if (maxAge.matches("[0-9]+")) { - Cookie cookie = new Cookie(key,value); - // 수정 : 외부입력값 검증 후 쿠키 유효시한 설정에 사용 - int t = Integer.parseInt(maxAge); - if ( t > 3600 ) { - t = 3600; - } - cookie.setMaxAge(t); - cookie.setPath("/"); - res.addCookie(cookie); - } - */ - - // 쿠키 유효기간 1년으로 변경 (2019.08.08) - int maxAge = 60*60*24*365; // 1년 - Cookie cookie = new Cookie(key,value); - cookie.setMaxAge(maxAge); - cookie.setPath("/"); - res.addCookie(cookie); - } - - public static void setCookie(final HttpServletResponse res, String key, String value){ - /* 2019.02.26 웹취약점 수정사항 => 1시간마다 쿠키 만료되고 있음 - String maxAge = String.valueOf((60*60*24*365)*10); - if (maxAge.matches("[0-9]+")) { - Cookie cookie = new Cookie(key,value); - // 수정 : 외부입력값 검증 후 쿠키 유효시한 설정에 사용 - int t = Integer.parseInt(maxAge); - if ( t > 3600 ) { - t = 3600; - } - cookie.setMaxAge(t); - cookie.setPath("/"); - res.addCookie(cookie); - } - */ - - // 쿠키 유효기간 1년으로 변경 (2019.08.08) - int maxAge = 60*60*24*365; // 1년 - Cookie cookie = new Cookie(key,value); - cookie.setMaxAge(maxAge); - cookie.setPath("/"); - res.addCookie(cookie); - } - - public static void setEncoderCookie(final HttpServletResponse res, String key, String value){ - - try { - value = java.net.URLEncoder.encode(value,Constant.ENCODING_UTF8); - } catch (UnsupportedEncodingException e) { - LOGGER.error("Error in setEncoderCookie()", e); - } catch (Exception e) { - LOGGER.error("Error in setEncoderCookie()", e); - } - - /* 2019.02.26 웹취약점 수정사항 => 1시간마다 쿠키 만료되고 있음 - String maxAge = String.valueOf((60*60*24*365)*10); - if (maxAge.matches("[0-9]+")) { - Cookie cookie = new Cookie(key,value); - // 수정 : 외부입력값 검증 후 쿠키 유효시한 설정에 사용 - int t = Integer.parseInt(maxAge); - if ( t > 3600 ) { - t = 3600; - } - cookie.setMaxAge(t); - cookie.setPath("/"); - res.addCookie(cookie); - } - */ - - // 쿠키 유효기간 1년으로 변경 (2019.08.08) - int maxAge = 60*60*24*365; // 1년 - Cookie cookie = new Cookie(key,value); - cookie.setMaxAge(maxAge); - cookie.setPath("/"); - res.addCookie(cookie); - } - - public static void removeCookie(final HttpServletRequest req, final HttpServletResponse res, String key){ - Cookie[] cookies = req.getCookies(); - if(cookies != null && cookies.length > 0){ - for(Cookie cookie : cookies){ - if(key.equals(cookie.getName())){ - cookie.setMaxAge(0); - cookie.setPath("/"); - cookie.setSecure(true); //중요정보 평문전송 (HTTP): 취약점 수정 - String val = cookie.getValue(); - String filtered_val = val.replaceAll("\r","").replaceAll("\n",""); - Cookie cookie2 = new Cookie(key, filtered_val); - res.addCookie(cookie2); - break; - } - } - } - } - private static String encryptPassword(String key, String val) throws NoSuchAlgorithmException { - if (key == null) { - return ""; - } - byte[] hashValue = null; // 해쉬값 - MessageDigest md = MessageDigest.getInstance("SHA-512"); - md.reset(); - md.update(val.getBytes()); - hashValue = md.digest(key.getBytes()); - - return new String(Base64.encodeBase64(hashValue)).replaceAll("\\+", "").replaceAll("=", ""); - } - public static boolean isSido(String str){ - boolean isSido = false; - for(int i=0; i -1 ){ - isSido = true; - break; - } - if(str.indexOf( Constant.AIS_SIDO_PARAM_NAME_ARRAY[i] ) > -1 ){ - isSido = true; - break; - } - } - return isSido; - } - public static String changeSido(String str){ - if(str == null || "".equals(str)) return ""; - String rtnSido = ""; - for(int i=0; i -1 ){ - rtnSido = Constant.AIS_SIDO_PARAM_NAME_ARRAY[i]; - break; - } - if(str.indexOf( Constant.AIS_SIDO_PARAM_NAME_ARRAY[i] ) > -1 ){ - rtnSido = Constant.AIS_SIDO_PARAM_NAME_ARRAY[i]; - break; - } - } - return rtnSido; - } - public static void setAmsPathModelMap(HttpServletRequest req, ModelMap modelMap){ - // ams 경로 - String amsAssetsPath = getPropertyStr(Constant.AMS_SERVER_KEY) + getPropertyStr(Constant.AMS_ASSETS_PATH_KEY); - String amsThumbnailPath = getPropertyStr(Constant.AMS_THUMBNAIL_PATH_KEY); - String amsImagePath = getPropertyStr(Constant.AMS_FILE_PATH_KEY); - modelMap.addAttribute("amsAssetsPath", amsAssetsPath); - modelMap.addAttribute("amsThumbnailPath", amsThumbnailPath); - modelMap.addAttribute("amsImagePath", amsImagePath); - } - - public static void setNfsPathModelMap(HttpServletRequest req, ModelMap modelMap){ - // ams 경로 - String nfsNasPath = getPropertyStr(Constant.NFS_NAS_KEY); - String nfsDocPath = getPropertyStr(Constant.NFS_DOC_KEY); - modelMap.addAttribute("nfsNasPath", nfsNasPath); - modelMap.addAttribute("nfsDocPath", nfsDocPath); - } - - public static String getAssetImageUrl(String imagePath) { - String imageUrl = ""; - if (StringUtils.isEmpty(imagePath)) return imageUrl; - - String amsAssetsPath = getPropertyStr(Constant.AMS_SERVER_KEY) + getPropertyStr(Constant.AMS_ASSETS_PATH_KEY); - String amsThumbnailPath = getPropertyStr(Constant.AMS_THUMBNAIL_PATH_KEY); - if (imagePath.startsWith("http")) { // http 포함한 전체 경로일 경우 ex) object storage 이미지 - imageUrl = imagePath; - - } else if (imagePath.indexOf("/") >= 0) { // ex) 2/2/7292_thumbnail.jpg - imageUrl = amsAssetsPath + "/" + imagePath; - - } else { - imageUrl = amsAssetsPath + "/" + amsThumbnailPath + "/" + imagePath; // ex) ac6be22ee9db4414aeb4dab6078d27feb723f1c0.jpg - } - - imageUrl = imageUrl.replaceAll("//", "/"); - imageUrl = imageUrl.replaceAll(":/", "://"); // ex) https:/ => https:// - - return imageUrl; - } - - - public static String getContentsImageUrl(String imagePath) { - String imageUrl = ""; - if (StringUtils.isEmpty(imagePath)) return imageUrl; - - String amsAssetsPath = getPropertyStr(Constant.KCCF_HOME_KEY); - if (imagePath.startsWith("http")) { // http 포함한 전체 경로일 경우 ex) object storage 이미지 - imageUrl = imagePath; - - } else if (imagePath.indexOf("/") >= 0) { // ex) 2/2/7292_thumbnail.jpg - imageUrl = amsAssetsPath + "/" + imagePath; - - } else { - imageUrl = amsAssetsPath + "/" + imagePath; // ex) ac6be22ee9db4414aeb4dab6078d27feb723f1c0.jpg - } - - imageUrl = imageUrl.replaceAll("//", "/"); - imageUrl = imageUrl.replaceAll(":/", "://"); // ex) https:/ => https:// - - return imageUrl; - } - - - public static void setUploadPathModelMap(HttpServletRequest req, ModelMap modelMap){ - // 서버경로 (upload폴더 상위경로) : 로컬 개발시 upload 파일이 로컬에 존재하지 않을 경우 사용 - String uploadHomePath = getPropertyStr(Constant.UPLOAD_HOME_KEY); - modelMap.addAttribute("uploadHomePath", uploadHomePath); - } - - /** - * 자산미디어 - 문서 목차 문자열 파싱 - * -테스트 목차 -----1 -제1장 6.25전쟁 전투수기 -----100 - -발간사 ---2 ***1 -축간사(창녕군수) ---4 -축간사(창녕군의회의장)---5 -제1장 6.25전쟁 전투수기 ***2 - 끊어진 한강 철교 빈 보트로 건너다.(성경상) ---12 - 포탄이 날아들어 전우 3명이 즉사하다.(김윤규) ---16 - * - * @param str - * @return - * @throws Exception - */ - public static List parseTableOfContents(String str) { - List list = new ArrayList(); - if (StringUtils.isEmpty(str)) return list; - - - String[] lineArr = str.split("\n"); - int listIdx = 1; - for (int i=0; i errorList = new ArrayList(); - - if (idx1 >= 0 && idx2 >= 0) { // ex) 발간사 ---2 ***1 - String[] arr = line.split(pattern1); - title = arr[0]; - String[] arr2 = arr[1].split(pattern2); - - try { - if (arr2.length == 2) { - pageNum = parseTableOfContentsPageNum(arr2[0]); - ocrFileNum = new Integer(StringUtils.trim(arr2[1]).replaceAll(" ", "")); - - } else if (arr2.length == 1) { // ex) 1. 옹기의 지역적인 특성 ---7 *** - pageNum = parseTableOfContentsPageNum(arr2[0]); - ocrFileNum = new Integer(""); // 강제로 에러발생시킴 - } - } catch (Exception e) { - errorList.add(listIdx+"\t"+e.getMessage()); - } - } else if (idx1 >= 0 && idx2 < 0) { // ex) 축간사(창녕군수) ---4 - String[] arr = line.split(pattern1); - title = arr[0]; - try { - pageNum = parseTableOfContentsPageNum(arr[1]); - } catch (Exception e) { - errorList.add(listIdx+"\t"+e.getMessage()); - } - - } else if (idx1 < 0 && idx2 >= 0) { // ex) 제1장 6.25전쟁 전투수기 ***2 - String[] arr = line.split(pattern2); - title = arr[0]; - try { - if (arr.length == 2) { - ocrFileNum = new Integer(StringUtils.trim(arr[1]).replaceAll(" ", "")); - - } else if (arr.length == 1) { // ex) -참고문헌 *** - ocrFileNum = new Integer(""); // 강제로 에러발생시킴 - } - } catch (Exception e) { - errorList.add(listIdx+"\t"+e.getMessage()); - } - - } else { - title = line; - } - - list.add(new CmmAmsDocTableOfContentsVO(title, pageNum, ocrFileNum, errorList)); - listIdx++; - } - - return list; - } - - /** - * PDF 목차 페이지번호 파싱 - * @param pageNumStr - * @return - * @throws Exception - */ - public static String parseTableOfContentsPageNum(String pageNumStr) throws Exception { - if (StringUtils.isEmpty(pageNumStr)) { - pageNumStr = new Integer(pageNumStr).toString(); // 강제로 Exception 발생시킴 - } - - pageNumStr = StringUtils.trim(pageNumStr).replaceAll(" ", ""); - - boolean isPageNum = true; - for (int i=0; i list, String delimiter) throws Exception { - StringBuffer sb = new StringBuffer();; - - String title = ""; - int titleDepth = 1; - int prevTitleDepth = 100; - String pageNum = null; - Integer ocrFileNum = null; - boolean hasOcrFileNum = false; - - for (int i=0; list!=null && i= 0) { - title = title.replaceAll("\"", " "); // 따옴표 치환 - } - pageNum = vo.getPageNum(); - - ocrFileNum = vo.getOcrFileNum(); - - if (ocrFileNum != null) { - hasOcrFileNum = true; - } else { - hasOcrFileNum = false; - } - - if (title.startsWith(" ") || title.startsWith("\t")) { - if (title.startsWith(" ")) { // 공백6칸 - titleDepth = 4; - } else if (title.startsWith(" ")) { // 공백5칸 - titleDepth = 4; - } else if (title.startsWith(" ")) { // 공백4칸 - titleDepth = 3; - } else if (title.startsWith(" ")) { // 공백3칸 - titleDepth = 3; - } else if (title.startsWith(" ")) { // 공백2칸 - titleDepth = 2; - } else if (title.startsWith(" ")) { // 공백1칸 - titleDepth = 2; - } else if (title.startsWith(" •")) { // 공백1칸 +원문자 ex) K163832.pdf - titleDepth = 2; - } - } else { - titleDepth = 1; - } - - String cssDepth = ""; - if (titleDepth == 1) cssDepth = "d1"; - else if (titleDepth == 2) cssDepth = "d2"; - else if (titleDepth == 3) cssDepth = "d3"; - else if (titleDepth == 4) cssDepth = "d4"; - - if (hasOcrFileNum) { - if (i > 0 && ocrFileNum != null) sb.append(delimiter); - title = title.replaceAll("(\r\n|\r|\n|\n\r)", ""); - sb.append("

"+title); - if (pageNum != null) sb.append(" - "+pageNum); - sb.append("

"); - - } else { - title = title.replaceAll("(\r\n|\r|\n|\n\r)", ""); - sb.append("

"+title); - if (pageNum != null) sb.append(" - "+pageNum); - sb.append("

"); - } - - // ocrFileNum 위치 검증 - if (titleDepth == 1 && prevTitleDepth > 1 && !hasOcrFileNum) { - List errorList = vo.getErrorList(); - errorList.add((i+1)+"\t"+"missing divided file number? : "+title+(pageNum!=null ? " - "+pageNum : "")); - } - - - prevTitleDepth = titleDepth; - } - - return sb.toString(); - } - - /** - * URL scheme HTTPS로 변경 - * @param url - * @return - */ - public static String changeSchemeToHttps(String url) { - String result = ""; - if (StringUtils.isEmpty(url)) return result; - - Pattern p = Pattern.compile("^(http:\\/\\/|https:\\/\\/)?(www\\.)?(.*)$"); // URL 앞부분 패턴 - Matcher m = p.matcher(url); - if (m.find()) { - LOGGER.info("changeSchemeToHttps() m.groupCount()={}, m.group(1)={}, m.group(2)={}, m.group(3)={}, m.group(0)={}", m.groupCount(), m.group(1), m.group(2), m.group(3), m.group(0)); - result = "https://"; - if (m.group(2) != null) result += m.group(2); - result += m.group(3); - } - - return result; - } - - public static String getLinkUrl(String aId, String mId )throws EgovBizException { - - DataMap param = new DataMap(); - param.put("aId", aId); - param.put("mId", mId); - DataMap media = cmmService.selectCmmAmsAssetsMediaDetail2(param); // asset id로 조회 - String mediaId = media.getString("mediaId"); - String mediaInterfaceId = media.getString("mediaInterfaceId"); - - String rtnStr = ""; - if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 - if(media.get("assetType") != null){ - if(media.get("assetType").toString().equals("문서") ){ - rtnStr = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/npdfView.do?"; - rtnStr += "npdf="+Constant.UA_TYPE_R+mediaInterfaceId; // MEDIA 의 INTERFACE_ID 사용 - - }else if(media.get("assetType").toString().equals("링크")){ - rtnStr = media.get("linkData").toString(); - }else{ - rtnStr = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/lib/libraryDetail.do?contentId="+mediaId; - rtnStr += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 시 사용 - } - } - } - return rtnStr; - } -} - diff --git a/src/main/java/cmm/util/CmmVO.java b/src/main/java/cmm/util/CmmVO.java deleted file mode 100644 index 3106107c..00000000 --- a/src/main/java/cmm/util/CmmVO.java +++ /dev/null @@ -1,673 +0,0 @@ -package cmm.util; - -import java.io.Serializable; -import java.util.Date; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; - -/** - * @Class Name : CmmVO.java - * @author Kdmistrator - * @version 1.0 - * 상속 받아서 사용하는 공통 VO - */ -public class CmmVO implements Serializable{ - - private static final long serialVersionUID = 1L; - private String cntntsSeCode; - private String searchCondition = ""; - private String searchKeyword = ""; - private String searchCondition2 = ""; - private String searchKeyword2 = ""; - private String searchCondition3 = ""; - private String searchKeyword3 = ""; - private String searchCondition4 = ""; - private String searchKeyword4 = ""; - private String searchCondition5 = ""; - private String searchKeyword5 = ""; - private String searchCondition6 = ""; - private String searchKeyword6 = ""; - private String searchCondition7 = ""; - private String searchCondition8 = ""; - private String searchKeywordWhole = ""; - private String searchConditionWhole = ""; - private String searchDateCondition = ""; - private Date searchStartDate = null; - private Date searchEndDate = null; - private String searchStartStr = null; - private String searchEndStr = null; - private String searchUseYn = ""; - private String searchType = ""; - private String searchType1 = ""; - private String searchType2 = ""; - private String searchType3 = ""; - private String searchType4 = ""; - private int pageIndex = 1; - private int pageIndex2 = 1; - private int pageIndex3 = 1; - - private int pageUnit = 12; - private int pageUnit10 = 10; - private int pageUnit20 = 20; - private int pageUnit30 = 30; - private int pageSize = 10; - private int mobilePageSize = 5; - private int firstIndex = 1; - private int lastIndex = 1; - private int recordCountPerPage = 10; - private String orderCondition; - private String orderType; - private boolean isBr = false; - private String pageUseAt = "Y"; - private int limit = 5; - private String authorCode; - private String targetId; - private String sido = ""; - private String sigungu = ""; - private String sido2 = ""; - private String sigungu2 = ""; - private String dong = ""; - private String lon = ""; - private String lat = ""; - private String addr =""; - private String xy =""; - private String distance = ""; - private String tabCode = ""; - private int fixedPage = 0; - private String activityType =""; - private String contentType = ""; - private String toDay = ""; - private String parameter1 = ""; - private String parameter2 = ""; - private String parameter3 = ""; - private String parameter4 = ""; - private String parameter5 = ""; - private String parameter6 = ""; - private String sessionId = ""; - private boolean isTag = false; - private String viewType = ""; - // 태그 명이 넘어가는 파라미터 - private String searchTag = ""; - // 스크랩 여부(스크랩 활성 체크) : 존재하면 on , 존재하지 않으면 빈값 "" - private String scrapActive = ""; - private String aId=""; // 에셋 아이디 - private String mId=""; // 에셋미디어 아이디 - private String [] searchLocaleArray; // 지역 - private String [] searchAssetClassArray; // 에셋유형 (ex. 일반, 특화, 문화원소장 등) - private String [] searchAssetTypeArray; // 자산유형 (ex. 문서, 이미지, 동영상, 오디오, 링크 등) - private String [] searchFirstCategoryArray; // 카테고리 - - private String sCouncilCd=""; - private String gubun=""; - - - public CmmVO() {} - public String getCntntsSeCode() { - return cntntsSeCode; - } - - public void setCntntsSeCode(String cntntsSeCode) { - this.cntntsSeCode = cntntsSeCode; - } - - public String getSearchCondition() { - return searchCondition; - } - - public void setSearchCondition(String searchCondition) { - this.searchCondition = searchCondition; - } - - public String getSearchKeyword() { - return searchKeyword; - } - - public void setSearchKeyword(String searchKeyword) { - this.searchKeyword = searchKeyword; - } - - public String getSearchCondition2() { - return searchCondition2; - } - - public void setSearchCondition2(String searchCondition2) { - this.searchCondition2 = searchCondition2; - } - - public String getSearchKeyword2() { - return searchKeyword2; - } - - public void setSearchKeyword2(String searchKeyword2) { - this.searchKeyword2 = searchKeyword2; - } - - public String getSearchCondition3() { - return searchCondition3; - } - - public void setSearchCondition3(String searchCondition3) { - this.searchCondition3 = searchCondition3; - } - - public String getSearchKeyword3() { - return searchKeyword3; - } - - public void setSearchKeyword3(String searchKeyword3) { - this.searchKeyword3 = searchKeyword3; - } - public String getSearchCondition4() { - return searchCondition4; - } - - public void setSearchCondition4(String searchCondition4) { - this.searchCondition4 = searchCondition4; - } - - public String getSearchKeyword4() { - return searchKeyword4; - } - - public void setSearchKeyword4(String searchKeyword4) { - this.searchKeyword4 = searchKeyword4; - } - - public String getSearchCondition5() { - return searchCondition5; - } - - public void setSearchCondition5(String searchCondition5) { - this.searchCondition5 = searchCondition5; - } - - public String getSearchKeyword5() { - return searchKeyword5; - } - - public void setSearchKeyword5(String searchKeyword5) { - this.searchKeyword5 = searchKeyword5; - } - - public String getSearchCondition6() { - return searchCondition6; - } - public void setSearchCondition6(String searchCondition6) { - this.searchCondition6 = searchCondition6; - } - public String getSearchKeyword6() { - return searchKeyword6; - } - - public String getSearchCondition7() { - return searchCondition7; - } - public void setSearchCondition7(String searchCondition7) { - this.searchCondition7 = searchCondition7; - } - public String getSearchCondition8() { - return searchCondition8; - } - public void setSearchCondition8(String searchCondition8) { - this.searchCondition8 = searchCondition8; - } - public String getSearchKeywordWhole() { - return searchKeywordWhole; - } - public void setSearchKeywordWhole(String searchKeywordWhole) { - this.searchKeywordWhole = searchKeywordWhole; - } - public String getSearchConditionWhole() { - return searchConditionWhole; - } - public void setSearchConditionWhole(String searchConditionWhole) { - this.searchConditionWhole = searchConditionWhole; - } - public void setSearchKeyword6(String searchKeyword6) { - this.searchKeyword6 = searchKeyword6; - } - public String getSearchDateCondition() { - return searchDateCondition; - } - - public void setSearchDateCondition(String searchDateCondition) { - this.searchDateCondition = searchDateCondition; - } - - public Date getSearchStartDate() { - return searchStartDate; - } - - public void setSearchStartDate(Date searchStartDate) { - this.searchStartDate = searchStartDate; - } - - public Date getSearchEndDate() { - return searchEndDate; - } - - public void setSearchEndDate(Date searchEndDate) { - this.searchEndDate = searchEndDate; - } - - - public String getSearchStartStr() { - return searchStartStr; - } - - public void setSearchStartStr(String searchStartStr) { - this.searchStartStr = searchStartStr; - } - - public String getSearchEndStr() { - return searchEndStr; - } - - public void setSearchEndStr(String searchEndStr) { - this.searchEndStr = searchEndStr; - } - - public String getSearchUseYn() { - return searchUseYn; - } - public void setSearchUseYn(String searchUseYn) { - this.searchUseYn = searchUseYn; - } - - public String getSearchType() { - return StringUtils.defaultIfEmpty(searchType, "1") ; - } - - public void setSearchType(String searchType) { - this.searchType = searchType; - } - - public String getSearchType1() { - return StringUtils.defaultIfEmpty(searchType1, "1") ; - } - public void setSearchType1(String searchType1) { - this.searchType1 = searchType1; - } - public String getSearchType2() { - return StringUtils.defaultIfEmpty(searchType2, "1") ; - } - public void setSearchType2(String searchType2) { - this.searchType2 = searchType2; - } - public String getSearchType3() { - return StringUtils.defaultIfEmpty(searchType3, "1") ; - } - public void setSearchType3(String searchType3) { - this.searchType3 = searchType3; - } - public String getSearchType4() { - return StringUtils.defaultIfEmpty(searchType4, "1") ; - } - public void setSearchType4(String searchType4) { - this.searchType4 = searchType4; - } - public int getPageIndex() { - return this.pageIndex; - } - - public void setPageIndex(int pageIndex) { - this.pageIndex = pageIndex; - } - - public int getPageIndex2() { - return pageIndex2; - } - public void setPageIndex2(int pageIndex2) { - this.pageIndex2 = pageIndex2; - } - - public int getPageIndex3() { - return pageIndex3; - } - public void setPageIndex3(int pageIndex3) { - this.pageIndex3 = pageIndex3; - } - public int getPageUnit() { - return pageUnit; - } - - public void setPageUnit(int pageUnit) { - this.pageUnit = pageUnit; - } - - public int getPageUnit10() { - return pageUnit10; - } - public void setPageUnit10(int pageUnit10) { - this.pageUnit10 = pageUnit10; - } - - public int getPageUnit20() { - return pageUnit20; - } - public void setPageUnit20(int pageUnit20) { - this.pageUnit20 = pageUnit20; - } - public int getPageUnit30() { - return pageUnit30; - } - public void setPageUnit30(int pageUnit30) { - this.pageUnit30 = pageUnit30; - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - public int getMobilePageSize() { - return mobilePageSize; - } - public void setMobilePageSize(int mobilePageSize) { - this.mobilePageSize = mobilePageSize; - } - public int getFirstIndex() { - return firstIndex; - } - - public void setFirstIndex(int firstIndex) { - this.firstIndex = firstIndex; - } - - public int getLastIndex() { - return lastIndex; - } - - public void setLastIndex(int lastIndex) { - this.lastIndex = lastIndex; - } - - public int getRecordCountPerPage() { - return recordCountPerPage; - } - - public void setRecordCountPerPage(int recordCountPerPage) { - this.recordCountPerPage = recordCountPerPage; - } - - public String getOrderCondition() { - return orderCondition; - } - - public void setOrderCondition(String orderCondition) { - this.orderCondition = orderCondition; - } - public String getOrderType() { - return orderType; - } - - public void setOrderType(String orderType) { - this.orderType = orderType; - } - - public boolean isBr() { - return isBr; - } - - public void setBr(boolean isBr) { - this.isBr = isBr; - } - - public String getPageUseAt() { - return pageUseAt; - } - public void setPageUseAt(String pageUseAt) { - this.pageUseAt = pageUseAt; - } - - public int getLimit() { - return limit; - } - public void setLimit(int limit) { - this.limit = limit; - } - - public String getAuthorCode() { - return authorCode; - } - public void setAuthorCode(String authorCode) { - this.authorCode = authorCode; - } - - public String getTargetId() { - return targetId; - } - public void setTargetId(String targetId) { - this.targetId = targetId; - } - - public String getSido() { - return sido; - } - public void setSido(String sido) { - this.sido = sido; - } - public String getSigungu() { - return sigungu; - } - public void setSigungu(String sigungu) { - this.sigungu = sigungu; - } - public String getSido2() { - return sido2; - } - public void setSido2(String sido2) { - this.sido2 = sido2; - } - public String getSigungu2() { - return sigungu2; - } - public void setSigungu2(String sigungu2) { - this.sigungu2 = sigungu2; - } - public String getDong() { - return dong; - } - public void setDong(String dong) { - this.dong = dong; - } - public String getLon() { - return lon; - } - public void setLon(String lon) { - this.lon = lon; - } - public String getLat() { - return lat; - } - public void setLat(String lat) { - this.lat = lat; - } - - public String getAddr() { - return addr; - } - public void setAddr(String addr) { - this.addr = addr; - } - public String getXy() { - return xy; - } - public void setXy(String xy) { - this.xy = xy; - } - - public String getDistance() { - return distance; - } - public void setDistance(String distance) { - this.distance = distance; - } - - public String getTabCode() { - return tabCode; - } - public void setTabCode(String tabCode) { - this.tabCode = tabCode; - } - - - public int getFixedPage() { - return fixedPage; - } - public void setFixedPage(int fixedPage) { - this.fixedPage = fixedPage; - } - - public String getActivityType() { - return activityType; - } - public void setActivityType(String activityType) { - this.activityType = activityType; - } - public String getContentType() { - return contentType; - } - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getToDay() { - return toDay; - } - public void setToDay(String toDay) { - this.toDay = toDay; - } - public String getParameter1() { - return parameter1; - } - public void setParameter1(String parameter1) { - this.parameter1 = parameter1; - } - public String getParameter2() { - return parameter2; - } - public void setParameter2(String parameter2) { - this.parameter2 = parameter2; - } - public String getParameter3() { - return parameter3; - } - public void setParameter3(String parameter3) { - this.parameter3 = parameter3; - } - public String getParameter4() { - return parameter4; - } - public void setParameter4(String parameter4) { - this.parameter4 = parameter4; - } - public String getParameter5() { - return parameter5; - } - public void setParameter5(String parameter5) { - this.parameter5 = parameter5; - } - public String getParameter6() { - return parameter6; - } - public void setParameter6(String parameter6) { - this.parameter6 = parameter6; - } - public String getSessionId() { - return sessionId; - } - public void setSessionId(String sessionId) { - this.sessionId = sessionId; - } - public boolean isTag() { - return isTag; - } - public void setIsTag(boolean isTag) { - this.isTag = isTag; - } - public String getViewType() { - return viewType; - } - public void setViewType(String viewType) { - this.viewType = viewType; - } - - public String getSearchTag() { - return searchTag; - } - public void setSearchTag(String searchTag) { - this.searchTag = searchTag; - } - - public String getScrapActive() { - return scrapActive; - } - public void setScrapActive(String scrapActive) { - this.scrapActive = scrapActive; - } - public String getaId() { - return aId; - } - public void setaId(String aId) { - this.aId = aId; - } - public String getmId() { - return mId; - } - public void setmId(String mId) { - this.mId = mId; - } - - public String[] getSearchLocaleArray() { - return searchLocaleArray; - } - public void setSearchLocaleArray(String[] searchLocaleArray) { - this.searchLocaleArray = searchLocaleArray; - } - public String[] getSearchAssetClassArray() { - return searchAssetClassArray; - } - public void setSearchAssetClassArray(String[] searchAssetClassArray) { - this.searchAssetClassArray = searchAssetClassArray; - } - - public String[] getSearchAssetTypeArray() { - return searchAssetTypeArray; - } - public void setSearchAssetTypeArray(String[] searchAssetTypeArray) { - this.searchAssetTypeArray = searchAssetTypeArray; - } - public String getsCouncilCd() { - return sCouncilCd; - } - public void setsCouncilCd(String sCouncilCd) { - this.sCouncilCd = sCouncilCd; - } - - public String[] getSearchFirstCategoryArray() { - return searchFirstCategoryArray; - } - public void setSearchFirstCategoryArray(String[] searchFirstCategoryArray) { - this.searchFirstCategoryArray = searchFirstCategoryArray; - } - - public String getGubun() { - return gubun; - } - public void setGubun(String gubun) { - this.gubun = gubun; - } - /** - * toString - * @return String - */ - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - -} diff --git a/src/main/java/cmm/util/DataMap.java b/src/main/java/cmm/util/DataMap.java deleted file mode 100644 index 569c50f8..00000000 --- a/src/main/java/cmm/util/DataMap.java +++ /dev/null @@ -1,196 +0,0 @@ -package cmm.util; - -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import egovframework.rte.psl.dataaccess.util.CamelUtil; - -/** - * @Class Name : DataMap.java - * @author Kdmistrator - * @version 1.0 - * DB 리턴 받을때 사용하거나 Map 타입으로 사용할때 사용한다. - */ -public class DataMap extends LinkedHashMap implements Map{ - private static final long serialVersionUID = 1L; - private static final Logger LOGGER = LoggerFactory.getLogger(DataMap.class); - - public static DataMap getNewDataMap(){ - return new DataMap(); - } - public static DataMap getNewDataMap(HttpServletRequest request){ - DataMap map = new DataMap(); - map.defaultSetInfo(request, map); - return map; - } - private void defaultSetInfo(HttpServletRequest request, DataMap map){ - map.setString("contentType",request.getContentType()); - map.setString("contextPath",request.getContextPath()); - map.setString("uri",request.getRequestURI()); - map.setString("protocol",request.getProtocol()); - map.setString("ip", CmmUtil.getIpAddress(request)); - } - @SuppressWarnings("unchecked") - private static DataMap makePrameterMap(HttpServletRequest request){ - DataMap resultMap = new DataMap(); - Map maps = request.getParameterMap(); - Set keySet = maps.keySet(); - Iterator keys = keySet.iterator(); - while (keys.hasNext()) { - String key = keys.next(); - String[] value = maps.get(key); - if (value.length > 1){ - //for (String val : value) { - //resultMap.put(key, val); - //} - resultMap.put(key, value); - } else { - if(value[0] instanceof String) { - resultMap.put(key, value[0].toString()); - } else { - resultMap.put(key, value[0]); - } - } - } - resultMap.defaultSetInfo(request, resultMap); - return resultMap; - } - public static DataMap getParamMap(HttpServletRequest request){ - return makePrameterMap(request); - } - private static String nvlTrim(String obj) { - String result = ""; - if (obj != null) - result = obj.trim(); - return result; - } - public Object get(String key){ - Object o = null; - try { - o = super.get(key); - } catch (NullPointerException e) { - LOGGER.error("Error in get() key="+key, e); - } - return o; - } - public String [] getStringArray(String key) { - String [] r = null; - try { - if(super.get(key) instanceof String[]){ - r = (String [])super.get(key); - }else{ - r = new String[1]; - r[0]= getString(key); - } - } catch (NullPointerException e) { - LOGGER.error("Error in getStringArray() key="+key, e); - } - return r; - } - public String getString(String key) { - String r = ""; - try { - if(super.get(key) != null){ - r = super.get(key).toString(); - } - } catch (NullPointerException e) { - LOGGER.error("Error in getString() key="+key, e); - } - return r; - } - public int getInt(String key) { - return getInt(key, 0); - } - public int getInt(String key, int defaultInt) { - int result = 0; - String str = getString(key); - try { - if(StringUtils.isNotEmpty(str)) { - result = new Integer(str).intValue(); - } - } catch (NumberFormatException e) { - LOGGER.error("Error in getInt() key="+key+", getString(key)=="+getString(key), e); - result = defaultInt; - } - return result; - } - public long getLong(String key) { - return getLong(key, 0); - } - public long getLong(String key, long defaultLong) { - long result = 0; - String str = getString(key); - try { - if(StringUtils.isNotEmpty(str)) { - Double tmp = Double.parseDouble(str); - result = tmp.longValue(); - } - } catch (NumberFormatException e) { - LOGGER.error("Error in getLong() key="+key+", getString(key)=="+getString(key), e); - result = defaultLong; - } - return result; - } - public double getDouble(String key) { - return getDouble(key, 0); - } - public double getDouble(String key, double defaultDouble) { - double result = 0; - String str = getString(key); - try { - if(StringUtils.isNotEmpty(str)) { - result = new Long(str).doubleValue(); - } - } catch (NumberFormatException e) { - LOGGER.error("Error in getDouble() key="+key+", getString(key)="+getString(key), e); - result = defaultDouble; - } - return result; - } - public boolean getBoolean(String key){ - return getBoolean(key, false); - } - public boolean getBoolean(String key, boolean defaltValue){ - boolean result = defaltValue; - String strObj = nvlTrim(key); - if (strObj.length() > 0){ - result = strObj.toLowerCase().equals("true"); - } - return result; - } - public void setString(String key, String value){ - super.put(key, value); - } - public void setInt(String key, int value){ - super.put(key, value); - } - public void setInt(String key, String value){ - super.put(key, new Integer(value).intValue()); - } - public void setLong(String key, long value){ - super.put(key, value); - } - public void setLong(String key, String value){ - super.put(key, new Long(value).longValue()); - } - public void setDouble(String key, double value){ - super.put(key, value); - } - public void setDouble(String key, String value){ - super.put(key, new Double(value).doubleValue()); - } - public void setBoolean(String key, boolean value){ - super.put(key, new Boolean(value)); - } - public Object put(String key, Object value) { - return super.put(CamelUtil.convert2CamelCase((String) key), value); - } -} diff --git a/src/main/java/cmm/util/DateUtil.java b/src/main/java/cmm/util/DateUtil.java deleted file mode 100644 index d3f7b7fe..00000000 --- a/src/main/java/cmm/util/DateUtil.java +++ /dev/null @@ -1,355 +0,0 @@ -package cmm.util; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; - -import org.apache.commons.lang.time.DateFormatUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DateUtil extends DateUtils { - - private final static Logger LOGGER = LoggerFactory.getLogger(DateUtil.class); - - private static TimeZone mySTZ = (TimeZone) TimeZone.getTimeZone("JST"); - private static Locale lc = new Locale("Locale.KOREAN", "Locale.KOREA"); - public static String [] HOUR_CODE_ARRAY = {"08","09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"}; - public static String [] HOUR_CODE_ARRAY2 = {"01", "02", "03", "04", "05", "06", "07","08","09","10", "11", "12", "13", "14", "15","16", "17", "18", "19","20","21","22","23"}; - public static String [][] HOUR_CODE_ONE_ARRAY = {{"10","11"}, {"11", "12"},{"14", "15"}, {"15","16"}, {"16", "17"}}; - public static String [][] HOUR_CODE_TWO_ARRAY = {{"10","12"}, {"14", "16"},{"16", "17"}}; - public static String [][] HOUR_CODE_THREE_ARRAY = {{"","12",""}, {"14", "16"},{"16", "17"}}; - public static String [][] HOUR_CODE_DAY_ARRAY = {{"10","17"}}; - public static String [] MINUTE_CODE_ARRAY = {"00","10", "20", "30", "40", "50"}; - public static String [] MINUTE_CODE_ARRAY2 = {"00","30"}; - public static String PATTERN_DATETIME_TO_STRING = "yyyy-MM-dd HH:mm:ss"; - public static String PATTERN_DATE_TO_STRING = "yyyy-MM-dd"; - public static String DEFAULT_DATE_DELIMITER = "-"; - - public final static String DATE_FORMAT = "yyyy-MM-dd"; - public final static String DATE_DB_FORMAT = "yyyyMMdd"; - public final static String DATEYEAR_FORMAT = "yyyy"; - public final static String DATEMONTH_FORMAT = "yyyy-MM"; - public final static String DATEMONTH_FORMAT2 = "yyyyK-MMK"; - public final static String DATEMONTH_DB_FORMAT = "yyyyMM"; - public final static String DATEMONTH_ONLY_FORMAT = "MM"; - public final static String DATEHOUR_FORMAT = "yyyy-MM-dd HH:mm"; - public final static String DATEHOUR_FORMAT2 = "yyyy-MM-dd HH"; - public final static String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - public final static String DATETIME_STRING_FORMAT = "yyyyMMddHHmmss"; - - public final static String TIMEHOUR_FORMAT = "HH:mm"; - public final static String TIMEHOUR_FORMAT2 = "HHmm"; - public final static String TIMEHOUR_FORMAT3 = "HH"; - public final static String TIMESECOND_FORMAT = "HH:mm:ss"; - - public final static String DELIMITER_DATE = "-"; - public final static String DELIMITER_TIME = ":"; - public final static String DELIMITER_DATETIME = " "; - public static final String DELIMITER_PERIOD = "~"; - - - public static int getYearCurrent() { - Calendar today = Calendar.getInstance(mySTZ, lc); - int year = today.get(Calendar.YEAR); - - return year; - } - - public static int getMonthCurrent() { - Calendar today = Calendar.getInstance(mySTZ, lc); - int month = today.get(Calendar.MONTH) +1; - - return month; - } - - public static int getDayIntCurrent() { - Calendar today = Calendar.getInstance(mySTZ, lc); - int day = today.get(Calendar.DAY_OF_MONTH); - - return day; - } - - public static Date getDayCurrent() { - Calendar today = Calendar.getInstance(mySTZ, lc); - return new Date(today.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getAddDayCurrent(int period) { - Calendar today = new GregorianCalendar(mySTZ,lc); - Calendar resultDay = new GregorianCalendar (mySTZ,lc); - resultDay.add(today.DATE, period); - return new Date(resultDay.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getDayAddDay(Date date, int day) { - if (date == null) return null; - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.add(cal.DATE, day); - return cal.getTime(); - } - - public static String getNowString(String dtFormat) { - Calendar today = Calendar.getInstance(mySTZ, lc); - String szResult = ""; - if (dtFormat != null) { - szResult = new SimpleDateFormat(dtFormat).format(today.getTime()); - } - return szResult; - } - - public static String getDateString(java.util.Date dt, SimpleDateFormat dtFormat) { - String szResult = ""; - if (dt != null && dtFormat != null) { - szResult = dtFormat.format(dt); - } - return szResult; - } - - public static String date2str(Date date, String format) { - if (date == null || StringUtils.isEmpty(format)) return null; - return new SimpleDateFormat(format).format(date); - } - - public static Date getFirstDayOfMonth(String strMonth) { - Calendar resultDay = new GregorianCalendar (mySTZ,lc); - - int intYear = Integer.parseInt(strMonth.substring(0,4)); - int intMonth = Integer.parseInt(strMonth.substring(4,6))-1; // -1을 해야 현재월 - int intDay = 1; - - resultDay.set(intYear, intMonth, intDay); - return new Date(resultDay.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getLastDayOfMonth(String strMonth) { - Calendar resultDay = Calendar.getInstance(mySTZ, lc); - int intYear = Integer.parseInt(strMonth.substring(0,4)); - int intMonth = Integer.parseInt(strMonth.substring(4,6))-1; // -1을 해야 현재월 - int intDay = 1; - resultDay.set(intYear, intMonth, intDay); - resultDay.add(resultDay.MONTH, +1); // 다음달 - resultDay.add(resultDay.DATE, -1); // 하루빼 - return new Date(resultDay.getTimeInMillis()); - } - - public static Calendar str2cal(String str, String format) { - Calendar cal = null; - if (StringUtils.isEmpty(str)) return cal; - - try { - DateFormat formatter = new SimpleDateFormat(format); - Date date = (Date)formatter.parse(str); - - cal = Calendar.getInstance(); - cal.setTime(date); - } catch (NullPointerException e) { - LOGGER.error("fail in str2cal() str="+str+", format="+format, e); - } catch (IllegalArgumentException e) { - LOGGER.error("fail in str2cal() str="+str+", format="+format, e); - } catch (Exception e) { - LOGGER.error("fail in str2cal() str="+str+", format="+format, e); - } - return cal; - } - - public static String getDateFormatString(String strDate) { - String formatDate = ""; - if(strDate == null) return formatDate; - strDate = CmmUtil.deleteChar(strDate); - - int strDateLen = strDate.length(); - if(strDateLen >= 4) { - formatDate = strDate.substring(0, 4); - } - if(strDateLen >= 6) { - formatDate += DEFAULT_DATE_DELIMITER + strDate.substring(4, 6) ; - } - if(strDateLen >= 8) { - formatDate += DEFAULT_DATE_DELIMITER + strDate.substring(6) ; - } - return formatDate; - } - - public static String getDateFormatString2(String strDate) { - String formatDate = ""; - if(strDate == null) return formatDate; - - strDate = CmmUtil.deleteChar(strDate); - - int strDateLen = strDate.length(); - - if(strDateLen > 8){ - strDate = strDate.substring(0, 8); - } - - if(strDateLen >= 4) { - formatDate = strDate.substring(0, 4); - } - if(strDateLen >= 6) { - formatDate += DEFAULT_DATE_DELIMITER + strDate.substring(4, 6) ; - } - if(strDateLen >= 8) { - formatDate += DEFAULT_DATE_DELIMITER + strDate.substring(6) ; - } - - return formatDate; - } - - @SuppressWarnings("static-access") - public static Date getDayPreMonth() throws IOException, InvocationTargetException, SQLException{ - Calendar today = new GregorianCalendar(mySTZ,lc); - Calendar resultDay = new GregorianCalendar (mySTZ,lc); - resultDay.add(today.MONTH, -1); - return new Date(resultDay.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getPreMonth(int period) throws IOException, InvocationTargetException, SQLException { - Calendar today = new GregorianCalendar(mySTZ,lc); - Calendar resultDay = new GregorianCalendar (mySTZ,lc); - resultDay.add(today.MONTH, period); - return new Date(resultDay.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getDayNextMonth() throws IOException, InvocationTargetException, SQLException { - Calendar today = new GregorianCalendar(mySTZ,lc); - Calendar resultDay = new GregorianCalendar (mySTZ,lc); - resultDay.add(today.MONTH, 1); - return new Date(resultDay.getTimeInMillis()); - } - - @SuppressWarnings("static-access") - public static Date getDayAddMonth(Calendar cal, int month) throws IOException, InvocationTargetException, SQLException { - if (cal == null) return null; - Calendar tmp = Calendar.getInstance(); - tmp.setTime(cal.getTime()); - tmp.add(cal.MONTH, month); - return tmp.getTime(); - } - - public static Date getDayAddMonth(int month) throws Exception { - Calendar today = new GregorianCalendar(mySTZ,lc); - return getDayAddMonth(today, month); - } - - public static Date getDayAddMonth(String str, String format, int month) throws IOException, InvocationTargetException, SQLException { - Calendar today = str2cal(str, format); - return getDayAddMonth(today, month); - } - - @SuppressWarnings("rawtypes") - public static Date getDate(Map map, String key) { - Date date = null; - if (CmmUtil.isEmpty(map, key)) return date; - - date = (Date)map.get(key); - return date; - } - - public static String[] getBetweenDays(String startD, String endD) throws ParseException, IOException, InvocationTargetException, SQLException { - List list = new ArrayList<>(); - - if( StringUtils.isBlank(startD) || StringUtils.isBlank(endD)){ - return null; - } - startD = startD.replaceAll("-", "").trim(); - endD = endD.replaceAll("-", "").trim(); - - if( startD.length() > 8 || endD.length() > 8) { - return null; - } - - String start = startD; - String end = endD; - - DateFormat inDf = new SimpleDateFormat("yyyyMMdd"); - - //getBetweenDays("20160930" , "20161003") = {"30,금,9월,20160930", "2,일,10월,20161002" , "1,토,10월,20161001" , "3,월,10월,20161003"} - //DateFormat outDf = new SimpleDateFormat("d,E,MMMM,yyyyMMdd", Locale.US); - - // getBetweenDays("20160930" , "20161003") = {"20160930", "20161002" , "20161001" , "20161003"} - DateFormat outDf = new SimpleDateFormat("yyyyMMdd", Locale.KOREA); - - Calendar startCal = Calendar.getInstance(); - Calendar endCal = Calendar.getInstance(); - startCal.setTime(inDf.parse(start)); - endCal.setTime(inDf.parse(end)); - endCal.add(Calendar.DAY_OF_MONTH, +1); - while (endCal.after(startCal)) { - String date = outDf.format(startCal.getTime()).toUpperCase(); - startCal.add(Calendar.DAY_OF_MONTH, +1); - list.add(date); - } - return list.toArray(new String[list.size()]); - } - - public static Date currentDate() - { - return new Date(); - } - - public static String currentDateHh() - { - Date dt = new Date(); - SimpleDateFormat sdf = new SimpleDateFormat("HH"); - return sdf.format(dt).toString(); - } - - public static String getAddYearFormat(int year, String format) - { - return dateToString(addYears(currentDate(), year), format); - } - - public static String getAddMonthFormat(int month, String format) - { - return dateToString(addMonths(currentDate(), month), format); - } - - public static String getAddDayFormat(int day, String format) - { - return dateToString(addDays(currentDate(), day), format); - } - public static String dateToString(Date date, String format) - { - if (date == null) { - return ""; - } - return DateFormatUtils.format(date, format); - } - - public static String getAddHourFormat(int h,String format) { - Calendar cal = Calendar.getInstance(mySTZ, lc); - cal.add(Calendar.HOUR, h); - return DateFormatUtils.format(cal.getTime(), format); - } - - public static Date stringToDate(String str, String format) throws Exception { - Date date = null; - if (StringUtils.isEmpty(str) || StringUtils.isEmpty(format)) return date; - - Calendar cal = str2cal(str, format); - if (cal == null) return date; - - date = cal.getTime(); - return date; - } -} diff --git a/src/main/java/cmm/util/ExcelUtil.java b/src/main/java/cmm/util/ExcelUtil.java deleted file mode 100644 index 863d4990..00000000 --- a/src/main/java/cmm/util/ExcelUtil.java +++ /dev/null @@ -1,776 +0,0 @@ -package cmm.util; - -import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.ss.usermodel.IndexedColors; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.CellReference; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExcelUtil { - - /** LOGGER */ - private static final Logger LOGGER = LoggerFactory.getLogger(ExcelUtil.class); - - /** 다운로드 버퍼 크기 */ - // private static final int BUFFER_SIZE = 8192; // 8kb - - /** 문자 인코딩 */ - public final static String CHARSET = "utf-8"; - - public final static String CELL_STYLE_TITLE = "1"; - public final static String CELL_STYLE_TITLE2 = "11"; - public final static String CELL_STYLE_TITLE3 = "12"; - public final static String CELL_STYLE_HEADER = "2"; - - public final static String CELL_STYLE_DATA_DEFAULT_CENTER = "3"; - public final static String CELL_STYLE_DATA_DEFAULT_LEFT = "4"; - public final static String CELL_STYLE_DATA_DEFAULT_RIGHT = "5"; - public final static String CELL_STYLE_DATA_DATE_HYPHEN = "6"; - public final static String CELL_STYLE_DATA_DATE_SLASH = "7"; - public final static String CELL_STYLE_DATA_NUMBER = "8"; - public final static String CELL_STYLE_DATA_NUMBER_DECIMAL_1 = "9"; - public final static String CELL_STYLE_DATA_NUMBER_DECIMAL_2 = "10"; - - public final static int CELL_SIZE_DEFAULT = 4500; - - public final static String DATALIST_MAP = "map"; - public final static String DATALIST_VO = "vo"; - - - private String filePath; - private List outputColumns; - private int startRow; - - public static void xlsxFileDownByEgovMap( - HttpServletResponse response, - String fileName, - String sheetName, - String headerTitle, - String[] headerNames, - String[] dataKeys, - String[] dataType, - int[] cellSizes, - List dataList) throws Exception - { - // 워크북 생성 - XSSFWorkbook wb = new XSSFWorkbook(); - - // 시트 생성 - XSSFSheet sheet = null; - if (StringUtils.isNotEmpty(sheetName)) - { - sheet = wb.createSheet(sheetName); - } - else - { - sheet = wb.createSheet(); - } - - // 기본 Cell Style - Map styles = createStyles(wb); - - int headerNamesLength = 1; - if (headerNames != null && headerNames.length > 0) headerNamesLength = headerNames.length; - - // 셀크기지정 - if (cellSizes == null || cellSizes.length == 0) - { - for (int i = 0; i < headerNamesLength; i++) - { - sheet.setColumnWidth(i, CELL_SIZE_DEFAULT); - } - } - else - { - for (int i = 0; i < headerNamesLength; i++) - { - sheet.setColumnWidth(i, cellSizes[i] * 256); - } - } - - Row titleRow = sheet.createRow(0); - titleRow.setHeightInPoints(45); - Cell titleCell = titleRow.createCell(0); - titleCell.setCellValue(headerTitle); - titleCell.setCellStyle(styles.get(CELL_STYLE_TITLE)); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerNamesLength-1)); - - Row headerRow = sheet.createRow(1); - headerRow.setHeightInPoints(40); - Cell headerCell; - for (int i = 0; i < headerNamesLength; i++) { - headerCell = headerRow.createCell(i); - headerCell.setCellValue(headerNames[i]); - headerCell.setCellStyle(styles.get(CELL_STYLE_HEADER)); - } - - Row dataRow = null; - - Cell dataCell = null; - - DataMap dataMap = null; - if (dataList != null && dataList.size() > 0) - { - for (int i = 0; i < dataList.size(); i++) - { - dataMap = (DataMap) dataList.get(i); - dataRow = sheet.createRow(i + 2); - dataCell = null; - if (dataKeys != null && dataKeys.length > 0) - { - for (int j = 0; j < dataKeys.length; j++) - { - Object dataObj = (Object)(dataMap.get(dataKeys[j])); - if (dataObj != null) { - String dataTypeNm = dataObj.getClass().getName(); - - dataCell = dataRow.createCell(j); - dataCell.setCellStyle(styles.get(dataType[j])); - if (dataTypeNm.contains("BigDecimal")) - { - dataCell.setCellValue(((BigDecimal)(dataMap.get(dataKeys[j]))).doubleValue()); - } - else if (dataTypeNm.contains("Integer")) - { - dataCell.setCellValue((Integer)(dataMap.get(dataKeys[j]))); - } - else if (dataTypeNm.contains("Long")) - { - dataCell.setCellValue((Long)(dataMap.get(dataKeys[j]))); - } - else if (dataTypeNm.contains("Date")) - { - dataCell.setCellValue((Date)(dataMap.get(dataKeys[j]))); - } - else - { - dataCell.setCellValue((String)(dataMap.get(dataKeys[j]))); - } - } - else - { - dataCell = dataRow.createCell(j); - dataCell.setCellStyle(styles.get(CELL_STYLE_DATA_DEFAULT_CENTER)); - dataCell.setCellValue(""); - } - - } - } - } - } - - BufferedOutputStream outs = null; - OutputStream out = null; - try - { - response.reset(); - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8") + ";"); - out = response.getOutputStream(); - outs = new BufferedOutputStream(out); - wb.write(outs); - out.flush(); - } - catch (IOException e){ - LOGGER.error("fail in xlsxFileDownByEgovMap()", e); - } catch (Exception e){ - LOGGER.error("fail in xlsxFileDownByEgovMap()", e); - } finally { - if(out != null){ - out.close(); - } - if(outs != null){ - outs.close(); - } - } - } - - public static void xlsxFileDownByEgovMap2( - HttpServletResponse response, - String fileName, - String sheetName, - String headerTitle, - String[] headerNames1, - String[] headerNames2, - int [][] headerMerged, - String[] dataKeys, - String[] dataType, - int[] cellSizes, - List dataList) throws Exception - { - XSSFWorkbook wb = new XSSFWorkbook(); - - XSSFSheet sheet = null; - if (StringUtils.isNotEmpty(sheetName)) - { - sheet = wb.createSheet(sheetName); - } - else - { - sheet = wb.createSheet(); - } - - Map styles = createStyles(wb); - - int headerNamesLength = 1; - if (headerNames1 != null && headerNames1.length > 0) headerNamesLength = headerNames1.length; - - int headerMergedLength = 0; - if (headerMerged != null && headerMerged.length > 0) headerMergedLength = headerMerged.length; - - if (cellSizes == null || cellSizes.length == 0) - { - for (int i = 0; i < headerNamesLength; i++) - { - sheet.setColumnWidth(i, CELL_SIZE_DEFAULT); - } - } - else - { - for (int i = 0; i < headerNamesLength; i++) - { - sheet.setColumnWidth(i, cellSizes[i] * 256); - } - } - - Row titleRow = sheet.createRow(0); - titleRow.setHeightInPoints(45); - Cell titleCell = titleRow.createCell(0); - titleCell.setCellValue(headerTitle); - titleCell.setCellStyle(styles.get(CELL_STYLE_TITLE)); - - - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerNamesLength-1)); - - Row headerRow1 = sheet.createRow(1); - headerRow1.setHeightInPoints(40); - Cell headerCell1; - for (int i = 0; i < headerNamesLength; i++) - { - //if (AtEduStringUtils.isNotEmpty(headerNames1[i])) - //{ - headerCell1 = headerRow1.createCell(i); - headerCell1.setCellValue(headerNames1[i]); - headerCell1.setCellStyle(styles.get(CELL_STYLE_HEADER)); - //} - } - - Row headerRow2 = sheet.createRow(2); - headerRow2.setHeightInPoints(40); - Cell headerCell2; - for (int i = 0; i < headerNamesLength; i++) - { - //if (AtEduStringUtils.isNotEmpty(headerNames2[i])) - //{ - headerCell2 = headerRow2.createCell(i); - headerCell2.setCellValue(headerNames2[i]); - headerCell2.setCellStyle(styles.get(CELL_STYLE_HEADER)); - //} - } - - for (int i = 0; i < headerMergedLength; i++) - { - sheet.addMergedRegion(new CellRangeAddress(headerMerged[i][0], headerMerged[i][1], headerMerged[i][2], headerMerged[i][3])); - } - - Row dataRow = null; - - Cell dataCell = null; - - DataMap dataMap = null; - if (dataList != null && dataList.size() > 0) - { - for (int i = 0; i < dataList.size(); i++) - { - dataMap = (DataMap) dataList.get(i); - dataRow = sheet.createRow(i + 3); - dataCell = null; - if (dataKeys != null && dataKeys.length > 0) - { - for (int j = 0; j < dataKeys.length; j++) - { - Object dataObj = (Object)(dataMap.get(dataKeys[j])); - if (dataObj != null) { - String dataTypeNm = dataObj.getClass().getName(); - - dataCell = dataRow.createCell(j); - dataCell.setCellStyle(styles.get(dataType[j])); - if (dataTypeNm.contains("BigDecimal")) - { - dataCell.setCellValue(((BigDecimal)(dataMap.get(dataKeys[j]))).doubleValue()); - } - else if (dataTypeNm.contains("Integer")) - { - dataCell.setCellValue((Integer)(dataMap.get(dataKeys[j]))); - } - else if (dataTypeNm.contains("Long")) - { - dataCell.setCellValue((Long)(dataMap.get(dataKeys[j]))); - } - else if (dataTypeNm.contains("Date")) - { - dataCell.setCellValue((Date)(dataMap.get(dataKeys[j]))); - } - else - { - dataCell.setCellValue((String)(dataMap.get(dataKeys[j]))); - } - } - else - { - dataCell = dataRow.createCell(j); - dataCell.setCellStyle(styles.get(CELL_STYLE_DATA_DEFAULT_CENTER)); - dataCell.setCellValue(""); - } - - } - } - } - } - - BufferedOutputStream outs = null; - try - { - response.reset(); - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8") + ";"); - outs = new BufferedOutputStream(response.getOutputStream()); - wb.write(outs); - outs.close(); - } - catch (IOException e){ - LOGGER.error("fail in xlsxFileDownByEgovMap2()", e); - } catch (Exception e){ - LOGGER.error("fail in xlsxFileDownByEgovMap2()", e); - } - - response.getOutputStream().flush(); - response.getOutputStream().close(); - } - - /** - * Create a library of cell styles - */ - public static Map createStyles(Workbook wb) - { - Map styles = new HashMap(); - CellStyle style; - - // DDDDDDDDDDDDDDDDDDDDDD 2021.08.13 임시 막음 버전차이로 인한 상수값 부재 - /* - Font titleFont = wb.createFont(); - titleFont.setFontHeightInPoints((short) 18); - titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD); - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_CENTER); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setFont(titleFont); - styles.put(CELL_STYLE_TITLE, style); - - Font title2Font = wb.createFont(); - title2Font.setFontHeightInPoints((short) 13); - title2Font.setBoldweight(Font.BOLDWEIGHT_BOLD); - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_LEFT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setFont(title2Font); - styles.put(CELL_STYLE_TITLE2, style); - - Font title3Font = wb.createFont(); - title3Font.setFontHeightInPoints((short) 10); - title3Font.setBoldweight(Font.BOLDWEIGHT_BOLD); - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_LEFT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setFont(title3Font); - styles.put(CELL_STYLE_TITLE3, style); - - Font headerFont = wb.createFont(); - headerFont.setFontHeightInPoints((short) 11); - headerFont.setColor(IndexedColors.WHITE.getIndex()); - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_CENTER); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setFillPattern(CellStyle.SOLID_FOREGROUND); - style.setFont(headerFont); - style.setWrapText(true); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_HEADER, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_CENTER); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setWrapText(true); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_DEFAULT_CENTER, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_RIGHT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setWrapText(true); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_DEFAULT_RIGHT, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_LEFT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setWrapText(true); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_DEFAULT_LEFT, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_CENTER); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setDataFormat(wb.createDataFormat().getFormat("yyyy-mm-dd")); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_DATE_HYPHEN, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_CENTER); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setDataFormat(wb.createDataFormat().getFormat("yyyy/mm/dd")); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_DATE_SLASH, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_RIGHT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setDataFormat(wb.createDataFormat().getFormat("#,##0")); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_NUMBER, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_RIGHT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setDataFormat(wb.createDataFormat().getFormat("#,##0.0")); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_NUMBER_DECIMAL_1, style); - - style = wb.createCellStyle(); - style.setAlignment(CellStyle.ALIGN_RIGHT); - style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); - style.setDataFormat(wb.createDataFormat().getFormat("#,##0.00")); - style.setBorderRight(CellStyle.BORDER_THIN); - style.setRightBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderLeft(CellStyle.BORDER_THIN); - style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderTop(CellStyle.BORDER_THIN); - style.setTopBorderColor(IndexedColors.BLACK.getIndex()); - style.setBorderBottom(CellStyle.BORDER_THIN); - style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); - styles.put(CELL_STYLE_DATA_NUMBER_DECIMAL_2, style); - */ - - return styles; - } - - - //추가 - public static Workbook getWorkbook(String filePath) { - - /* - * FileInputStream은 파일의 경로에 있는 파일을 - * 읽어서 Byte로 가져온다. - * - * 파일이 존재하지 않는다면은 - * RuntimeException이 발생된다. - */ - FileInputStream fis = null; - try { - fis = new FileInputStream(filePath); - } catch (FileNotFoundException e) { - throw new RuntimeException(e.getMessage(), e); - } - - Workbook wb = null; - - /* - * 파일의 확장자를 체크해서 .XLS 라면 HSSFWorkbook에 - * .XLSX라면 XSSFWorkbook에 각각 초기화 한다. - */ - if(filePath.toUpperCase().endsWith(".XLS")) { - try { - wb = new HSSFWorkbook(fis); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - else if(filePath.toUpperCase().endsWith(".XLSX")) { - try { - wb = new XSSFWorkbook(fis); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - return wb; - } - - - - - public static String getName(Cell cell, int cellIndex) { - int cellNum = 0; - if(cell != null) { - cellNum = cell.getColumnIndex(); - } - else { - cellNum = cellIndex; - } - - return CellReference.convertNumToColString(cellNum); - } - - public static String getValue(Cell cell) { - String value = ""; - - if(cell == null) { - value = ""; - } - else { - // DDDDDDDDDDDDDDDDDDDDDD 2021.08.13 임시 막음 버전차이로 인한 상수값 부재 - /* - if( cell.getCellType() == Cell.CELL_TYPE_FORMULA ) { - value = cell.getCellFormula(); - } - else if( cell.getCellType() == Cell.CELL_TYPE_NUMERIC ) { - value = cell.getNumericCellValue() + ""; - } - else if( cell.getCellType() == Cell.CELL_TYPE_STRING ) { - value = cell.getStringCellValue(); - } - else if( cell.getCellType() == Cell.CELL_TYPE_BOOLEAN ) { - value = cell.getBooleanCellValue() + ""; - } - else if( cell.getCellType() == Cell.CELL_TYPE_ERROR ) { - value = cell.getErrorCellValue() + ""; - } - else if( cell.getCellType() == Cell.CELL_TYPE_BLANK ) { - value = ""; - } - else { - value = cell.getStringCellValue(); - } - */ - } - - return value; - } - - public static List> read(ExcelUtil excelReadOption) { - //엑셀 파일 자체 - //엑셀파일을 읽어 들인다. - //FileType.getWorkbook() <-- 파일의 확장자에 따라서 적절하게 가져온다. - Workbook wb = getWorkbook(excelReadOption.getFilePath()); - /** - * 엑셀 파일에서 첫번째 시트를 가지고 온다. - */ - Sheet sheet = wb.getSheetAt(0); - - //System.out.println("Sheet 이름: "+ wb.getSheetName(0)); - //System.out.println("데이터가 있는 Sheet의 수 :" + wb.getNumberOfSheets()); - /** - * sheet에서 유효한(데이터가 있는) 행의 개수를 가져온다. - */ - int numOfRows = sheet.getPhysicalNumberOfRows(); - int numOfCells = 0; - - Row row = null; - Cell cell = null; - - String cellName = ""; - /** - * 각 row마다의 값을 저장할 맵 객체 - * 저장되는 형식은 다음과 같다. - * put("A", "이름"); - * put("B", "게임명"); - */ - Map map = null; - /* - * 각 Row를 리스트에 담는다. - * 하나의 Row를 하나의 Map으로 표현되며 - * List에는 모든 Row가 포함될 것이다. - */ - List> result = new ArrayList>(); - /** - * 각 Row만큼 반복을 한다. - */ - for(int rowIndex = excelReadOption.getStartRow() - 1; rowIndex < numOfRows; rowIndex++) { - /* - * 워크북에서 가져온 시트에서 rowIndex에 해당하는 Row를 가져온다. - * 하나의 Row는 여러개의 Cell을 가진다. - */ - row = sheet.getRow(rowIndex); - - if(row != null) { - /* - * 가져온 Row의 Cell의 개수를 구한다. - */ - numOfCells = row.getPhysicalNumberOfCells(); - /* - * 데이터를 담을 맵 객체 초기화 - */ - map = new HashMap(); - /* - * cell의 수 만큼 반복한다. - */ - for(int cellIndex = 0; cellIndex < numOfCells; cellIndex++) { - /* - * Row에서 CellIndex에 해당하는 Cell을 가져온다. - */ - cell = row.getCell(cellIndex); - /* - * 현재 Cell의 이름을 가져온다 - * 이름의 예 : A,B,C,D,...... - */ - cellName = getName(cell, cellIndex); - /* - * 추출 대상 컬럼인지 확인한다 - * 추출 대상 컬럼이 아니라면, - * for로 다시 올라간다 - */ - if( !excelReadOption.getOutputColumns().contains(cellName) ) { - continue; - } - /* - * map객체의 Cell의 이름을 키(Key)로 데이터를 담는다. - */ - map.put(cellName, getValue(cell)); - } - /* - * 만들어진 Map객체를 List로 넣는다. - */ - result.add(map); - - } - - } - - return result; - - } - - - - public String getFilePath() { - return filePath; - } - public void setFilePath(String filePath) { - this.filePath = filePath; - } - public List getOutputColumns() { - - List temp = new ArrayList(); - temp.addAll(outputColumns); - - return temp; - } - public void setOutputColumns(List outputColumns) { - - List temp = new ArrayList(); - temp.addAll(outputColumns); - - this.outputColumns = temp; - } - - public void setOutputColumns(String ... outputColumns) { - - if(this.outputColumns == null) { - this.outputColumns = new ArrayList(); - } - - for(String ouputColumn : outputColumns) { - this.outputColumns.add(ouputColumn); - } - } - - public int getStartRow() { - return startRow; - } - public void setStartRow(int startRow) { - this.startRow = startRow; - } - - - -} diff --git a/src/main/java/cmm/util/FileUtil.java b/src/main/java/cmm/util/FileUtil.java deleted file mode 100644 index b85d8dd6..00000000 --- a/src/main/java/cmm/util/FileUtil.java +++ /dev/null @@ -1,193 +0,0 @@ -package cmm.util; - -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; -import java.sql.SQLException; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.validation.Errors; - -import egovframework.com.cmm.service.FileVO; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.idgnr.impl.Base64; - -public class FileUtil { - - /** LOGGER */ - private final static Logger LOGGER = LoggerFactory.getLogger(FileUtil.class); - - /** 파일업로드시 사용 */ - public static final String ORDER_FLAG_INSERT = "C"; - public static final String ORDER_FLAG_RETRIEVE = "R"; - public static final String ORDER_FLAG_UPDATE = "U"; - public static final String ORDER_FLAG_DELETE = "D"; - - public static String getFileExtension(String fileName) { - String ext = ""; - if (StringUtils.isNotEmpty(fileName) && fileName.indexOf(".") >= 0) { - ext = fileName.substring(fileName.lastIndexOf(".")+1, fileName.length()); - } - return ext; - } - @SuppressWarnings("unused") - public static String getImageFileStream(FileVO fvo) throws IOException, InvocationTargetException, SQLException { - byte[] result = null; - - File file = null; - FileInputStream fis = null; - - BufferedInputStream in = null; - ByteArrayOutputStream bStream = null; - - try { - file = new File(fvo.getFileStreCours(), fvo.getStreFileNm()); - fis = new FileInputStream(file); - - in = new BufferedInputStream(fis); - bStream = new ByteArrayOutputStream(); - - Base64.encode(bStream.toByteArray()); - int imgByte; - while ((imgByte = in.read()) != -1) { - bStream.write(imgByte); - } - - String type = ""; - if (fvo.getFileExtsn() != null && !"".equals(fvo.getFileExtsn())) { - if ("jpg".equals(fvo.getFileExtsn().toLowerCase())) { - type = "image/jpeg"; - } else { - type = "image/" + fvo.getFileExtsn().toLowerCase(); - } - type = "image/" + fvo.getFileExtsn().toLowerCase(); - - } else { - LOGGER.debug("getImageFileStream() Image fileType is null... fvo={}", fvo); - } - result = bStream.toByteArray(); - - } catch (FileNotFoundException e) { - LOGGER.error("fail in getImageFileStream() message="+e+", fvo="+fvo); - - } catch (IOException e) { - LOGGER.error("fail in getImageFileStream() message="+e+", fvo="+fvo); - - } catch (Exception e) { - LOGGER.error("fail in getImageFileStream() message="+e+", fvo="+fvo); - - } finally { - if (bStream != null) { - try { - bStream.close(); - } catch (IOException ignore) { - LOGGER.error("IGNORED: {}", ignore); - } - } - if (in != null) { - try { - in.close(); - } catch (IOException ignore) { - LOGGER.error("IGNORED: {}", ignore); - } - } - if (fis != null) { - try { - fis.close(); - } catch (IOException ignore) { - LOGGER.error("IGNORED: {}", ignore); - } - } - } - String encodedResult = result == null ? "" : Base64.encode(result); - return encodedResult; - } - - public static int validateFileSize(FileVO fileVO, BigDecimal maxFileSize, String fieldName, Errors errors) throws EgovBizException { - int errorCnt = 0; - BigDecimal fileSize = null; - String fileMg = fileVO.getFileMg(); // 파일크기 - if (StringUtils.isNotEmpty(fileMg)) fileSize = new BigDecimal(fileMg); - if (fileSize == null) return errorCnt; // 더 이상 진행하지 않음 - - BigDecimal maxSize = maxFileSize.multiply(new BigDecimal(1024*1024)); // byte 단위 - if (fileSize.compareTo(maxSize) > 0) { -// throw new EgovBizException("파일 업로드 용량을 초과하였습니다... [허용size:"+maxSize+" byte] fileVO="+fileVO); - errors.rejectValue(fieldName, "", "파일 업로드 용량을 초과하였습니다. [허용size:"+maxFileSize+" Mb]"); - errorCnt++; - } - - if (errorCnt > 0) { - LOGGER.debug("validateFileSize() errorCnt={}", errorCnt+", fileSize="+fileSize+", errors="+errors); - } - return errorCnt; - } - - public static int validateFileExt(FileVO fileVO, List extList, String fieldName, Errors errors) throws EgovBizException { - int errorCnt = 0; - String fileExt = fileVO.getFileExtsn(); - if (StringUtils.isEmpty(fileExt)) { - if (StringUtils.isNotEmpty(fileVO.getOrignlFileNm())) { - String tmp = FileUtil.getFileExtension(fileVO.getOrignlFileNm()); - if (!StringUtils.isEmpty(tmp)) { - fileExt = tmp; - } else { -// throw new EgovBizException("파일 확장자를 확인할 수 없습니다... fileVO="+fileVO); - errors.rejectValue(fieldName, "", "파일 확장자를 확인할 수 없습니다. [파일명:"+fileVO.getOrignlFileNm()+"]"); - errorCnt++; - } - } else { -// throw new EgovBizException("파일 확장자를 확인할 수 없습니다... fileVO="+fileVO); - errors.rejectValue(fieldName, "", "파일 확장자를 확인할 수 없습니다. [파일명:"+fileVO.getOrignlFileNm()+"]"); - errorCnt++; - } - } - - if (errorCnt == 0) { - if (StringUtils.isEmpty(fileExt) || !extList.contains(fileExt.toLowerCase())) { // 소문자로 비교 -// LOGGER.debug("validateFileExt() 소문자비교... errorCnt={}", errorCnt+", fileExt="+fileExt+", fieldName="+fieldName+", errors="+errors); -// throw new EgovBizException("허용되지 않는 파일 확장자 입니다... fileVO="+fileVO); - errors.rejectValue(fieldName, "", "허용되지 않는 파일 확장자 입니다. [파일명:"+fileVO.getOrignlFileNm()+"]"); - errorCnt++; - } - } - - if (errorCnt > 0) { - LOGGER.debug("validateFileExt() errorCnt={}", errorCnt+", fileExt="+fileExt+", errors="+errors); - } - return errorCnt; - } - public static void makeDir(String dirPath) { - if (StringUtils.isEmpty(dirPath)) { - LOGGER.warn("makeDir() dirPath is null!!!"); - return; - } - - File file = new File(dirPath); - //file.setExecutable(false,true); - //file.setReadable(true); - //file.setWritable(false, true); - - if (!file.isDirectory()) { - boolean flag = file.mkdirs(); - if (!flag) { - LOGGER.error("fail in directory creation... file="+file); -// throw new IOException("fail in directory creation..."); - } - } - } - - public static boolean isExistFile(String filePath) { - File file = new File(filePath); - return file.exists(); - } - -} diff --git a/src/main/java/cmm/util/MailUtil.java b/src/main/java/cmm/util/MailUtil.java deleted file mode 100644 index 358e3150..00000000 --- a/src/main/java/cmm/util/MailUtil.java +++ /dev/null @@ -1,156 +0,0 @@ -package cmm.util; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.util.Properties; - -import javax.mail.Authenticator; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import egovframework.com.cmm.service.EgovProperties; - -public class MailUtil { - - private static final Log log = LogFactory.getLog(MailUtil.class); - - public static void sendMail(String toAddr, String toName, String msgSubj, String msgText) { - try{ - Properties mailProps = new Properties(); - - mailProps.put("mail.smtp.starttls.enable", "true"); - mailProps.put("mail.smtp.host", EgovProperties.getProperty("Globals.mail.smtp.host")); - mailProps.put("mail.smtp.auth", "true"); - mailProps.put("mail.smtp.port", EgovProperties.getProperty("Globals.mail.smtp.port")); - - - Authenticator auth = new MyAuthentication(); - //session 생성 및 MimeMessage생성 - Session _session = Session.getDefaultInstance(mailProps, auth); - - String fromAddr = EgovProperties.getProperty("Globals.mail.smtp.user"); - String fromName = EgovProperties.getProperty("Globals.mail.smtp.username"); - - MimeMessage msg = new MimeMessage(_session); - msg.setFrom(new InternetAddress(fromAddr, fromName)); - InternetAddress[] address = {new InternetAddress(fromAddr, toName)}; - msg.setRecipients(Message.RecipientType.TO, address); - - /*참조인원*/ - InternetAddress[] addresscc = {new InternetAddress(EgovProperties.getProperty("Globals.mail.cc.user01")), - new InternetAddress(EgovProperties.getProperty("Globals.mail.cc.user02")), - new InternetAddress(EgovProperties.getProperty("Globals.mail.cc.user03")), - new InternetAddress(EgovProperties.getProperty("Globals.mail.cc.user04")) - }; - msg.setRecipients(Message.RecipientType.CC, addresscc); - - msgSubj = "Q&A가 등록되었습니다."; - msg.setSubject(msgSubj); - msg.setSentDate(new Date()); - msgText = "Q&A가 등록되었습니다. 관리자사이트에서 Q&A를 확인하시기 바랍니다."; - // 이메일 제목 - msg.setSubject(msgSubj, "UTF-8"); - // 이메일 내용 - msg.setText(msgText, "UTF-8"); - // 이메일 헤더 - msg.setHeader("content-Type", "text/html"); - //메일보내기 - Transport.send(msg); - - }catch(MessagingException e){ - log.error("Error in sendMail()", e); - }catch (UnsupportedEncodingException e) { - log.error("Error in sendMail()", e); - } - } - public static void sendMailHtml(HttpServletRequest request, String toAddr, String toName, String msgSubj, String msgText) { - try{ - String serverPath = request.getContextPath(); // 서버패스 - String htmlFilePath = EgovProperties.getProperty("Globals.mail.html.path"); - String htmlFileName = EgovProperties.getProperty("Globals.mail.html.file"); - - Properties mailProps = new Properties(); - - - mailProps.put("mail.smtp.host", EgovProperties.getProperty("Globals.mail.smtp.host")); - Session _session = Session.getInstance(mailProps, null); - - String fromAddr = EgovProperties.getProperty("Globals.mail.smtp.user"); - String fromName = EgovProperties.getProperty("Globals.mail.smtp.username"); - - MimeMessage msg = new MimeMessage(_session); - msg.setFrom(new InternetAddress(fromAddr, fromName)); - InternetAddress[] address = { - new InternetAddress(toAddr, toName) - }; - - msg.setRecipients(Message.RecipientType.TO, address); - - msg.setSubject(msgSubj); - - msg.setSentDate(new Date()); - - MimeMultipart cont = new MimeMultipart(); - MimeBodyPart txt = new MimeBodyPart(); - - txt.setText(msgText, "EUC-KR"); //"ks_c_5601-1987" - txt.setHeader("Content-Type", "text/html; charset=\"EUC-KR\""); //charset=\"ks_c_5601-1987\"" - txt.setHeader("Content-Transfer-Encoding", "base64"); - - /// html 값을 리플레이스. - String html = getMailBodyHtml(htmlFilePath+htmlFileName); - html.replace("$title$", msgSubj); - - cont.addBodyPart(txt); - msg.setText(html); - msg.setContent(cont); - msg.saveChanges(); - - Transport.send(msg); - - }catch(MessagingException e){ - log.error("Error in sendMail()", e); - }catch (UnsupportedEncodingException e) { - log.error("Error in sendMail()", e); - } - } - public static String getMailBodyHtml(String pathFile){ - String html = ""; - if(StringUtils.isBlank(pathFile) ){ - return html; - }else{ - BufferedReader br = null ; - try { - br = new BufferedReader(new FileReader(pathFile)); - while(true) { - String temp = br.readLine(); - if (temp==null) break; - html += temp; - } - br.close(); - } catch (Exception e) { - }finally { - try { - br.close(); - } catch (IOException e) { - } - } - } - return html; - } - -} diff --git a/src/main/java/cmm/util/MessageAlertUtil.java b/src/main/java/cmm/util/MessageAlertUtil.java deleted file mode 100644 index 92e9a8c0..00000000 --- a/src/main/java/cmm/util/MessageAlertUtil.java +++ /dev/null @@ -1,701 +0,0 @@ -package cmm.util; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MessageAlertUtil -{ - private static final Logger LOGGER = LoggerFactory.getLogger(MessageAlertUtil.class); - - public static void alert(String msg, HttpServletResponse response){ - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alert()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alert()", e); - } - finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertBack(String msg, HttpServletResponse response) - { - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try{ - out = response.getWriter(); - out.println(""); - } - catch (IOException ex){ - LOGGER.error("Error in alertBack()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertBack()", e); - }finally{ - if(out != null){ - out.close(); - } - } - } - - public static void alertBackExceptionMessage(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertBackExceptionMessage()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertBackExceptionMessage()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertBack(String msg, Object[] args, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertBack()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertBack()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertClose(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertClose()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertClose()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertCloseOpenerReload(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertCloseOpenerReload()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertCloseOpenerReload()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirect(String msg, String url, HttpServletResponse response) - { - response.setHeader("Cache-Control", "no-store"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires", "0"); - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirect()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirect()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirect(String msg, String url, String hiddens, HttpServletResponse response) - { - response.setHeader("Cache-Control", "no-store"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires", "0"); - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - StringBuffer sb = new StringBuffer(); - - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append("
"); - sb.append(hiddens); - sb.append("
"); - sb.append(""); - - out.println(sb.toString()); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirect()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirect()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertReload(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - out.println(""); - out.close(); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertReload()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertReload()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertOpenerReload(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - out.println(""); - out.close(); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertOpenerReload()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertOpenerReload()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertCloseOpenerClose(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(""); - out.println(""); - out.close(); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertCloseOpenerClose()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertCloseOpenerClose()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void println(Object obj, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - out.println(obj); - } - catch (IOException ex) - { - LOGGER.error("Error in println()", ex); - }catch (Exception e) - { - LOGGER.error("Error in println()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void println(String msg, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(msg); - } - catch (IOException ex) - { - LOGGER.error("Error in println()", ex); - }catch (Exception e) - { - LOGGER.error("Error in println()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void script(String script, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in script()", ex); - }catch (Exception e) - { - LOGGER.error("Error in script()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirectTop(String msg, String url, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirectTop()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirectTop()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirectClose(String msg, String url, HttpServletResponse response) - { - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - - /*out.println(""); - out.println("");*/ - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirectClose()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirectClose()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirect(String msg, String url, HttpServletRequest request, HttpServletResponse response) - { - response.setHeader("Cache-Control", "no-cache"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires", "0"); - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirect()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirect()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertRedirect(String msg, String url, String hiddens, HttpServletRequest request, HttpServletResponse response) - { - response.setHeader("Cache-Control", "no-cache"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires", "0"); - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - StringBuffer sb = new StringBuffer(); - - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append("
"); - sb.append(hiddens); - sb.append("
"); - sb.append(""); - - out.println(sb.toString()); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertRedirect()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertRedirect()", e); - }finally - { - if(out != null){ - out.close(); - } - } - } - - public static void alertDirectMsgRedirect(String msg, String url, String hiddens, HttpServletRequest request, HttpServletResponse response) - { - response.setHeader("Cache-Control", "no-cache"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires", "0"); - - response.setContentType("text/html; charset=utf-8"); - PrintWriter out = null; - try - { - out = response.getWriter(); - StringBuffer sb = new StringBuffer(); - - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append("
"); - sb.append(hiddens); - sb.append("
"); - sb.append(""); - - out.println(sb.toString()); - - } - catch (IOException ex) - { - LOGGER.error("Error in alertDirectMsgRedirect()", ex); - }catch (Exception e) - { - LOGGER.error("Error in alertDirectMsgRedirect()", e); - }finally - { - if(out != null){ - out.close(); - } - } - }} diff --git a/src/main/java/cmm/util/MyAuthentication.java b/src/main/java/cmm/util/MyAuthentication.java deleted file mode 100644 index 374ab182..00000000 --- a/src/main/java/cmm/util/MyAuthentication.java +++ /dev/null @@ -1,20 +0,0 @@ -package cmm.util; - -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; - -import egovframework.com.cmm.service.EgovProperties; - -public class MyAuthentication extends Authenticator { - PasswordAuthentication pa; - public MyAuthentication(){ - - String id = EgovProperties.getProperty("Globals.mail.smtp.user"); - String pw = EgovProperties.getProperty("Globals.mail.smtp.pass"); - pa = new PasswordAuthentication(id, pw); - } - // 시스템에서 사용하는 인증정보 - public PasswordAuthentication getPasswordAuthentication() { - return pa; - } -} diff --git a/src/main/java/cmm/util/cxRovecat.java b/src/main/java/cmm/util/cxRovecat.java deleted file mode 100644 index 8c814ca0..00000000 --- a/src/main/java/cmm/util/cxRovecat.java +++ /dev/null @@ -1,245 +0,0 @@ -//ROVECAT-PROTOCOL : PACKET SAMPLE ///////////////////////////////////////////// -//Client -> Server ............................... -// ENQUE/NENCODER 192.168.7.104:8087/192.168.7.109 ROVECAT/1.0 -// Content-Length: 105 -// -// Source-Media: /mkv/120414_YCH_02.avi -// Export-Path: /mp4_files/ -// Is-File-Path: false -// Is-Overwrite: true - -//Server -> Client ............................... -// ROVECAT/1.0 200 OK -// Date: Wed, 4 Jul 2012 08:44:14 GMT -// Server: NACLIPS.encoder/1.1.0.00 (NEXPOLY Technology Inc.) -// Content-Length: 80 -// -// Result: 1000 OK_ENC_ACCEPTED -// Connection-Sequence: 421 -// Encoding-Sequence: 280 -// ROVECAT-PROTOCOL : PACKET SAMPLE ///////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////// -package cmm.util; - -import java.net.*; -import java.io.*; -import java.util.Arrays; - -public class cxRovecat { - private static final String LOG_PATH = "/usr/local/tomcat/webapps/ROOT/log/iface_rovecat.log"; - private String ms_serv_name = "RVCP_SERVER"; - private String ms_params = ""; - - private String ms_ret_code = ""; - - private String ms_ret_date = ""; - private String ms_ret_server = ""; - private int mi_ret_length = 0; - - private String ms_body = ""; - private String ms_error = ""; - private Boolean mb_readblock = false; - private String ms_charset = "UTF-8"; - - private BufferedInputStream mx_bis = null; - - ////////////////////////////////////////////////////////////// - public cxRovecat(){}; - ////////////////////////////////////////////////////////////// - public cxRovecat(String s_serv_name){ - if(s_serv_name != null && s_serv_name != "") ms_serv_name = s_serv_name; - }; - - //////////////////////////////////// - public int iGetFromServer(String s_server,int i_port,String s_client,String s_div,int i_conn_timeout, int i_read_timeout){ - Socket x_conn = null; - - //OutputStream x_os; - PrintWriter x_pw = null; - String s_request = ""; - - s_request += s_div +"/"+ ms_serv_name +" "+ s_server +":"+ Integer.toString(i_port) +"/"+ s_client + " ROVECAT/1.0\r\n"; - s_request += "Content-Length: "+Integer.toString(ms_params.length())+"\r\n"; - s_request += "\r\n"; - s_request += ms_params; - - //fiLog(s_request); - - try{ - SocketAddress socketAddress = new InetSocketAddress(s_server,i_port); - x_conn = new Socket(); - x_conn.connect(socketAddress, i_conn_timeout); //connection timeout - ref: jsp_oracle.txt - x_conn.setSoTimeout(i_read_timeout); //communication timeout - ref: jsp_oracle.txt - - //x_os = x_conn.getOutputStream(); - - mx_bis = new BufferedInputStream(x_conn.getInputStream()); - x_pw = new PrintWriter(x_conn.getOutputStream()); - - x_pw.print(s_request); - x_pw.flush(); - - ms_body = ""; - - String s_line; - boolean b_body = false; - - clearRet(); - - Integer i_pt = 0; - Integer i_read = 0; - - byte[] bs_buf = new byte[2048]; - //String s_num = new String(bs_buf); - while ((i_read = iGetOnLine(bs_buf)) >= 0){ - s_line = new String(bs_buf).trim(); - if(i_read == 0){ - if(mi_ret_length <= 0) break; - if(mb_readblock){ - byte[] bs_body = new byte[mi_ret_length]; - int i_bytes = mx_bis.read(bs_body); - if(i_bytes > 0){ - String s_ret = new String(bs_body, ms_charset); - ms_body += s_ret; - } - break; - } - b_body = true; - }else{ - if(b_body){ - ms_body += s_line+"\r\n"; - }else{ - String s_data = ""; - if ((s_data = getPropertyOnLine(s_line,"ROVECAT/1.0" ))!="" ) ms_ret_code = s_data; - else if((s_data = getPropertyOnLine(s_line,"Date:" ))!="" ) ms_ret_date = s_data; - else if((s_data = getPropertyOnLine(s_line,"Server:" ))!="" ) ms_ret_server = s_data; - else if((s_data = getPropertyOnLine(s_line,"Content-Length:"))!="" ){ - mi_ret_length = Integer.parseInt(s_data); - } - } - }//if - if(mi_ret_length>0 && ms_body.length() >= mi_ret_length){ - break; - } - }//while - - mi_ret_length = ms_body.length(); - } - catch (IOException e){ - ms_error = "connection error : "+e.getMessage(); - mi_ret_length = -1; - } - finally{ - try{ - if(mx_bis!= null) mx_bis.close(); - if(x_pw != null) x_pw .close(); - } - catch(IOException e1) {} - - try{ - if(x_conn!= null && !x_conn.isClosed()) x_conn.close(); - } - catch(IOException e1) {} - } - - return mi_ret_length; - } - - //////////////////////////////////// - public String getLastError() { return ms_error; } - public String getBody() { return ms_body; } - public String getParams() { return ms_params; } - public String getRetCode() { return ms_ret_code; } - public String getRetDate() { return ms_ret_date; } - public String getRetServer() { return ms_ret_server; } - public int getContentLength(){ return mi_ret_length; } - - public void setDataChareset(String cs_charset){ms_charset = cs_charset;} - public void setReadBlock(Boolean b_block){ mb_readblock = b_block;} - public void clearRet() { ms_ret_code = ms_ret_date = ms_ret_server = ""; mi_ret_length = 0;} - public void clearParams() { ms_params = ""; } - public void addParams(String s_param_name, String s_data){ ms_params += ((s_param_name==null)?"":(s_param_name+": "))+s_data+"\r\n";} - public String getProperty(String s_porperty_name){ - if(s_porperty_name == null || s_porperty_name.length() <= 0) return ""; - if(ms_body.length() <= 0) return ""; - - int i_pt = ms_body.indexOf(s_porperty_name); - if(i_pt < 0) return ""; - - String s_data = ""; - try{ - String s_find = ms_body.substring(i_pt+s_porperty_name.length()+1); - if(s_find.length() > 0){ - - i_pt = s_find.indexOf("\r\n"); - if(i_pt >= 0) s_data = s_find.substring(0,i_pt); - else s_data = s_find; - - } - }catch(Exception e){} - - return s_data.trim(); - } - - //////////////////////////////////// - private String getPropertyOnLine(String s_line, String s_porperty_name){ - if(s_line == null || s_line.length() <= 0) return ""; - if(s_porperty_name == null || s_porperty_name.length() <= 0) return ""; - - String s_data = ""; - int i_pt = s_line.indexOf(s_porperty_name); - if(i_pt == 0) s_data = s_line.substring(s_porperty_name.length()); - return s_data.trim(); - }; - - //////////////////////////////////// - private int iGetOnLine(byte[] bs_buf){ - if(mx_bis == null) return -1; - Arrays.fill(bs_buf, (byte) 0 ); - - int i = 0; - for(i =0 ; i < bs_buf.length ; i++){ - try{ - int i_ret = mx_bis.read(); - if(i_ret == -1 && i == 0) return -1; - if(i_ret == -1 || i_ret == '\n'){ - if(bs_buf[i-1] == '\r'){ - bs_buf[i-1] = (byte)0; - i--; - } - break; - } - bs_buf[i] = (byte)i_ret; - }catch (IOException e){ - ms_error = "getting packet error : "+e.getMessage(); - return -1; - } - } - return i; - } - - /* - //////////////////////////////////// - private boolean fiLog(String s_mesg){ - boolean b_retu = false; - - FileWriter fstream = null; - BufferedWriter fbw = null; - try{ - fstream = new FileWriter(LOG_PATH,true); - fbw = new BufferedWriter(fstream); - fbw.write(s_mesg); - fbw.newLine(); - }catch (IOException e){ } - - try{ - if(fbw !=null) fbw.close(); - if(fstream !=null) fstream.close(); - b_retu = true; - }catch (Exception e){} - return b_retu; - }; - //////////////////////////////////// - */ -} - diff --git a/src/main/java/cmm/web/CmmController.java b/src/main/java/cmm/web/CmmController.java deleted file mode 100644 index 33e1f751..00000000 --- a/src/main/java/cmm/web/CmmController.java +++ /dev/null @@ -1,1687 +0,0 @@ -package cmm.web; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import kccf.res.service.ResourcesService; -import kccf.sch.service.vo.SearchVO; - -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringUtils; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.util.FileCopyUtils; -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 org.springframework.web.servlet.ModelAndView; - -import cmm.Constant; -import cmm.service.CmmAmsDocTableOfContentsVO; -import cmm.service.CmmApiService; -import cmm.service.CmmFileService; -import cmm.service.CmmService; -import cmm.service.ExtService; -import cmm.service.FileDetailVO; -import cmm.util.CmmUtil; -import cmm.util.CmmVO; -import cmm.util.DataMap; -import cmm.util.MessageAlertUtil; -import egovframework.com.cmm.ComDefaultCodeVO; -//import egovframework.com.cmm.EgovMessageSource; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.property.EgovPropertyService; -import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; - -/** - * @Class Name : CmmController.java - * @author ecplaza - * @since 2018-04-17 - * @version 1.0 - */ -@Controller -public class CmmController { - /** LOGGER */ - private static final Logger LOGGER = LoggerFactory.getLogger(CmmController.class); - - /** EgovPropertyService */ - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - -// @Resource(name="egovMessageSource") -// EgovMessageSource egovMessageSource; -// - @Resource(name = "cmmFileService") - private CmmFileService cmmFileService; - - /** extService */ - @Resource(name = "extService") - private ExtService extService; - - /** cmmApiService */ - @Resource(name = "cmmApiService") - private CmmApiService cmmApiService; - - /** cmmService */ - @Resource(name = "cmmService") - private CmmService cmmService; - - /** EgovCmmUseService */ - @Resource(name = "EgovCmmUseService") - private EgovCmmUseService cmmUseService; - - /** resourcesService */ - @Resource(name = "resourcesService") - private ResourcesService resourcesService; - - @RequestMapping(value="/cmm/downloadFile.do") - public void cvplFileDownload(HttpServletRequest request, HttpServletResponse response) throws IOException, EgovBizException { - - String atchFileId = request.getParameter("atchFileId"); - String fileSn = request.getParameter("fileSn"); - - FileDetailVO paramVO = new FileDetailVO(); - paramVO.setAtchFileId(atchFileId); - paramVO.setFileSn(fileSn); - FileDetailVO fileDetailVO = cmmFileService.selectFileDetail(paramVO); - - File uFile = new File(fileDetailVO.getFileStreCours(), fileDetailVO.getStreFileNm()); - long fSize = uFile.length(); - - if (fSize > 0) { - String mimetype = "application/x-msdownload"; - - response.setContentType(mimetype); - setDisposition(fileDetailVO.getOrignlFileNm(), request, response); - //response.setContentLength(fSize); - - BufferedInputStream in = null; - FileInputStream fis = null; - BufferedOutputStream out = null; - - try { - - fis = new FileInputStream(uFile); - in = new BufferedInputStream(fis); - out = new BufferedOutputStream(response.getOutputStream()); - - FileCopyUtils.copy(in, out); - out.flush(); - } catch (IOException ioe) { - LOGGER.error("Error in cvplFileDownload()", ioe); - } catch (NullPointerException npe) { - LOGGER.error("Error in cvplFileDownload()", npe); - } finally { - if (fis != null) { - try { - fis.close(); - } catch (IOException ioe) { - LOGGER.error("Error in cvplFileDownload()", ioe); - } - } - if (in != null) { - try { - in.close(); - } catch (IOException ioe) { - LOGGER.error("Error in cvplFileDownload()", ioe); - } - } - if (out != null) { - try { - out.close(); - } catch (IOException ioe) { - LOGGER.error("Error in cvplFileDownload()", ioe); - } - } - } - - } else { - MessageAlertUtil.alertBack("파일이 존재하지 않습니다." , response); - } - } - - @RequestMapping("/cmm/selectIconFileDownLoad.do") - public String selectIconFileDownLoad(@ModelAttribute("searchVO") FileDetailVO fileVO, @RequestParam Map commandMap, ModelMap model) throws IOException, EgovBizException { - String atchFileId = (String)commandMap.get("param_atchFileId"); - List result = cmmFileService.selectIconFileDownLoad(atchFileId); - model.addAttribute("fileList", result); - model.addAttribute("fileListCnt", result.size()); - model.addAttribute("atchFileId", atchFileId); - return "kdm/cmm/cmmIconFileList"; - } - - @RequestMapping(value="/cmm/cmmSigunguList.do") - public ModelAndView selectCmmSigunguList(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - model.addAttribute("resultList", extService.selectExtSigunguList(paramMap)); - - return modelAndView; - } - - @RequestMapping(value="/cmm/cmmSigunguList2.do") - public ModelAndView selectCmmSigunguList2(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - model.addAttribute("resultList", extService.selectExtSigunguList2(paramMap)); - - return modelAndView; - } - - @RequestMapping(value="/cmm/cmmGisSigunguList.do") - public ModelAndView selectCmmGisSigunguList(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - model.addAttribute("resultList", extService.selectExtGisSigunguList(paramMap)); - - return modelAndView; - } - - @RequestMapping(value="/cmm/cmmGisSigunguList2.do") - public ModelAndView selectCmmGisSigunguList2(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - model.addAttribute("resultList", extService.selectExtGisSigunguList(paramMap)); - - return modelAndView; - } - - @RequestMapping(value="/cmm/cmmGisDongList.do") - public ModelAndView selectCmmGisDongList(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - model.addAttribute("resultList", extService.selectExtGisDongList(paramMap)); - - return modelAndView; - } - - @RequestMapping(value="/cmm/cmmJusoCheck.do") - public ModelAndView jusoCheck(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws EgovBizException{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - String addr = paramMap.getString("localSido") + " " + paramMap.getString("localSigungu") + " " + paramMap.getString("localDong"); - paramMap.clear(); - paramMap.setString("juso", addr); - DataMap rtnMap = cmmApiService.getNaverApiJuso(paramMap); - model.addAttribute("resultData", rtnMap); - - return modelAndView; - } - @RequestMapping(value="/cmm/cmmPscHstTotCnt.do") - public void selectCmmPscHstTotCnt(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException{ - DataMap paramMap = DataMap.getParamMap(request); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - String successYn = "N"; - - int cnt = 0; - try { - cnt = cmmService.selectCmmPscHstTotCnt(paramMap); - successYn = "Y"; - } catch (EgovBizException e) { - LOGGER.error("Error in selectCmmPscHstTotCnt()", e); - } - - JSONObject jsonObj = new JSONObject(); - jsonObj.put("successYn", successYn); - jsonObj.put("cnt", cnt); - - - response.setContentType("text/html; charset=utf-8"); - response.setDateHeader("Expires", -1); - response.setHeader("Pragma", "no-cahce"); - response.setHeader("Cache-Control", "no-store"); // HTTP 1.0 - response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1 - - response.getWriter().write(jsonObj.toString()); - } - - @RequestMapping(value="/cmm/regCmmPscHst.do") - public void insertCmmPscHst(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException{ - DataMap paramMap1 = DataMap.getParamMap(request); - DataMap paramMap2 = DataMap.getParamMap(request); - DataMap paramMap3 = DataMap.getParamMap(request); - - paramMap1.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap1.setString("sidoName", paramMap1.getString("localSido1")); - paramMap1.setString("sigunguName", paramMap1.getString("localSigungu1")); - - paramMap2.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap2.setString("sidoName", paramMap2.getString("localSido2")); - paramMap2.setString("sigunguName", paramMap2.getString("localSigungu2")); - - paramMap3.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap3.setString("sidoName", paramMap3.getString("localSido3")); - paramMap3.setString("sigunguName", paramMap3.getString("localSigungu3")); - - String successYn = "N"; - String addr = ""; - - try { - - addr = paramMap1.getString("localSido1") + "|" + paramMap1.getString("localSigungu1") + "^"; - addr = addr + paramMap2.getString("localSido2") + "|" + paramMap2.getString("localSigungu2") + "^"; - addr = addr + paramMap3.getString("localSido3") + "|" + paramMap3.getString("localSigungu3"); - - paramMap1.setInt("sortOrdr", 1); - if(cmmService.selectCmmPscHstTotCnt(paramMap1)>0){ - cmmService.updateCmmPscHst(paramMap1); - }else{ - cmmService.insertCmmPscHst(paramMap1); - } - - paramMap2.setInt("sortOrdr", 2); - if(cmmService.selectCmmPscHstTotCnt(paramMap2)>0){ - cmmService.updateCmmPscHst(paramMap2); - }else{ - cmmService.insertCmmPscHst(paramMap2); - } - - paramMap3.setInt("sortOrdr", 3); - if(cmmService.selectCmmPscHstTotCnt(paramMap3)>0){ - cmmService.updateCmmPscHst(paramMap3); - }else{ - cmmService.insertCmmPscHst(paramMap3); - } - - CmmUtil.removeCookie(request, response, CmmUtil.getCookie(request, propertiesService.getString("kccf.cookie.addr.key"))); - //CmmUtil.removeCookie(request, response, CmmUtil.getCookie(request, propertiesService.getString("kccf.cookie.pscType.key"))); - CmmUtil.setEncoderCookie(response, propertiesService.getString("kccf.cookie.addr.key"), addr); - //CmmUtil.setEncoderCookie(response, propertiesService.getString("kccf.cookie.pscType.key"), paramMap.getString("pscType")); - - successYn = "Y"; - } catch (PatternSyntaxException ex1) { - LOGGER.error("Error in insertCmmPscHst()", ex1); - } catch (EgovBizException ex2) { - LOGGER.error("Error in insertCmmPscHst()", ex2); - } - - JSONObject jsonObj = new JSONObject(); - jsonObj.put("successYn", successYn); - - - response.setContentType("text/html; charset=utf-8"); - response.setDateHeader("Expires", -1); - response.setHeader("Pragma", "no-cahce"); - response.setHeader("Cache-Control", "no-store"); // HTTP 1.0 - response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1 - - response.getWriter().write(jsonObj.toString()); - } - - @RequestMapping(value="/cmm/regCmmPscHst-data.do") - public String insertCmmPscHstAjax(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException{ - DataMap paramMap = DataMap.getParamMap(request); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap.setString("sidoName", paramMap.getString("localSido")); - paramMap.setString("sigunguName", paramMap.getString("localSigungu")); - - String addr = ""; - try { - - addr = paramMap.getString("localSido") + "|" + paramMap.getString("localSigungu"); - if(cmmService.selectCmmPscHstTotCnt(paramMap)>0){ - cmmService.updateCmmPscHst(paramMap); - }else{ - cmmService.insertCmmPscHst(paramMap); - } - - CmmUtil.removeCookie(request, response, CmmUtil.getCookie(request, propertiesService.getString("kccf.cookie.addr.key"))); - CmmUtil.removeCookie(request, response, CmmUtil.getCookie(request, propertiesService.getString("kccf.cookie.pscType.key"))); - CmmUtil.setEncoderCookie(response, propertiesService.getString("kccf.cookie.addr.key"), addr); - CmmUtil.setEncoderCookie(response, propertiesService.getString("kccf.cookie.pscType.key"), paramMap.getString("pscType")); - - - int pscHstCnt = 0; - DataMap pscHstMap = cmmService.selectCmmPscHstDetail(paramMap); - List sigunguList = null; - if(pscHstMap != null){ - pscHstCnt = 1; - paramMap.clear(); - paramMap.setString("sido", pscHstMap.getString("sidoName")); - sigunguList = extService.selectExtSigunguList(paramMap); - } - model.addAttribute("pscHstCnt", pscHstCnt); - model.addAttribute("pscHst", pscHstMap); - model.addAttribute("pscHstSigunguList", sigunguList); - - } catch (PatternSyntaxException ex1) { - LOGGER.error("Error in insertCmmPscHst()", ex1); - } catch (EgovBizException ex2) { - LOGGER.error("Error in insertCmmPscHst()", ex2); - } - - return "kccf/cmm/userSetPopupAjax.jsp"; - } - - @RequestMapping(value="/cmm/cmmActivityHstAllListTotCnt.do") - public ModelAndView selectCmmActivityHstAllListTotCnt(ModelMap model, HttpServletRequest request, HttpServletResponse response) { - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - String successYn = "N"; - - List resultList = null; - try { - resultList = cmmService.selectCmmActivityHstAllListTotCnt(paramMap); - successYn = "Y"; - } catch (EgovBizException e) { - LOGGER.error("Error in selectCmmActivityHstAllListTotCnt()", e); - } - model.addAttribute("successYn", successYn); - model.addAttribute("resultList", resultList); - return modelAndView; - } - @RequestMapping(value="/cmm/regCmmScrap.do") - public void insertCmmScrap(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException{ - DataMap paramMap = DataMap.getParamMap(request); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap.setString("contentId", paramMap.getString("cId")); - paramMap.setString("contentType", paramMap.getString("cType")); - - String keyName = "contentId"; - if(Constant.CONTENT_TYPE_G.equals(paramMap.getString("contentType")) - || Constant.CONTENT_TYPE_I.equals(paramMap.getString("contentType")) - || Constant.CONTENT_TYPE_P.equals(paramMap.getString("contentType")) ){ - keyName = "targetId"; - } - paramMap.setString("linkUrl", paramMap.getString("lUrl") + "?"+keyName+"="+paramMap.getString("contentId")); - - String successYn = "Y"; - String resultCode = "01"; - try { - if("on".equals(paramMap.getString("already"))){ - if(cmmService.selectCmmScrapCnt(paramMap)<1){ - successYn = "N"; - resultCode = "98"; - }else{ - cmmService.deleteCmmScrapInfo(paramMap); - } - }else{ - // 다른곳에서 등록시에는 불이 안들어온 상태로 DB에만 등록되어있어서 체크 해야함. - if(cmmService.selectCmmScrapCnt(paramMap)>0){ - successYn = "N"; - resultCode = "99"; - }else{ - resultCode = "00"; - cmmService.insertCmmScrap(paramMap); - } - } - } catch (EgovBizException e) { - LOGGER.error("Error in insertCmmScrap()", e); - } - JSONObject jsonObj = new JSONObject(); - jsonObj.put("successYn", successYn); - jsonObj.put("resultCode", resultCode); - - response.setContentType("text/html; charset=utf-8"); - response.setDateHeader("Expires", -1); - response.setHeader("Pragma", "no-cahce"); - response.setHeader("Cache-Control", "no-store"); // HTTP 1.0 - response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1 - - response.getWriter().write(jsonObj.toString()); - } - @RequestMapping(value="/cmm/regCmmRecentlyView.do") - public void insertCmmRecentlyView(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException{ - DataMap paramMap = DataMap.getParamMap(request); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap.setString("contentId", paramMap.getString("cId")); - paramMap.setString("contentType", paramMap.getString("cType")); - paramMap.setString("linkUrl", paramMap.getString("lUrl")); - - String successYn = "N"; - try { - cmmService.insertCmmActivityHst(paramMap); - successYn = "Y"; - } catch (EgovBizException e) { - LOGGER.error("Error in insertCmmRecentlyView()", e); - } - JSONObject jsonObj = new JSONObject(); - jsonObj.put("successYn", successYn); - - response.setContentType("text/html; charset=utf-8"); - response.setDateHeader("Expires", -1); - response.setHeader("Pragma", "no-cahce"); - response.setHeader("Cache-Control", "no-store"); // HTTP 1.0 - response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1 - - response.getWriter().write(jsonObj.toString()); - } - @RequestMapping(value="/cmm/regSatisfaction.do") - public ModelAndView insertSatisfaction(ModelMap model, HttpServletRequest request, HttpServletResponse response) { - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - String satisfaction; - switch (paramMap.get("satisfaction").toString()){ - case "매우만족" : satisfaction="5"; - break; - case "만족" : satisfaction="4"; - break; - case "보통" : satisfaction="3"; - break; - case "불만족" : satisfaction="2"; - break; - default: satisfaction="1"; - break; - } - paramMap.setString("contentId", paramMap.get("contentId").toString()); - paramMap.setString("jsessionId", CmmUtil.getCookieId(request)); - paramMap.setString("stsfdg", satisfaction); //만족도 - paramMap.setString("stsfdgCnt", paramMap.get("satisfactionText").toString()); - paramMap.setString("contentType", paramMap.get("type").toString()); - String successYn = "N"; - try { - if(cmmService.selectSatisfactionTotCnt(paramMap) > 0){ - successYn = "Y"; - }else{ - cmmService.insertSatisfaction(paramMap); - successYn = "N"; - } - } catch (EgovBizException e) { - LOGGER.error("Error in insertSatisfaction()", e); - } - - model.addAttribute("successYn", successYn); - return modelAndView; - } - - - @RequestMapping(value="/cmm/cmmAmsAssetMediaList.do") - public String selectCmmAmsAssetMediaList( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - - //paramMap.setString("aId", paramMap.getString("aId")); - //cmmVO.setaId(paramMap.getString("aId")); - - // 스크랩 여부 키 - paramMap.setString("sessionId", CmmUtil.getCookieId(req)); - - model.addAttribute("paramVO", cmmVO); // 파라미터 - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - // ams nfs 파일 경로 - CmmUtil.setNfsPathModelMap(req,model); - - - return "/kccf/cmm/layerMediaListAjax"; - } - - - /** - * AMS ASSETS 상세 정보 - * pick 레이어 에셋의 상세정보 : 모든 데이터 - * @param cmmVO - * @param model - * @param commandMap - * @param req - * @param res - * @return - * @throws EgovBizException - */ - @RequestMapping(value="/cmm/cmmAmsAssetsPick.do") - public String selectCmmAmsAssetsPick( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - LOGGER.info("selectCmmAmsAssetsPick() paramMap={}", paramMap); - - //paramMap.setString("aId", paramMap.getString("aId")); - //cmmVO.setaId(paramMap.getString("aId")); - - // 스크랩 여부 키 - paramMap.setString("sessionId", CmmUtil.getCookieId(req)); - - // Asset 상세정보 : 죄측 상단 및 상세 - DataMap cmmAmsAssetsDetail = cmmService.selectCmmAmsAssetsDetail(paramMap); - model.addAttribute("cmmAmsAssetsDetail", cmmAmsAssetsDetail); - - // 다른문화원 소장자료 목록 정보를 가져오기 위한 맵핑 - paramMap.setString("sojangCouncil", cmmAmsAssetsDetail.getString("sojangCouncil")); // 소장문화원 - - // AssetMedia 그룹 목록 : 좌측 목록 Cnt - List cmmAmsAssetsMediaGroupListCnt = cmmService.selectCmmAmsAssetsMediaGroupListCnt(paramMap); - model.addAttribute("cmmAmsAssetsMediaGroupListCnt", cmmAmsAssetsMediaGroupListCnt); - - // AssetMedia 그룹 목록 : 좌측 목록 - List cmmAmsAssetsMediaGroupList = cmmService.selectCmmAmsAssetsMediaGroupList(paramMap); - model.addAttribute("cmmAmsAssetsMediaGroupList", cmmAmsAssetsMediaGroupList); - - /**** 연속자료 paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmVO.getPageUnit()); - paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmVO.getMobilePageSize() : cmmVO.getPageSize()); - - cmmVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** 연속자료 paging ****/ - - int totCnt = 0; - DataMap cmmAmsAssetsMediaDetail = null; - List cmmAmsAssetsContinueList = null; - List tagsListResult = null; - - // 화면에서 mId 값 넘어오면(지역문화Pick 유형별 목록) 넘어온 값 사용하도록 수정 (2019.10.16) - String mediaId = paramMap.getString("mId"); - if (StringUtils.isEmpty(mediaId)) { - // 화면에서 mId 값 넘어오지 않는 경우 (지역문화Pick 지역별 목록) - if(cmmAmsAssetsMediaGroupList != null && cmmAmsAssetsMediaGroupList.size()>0) { - mediaId = cmmAmsAssetsMediaGroupList.get(0).getString("id"); // 0번째의 미디어 아이디 - } - } - LOGGER.info("selectCmmAmsAssetsPick() mediaId={}", mediaId); - - if(StringUtils.isNotEmpty(mediaId)){ - // 미디어 ID 맵핑 - if (StringUtils.isEmpty(paramMap.getString("mId"))) paramMap.setString("mId", mediaId); - cmmVO.setmId(paramMap.getString("mId")); - - // 에셋 미디어 상세정보(원문보기 쪽 상세정보) - cmmAmsAssetsMediaDetail = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - // 문서 목차정보 파싱 - List tableOfContentsList = CmmUtil.parseTableOfContents(cmmAmsAssetsMediaDetail.getString("tableOfContents")); - cmmAmsAssetsMediaDetail.put("tableOfContentsList", tableOfContentsList); - */ - - // 연관태그목록 - tagsListResult = cmmService.selectCmmAmsAssetsTagsList(paramMap); - model.addAttribute("cmmAmsAssetsTagsList", tagsListResult); - - // 연속자료 총 수 - totCnt = cmmService.selectCmmAmsAssetsContinueListTotCnt(cmmVO); - // 연속자료 목록 - cmmAmsAssetsContinueList = cmmService.selectCmmAmsAssetsContinueList(cmmVO); - } - // 상세정보 - model.addAttribute("cmmAmsAssetsMediaDetail", cmmAmsAssetsMediaDetail); - - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - // 문서 원문보기 OCR 목록 (2019.10.04) - if (cmmAmsAssetsMediaDetail != null && cmmAmsAssetsMediaDetail.getInt("ocrSplitNum") > 1) { - model.addAttribute("cmmAmsAssetsMediaOcrList", cmmService.selectCmmAmsAssetsMediaOcrList(paramMap)); - } - */ - - // 연속자료 페이징 오브젝트 - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - model.addAttribute("cmmAmsAssetsContinueList", cmmAmsAssetsContinueList); // 연속자료 목록 - - - // 연관 지역문화 이야기 - List cmsTag = new ArrayList(); - for(int i = 0; i < tagsListResult.size() ; i++){ - cmsTag.add(tagsListResult.get(i).get("tagsName") ); - } - List themesResult = cmmService.selectCmmAmsAssetsThemesContentsList(cmsTag); - model.addAttribute("cmmAmsAssetsThemesContentsList",themesResult); - - - // 문화원의 다른 소장자료 목록 - List diffSojangListResult = cmmService.selectCmmAmsAssetsDiffSojangList(paramMap); - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - for (int i=0; diffSojangListResult!=null && i diffSojangTableOfContentsList = CmmUtil.parseTableOfContents(diffSojang.getString("tableOfContents")); - diffSojang.put("tableOfContentsList", diffSojangTableOfContentsList); - - // 문서 원문보기 OCR 목록 - if (diffSojang.getInt("ocrSplitNum") > 1) { - diffSojang.put("mediaOcrList", cmmService.selectCmmAmsAssetsMediaOcrList(paramMap)); - } -// LOGGER.info("selectCmmAmsAssetsPick() diffSojangListResult... i={}, diffSojang.get(\"tableOfContentsLis\")=", i, diffSojang.get("tableOfContentsList")); - } - */ - model.addAttribute("cmmAmsAssetsDiffSojangList", diffSojangListResult); - - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - // 문서 목차정보 파싱 - List tableOfContentsList = CmmUtil.parseTableOfContents(cmmAmsAssetsMediaDetail.getString("tableOfContents")); - cmmAmsAssetsMediaDetail.put("tableOfContentsList", tableOfContentsList); - */ - - paramMap.setString("jsessionId", CmmUtil.getCookieId(req)); - paramMap.setString("contentId", paramMap.getString("mId")); - paramMap.setString("contentType", Constant.CONTENT_TYPE_A); - cmmService.insertCmmActivityHst(paramMap); - - model.addAttribute("paramVO", cmmVO); // 파라미터 - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - // ams nfs 파일 경로 - CmmUtil.setNfsPathModelMap(req,model); - // jsi 값 세팅 - model.addAttribute("jsi", CmmUtil.getCookieId(req)); - - return "/kccf/cmm/layerAmsAssetsPickAjax"; - } - //AMS 미디어 목록 상세 레이어(PICK) : Ajax - @RequestMapping(value="/cmm/cmmAmsAssetsPickDetail.do") - public String selectCmmAmsAssetsPickDetail( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - - //paramMap.setString("aId", paramMap.getString("aId")); - //cmmVO.setaId(paramMap.getString("aId")); - //paramMap.setString(mId", paramMap.getString("mId")); - //cmmVO.setaId(paramMap.getString("mId")); - - // 스크랩 여부 키 - paramMap.setString("sessionId", CmmUtil.getCookieId(req)); - - // Asset 상세정보(죄측 상단 및 상세) - DataMap cmmAmsAssetsDetail = cmmService.selectCmmAmsAssetsDetail(paramMap); - model.addAttribute("cmmAmsAssetsDetail", cmmAmsAssetsDetail); - - // 다른문화원 소장자료 목록 정보를 가져오기 위한 맵핑 - paramMap.setString("sojangCouncil", cmmAmsAssetsDetail.getString("sojangCouncil")); // 소장문화원 - - // 에셋 미디어 상세정보(원문보기 쪽 상세정보) - DataMap cmmAmsAssetsMediaDetail = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - model.addAttribute("cmmAmsAssetsMediaDetail", cmmAmsAssetsMediaDetail); - - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - // 문서 목차정보 파싱 - List tableOfContentsList = CmmUtil.parseTableOfContents(cmmAmsAssetsMediaDetail.getString("tableOfContents")); - cmmAmsAssetsMediaDetail.put("tableOfContentsList", tableOfContentsList); - - // 문서 원문보기 OCR 목록 (2019.10.04) - if (cmmAmsAssetsMediaDetail != null && cmmAmsAssetsMediaDetail.getInt("ocrSplitNum") > 1) { - model.addAttribute("cmmAmsAssetsMediaOcrList", cmmService.selectCmmAmsAssetsMediaOcrList(paramMap)); - } - */ - - // 연관태그목록 - List tagsListResult = cmmService.selectCmmAmsAssetsTagsList(paramMap); - model.addAttribute("cmmAmsAssetsTagsList", tagsListResult); - - /**** 연속자료 paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmVO.getPageUnit()); - paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmVO.getMobilePageSize() : cmmVO.getPageSize()); - - cmmVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** 연속자료 paging ****/ - - // 미디어 ID 맵핑 - cmmVO.setmId(paramMap.getString("mId")); - // 연속자료 총 수 - int totCnt = cmmService.selectCmmAmsAssetsContinueListTotCnt(cmmVO); - // 연속자료 목록 - model.addAttribute("cmmAmsAssetsContinueList", cmmService.selectCmmAmsAssetsContinueList(cmmVO)); - // 연속자료 페이징 오브젝트 - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - // 연관 지역문화 이야기 - List cmsTag = new ArrayList(); - for(int i = 0; i < tagsListResult.size() ; i++){ - cmsTag.add(tagsListResult.get(i).get("tagsName") ); - } - List themesResult = cmmService.selectCmmAmsAssetsThemesContentsList(cmsTag); - model.addAttribute("cmmAmsAssetsThemesContentsList",themesResult); - - // 문화원의 다른 소장자료 목록 - List diffSojangListResult = cmmService.selectCmmAmsAssetsDiffSojangList(paramMap); - /* 목차 정보가 많을 경우 select box에 표시하기 어려움 - 뷰어 띄울 때 목차 표시하도록 변경할 예정 - for (int i=0; diffSojangListResult!=null && i diffSojangTableOfContentsList = CmmUtil.parseTableOfContents(diffSojang.getString("tableOfContents")); - diffSojang.put("tableOfContentsList", diffSojangTableOfContentsList); - - // 문서 원문보기 OCR 목록 - if (diffSojang.getInt("ocrSplitNum") > 1) { - diffSojang.put("mediaOcrList", cmmService.selectCmmAmsAssetsMediaOcrList(paramMap)); - } -// LOGGER.info("selectCmmAmsAssetsPickDetail() diffSojangListResult... i={}, diffSojang.get(\"tableOfContentsLis\")=", i, diffSojang.get("tableOfContentsList")); - } - */ - model.addAttribute("cmmAmsAssetsDiffSojangList", diffSojangListResult); - - - paramMap.setString("jsessionId", CmmUtil.getCookieId(req)); - paramMap.setString("contentId", paramMap.getString("mId")); - paramMap.setString("contentType", Constant.CONTENT_TYPE_A); - cmmService.insertCmmActivityHst(paramMap); - - // 관심지역 정보 - model.addAttribute("pscHst", cmmService.selectCmmPscHstDetail(paramMap)); - - model.addAttribute("paramVO", cmmVO); // 파라미터 - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - // ams nfs 파일 경로 - CmmUtil.setNfsPathModelMap(req,model); - - return "/kccf/cmm/layerAmsAssetsPickDetailAjax"; - } - //AMS 미디어 목록 상세 레이어(PICK) : 연속자료 목록: Ajax - @RequestMapping(value="/cmm/cmmAmsAssetsPickContinueList.do") - public String selectCmmAmsAssetsPickContinueList( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - - // 스크랩 여부 키 - paramMap.setString("sessionId", CmmUtil.getCookieId(req)); - - // Asset 상세정보(죄측 상단 및 상세) - DataMap cmmAmsAssetsDetail = cmmService.selectCmmAmsAssetsDetail(paramMap); - model.addAttribute("cmmAmsAssetsDetail", cmmAmsAssetsDetail); - - // 에셋 미디어 상세정보(원문보기 쪽 상세정보) - DataMap cmmAmsAssetsMediaDetail = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - model.addAttribute("cmmAmsAssetsMediaDetail", cmmAmsAssetsMediaDetail); - - - /**** 연속자료 paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmVO.getPageUnit()); - paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmVO.getMobilePageSize() : cmmVO.getPageSize()); - - cmmVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** 연속자료 paging ****/ - - // 연속자료 총 수 - int totCnt = cmmService.selectCmmAmsAssetsContinueListTotCnt(cmmVO); - // 연속자료 목록 - model.addAttribute("cmmAmsAssetsContinueList", cmmService.selectCmmAmsAssetsContinueList(cmmVO)); - // 연속자료 페이징 오브젝트 - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - // 관심지역 정보 - model.addAttribute("pscHst", cmmService.selectCmmPscHstDetail(paramMap)); - model.addAttribute("paramVO", cmmVO); // 파라미터 - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - // ams nfs 파일 경로 - CmmUtil.setNfsPathModelMap(req,model); - - return "/kccf/cmm/layerAmsAssetsPickContinueListAjax"; - } - // 미디어 기준의 목록(레이어 원문보기용) - @RequestMapping(value="/cmm/cmmAmsAssetsOriginViewList.do") - public String selectCmmAmsAssetsOriginViewList( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - - paramMap.setString("aid", paramMap.getString("aId")); - paramMap.setString("mid", paramMap.getString("mId")); - - // AssetMedia 목록 - String rsUrl = ""; - String assetType = ""; - if(Constant.M_TYPE_I.equals(paramMap.getString("mType"))){ - // 이미지 - rsUrl = "/kccf/cmm/layerImgAjax"; - assetType = Constant.M_TYPE_ARRAY[0]; - } else if(Constant.M_TYPE_V.equals(paramMap.getString("mType"))){ - // 비디오 - rsUrl = "/kccf/cmm/layerVideoAjax"; - assetType = Constant.M_TYPE_ARRAY[1]; - } else if(Constant.M_TYPE_A.equals(paramMap.getString("mType"))){ - // 오디오 - rsUrl = "/kccf/cmm/layerAudioAjax"; - assetType = Constant.M_TYPE_ARRAY[2]; - } - - paramMap.setString("assetType", assetType); - model.addAttribute("mType", paramMap.getString("mType")); - model.addAttribute("pageIndex", 1); - model.addAttribute("lastPageNo", 1); - - model.addAttribute("cmmOriginViewList", cmmService.selectCmmAmsAssetsOriginViewList(paramMap)); - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - - return rsUrl; - } - - - @RequestMapping(value="/cmm/cmmAmsAssetsOriginViewList-data.do") - public String selectCmmAmsAssetsOriginViewListData( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - - DataMap paramMap = DataMap.getParamMap(req); - model.addAttribute("paramVO",cmmVO); - paramMap.setString("uaType", Constant.UA_TYPE_A); - paramMap.setString("activityType", Constant.ACTIVITY_TYPE_B); - // 파라미터 맵핑 - - - - paramMap.setString("aid", paramMap.getString("aId")); - paramMap.setString("mid", paramMap.getString("mId")); - - // AssetMedia 목록 - String rsUrl = ""; - String assetType = ""; - if(Constant.M_TYPE_I.equals(paramMap.getString("mType"))){ - // 이미지 - rsUrl = "/kccf/cmm/layerImgAddAjax"; - assetType = Constant.M_TYPE_ARRAY[0]; - } else if(Constant.M_TYPE_V.equals(paramMap.getString("mType"))){ - // 비디오 - rsUrl = "/kccf/cmm/layerVideoAddAjax"; - assetType = Constant.M_TYPE_ARRAY[1]; - } else if(Constant.M_TYPE_A.equals(paramMap.getString("mType"))){ - // 오디오 - rsUrl = "/kccf/cmm/layerVideoAddAjax"; - assetType = Constant.M_TYPE_ARRAY[2]; - } - - - - paramMap.setString("assetType", assetType); - model.addAttribute("mType", paramMap.getString("mType")); - - - - /**** paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmVO.getPageUnit()); - paginationInfo.setPageSize(cmmVO.getPageSize()); - - cmmVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** paging ****/ - - paramMap.setInt("recordCountPerPage", paginationInfo.getRecordCountPerPage()); - paramMap.setInt("firstIndex", paginationInfo.getFirstRecordIndex()); - paramMap.setInt("lastIndex", paginationInfo.getLastRecordIndex()); - - int totCnt = cmmService.selectCmmAmsAssetsOriginViewListAjaxCnt(paramMap); - model.addAttribute("totCnt", totCnt); - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - model.addAttribute("lastPageNo", paginationInfo.getLastPageNo()); - - - - model.addAttribute("cmmOriginViewList", cmmService.selectCmmAmsAssetsOriginViewListAjax(paramMap)); - - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - - - return rsUrl; - } - - - - - - - - - - - - - - // 미디어 기준의 상세(레이어 원문보기용) - @RequestMapping(value="/cmm/cmmAmsAssetsOriginViewDetail.do") - public ModelAndView selectCmmAmsAssetsOriginViewDetail( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - LOGGER.info("selectCmmAmsAssetsOriginViewDetail() start... req.getRequestURI()={}, req.getQueryString()={}", req.getRequestURI(), req.getQueryString()); - - DataMap paramMap = DataMap.getParamMap(req); - paramMap.setString("mid", paramMap.getString("mId")); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - DataMap responseMap = new DataMap(); - DataMap resultMap = cmmService.selectCmmAmsAssetsOriginViewDetail(paramMap); - responseMap.put("result", resultMap); - - - // 미디어 활동이력 (원문보기 이력) 등록 (2019.08.26) - DataMap hstParamMap = new DataMap(); - hstParamMap.put("jsessionId", CmmUtil.getCookieId(req)); - hstParamMap.put("contentId", paramMap.getString("mId")); - hstParamMap.put("assetType", resultMap.getString("assetType")); - hstParamMap.put("linkUrl", req.getRequestURI()+"?"+req.getQueryString()); - hstParamMap.put("uaType", CmmUtil.isMobile(req) ? Constant.UA_TYPE_M : Constant.UA_TYPE_W); - cmmService.insertCmmActivityMediaHst(hstParamMap); - - - model.addAttribute("responseData", responseMap); - return modelAndView; - } - - @RequestMapping(value="/cmm/imageSrc.do") - public String cmmSmartEditorImageView(HttpServletRequest request, HttpServletResponse response) { - return "egovframework/cmm/cmmSmartEditorImageView"; - } - private String getBrowser(HttpServletRequest request) { - String header = request.getHeader("User-Agent"); - if (header.indexOf("MSIE") > -1) { - return "MSIE"; - } else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지 - return "Trident"; - } else if (header.indexOf("Chrome") > -1) { - return "Chrome"; - } else if (header.indexOf("Opera") > -1) { - return "Opera"; - } - return "Firefox"; - } - private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws IOException { - String browser = getBrowser(request); - - String dispositionPrefix = "attachment; filename="; - String encodedFilename = null; - - if (browser.equals("MSIE")) { - encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20"); - } else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지 - encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20"); - } else if (browser.equals("Firefox")) { - encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\""; - } else if (browser.equals("Opera")) { - encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\""; - } else if (browser.equals("Chrome")) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < filename.length(); i++) { - char c = filename.charAt(i); - if (c > '~') { - sb.append(URLEncoder.encode("" + c, "UTF-8")); - } else { - sb.append(c); - } - } - encodedFilename = sb.toString(); - } else { - throw new IOException("Not supported browser"); - } - - response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename); - - if ("Opera".equals(browser)) { - response.setContentType("application/octet-stream;charset=UTF-8"); - } - } - /** - * response Cache - * @param response - */ - @SuppressWarnings("unused") - private void setResponseCacheControl(HttpServletResponse response){ - response.setContentType("text/html; charset=utf-8"); - response.setDateHeader("Expires", -1); - response.setHeader("Pragma", "no-cahce"); - response.setHeader("Cache-Control", "no-store"); // HTTP 1.0 - response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1 - } - - /** - * PDF 호출 - [RIS] 파일에 표시되는 URL (viewer에 관계없이 변하지 않는 URL 제공위해 생성) - * ex) /npdfView.do?npdf=R10692 - * - * npdf="미디어ID" (사용여부, 원문공개여부 모두 Y가 아니면 404 페이지) - * npdf="R+미디어인터페이스ID" (사용여부, 원문공개여부 모두 Y가 아니면 404 페이지) - * npdf="I+미디어인터페이스ID" (사용여부, 원문공개여부 모두 Y가 아니면 404 페이지) - * npdf="A+미디어인터페이스ID" (사용여부, 원문공개여부 관계없이 항상 뷰어 띄움) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value="/npdfView.do") - public String nPdfView(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception { - DataMap paramMap = DataMap.getParamMap(request); - String npdf = paramMap.getString("npdf"); // "R" + interfaceId - String pNumber = paramMap.getString("pn"); - if (StringUtils.isEmpty(npdf)) { - LOGGER.error("nPdfView() npdf is empty..."); - return "/code404.jsp"; - } - - String rfType = ""; // RIS일 경우 "R" (Constant.UA_TYPE_R) - String contentId = ""; // asset media id - if (npdf.startsWith(Constant.UA_TYPE_R) || npdf.startsWith("I") || npdf.startsWith("A")) { // npdf="R+인터페이스ID", npdf="I+인터페이스ID", npdf="A+인터페이스ID" - if (npdf.startsWith(Constant.UA_TYPE_R)) rfType = Constant.UA_TYPE_R; - - if (npdf.length() > 1) { - // interface_id 로 media_id 구하기 - DataMap mediaParamMap = new DataMap(); - mediaParamMap.put("interfaceId", npdf.substring(1)); - DataMap mediaMap = cmmService.selectCmmAmsAssetsMediaDetailByInterfaceId(mediaParamMap); - if (mediaMap != null) contentId = mediaMap.getString("id"); - } - } else { // mediaId만 넘긴 경우 (npdf="미디어ID") - contentId = npdf; - } - LOGGER.info("nPdfView() contentId={}, rfType={}", contentId, rfType); - - // searchData index (분할파일일 경우 default로 띄울 분할파일 index 값 (1부터 시작하는 값)) - //int sdIdx = paramMap.getInt("sd"); xss 때문에 아래처럼 수정 - - String sd = CmmUtil.clearXSS(paramMap.getString("sd")); // XSS 방지 - if(sd == "") sd = "0"; - int sdIdx = Integer.parseInt(sd); - - if (sdIdx == 0) sdIdx += 1; - LOGGER.info("nPdfView() sdIdx={}", sdIdx); - - String assetType = ""; -// String encData = ""; // 원본파일 사용할 경우 - String path = ""; // 분할파일 사용할 경우 - String title = ""; // 분할파일 사용할 경우 - String searchData = ""; // 분할파일 사용할 경우 (분할파알 중 default로 선택될 파일명) - String orginTitle = ""; - String ogData = ""; - - if (StringUtils.isNotEmpty(contentId)) { - String jsessionId = CmmUtil.getCookieId(request); - - // media 단건조회 - DataMap mediaParamMap = new DataMap(); - mediaParamMap.put("mId", contentId); - mediaParamMap.put("sessionId", jsessionId); - if (npdf.startsWith("A")){ - mediaParamMap.put("allView", "Y"); - } - DataMap mediaMap = cmmService.selectCmmAmsAssetsMediaDetail(mediaParamMap); - orginTitle = mediaMap.getString("title"); - ogData = mediaMap.getString("title")+"||"; - ogData = ogData + CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+request.getRequestURI()+"?"+request.getQueryString()+"||"; - - if (StringUtils.isNotEmpty(mediaMap.getString("mainImg"))){ - ogData = ogData + CmmUtil.getAssetImageUrl(mediaMap.getString("mainImg"))+"||"; - }else{ - ogData = ogData + "||"; - } - ogData = ogData + mediaMap.getString("sojangCouncilNm"); - - if (mediaMap != null) { - if ("N".equals(mediaMap.getString("useAt")) || "N".equals(mediaMap.getString("orgOpenAt"))) { - LOGGER.error("nPdfView() USE_AT=N or ORG_OPEN_AT=N ... npdf={}, mediaParamMap={}", npdf, mediaParamMap); - if (!npdf.startsWith("A")) return "/code404.jsp"; // npdf="A***" 형식일 때는 사용여부/원문공개여부 상관없이 항상 띄움 - } - assetType = mediaMap.getString("assetType"); - - String pdfViewerDelimiter = "||"; // pdf뷰어에서 사용하는 delimiter - String amsNasPath = CmmUtil.getPropertyStr(Constant.NFS_NAS_KEY); - - // 분할파일 정보 조회 - List ocrList = cmmService.selectCmmAmsAssetsMediaOcrList(mediaParamMap); - if (ocrList == null || ocrList.size() == 0) { - String streFileName = mediaMap.getString("streFileName"); - String filePath = CmmUtil.getPropertyStr(Constant.NFS_NAS_KEY)+CmmUtil.getPropertyStr(Constant.NFS_DOC_KEY); - if (streFileName.contains("/")) filePath = CmmUtil.getPropertyStr(Constant.NFS_NAS_KEY); - if (streFileName.startsWith(CmmUtil.getPropertyStr("ams.nas.root.path"))) filePath = ""; // ex) /nfs_nas/minio/amsweb-opt/pdf/***.pdf - - path += filePath + streFileName; - /* - // 암호화 문자열 생성 - 기존방식 (원본파일 하나 호출) - encData = FunctionTag.unidocsViewer(filePath, streFileName); - */ - - // 2019.12.27 수정작업 이후 - customLayout.jsp 사용하려면 반드시 searchData 값 존재해야 함 - searchData = FilenameUtils.getName(path); // 경로 제외한 파일명만 - - } else { - // sdIdx 값이 ocrList 크기를 벗어날 경우 첫번째 분할 파일 default로 보여주기 - if (sdIdx > ocrList.size()) sdIdx = 1; - - for (int i=0; i 0) path += pdfViewerDelimiter; - if (fileName.startsWith(CmmUtil.getPropertyStr("ams.nas.root.path"))) path += fileName; // ex) /nfs_nas/minio/amsweb-opt/pdf/***.pdf - else path += amsNasPath + fileName; // ex) 248/15/5064_divide1-1.pdf - - - if (i == (sdIdx-1)) { - searchData = fileName; - searchData = FilenameUtils.getName(path); // 경로 제외한 파일명만 - } - } - pNumber = "1"; //분할파일은 1페이지 부터 무조건 시작 - } - LOGGER.info("nPdfView() path={}", path); - LOGGER.info("nPdfView() searchData={}", searchData); - - // 문서 목차정보 파싱 - List tableOfContentsList = CmmUtil.parseTableOfContents(mediaMap.getString("tableOfContents")); - title = CmmUtil.makeTableOfContentsMarkup(tableOfContentsList, pdfViewerDelimiter); - LOGGER.info("nPdfView() title={}", title); - - /* - // 암호화 문자열 생성 - // PDFPath, downloadYn(true/false), printYn(true/false) - String download = "true"; - String print = "true"; - String annotation = "false"; - String[] param = new String[]{ java.net.URLEncoder.encode( path, "UTF-8" ), java.net.URLEncoder.encode( title, "UTF-8" ), download, print, annotation}; - encData = PDFInfoEncrypter.encrypt( param ); - LOGGER.info("nPdfView() encData={}", encData); - */ - } - - // 미디어 활동이력 (원문보기 이력) 등록 - DataMap hstParamMap = new DataMap(); - hstParamMap.put("jsessionId", jsessionId); - hstParamMap.put("contentId", contentId); - hstParamMap.put("assetType", assetType); - hstParamMap.put("linkUrl", request.getRequestURI()+"?"+request.getQueryString()); - String uaType = rfType; // rfType 값이 넘어온 경우 그대로 사용 - if (StringUtils.isEmpty(uaType)) { - if (CmmUtil.isMobile(request)) uaType = Constant.UA_TYPE_M; - else uaType = Constant.UA_TYPE_W; - } - hstParamMap.put("uaType", uaType); - cmmService.insertCmmActivityMediaHst(hstParamMap); - } - - /*if (StringUtils.isNotEmpty(encData)) { // 원본파일 열 경우 - 기존방식 사용 - String pdfPath = CmmUtil.getPropertyStr(Constant.PDF_VIEW_KEY); - return "redirect:"+pdfPath + "/customLayoutBasic.jsp?encdata="+encData; - - } else */ if (StringUtils.isNotEmpty(path)) { // prepareCustomLayout.jsp 에서 암호화 후 POST 전송 (직접 redirect 하면 "Request-URI Too Long" 에러 발생 - // 목차 + 분할파일 열 경우 및 원본파일 일 경우 모두 신규방식 사용 (2019.12.27) - request.setAttribute("path", path); - request.setAttribute("title", title); - request.setAttribute("searchData", searchData); - request.setAttribute("orginTitle", orginTitle); - request.setAttribute("ogData", ogData); - request.setAttribute("pNumber", pNumber); - - return "kccf/cmm/prepareCustomLayout"; - } else { - LOGGER.error("nPdfView() encData, path empty... npdf={}", npdf); - return "/code404.jsp"; - } - } - - /** - * 테스트용 PDF 호출 - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value="/cmm/pdfView.do") - public String cmmPdfView(HttpServletRequest request, HttpServletResponse response, ModelMap model) { - DataMap paramMap = DataMap.getParamMap(request); - String fileNm = paramMap.getString("fileNm"); - model.addAttribute("fileNm", fileNm); - return "/kccf/cmm/pdfTestView"; - } - /** - * 테스트용 vod 호출 (ams에서 동영상 확인위해 사용한다고 함) - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value="/cmm/vodView.do") - public String cmmVodView(HttpServletRequest request, HttpServletResponse response, ModelMap model) { - DataMap paramMap = DataMap.getParamMap(request); - - // 동영상파일명 - String fileNm = paramMap.getString("fileNm"); - model.addAttribute("fileNm", fileNm); - - // 자막파일명 - String sFileNm = paramMap.getString("sFileNm"); - model.addAttribute("sFileNm", sFileNm); - - return "/kccf/cmm/vodTestView"; - } - - - - /** - * 테스트용 audio 호출 - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value="/cmm/audioView.do") - public String cmmAudioView(HttpServletRequest request, HttpServletResponse response, ModelMap model) { - DataMap paramMap = DataMap.getParamMap(request); - String fileNm = paramMap.getString("fileNm"); - String fileNmOri = paramMap.getString("fileNmOri"); - model.addAttribute("fileNm", fileNm); - model.addAttribute("fileNmOri", fileNmOri); - return "/kccf/cmm/audioTestView"; - } - - // 미디어 활동이력 (원문보기 이력) 등록 (2019.08.26) - @RequestMapping(value="/cmm/regCmmMediaHst.do") - public ModelAndView insertCmmActivityMediaHst( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - LOGGER.info("insertCmmActivityMediaHst() start... req.getRequestURI()={}, req.getQueryString()={}", req.getRequestURI(), req.getQueryString()); - - DataMap paramMap = DataMap.getParamMap(req); - paramMap.setString("mid", paramMap.getString("mId")); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - DataMap responseMap = new DataMap(); - DataMap resultMap = cmmService.selectCmmAmsAssetsOriginViewDetail(paramMap); - responseMap.put("result", resultMap); - - - // 미디어 활동이력 (원문보기 이력) 등록 (2019.08.26) - DataMap hstParamMap = new DataMap(); - hstParamMap.put("jsessionId", CmmUtil.getCookieId(req)); - hstParamMap.put("contentId", paramMap.getString("mId")); - hstParamMap.put("assetType", resultMap.getString("assetType")); - hstParamMap.put("linkUrl", req.getRequestURI()+"?"+req.getQueryString()); - hstParamMap.put("uaType", CmmUtil.isMobile(req) ? Constant.UA_TYPE_M : Constant.UA_TYPE_W); - cmmService.insertCmmActivityMediaHst(hstParamMap); - - - model.addAttribute("responseData", hstParamMap); - return modelAndView; - } - - /** - * [상세검색] 레이어 - 지역문화원 정보 - * @param cmmVO - * @param model - * @param commandMap - * @param req - * @param res - * @return - * @throws Exception - */ - @RequestMapping(value="/cmm/cmmSearchLayerCouncilInfo-data.do") - public String selectCmmSearchLayerCouncilInfoAjax( - @ModelAttribute("searchVO") SearchVO searchVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws Exception { - DataMap paramMap = DataMap.getParamMap(req); - LOGGER.info("selectCmmCouncilInfoListAjax() paramMap={}, searchVO={}", paramMap, searchVO); - - ComDefaultCodeVO CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS018); - model.addAttribute("couSidoList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - List councilList = resourcesService.selectCouncilList(); - model.addAttribute("councilList", councilList); - - model.addAttribute("searchVO", searchVO); - - return "kccf/cmm/searchLayerCouncilAjax"; - } - - - - @RequestMapping(value="/cmm/risDownloadFile.do") - public void risFileDownload(HttpServletRequest request, HttpServletResponse response) throws Exception { - - DataMap paramMap = DataMap.getParamMap(request); - LOGGER.info("risFileDownload() paramMap={}", paramMap); - DataMap media = cmmService.selectCmmAmsAssetsMediaDetail2(paramMap); // asset id로 조회 - String mediaId = media.getString("mediaId"); - String mediaInterfaceId = media.getString("mediaInterfaceId"); - - List tagsList = null; - tagsList = cmmService.selectCmmAmsAssetsTagKeyList(paramMap); - - StringBuffer msb = new StringBuffer(); - msb.append("TY - BOOK\n"); - if(media.get("title") != null){ msb.append("TI - " + media.get("title").toString() + "\n");} //제목 - - if(media.get("author") != null){ msb.append("AU - " + media.get("author").toString() + "\n");} //저자 - - if(media.get("summary") != null){ //요약 - msb.append("AB - " + media.get("summary").toString() + "\n"); - }else{ - msb.append("AB - 한국문화원연합회 지역문화 포털에서 제공하는 지방문화원 소장자료 입니다.\n"); - } - - if(media.get("mgntNo") != null){ msb.append("CN - " + media.get("mgntNo").toString() + "\n");} //도서번호 - - if(media.get("genyear") != null){ msb.append("DA - " + media.get("genyear").toString() + "\n");} //발행일자 - - if(media.get("genyear") != null){ msb.append("PY - " + media.get("genyear").toString() + "\n");} //발행년도 - - if(media.get("totalPage") != null){ msb.append("SP - " + media.get("totalPage").toString() + "\n");} //총페이지수 - - msb.append("LA - Korean\n"); //언어 - - if(media.get("copyright") != null){ msb.append("PB - " + media.get("copyright").toString() + "\n");} //출판사 - - if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 - if(media.get("assetType") != null){ - if(media.get("assetType").toString().equals("문서") ){ - - String url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/npdfView.do?"; - url += "npdf="+Constant.UA_TYPE_R+mediaInterfaceId; // MEDIA 의 INTERFACE_ID 사용 - - if(media.get("orgOpenAt").toString().equals("Y")){ //원문공개여부 - msb.append("UR - "+url+"\n"); - } - - }else if(media.get("assetType").toString().equals("링크")){ - msb.append("UR - " + media.get("linkData").toString() + "\n"); - }else{ - String url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/lib/libraryDetail.do?contentId="+mediaId; - url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 시 사용 - msb.append("UR - " + url + "\n"); - } - } - } - - if(media.get("source") != null){ msb.append("DB - " + media.get("source").toString() + "\n");} //아카이브 - - for(int i = 0; i < tagsList.size() ; i++){ - if(tagsList.get(i).get("tagName").toString() != "-"){ msb.append("KW - " + tagsList.get(i).get("tagName").toString() + "\n");} //키워드 - } - - if(media.get("subtitle") != null){ msb.append("T2 - " + media.get("subtitle").toString() + "\n");} //부제목 - - msb.append("ER - "); - - byte[] content = msb.toString().getBytes(); - - String fileName = media.get("title").toString() + ".ris"; - //FileOutputStream fos = null; - BufferedOutputStream outs = null; - try - { - String orglFileNm = new String(fileName.getBytes("euc-kr"), "iso-8859-1"); - response.setHeader("Content-Disposition", "attachment; filename=\""+ orglFileNm +"\""); - outs = new BufferedOutputStream(response.getOutputStream()); - outs.write(content); - outs.close(); - } - catch (IOException e){ - LOGGER.error("fail in risFileDownload()", e); - } catch (Exception e){ - LOGGER.error("fail in risFileDownload()", e); - } - - response.getOutputStream().flush(); - response.getOutputStream().close(); - - } - - @RequestMapping(value="/cmm/cmmWebzineSubScribe.do") - public String selectCmmWebzineCnfirm(ModelMap model, HttpServletRequest request, HttpServletResponse response) { - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - String successYn = "N"; - int cnt = 0; - try { - cnt = cmmService.selectCmmWebzineCnfirm(paramMap); - if(cnt < 1){ - cmmService.insertCmmWebzineSubScribe(paramMap); - successYn = "Y"; - }else{ - successYn = "F"; - } - - } catch (EgovBizException e) { - LOGGER.error("Error in selectCmmWebzineCnfirm()", e); - } - model.addAttribute("successYn", successYn); - return "/kccf/cmm/webzineMessage"; - } - - @RequestMapping(value="/cmm/nvodView.do") - public String cmmNvodView(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(request); - String nvod = paramMap.getString("nvod"); - - String rfType = ""; // RIS일 경우 "R" (Constant.UA_TYPE_R) - String contentId = ""; // asset media id - String assetType = ""; - String fileNm = ""; - String sFileNm = ""; - String mainImg = ""; - if (nvod.startsWith("Z")) { // nvod="Z+인터페이스ID" (웹진) - if (nvod.length() > 1) { - // interface_id 로 media_id 구하기 - DataMap mediaParamMap = new DataMap(); - mediaParamMap.put("interfaceId", nvod.substring(1)); - mediaParamMap.put("useAt", "Y"); - DataMap mediaMap = cmmService.selectCmmAmsAssetsMediaDetailByInterfaceId(mediaParamMap); - if (mediaMap != null){ - contentId = mediaMap.getString("id"); - assetType = mediaMap.getString("assetType"); - } - - // 동영상파일명 - fileNm = mediaMap.getString("streFileName"); - model.addAttribute("fileNm", fileNm); - // 자막파일명 - sFileNm = mediaMap.getString("subtitleStreFileName"); - model.addAttribute("sFileNm", sFileNm); - // 자막파일명 - mainImg = mediaMap.getString("mainImg"); - model.addAttribute("mainImg", mainImg); - - model.addAttribute("mediaMap", mediaMap); - } - - } - - if (StringUtils.isNotEmpty(contentId)) { - String jsessionId = CmmUtil.getCookieId(request); - // 미디어 활동이력 (원문보기 이력) 등록 - DataMap hstParamMap = new DataMap(); - hstParamMap.put("jsessionId", jsessionId); - hstParamMap.put("contentId", contentId); - hstParamMap.put("assetType", assetType); - hstParamMap.put("linkUrl", request.getRequestURI()+"?"+request.getQueryString()); - String uaType = rfType; // rfType 값이 넘어온 경우 그대로 사용 - if (StringUtils.isEmpty(uaType)) { - if (CmmUtil.isMobile(request)) uaType = Constant.UA_TYPE_M; - else uaType = Constant.UA_TYPE_W; - } - hstParamMap.put("uaType", uaType); - cmmService.insertCmmActivityMediaHst(hstParamMap); - } - - return "/kccf/cmm/vodView"; - } - - // 미디어 기준의 목록(레이어 원문보기용) - @RequestMapping(value="/cmm/cmmNvodViewLayer.do") - public String cmmNvodViewLayer( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - DataMap paramMap = DataMap.getParamMap(req); - - paramMap.setString("aid", paramMap.getString("aId")); - paramMap.setString("mid", paramMap.getString("mId")); - - // AssetMedia 목록 - String rsUrl = ""; - String assetType = ""; - - // 비디오 - rsUrl = "/kccf/cmm/layerNvodViewAjax"; - assetType = Constant.M_TYPE_ARRAY[1]; - - paramMap.setString("assetType", assetType); - model.addAttribute("mType", paramMap.getString("mType")); - model.addAttribute("pageIndex", 1); - model.addAttribute("lastPageNo", 1); - - model.addAttribute("cmmOriginViewList", cmmService.selectCmmAmsAssetsOriginViewList(paramMap)); - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(req,model); - - return rsUrl; - } - - - @RequestMapping(value="/cmm/cmmAssetSecondCategory.do") - public ModelAndView selectCmmAssetSecondCategoryList(ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception{ - DataMap paramMap = DataMap.getParamMap(request); - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - ComDefaultCodeVO CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS015); - CodeVO.setCode(paramMap.getString("code")); - - // DDDDDDDDDDDDDDDDDDDDD cmmUseService.selectCmmCodeDetail2 부재로 임시 막음 (2021.08.13) - // model.addAttribute("resultList", cmmUseService.selectCmmCodeDetail2(CodeVO)); - - - return modelAndView; - } - - @RequestMapping(value="/cmm/tableOfContentsView.do") - public String selectLocalCultureListAjax ( - @ModelAttribute("cmmVO") CmmVO cmmVO - , ModelMap model - , @RequestParam Map commandMap - , HttpServletRequest req - , HttpServletResponse res - ) throws Exception { - - DataMap paramMap = DataMap.getParamMap(req); - - DataMap cmmAmsAssetsMediaDetail = null; - String mediaId = paramMap.getString("mId"); - if(StringUtils.isNotEmpty(mediaId)){ - // 미디어 ID 맵핑 - if (StringUtils.isEmpty(paramMap.getString("mId"))) paramMap.setString("mId", mediaId); - - // 에셋 미디어 상세정보(원문보기 쪽 상세정보) - cmmAmsAssetsMediaDetail = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - List tableOfContentsList = CmmUtil.parseTableOfContents(cmmAmsAssetsMediaDetail.getString("tableOfContents")); - cmmAmsAssetsMediaDetail.put("tableOfContentsList", tableOfContentsList); - - if (cmmAmsAssetsMediaDetail.getInt("ocrSplitNum") > 1) { - cmmAmsAssetsMediaDetail.put("mediaOcrList", cmmService.selectCmmAmsAssetsMediaOcrList(paramMap)); - } - } - - // 상세정보 - model.addAttribute("cmmAmsAssetsMediaDetail", cmmAmsAssetsMediaDetail); - - paramMap.setString("jsessionId", CmmUtil.getCookieId(req)); - CmmUtil.setAmsPathModelMap(req,model); - - return "/kccf/cmm/layerTableOfContentsAjax"; - } - -} diff --git a/src/main/java/kccf/res/service/ResourcesService.java b/src/main/java/kccf/res/service/ResourcesService.java deleted file mode 100644 index 78104b20..00000000 --- a/src/main/java/kccf/res/service/ResourcesService.java +++ /dev/null @@ -1,50 +0,0 @@ -package kccf.res.service; - -import java.util.List; - -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmCouncilInfoVO; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -public interface ResourcesService { - - int selectResourcesListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - int selectResourcesListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - int selectResourcesListProvideTotCnt() throws EgovBizException; - int selectResourcesListOpenTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - List selectResourcesList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - List selectCouncilList() throws EgovBizException; - - CmmCouncilInfoVO selectCouncilInfo(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - List selectCouMainBannerList(DataMap param) throws EgovBizException; - List selectCouMainResTagList(DataMap param) throws EgovBizException; - List selectCouMainSeeResList(DataMap param) throws EgovBizException; - List selectCouMainRecommendResList(DataMap param) throws EgovBizException; - List selectCouMainBestYearList(DataMap param) throws EgovBizException; - List selectCouMainYearDataList(DataMap param) throws EgovBizException; - - - - int selectResourcesCouListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - int selectResourcesCouListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - List selectResourcesCouList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - - - - -// CmmAmsAssetMediaVO selectResourcesDetail(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesKeywordsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesTagsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesAddrList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesCouncilList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesUserGroupList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesRelatedThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesRelatedLibraryList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesCouncilFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; -// List selectResourcesCouncilFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException; - -} diff --git a/src/main/java/kccf/res/service/impl/ResourcesDAO.java b/src/main/java/kccf/res/service/impl/ResourcesDAO.java deleted file mode 100644 index 4a2c3277..00000000 --- a/src/main/java/kccf/res/service/impl/ResourcesDAO.java +++ /dev/null @@ -1,183 +0,0 @@ -package kccf.res.service.impl; - -import java.util.List; - -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Repository; - -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmCouncilInfoVO; -import cmm.util.DataMap; -import egovframework.com.cmm.service.impl.EgovComAbstractDAO; - -/** - * Resources 관리에 대한 데이터 접근 클래스를 정의한다 - * @Class Name : ResourcesDAO.java - * @author ecplaza - * @since 2018-05-11 - * @version 1.0 - * @see - * - *
- * << 개정이력(Modification Information) >>
- * @
- * @ 수정일		수정자		수정내용
- * @ ---------	---------	-------------------------------
- * @ 2018-05-11	ecplaza		최초생성
- * 
- * 
- */ -@Repository("resourcesDAO") -public class ResourcesDAO extends EgovComAbstractDAO { - - @SuppressWarnings("deprecation") - public int selectResourcesListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesListTotCnt", cmmAmsAssetMediaVO); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public int selectResourcesListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesListSchTotCnt", cmmAmsAssetMediaVO); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public int selectResourcesListProvideTotCnt() throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesListProvideTotCnt"); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectResourcesListOpenTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesListOpenTotCnt", cmmAmsAssetMediaVO); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("unchecked") - public List selectResourcesList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - return (List)list("resourcesDAO.selectResourcesList", cmmAmsAssetMediaVO); - } - - @SuppressWarnings("unchecked") - public List selectCouncilList() throws DataAccessException { - //return (List)list("resourcesDAO.selectCouncilList"); - return null; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public CmmCouncilInfoVO selectCouncilInfo(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (CmmCouncilInfoVO)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectCouncilInfo", cmmAmsAssetMediaVO); - return null; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("unchecked") - public List selectCouMainBannerList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainBannerList", param); - } - @SuppressWarnings("unchecked") - public List selectCouMainResTagList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainResTagList", param); - } - @SuppressWarnings("unchecked") - public List selectCouMainSeeResList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainSeeResList", param); - } - @SuppressWarnings("unchecked") - public List selectCouMainRecommendResList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainRecommendResList", param); - } - @SuppressWarnings("unchecked") - public List selectCouMainBestYearList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainBestYearList", param); - } - @SuppressWarnings("unchecked") - public List selectCouMainYearDataList(DataMap param) throws DataAccessException { - return (List)list("resourcesDAO.selectCouMainYearDataList", param); - } - - - - - - @SuppressWarnings("deprecation") - public int selectResourcesCouListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesCouListTotCnt", cmmAmsAssetMediaVO); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("deprecation") - public int selectResourcesCouListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - //return (Integer)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesCouListSchTotCnt", cmmAmsAssetMediaVO); - return 0; // DDDDDDDDDDDDDD 임시 처리 (2021.08.13) - } - - @SuppressWarnings("unchecked") - public List selectResourcesCouList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { - return (List)list("resourcesDAO.selectResourcesCouList", cmmAmsAssetMediaVO); - } - -// @SuppressWarnings("deprecation") -// public CmmAmsAssetMediaVO selectResourcesDetail(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (CmmAmsAssetMediaVO)getSqlMapClientTemplate().queryForObject("resourcesDAO.selectResourcesDetail", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesKeywordsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesKeywordsList", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesTagsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesTagsList", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesThemeList",cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesAddrList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesAddrList",cmmAmsAssetMediaVO); -// } -// @SuppressWarnings("unchecked") -// public List selectResourcesCouncilList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesCouncilList",cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesUserGroupList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesUserGroupList",cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesRelatedThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesRelatedThemeList", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesRelatedLibraryList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesRelatedLibraryList", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesFilter", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesFilterCnt", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesCouncilFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesCouncilFilter", cmmAmsAssetMediaVO); -// } -// -// @SuppressWarnings("unchecked") -// public List selectResourcesCouncilFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws DataAccessException { -// return (List)list("resourcesDAO.selectResourcesCouncilFilterCnt", cmmAmsAssetMediaVO); -// } - -} diff --git a/src/main/java/kccf/res/service/impl/ResourcesServiceImpl.java b/src/main/java/kccf/res/service/impl/ResourcesServiceImpl.java deleted file mode 100644 index 68b24222..00000000 --- a/src/main/java/kccf/res/service/impl/ResourcesServiceImpl.java +++ /dev/null @@ -1,189 +0,0 @@ -package kccf.res.service.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import kccf.res.service.ResourcesService; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; - -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmCouncilInfoVO; -import cmm.service.impl.CmmCmsServiceImpl; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -/** - * Resources 관리에 대한 서비스 클래스를 구현한다 - * @Class Name : ResourcesServiceImpl.java - * @author ecplaza - * @since 2018-05-11 - * @version 1.0 - */ - -@Service("resourcesService") -public class ResourcesServiceImpl extends EgovAbstractServiceImpl implements ResourcesService{ - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(CmmCmsServiceImpl.class); - - /** LibraryDAO */ - @Resource(name="resourcesDAO") - private ResourcesDAO resourcesDAO; - - @Override - public int selectResourcesListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesListTotCnt(cmmAmsAssetMediaVO); - } - @Override - public int selectResourcesListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesListSchTotCnt(cmmAmsAssetMediaVO); - } - - @Override - @Cacheable(value="resProvideCntCache") - public int selectResourcesListProvideTotCnt() throws EgovBizException { - return resourcesDAO.selectResourcesListProvideTotCnt(); - } - @Override - public int selectResourcesListOpenTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesListOpenTotCnt(cmmAmsAssetMediaVO); - } - - @Override - public List selectResourcesList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesList(cmmAmsAssetMediaVO); - } - - @Override - @Cacheable(value="councilCache") - public List selectCouncilList() throws EgovBizException { - return resourcesDAO.selectCouncilList(); - } - - @Override - public CmmCouncilInfoVO selectCouncilInfo(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectCouncilInfo(cmmAmsAssetMediaVO); - } - - @Override - public List selectCouMainBannerList(DataMap param) throws EgovBizException { - return (List)resourcesDAO.selectCouMainBannerList(param); - } - @Override - public List selectCouMainResTagList(DataMap param) throws EgovBizException { - return (List)resourcesDAO.selectCouMainResTagList(param); - } - - @Override - public List selectCouMainSeeResList(DataMap param) throws EgovBizException { - return resourcesDAO.selectCouMainSeeResList(param); - } - - @Override - public List selectCouMainRecommendResList(DataMap param) throws EgovBizException { - return resourcesDAO.selectCouMainRecommendResList(param); - } - @Override - public List selectCouMainBestYearList(DataMap param) throws EgovBizException { - return (List)resourcesDAO.selectCouMainBestYearList(param); - } - - @Override - public List selectCouMainYearDataList(DataMap param) throws EgovBizException { - return resourcesDAO.selectCouMainYearDataList(param); - } - - - - - - - - - @Override - public int selectResourcesCouListTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesCouListTotCnt(cmmAmsAssetMediaVO); - } - @Override - public int selectResourcesCouListSchTotCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesCouListSchTotCnt(cmmAmsAssetMediaVO); - } - - @Override - public List selectResourcesCouList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { - return resourcesDAO.selectResourcesCouList(cmmAmsAssetMediaVO); - } - -// @Override -// public CmmAmsAssetMediaVO selectResourcesDetail(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesDetail(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesKeywordsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesKeywordsList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesTagsList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesTagsList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesThemeList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesAddrList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesAddrList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesCouncilList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesCouncilList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesUserGroupList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesUserGroupList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesRelatedThemeList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesRelatedThemeList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesRelatedLibraryList(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesRelatedLibraryList(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesFilter(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesFilterCnt(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesCouncilFilter(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesCouncilFilter(cmmAmsAssetMediaVO); -// } -// -// @Override -// public List selectResourcesCouncilFilterCnt(CmmAmsAssetMediaVO cmmAmsAssetMediaVO) throws EgovBizException { -// return resourcesDAO.selectResourcesCouncilFilterCnt(cmmAmsAssetMediaVO); -// } - -} diff --git a/src/main/java/kccf/res/web/ResourcesController.java b/src/main/java/kccf/res/web/ResourcesController.java deleted file mode 100644 index 82430ce4..00000000 --- a/src/main/java/kccf/res/web/ResourcesController.java +++ /dev/null @@ -1,489 +0,0 @@ -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 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 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 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 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 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 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 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 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 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"; - }*/ - -} diff --git a/src/main/java/kccf/sch/common/WNAnchor.java b/src/main/java/kccf/sch/common/WNAnchor.java deleted file mode 100644 index 4ca84146..00000000 --- a/src/main/java/kccf/sch/common/WNAnchor.java +++ /dev/null @@ -1,108 +0,0 @@ -package kccf.sch.common; - -public class WNAnchor { - private int m_before = -1; - private int m_next = -1; - private int m_bundleBefore = -1; - private int m_bundleNext = -1; - private int m_firstPage = -1; - private int m_lastPage = -1; - private int m_totalPgCount = 0; - private int m_totlalBundlePgCount = 0; - private int m_pageCount = 0; - private int m_curPageNumber = 1; - private String[][] m_pages = new String[1][2]; - - public WNAnchor() { - m_pages[0][0] = "1"; - m_pages[0][1] = "-1"; - } - - public int getBefore() { - return m_before; - } - - public void setBefore(int before) { - m_before = before; - } - - public int getFirstPage() { - return m_firstPage; - } - - public void setFirstPage(int firstPage) { - m_firstPage = firstPage; - } - - public int getLastPage() { - return m_lastPage; - } - - public void setLastPage(int lastPage) { - m_lastPage = lastPage; - } - - public int getNext() { - return m_next; - } - - public void setNext(int next) { - m_next = next; - } - - public int getBundleBefore() { - return m_bundleBefore; - } - - public void setBundleBefore(int bundleBefore) { - m_bundleBefore = bundleBefore; - } - - public int getBundleNext() { - return m_bundleNext; - } - - public void setBundleNext(int bundleNext) { - m_bundleNext = bundleNext; - } - - public int getTotalPgCount() { - return m_totalPgCount; - } - - public void setTotalPgCount(int totalPgCount) { - m_totalPgCount = totalPgCount; - } - - public int getTotlalBundlePgCount() { - return m_totlalBundlePgCount; - } - - public void setTotlalBundlePgCount(int totlalBundlePgCount) { - m_totlalBundlePgCount = totlalBundlePgCount; - } - - public int getPageCount() { - return m_pageCount; - } - - public void setPageCount(int pageCount) { - m_pageCount = pageCount; - } - - public int getCurPageNumber() { - return m_curPageNumber; - } - - public void setCurPageNumber(int curPageNumber) { - m_curPageNumber = curPageNumber; - } - - public String[][] getPages() { - return m_pages; - } - - public void setPages(String[][] pages) { - m_pages = pages; - } -} \ No newline at end of file diff --git a/src/main/java/kccf/sch/common/WNCollection.java b/src/main/java/kccf/sch/common/WNCollection.java deleted file mode 100644 index 58e87f6b..00000000 --- a/src/main/java/kccf/sch/common/WNCollection.java +++ /dev/null @@ -1,335 +0,0 @@ -package kccf.sch.common; - -public class WNCollection { - - - public static String[] COLLECTIONS = new String[]{"info","map","number","pick","reference","story","culturePost","total","culturePostHot","toon","ocr"}; - public static String[] COLLECTIONS_NAME = new String[]{"info","map","number","pick","reference","story","culturePost","total","culturePostHot","toon","ocr"}; - public static String[] MERGE_COLLECTIONS = new String[]{""}; - public String[][] MERGE_COLLECTION_INFO = null; - public String[][] COLLECTION_INFO = null; - public WNCollection(){ - COLLECTION_INFO = new String[][] - { - { - "info", // set index name - "info", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,CONTENT_TYPE_NAME_EX,SIDO_NAME",// set search field - "DOCID,DATE,CONT_TYPE,CAT1_NAME,GIA_CAT2_NAME,CAT3_NAME,CONTENT_ID,CONTENT_TYPE_ID,CONTENT_TYPE_NAME,TITLE,SIDO_NAME,SIGUNGU_NAME,SEARCH_AREA,MAIN_IMG,ADDR1,ZIP_CODE,TEL,ALIAS,SEARCH_AREA_COUNCIL,SEARCH_AREA_COUNCIL_INFO",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "CONTENT_TYPE_NAME,SEARCH_AREA_COUNCIL_INFO", // use check prefix query filed - "", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "info" // collection display name - } - , - { - "map", // set index name - "map", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,TRS_AGE_EX,INTERFACE_ID,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_TOPIC,SECOND_TOPIC,FIRST_CLASS,SECOND_CLASS,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM",// set search field - "DOCID,DATE,CONTENT_TYPE,CONTENT_ID,TITLE,SUMMARY,MAIN_IMG,ADDR1,LATITUDE,LONGITUDE,LINK_DATA,READ_CNT,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_TOPIC,SECOND_TOPIC,FIRST_CLASS,SECOND_CLASS,SIDO_NAME,SIGUNGU_NAME,ADDR2,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,CONTENT_TYPE_ID,ID,FIRST_CATEGORY,SECOND_CATEGORY,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,TAGS_NAME,CONTENT_TYPE_NAME,CAT1,CAT1_NAME,CAT2,CAT2_NAME,CAT3,CAT3_NAME,ZIP_CODE,TEL,RECOMMEND_YN,NTCE_BGNDE,NTCE_ENDDE,WEBSITE,UPDATED_AT,COUNCIL_CD,COUNCIL_NM,ALIAS,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,CONTENT_TYPE", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "map" // collection display name - } - , - { - "number", // set index name - "number", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TAGS,TITLE,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,FIRST_TOPIC,SECOND_TOPIC,THEME_CD_EX,THEME_NM_EX,SERIES_CD_EX,SERIES_NM_EX",// set search field - "DOCID,DATE,TITLE,SUMMARY,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,SIDO_NAME,SIGUNGU_NAME,LINK_DATA,FIRST_TOPIC,SECOND_TOPIC,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,TAGS,COUNCIL,KEYWORDS,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_CATEGORY,SECOND_CATEGORY,READ_CNT,CONTENT_ID,CONTENT_TYPE,ID,SEARCH_THEME_CD,SEARCH_THEME_NM,SEARCH_CLASS,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,SOJANG_COUNCIL_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,MEDIA_ID,ASSET_CLASS,ALIAS,SEARCH_AREA_COUNCIL,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,COUNCIL_NM_TOT,ASSET_TYPE,MAIN_IMG",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,FIRST_CLASS,SECOND_CLASS,THEME_CD,THEME_NM,SEARCH_THEME_CD,SEARCH_THEME_NM,SOJANG_COUNCIL,KEYWORDS,SIDO_NAME,SERIES_CD,SERIES_NM", // use check prefix query filed - "GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END,READ_CNT", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "number" // collection display name - } - , - { - "pick", // set index name - "pick", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,SUMMARY,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,THEME,SERIES,COUNCIL,KEYWORDS_EX,TAGS,OCR_TEXT_TOT",// set search field - "DOCID,DATE,TITLE,SUMMARY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,TAGS,KEYWORDS,READ_CNT,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_CATEGORY,SECOND_CATEGORY,SEARCH_CLASS,AUTHOR,PUBLISHER,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,COUNCIL,SIDO_NAME,SIGUNGU_NAME,TRS_SIDO_NAME,TRS_SIGUNGU_NAME,FIRST_CLASS_NM,SECOND_CLASS_NM,SEARCH_AREA_COUNCIL,LINK_DATA,ASSETS_ID,MEDIA_ID,MAIN_IMG,MGNT_NO,ASSET_TYPE,THEME,SERIES,ORG_OPEN_AT,STRE_FILE_NAME,ALIAS,SUBTITLE,ADDITION,ORIGNL_FILE_NAME,FILE_SIZE,WIDTH,HEIGHT,IMG_ALT,MEDIA_TYPE,PLAYER_AT,PLAY_TIME,VOLUME,TOTAL_PAGE,ISBN,WEBSITE_NAME,LINK_USE_AT,MAKING_DATE,FILMING_LOCATION,SUBTITLE_AT,SUBTITLE_ORG_FILE_NAME,SUBTITLE_STRE_FILE_NAME,SUBTITLE_DESC,PROVIDER,SOURCE_AT,SOURCE,COPYRIGHT,RETENTION_PERIOD,COPYRIGHT_MGNT_DEPART,THIRD_COPYRIGHT,CCL_TYPE,UPDATED_AT,DELETED_AT,USE_AT,REMARKS_DESC,RECOMMEND_YN,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,COUNCIL_NM_TOT,OCR_TEXT_TOT",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,FIRST_CATEGORY,SECOND_CATEGORY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,MGNT_NO,KEYWORDS,SIDO_NAME,MEDIA_ID,ASSET_TYPE,ASSETS_ID", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "pick" // collection display name - } - , - { - "reference", // set index name - "reference", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "custom,rweight=0.7;dweight=0.2;fweight=0.1,0", // set sort field (field,order) multi sort '/' - "TITLE/5,SUMMARY,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,THEME,SERIES,COUNCIL,KEYWORDS_EX,TAGS,OCR_TEXT_TOT",// set search field - "DOCID,DATE,TITLE,SUMMARY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,TAGS,KEYWORDS,READ_CNT,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_CATEGORY,SECOND_CATEGORY,SEARCH_CLASS,SEARCH_CATEGORY,AUTHOR,PUBLISHER,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,COUNCIL,SIDO_NAME,SIGUNGU_NAME,TRS_SIDO_NAME,TRS_SIGUNGU_NAME,FIRST_CLASS_NM,SECOND_CLASS_NM,SEARCH_AREA_COUNCIL,LINK_DATA,ASSETS_ID,MEDIA_ID,MAIN_IMG,MGNT_NO,ASSET_TYPE,THEME,SERIES,ORG_OPEN_AT,STRE_FILE_NAME,ALIAS,SUBTITLE,ADDITION,ORIGNL_FILE_NAME,FILE_SIZE,WIDTH,HEIGHT,IMG_ALT,MEDIA_TYPE,PLAYER_AT,PLAY_TIME,VOLUME,TOTAL_PAGE,ISBN,WEBSITE_NAME,LINK_USE_AT,MAKING_DATE,FILMING_LOCATION,SUBTITLE_AT,SUBTITLE_ORG_FILE_NAME,SUBTITLE_STRE_FILE_NAME,SUBTITLE_DESC,PROVIDER,SOURCE_AT,SOURCE,COPYRIGHT,RETENTION_PERIOD,COPYRIGHT_MGNT_DEPART,THIRD_COPYRIGHT,CCL_TYPE,UPDATED_AT,DELETED_AT,USE_AT,REMARKS_DESC,RECOMMEND_YN,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,OCR_TEXT_TOT,COUNCIL_NM_TOT,TABLE_OF_CONTENTS,ORG_OPEN_EXIST,MAIN_IMG_EXIST",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,FIRST_CATEGORY,SECOND_CATEGORY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,MGNT_NO,KEYWORDS,SIDO_NAME,MEDIA_ID,ASSET_TYPE,ASSETS_ID", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "reference" // collection display name - } - , - { - "story", // set index name - "story", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,SUMMARY,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_TOPIC,SECOND_TOPIC,THEME_CD_EX,THEME_NM_EX,SERIES_CD_EX,SERIES_NM_EX,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,KEYWORDS_EX,TAGS",// set search field - "DOCID,DATE,TITLE,SUMMARY,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,SIDO_NAME,SIGUNGU_NAME,DONG_NAME1,AGE,TRS_AGE,LINK_DATA,FIRST_TOPIC,SECOND_TOPIC,TAGS,KEYWORDS,COUNCIL,READ_CNT,INTERFACE_ID,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END,ID,SEARCH_THEME_CD,SEARCH_THEME_NM,SEARCH_AREA_COUNCIL,MAIN_IMG,FIRST_CLASS,SECOND_CLASS,FIRST_CLASS_NM,SECOND_CLASS_NM,FIRST_CATEGORY,SECOND_CATEGORY,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,ALIAS,SOJANG_COUNCIL,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "THEME_CD,THEME_NM,TRS_AGE,SEARCH_THEME_CD,SEARCH_THEME_NM,SOJANG_COUNCIL,KEYWORDS,SERIES_CD,SERIES_NM,SECOND_CATEGORY,FIRST_CATEGORY", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "story" // collection display name - } - , - { - "culturePost", // set index name - "culturePost", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,SUMMARY,TAGS,KEYWORDS",// set search field - "DOCID,DATE,TITLE,SUMMARY,TAGS,MAIN_IMG,ALIAS,KEYWORDS",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "", // use check prefix query filed - "", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "culturePost" // collection display name - } - , - { - "total", // set index name - "total", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,TAGS_TITLE,SUMMARY,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,THEME_CD_EX,THEME_NM_EX,SERIES_CD_EX,SERIES_NM_EX,COUNCIL,KEYWORDS,CONTENT_TYPE_NAME,SIDO_NAME_EX,TAGS,NUMBER_TITLE,FIRST_TOPIC,SECOND_TOPIC",// set search field - "DOCID,DATE,TITLE,SUMMARY,FIRST_CLASS,SECOND_CLASS,TAGS,READ_CNT,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_CATEGORY,SECOND_CATEGORY,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,SIDO_NAME,SOJANG_COUNCIL,LINK_DATA,MAIN_IMG,MGNT_NO,TAGS_TITLE,ALIAS,NUMBER_TITLE,SEARCH_THEME_CD,SEARCH_THEME_NM,NUMBER_SUMMARY,INTERFACE_ID,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,COUNCIL,KEYWORDS,CONTENT_TYPE_NAME,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_TOPIC,SECOND_TOPIC,ID,MEDIA_ID,ORG_OPEN_AT,ASSET_TYPE,ASSETS_ID,STRE_FILE_NAME,CONTENT_ID,CONT_TYPE",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,FIRST_CATEGORY,SECOND_CATEGORY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,MGNT_NO,SIDO_NAME,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,SEARCH_THEME_NM,SEARCH_THEME_CD", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "total" // collection display name - } - , - { - "culturePostHot", // set index name - "culturePostHot", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,SUMMARY,INTERFACE_ID,GENYEAR_SCH,TRS_AGE_EX,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_TOPIC,SECOND_TOPIC",// set search field - "DOCID,DATE,TITLE,SUMMARY,LINK_DATA,TAGS,MAIN_IMG,READ_CNT,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_TOPIC,SECOND_TOPIC,ID,KEYWORDS,THEME_CD,THEME_NM,SERIES_CD,SERIES_NM,ALIAS,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,KEYWORDS", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "culturePostHot" // collection display name - } - , - { - "toon", // set index name - "toon", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "TITLE,SUMMARY,INTERFACE_ID,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,FIRST_CLASS_NM,SECOND_CLASS_NM,TAGS",// set search field - "DOCID,DATE,TITLE,SUMMARY,FIRST_CLASS,SECOND_CLASS,SOJANG_COUNCIL,TAGS,KEYWORDS,READ_CNT,INTERFACE_ID,GENYEAR,TRS_AGE,CHRONOLOGICAL_START,CHRONOLOGICAL_END,FIRST_CATEGORY,SECOND_CATEGORY,SEARCH_CLASS,AUTHOR,PUBLISHER,FIRST_CATEGORY_NM,SECOND_CATEGORY_NM,SOJANG_COUNCIL_NM,SIDO_NAME,SIGUNGU_NAME,TRS_SIDO_NAME,TRS_SIGUNGU_NAME,FIRST_CLASS_NM,SECOND_CLASS_NM,SEARCH_AREA_COUNCIL,LINK_DATA,ASSETS_ID,MEDIA_ID,MAIN_IMG,MGNT_NO,ASSET_TYPE,THEME,SERIES,ORG_OPEN_AT,STRE_FILE_NAME,SUBTITLE,ADDITION,ORIGNL_FILE_NAME,FILE_SIZE,WIDTH,HEIGHT,IMG_ALT,MEDIA_TYPE,PLAYER_AT,PLAY_TIME,VOLUME,TOTAL_PAGE,ISBN,WEBSITE_NAME,LINK_USE_AT,MAKING_DATE,FILMING_LOCATION,SUBTITLE_AT,SUBTITLE_ORG_FILE_NAME,SUBTITLE_STRE_FILE_NAME,SUBTITLE_DESC,PROVIDER,SOURCE_AT,SOURCE,COPYRIGHT,RETENTION_PERIOD,COPYRIGHT_MGNT_DEPART,THIRD_COPYRIGHT,CCL_TYPE,UPDATED_AT,DELETED_AT,USE_AT,REMARKS_DESC,RECOMMEND_YN,GENYEAR_SCH,CHRONOLOGICAL_START_SCH,CHRONOLOGICAL_END_SCH",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "TRS_AGE,KEYWORDS", // use check prefix query filed - "READ_CNT,GENYEAR,CHRONOLOGICAL_START,CHRONOLOGICAL_END", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "toon" // collection display name - } - , - { - "ocr", // set index name - "ocr", // set collection name - "0,3", // set pageinfo (start,count) - "1,0,0,1,0", // set query analyzer (useKMA,isCase,useOriginal,useSynonym, duplcated detection) - "RANK/DESC,DATE/DESC", // set sort field (field,order) multi sort '/' - "basic,rpfmo,100", // set sort field (field,order) multi sort '/' - "OCR_TEXT",// set search field - "DOCID,ID,MEDIA_ID,FIRST_PAGE_NUM,LAST_PAGE_NUM,ORDER_NUM,OCR_TEXT,FILE_NAME,ALIAS",// set document field - "", // set date range - "", // set rank range - "", // set prefix query, example: |/1, (fieldname:contains:value) and ' ', or '|', not '!' / operator (AND:1, OR:0) - "", // set collection query (/option...) and ' ', or '|' - "", // set boost query ( | ...) and ' ', or '|' - "", // set filter operation () - "", // set groupby field(field, count) - "", // set sort field group(field/order,field/order,...) - "", // set categoryBoost(fieldname,matchType,boostID,boostKeyword) - "", // set categoryGroupBy (fieldname:value) - "", // set categoryQuery (fieldname:value) - "", // set property group (fieldname,min,max, groupcount) - "MEDIA_ID", // use check prefix query filed - "ID", // set use check fast access field - "", // set multigroupby field - "", // set auth query (Auth Target Field, Auth Collection, Auth Reference Field, Authority Query) - "", // set Duplicate Detection Criterion Field, RANK/DESC,DATE/DESC - "ocr" // collection display name - } - - }; - } - } diff --git a/src/main/java/kccf/sch/common/WNCommon.java b/src/main/java/kccf/sch/common/WNCommon.java deleted file mode 100644 index f99657fa..00000000 --- a/src/main/java/kccf/sch/common/WNCommon.java +++ /dev/null @@ -1,1583 +0,0 @@ -package kccf.sch.common; - - -import java.io.IOException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import QueryAPI530.Search; -import static kccf.sch.common.WNUtils.*; - -public class WNCommon { - private static final Logger LOGGER = LoggerFactory.getLogger(WNCommon.class); - private Search search = null; - boolean isDebug = false; - - /** - * SF-1 Search 클래스 객체를 생성하는 WNCommon의 생성자 함수이다. - */ - public WNCommon() { - this.search = new Search(); - } - - /** - * 검색 질의 키워드와 질의나 출력에 사용될 문자집합을 정한다. v4.x 호환 method이므로 - * COMMON_OR_WHEN_NORESULT을 지정하지 않는다. - * - * @param query - * @param charSet - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by - * {@link #setCommonQuery(String,String,int)} - */ - public int setCommonQuery(String query, String charSet) { - int ret = 0; - ret = search.w3SetCodePage(charSet); - ret = search.w3SetQueryLog(1); - ret = search.w3SetTraceLog(0); - ret = search.w3SetCommonQuery(query, 0); - return ret; - } - - /** - * 검색 질의 UID와 질의나 출력에 사용될 문자집합을 정한다. - * - * @param charSet - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setUidQuery(String charSet) { - int ret = 0; - ret = search.w3SetCodePage(charSet); - ret = search.w3SetQueryLog(0); - return ret; - } - - /** - * 검색 질의 키워드와 질의나 출력에 사용될 문자집합을 정한다. - * - * @param query - * @param charSet - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setCommonQuery(String query, String charSet, int useOrResult, - boolean useSuggestedQuery) { - int ret = 0; - ret = search.w3SetCodePage(charSet); - ret = search.w3SetQueryLog(1); - ret = search.w3SetTraceLog(0); - ret = search.w3SetCommonQuery(query, useOrResult); - if (useSuggestedQuery) { - ret = search.w3SetSpellCorrectionQuery(query, 0); - } - return ret; - } - - /** - * setCommonQuery의 오버로딩(overloading) 함수로 session정보를 부가기능으로 사용할 수 있다. v4.x 호환 - * method이므로 COMMON_OR_WHEN_NORESULT을 지정하지 않는다. - * - * @param query - * @param charSet - * @param logInfo - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by - * {@link #setCommonQuery(String,String,String[],int)} - */ - public int setCommonQuery(String query, String charSet, String[] logInfo) { - int ret = 0; - if (logInfo != null && logInfo.length > 2) { - ret = search.w3SetSessionInfo(logInfo[0], logInfo[1], logInfo[2]); - } - setCommonQuery(query, charSet); - return ret; - } - - /** - * setCommonQuery의 오버로딩(overloading) 함수로 session정보를 부가기능으로 사용할 수 있다. - * - * @param query - * @param charSet - * @param logInfo - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setCommonQuery(String query, String charSet, int useOrResult, - String[] logInfo) { - int ret = 0; - if (logInfo != null && logInfo.length > 2) { - ret = search.w3SetSessionInfo(logInfo[0], logInfo[1], logInfo[2]); - } - ret = search.w3SetCodePage(charSet); - ret = search.w3SetQueryLog(1); - ret = search.w3SetCommonQuery(query, useOrResult); - return ret; - } - - /** - * setCommonQuery의 오버로딩(overloading) 함수로 session정보를 부가기능으로 사용할 수 있다. - * - * @param query - * @param charSet - * @param logInfo - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setCommonQuery(String query, String charSet, int useOrResult, - boolean useSuggestedQuery, String[] logInfo) { - int ret = 0; - if (logInfo != null && logInfo.length > 2) { - ret = search.w3SetSessionInfo(logInfo[0], logInfo[1], logInfo[2]); - } - ret = search.w3SetCodePage(charSet); - ret = search.w3SetQueryLog(1); - ret = search.w3SetCommonQuery(query, useOrResult); - if (useSuggestedQuery) { - ret = search.w3SetSpellCorrectionQuery(query, 0); - } - return ret; - } - - /** - * 컬렉션 별로 검색어 지정 - * - * @param collectionName - * @param query - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setCollectionQuery(String collectionName, String query) { - return search.w3SetCollectionQuery(collectionName, query); - } - - /** - * 컬렉션 별로 boost query 지정 - * - * @param collectionName - * @param boost - * query - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setBoostQuery(String collectionName, String query) { - int idx = query.lastIndexOf("/"); - int option = Integer.parseInt(query.substring(idx, query.length())); - return search.w3SetBoostQuery(collectionName, query, option); - } - - /** - * 컬렉션 별로 boost query 지정 - * - * @param collectionName - * @param boost - * query - * @param option - * 0,1,2 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setBoostQuery(String collectionName, String query, int option) { - return search.w3SetBoostQuery(collectionName, query, option); - } - - /** - * 검색하고자 하는 컬렉션의 UID를 설정한다. - * - * @param collectionName - * @param values - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setUid(String collectionName, String[] values, String searcherId) { - int ret = 0; - for (int i = 0; i < values.length; i++) { - long uid = 0L; - try { - uid = Long.parseLong(values[i]); - } catch (NumberFormatException e) { - return -1; - } - ret = search.w3AddUid(collectionName, uid, searcherId); - } - return ret; - } - - /** - * 검색대상 컬렉션, 언어분석기 사용유무, 대소문자 구분유무를 설정한다. v4.x 호환 method이므로 USEORIGINAL, - * USESYNONYM을 지정하지 않는다. - * - * @param collectionName - * @param useKma - * @param isCase - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.5, replaced by - * {@link #addCollection(String,int,int,int,int,int)} - */ - public int addCollection(String collectionName, int useKma, int isCase) { - int ret = 0; - ret = search.w3AddCollection(collectionName); - // USEMA, ISCASE, USEORIGINAL, USESYNONYM - ret = search.w3SetQueryAnalyzer(collectionName, useKma, isCase, 1, 1); - ret = search.w3SetDuplicateDetection(collectionName); - // systemOut("[w3AddCollection] "+collectionName); - return ret; - } - - /** - * 검색대상 컬렉션, 언어분석기 사용유무, 대소문자 구분유무를 설정한다. - * - * @param collectionName - * @param useKma - * @param isCase - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addCollection(String collectionName, int useKma, int isCase, - int useOriginal, int useSynonym, int duplicateDectection) { - int ret = 0; - ret = search.w3AddCollection(collectionName); - // USEMA, ISCASE, USEORIGINAL, USESYNONYM - ret = search.w3SetQueryAnalyzer(collectionName, useKma, isCase, - useOriginal, useSynonym); - // systemOut("[w3AddCollection] "+collectionName); - if (duplicateDectection == 1) { - ret = search.w3SetDuplicateDetection(collectionName); - } - return ret; - } - - /** - * 추상 컬렉션 추가 v4.x 호환 method이므로 USEORIGINAL, USESYNONYM을 지정하지 않는다. - * - * @param aliasName - * 설정한 별칭 컬렉션명 - * @param collectionName - * 실제 컬렉션 - * @param useKma - * @param isCase - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.5, replaced by - * {@link #addAliasCollection(String,String,int,int,int,int,int)} - */ - public int addAliasCollection(String aliasName, String collectionName, - int useKma, int isCase) { - int ret = 0; - ret = search.w3AddAliasCollection(aliasName, collectionName); - ret = search.w3SetQueryAnalyzer(aliasName, useKma, isCase, 1, 1); - ret = search.w3SetDuplicateDetection(aliasName); - return ret; - } - - /** - * 추상 컬렉션 추가 - * - * @param aliasName - * 설정한 별칭 컬렉션명 - * @param collectionName - * 실제 컬렉션 - * @param useKma - * @param isCase - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addAliasCollection(String aliasName, String collectionName, - int useKma, int isCase, int useOriginal, int useSynonym, - int duplicateDectection) { - int ret = 0; - ret = search.w3AddAliasCollection(aliasName, collectionName); - ret = search.w3SetQueryAnalyzer(aliasName, useKma, isCase, useOriginal, - useSynonym); - if (duplicateDectection == 1) { - ret = search.w3SetDuplicateDetection(aliasName); - } - return ret; - } - - /** - * 검색기 연결 - * - * @param ip - * @param port - * @param timeOut - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int getConnection(String ip, int port, int timeOut) { - int ret = search.w3ConnectServer(ip, port, timeOut); - return ret; - } - - /** - * 해당 컬렉션의 검색 대상 필드를 여러 개를 설정한다. v4.x 호환 method이므로 fieldscore를 지정하지 않는다. - * - * @param collectionName - * @param fields - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.5, replaced by - * {@link #setSearchField(String,String)} - **/ - public int addSearchField(String collectionName, String[] fields) { - int ret = 0; - for (int i = 0; i < fields.length; i++) { - ret = search.w3AddSearchField(collectionName, fields[i]); - systemOut("[w3AddSearchField] " + collectionName + " / " - + fields[i]); - } - return ret; - } - - /** - * 검색 필드별 랭킹 스코어(score)를 설정한다. - * - * @param collectionName - * @param fields - * TITLE,CONTENT - * @param rankScores - * 100,30 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addSearchFieldScore(String collectionName, String[] fields, - int[] rankScores) { - int ret = 0; - for (int i = 0; i < fields.length; i++) { - ret = search.w3AddSearchFieldScore(collectionName, fields[i], - rankScores[i]); - systemOut("[w3AddSearchFieldScore] " + collectionName + " / " - + fields[i] + "/" + rankScores[i]); - } - return ret; - } - - /** - * 해당 컬렉션의 검색 대상 필드를 여러 개를 설정한다. - * - * @param collectionName - * @param fields - * TITLE/100,CONTENT/30 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setSearchField(String collectionName, String fields) { - int ret = 0; - String[] searchFieldTemp = split(fields, ","); // TITLE/100,CONTENT/30 - for (int i = 0; i < searchFieldTemp.length; i++) { - String[] searchField = split(searchFieldTemp[i], "/"); - if (searchField != null && searchField.length > 0) { - ret = search.w3AddSearchField(collectionName, searchField[0]); - systemOut("[w3AddSearchField] " + collectionName + " / " - + searchField[0]); - } - } - ret = search.w3SetSearchFieldScore(collectionName, fields); - systemOut("[w3AddSearchField] " + collectionName + " / " + fields); - return ret; - } - - /** - * 검색결과의 정렬필드를 설정한다. v4.x 호환 method - * - * @param collectionName - * @param sortField - * @param sortOrder - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.5, replaced by {@link #setSortField(String,String)} - */ - public int addSortField(String collectionName, String sortField, - int sortOrder) { - int ret = 0; - ret = search.w3AddSortField(collectionName, sortField, sortOrder); - systemOut("[w3AddSortField] " + collectionName + " / " + sortField); - return ret; - } - - /** - * 검색결과의 정렬필드를 설정한다. - * - * @param collectionName - * @param sortValue - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setSortField(String collectionName, String sortValue) { - int ret = 0; - ret = search.w3SetSortField(collectionName, sortValue); - systemOut("[w3SetSortField] " + collectionName + " / " + sortValue); - return ret; - } - - /** - * 검색결과 RANKING을 설정한다. SF-1 v5.0 신규 추가 method. - * - * @param collectionName - * @param method - * 랭킹 메소드( basic, custom, BM25 ) - * @param option - * - p( proximity ) - r( field weight ) - k( multi keyword factor - * ) - f( frequency ) - m( morpheme ) - o( offset ) - l( length ) - * @param maxcount - * Ranking 표기의 MAX 값. (예) %로 표기할 시 100 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setRanking(String collectionName, String method, String option, - int maxcount) { - return search.w3SetRanking(collectionName, method, option, maxcount); - } - - /** - * 검색한 결과 랭크값에 대한 범위를 지정 - * - * @param collectionName - * Collection 이름 - * @param minRank - * 최소 랭킹 값 - * @param maxRank - * 최대 랭킹 값 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setRankRange(String collectionName, int minRank, int maxRank) { - return search.w3SetRankRange(collectionName, minRank, maxRank); - - } - - /** - * - * @param collectionName - * @param fieldNameValues - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setPrefixQuery(String collectionName, String fieldNameValues) { - // value값에 /가 있을 수 있으므로 >/로 찾아서 query와 연산자를 분리한다. - fieldNameValues = fieldNameValues.trim(); - int index = fieldNameValues.lastIndexOf("/"); - String prefixQuery = ""; - int operator = 1; - if (index != -1) { - prefixQuery = fieldNameValues.substring(0, index); - String temp = fieldNameValues.substring(index + 1, - fieldNameValues.length()); - temp = temp.trim(); - operator = Integer.parseInt(temp); - } else { - prefixQuery = fieldNameValues.trim(); - } - int ret = search - .w3SetPrefixQuery(collectionName, prefixQuery, operator); - systemOut("[w3SetPrefixQuery]" + fieldNameValues); - return ret; - } - - /** - * - * @param collectionName - * @param fieldNameValues - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setFilterOperation(String collectionName, String fieldNameValues) { - int ret = search.w3SetFilterQuery(collectionName, fieldNameValues); - systemOut("[w3SetFilterQuery]" + fieldNameValues); - return ret; - } - - /** - * - * @param collectionName - * @param fieldNameValues - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setFilterQuery(String collectionName, String fieldNameValues) { - int ret = search.w3SetFilterQuery(collectionName, fieldNameValues); - systemOut("[w3SetFilterQuery]" + fieldNameValues); - return ret; - } - - /** - * setResultField에서 지정한 결과 필드들의 값을 얻는 함수이다. v4.x 호환 method이다. displaylength를 - * 지정하지 않으므로 주의해야한다. - * - * @param collectionName - * @param fields - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.5, replaced by - * {@link #setResultField(String,String)} - */ - public int setResultField(String collectionName, String[] fields) { - int ret = 0; - for (int i = 0; i < fields.length; i++) { - ret = search.w3AddDocumentField(collectionName, fields[i], 0); - systemOut("[w3AddDocumentField] " + collectionName + " / " - + fields[i]); - } - return ret; - } - - /** - * setResultField에서 지정한 결과 필드들의 값을 얻는 함수이다. - * - * @param collectionName - * @param fields - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setResultField(String collectionName, String fields) { - int ret = 0; - ret = search.w3SetDocumentField(collectionName, fields); - systemOut("[w3SetDocumentField] " + collectionName + " / " + fields); - return ret; - } - - /** - * 해당 컬렉션의 몇 번째 검색 결과부터 몇 개를 가져올 것인지를 지정하고 하이라이트 기능과 요약기능을 지정하는 함수이다. 검색 API - * v3.5에서는 w3SetHighlight의 파라미터가 2개이지만 v3.7에서는 3개이다. - * - * @param collName - * @param highlight - * @param startPos - * @param resultCnt - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setPageInfo(String collName, int highlight, int startPos, - int resultCnt) { - int ret = 0; - if (highlight == 1) { // OFF, ON - ret = search.w3SetHighlight(collName, 0, 1); - } else if (highlight == 2) { // ON , OFF - ret = search.w3SetHighlight(collName, 1, 0); - } else if (highlight == 3) { // ON, ON - ret = search.w3SetHighlight(collName, 1, 1); - } else {// OFF, OFF - ret = search.w3SetHighlight(collName, 0, 0); - } - // 페이지, 기본정렬 설정 - ret = search.w3SetPageInfo(collName, startPos, resultCnt); - - return ret; - } - - /** - * 검색한 결과 날짜/시간 범위를 지정하고 시작날짜와 종료날짜의 형식이 YYYY/MM/DD가 아니라면 변경할 문자를 인자로 지정한다. - * - * @param collectionName - * @param startDate - * @param endDate - * @param replaceChr - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setDateRange(String collectionName, String startDate, - String endDate, String replaceChr) { - // 날짜 조건 세팅 - int ret = 0; - if (!startDate.equals("") && !endDate.equals("")) { - startDate = replace(startDate, replaceChr, "/"); - endDate = replace(endDate, replaceChr, "/"); - ret = search.w3SetDateRange(collectionName, startDate, endDate); - } - return ret; - } - - /** - * - * @param collectionName - * @param field - * @param matchType - * @param boostID - * @param boostKeyword - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by - * {@link #setBoostCategory(String,String,String,String)} - */ - public int setCategoryBoost(String collectionName, String field, - String matchType, String boostID, String boostKeyword) { - int ret = 0; - ret = search.w3SetBoostCategory(collectionName, field, matchType, - boostKeyword); - return ret; - } - - /** - * - * @param collectionName - * @param field - * @param matchType - * @param boostID - * @param boostKeyword - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setBoostCategory(String collectionName, String field, - String matchType, String boostID, String boostKeyword) { - return search.w3SetBoostCategory(collectionName, field, matchType, - boostKeyword); - } - - /** - * 검색결과에서 중복문서 정렬 기준을 설정한다. - * - * @param collectionName - * Collection 명 - * @param categoryGroup - * Category 그룹정보 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addDuplicateDetectionCriterionField(String collection, - String field, int nOrder) { - int ret = -1; - ret = search.w3AddDuplicateDetectionCriterionField(collection, field, - nOrder); - return ret; - } - - /** - * 검색결과에서 중복문서 정렬 기준을 설정한다. - * - * @param collectionName - * Collection 명 - * @param categoryGroup - * Category 그룹정보 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setDuplicateDetectionCriterionField(String collection, - String fieldList) { - int ret = -1; - ret = search.w3SetDuplicateDetectionCriterionField(collection, - fieldList); - return ret; - } - - /** - * 검색결과 패킷에 카테고리 지정 컬렉션의 카테고리 필드에서 Depth별 Category의 리스트를 포함시킨다. - * - * @param collectionName - * Collection 명 - * @param categoryGroup - * Category 그룹정보 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addCategoryGroupBy(String collectionName, String[] categoryGroup) { - int ret = -1; - int length = categoryGroup.length; - for (int i = 0; i < length; i++) { - String[] dataFields = split(categoryGroup[i], ":"); - if (dataFields.length == 2) { - // depthList depth의 list를 콤마(:) 로 구분하여 입력 - ret = search.w3AddCategoryGroupBy(collectionName, - dataFields[0], dataFields[1]); - } - } - return ret; - } - - /** - * 선택한 컬렉션 내의 선택 카테고리 필드의 값으로 검색결과를 필터링 한다. 혹은 다른 쿼리없이 본쿼리를 실행하면 해당 카테고리의 값에 - * 매치되는 문서를 출력한다. - * - * @param collectionName - * Collection 명 - * @param categoryQuery - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addCategoryQuery(String collectionName, String[] categoryQuery) { - int ret = -1; - int length = categoryQuery.length; - for (int i = 0; i < length; i++) { - String[] dataFields = split(categoryQuery[i], ":"); - if (dataFields.length == 2) { - ret = search.w3AddCategoryQuery(collectionName, dataFields[0], - dataFields[1]); - } - } - return ret; - } - - /** - * w3SetCategoryGroupBy를 통해 패킷에 포함된 해당 collection-field-depth를 key로 하는 카테고리의 - * 총 개수를 반환 - * - * @param collectionName - * 검색 대상 collection명 - * @param fieldName - * Category Field 명 - * @param depth - * 현재 그룹핑하여 보고자 하는 depth - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int getCategoryCount(String collectionName, String field, int depth) { - return search.w3GetCategoryCount(collectionName, field, depth); - } - - /** - * w3SetCategoryGroupBy를 통해 패킷에 포함된 해당 collection-field-depth를 key로 하는 카테고리 - * 중 categoryIdx번째의 완전한 카테고리 이름을 반환 - * - * @param collectionName - * 검색 대상 collection명 - * @param fieldName - * Category Field 명 - * @param depth - * 현재 그룹핑하여 보고자 하는 depth - * @param idx - * 해당 컬렉션-카테고리-Depth에 해당하는 카테고리 결과의 인덱스 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public String getCategoryName(String collectionName, String field, - int depth, int idx) { - return search.w3GetCategoryName(collectionName, field, depth, idx); - } - - /** - * w3SetCategoryGroupBy를 통해 패킷에 포함된 해당 collection-field-depth를 key로 하는 카테고리 - * 중 categoryIdx번째의 카테고리안에 몇 개의 문서가 포함되어있는지(검색 결과내에서)를 반환 - * - * @param collectionName - * 검색 대상 collection명 - * @param fieldName - * Category Field 명 - * @param depth - * 현재 그룹핑하여 보고자 하는 depth - * @param idx - * 해당 컬렉션-카테고리-Depth에 해당하는 카테고리 결과의 인덱스 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int getDocumentCountInCategory(String collectionName, String field, - int depth, int idx) { - return search.w3GetDocumentCountInCategory(collectionName, field, - depth, idx); - } - - /** - * 특정 필드의 값을 기준으로 범위 별로 그룹을 만들거나, 이 필드 값이 특정 범위에 속하는 레코드만 추출 @ - * collectionName @ field @ min @ max @ groupCount - */ - public int setPropertyGroup(String collectionName, String field, int min, - int max, int groupCount) { - int ret = 0; - ret = search.w3SetPropertyGroup(collectionName, field, min, max, - groupCount); - return ret; - } - - /** - * v3.7에서는 2개의 전달인자 v4.0에서는 3개의 전달인자 - * - * @param collectionName - * @param field - * @param docCount - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setGroupBy(String collectionName, String field, int docCount) { - int ret = 0; - ret = search.w3SetGroupBy(collectionName, field, docCount); - return ret; - } - - /** - * 단순히 최종 결과에서 특정 필드(들)값의 그룹핑된 결과를 얻어오기 원할 때 사용 - * - * @param collectionName - * 컬렉션명 - * @param fieldName - * 그룹핑할 필드명 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addMultiGroupBy(String collectionName, String fields) { - int ret = 0; - String[] field = split(fields, ","); - int length = field.length; - for (int i = 0; i < length; i++) { - ret = search.w3AddMultiGroupBy(collectionName, field[i]); - } - return ret; - } - - public int setMultiGroupBy(String collectionName, String fields) { - return search.w3SetMultiGroupBy(collectionName, fields); - } - - /** - * 멀티 그룹바이된 결과를 반환 - * - * @param collectionName - * 컬렉션명 - * @param fieldName - * 그룹핑할 필드명 - * @return 성공 시 해당 컬렉션 결과에서 인자로 주어진 필드의 그룹핑 결과 문자열을 반환하며, 에러 발생시 빈 문자열을 반환 - */ - public String getMultiGroupByResult(String collectionName, String field) { - String ret = ""; - ret = search.w3GetMultiGroupByResult(collectionName, field); - return ret; - } - - /** - * 그룹 검색결과의 정렬필드를 설정한다. - * - * @param collectionName - * @param sortField - * @param sortOrder - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addSortFieldInGroup(String collectionName, String sortField, - int sortOrder) { - int ret = 0; - ret = search - .w3AddSortFieldInGroup(collectionName, sortField, sortOrder); - systemOut("[w3AddSortFieldInGroup] " + collectionName + " / " - + sortField); - return ret; - } - - /** - * 그룹내의 문서들의 정렬 정보들을 지정해 주는 함수 - * - * @param collectionName - * @param sortValue - * url/DESC,RANK/DESC,DATE/ASC - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setSortFieldInGroup(String collectionName, String sortValue) { - int ret = 0; - ret = search.w3SetSortFieldInGroup(collectionName, sortValue); - systemOut("[w3SetSortFieldInGroup] " + collectionName + " / " - + sortValue); - return ret; - } - - /** - * 권한 쿼리 (Authority Query) - * - * @param collection - * @param authTargetField - * @param authCollection - * @param authReferField - * @param authorityQuery - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int setAuthorityQuery(String collection, String authTargetField, - String authCollection, String authReferField, String authorityQuery) { - int ret = search.w3SetAuthorityQuery(collection, authTargetField, - authCollection, authReferField, authorityQuery); - systemOut("[w3SetAuthorityQuery]" + authorityQuery); - return ret; - } - - /** - * - * @param collectionName - * @return 검색기로부터 받아온 속성 그룹의 개수를 반환 - */ - public int getCountPropertyGroup(String collectionName) { - return search.w3GetCountPropertyGroup(collectionName); - } - - /** - * - * @param collectionName - * @return 전체 그룹 개수 - */ - public int getResultGroupCount(String collectionName) { - return search.w3GetResultGroupCount(collectionName); - } - - /** - * - * @param collectionName - * @return 전체 그룹 개수 - */ - public int getResultTotalGroupCount(String collectionName) { - return search.w3GetResultTotalGroupCount(collectionName); - } - - /** - * - * @param collectionName - * @parma groupIndex - * @return 그룹에 속하는 문서 중 가져온 문서 개수 - */ - public int getCountInGroup(String collectionName, int groupIndex) { - return search.w3GetCountInGroup(collectionName, groupIndex); - } - - /** - * - * @param collectionName - * @parma groupIndex - * @return 그룹에 속하는 전체문서 개수 - */ - public int getTotalCountInGroup(String collectionName, int groupIndex) { - return search.w3GetTotalCountInGroup(collectionName, groupIndex); - } - - /** - * - * @param collectionName - * @return 성공시 해당 속성 그룹의 최소값을 반환하며, 에러 발생시 음수를 반환 - */ - public int getMinValuePropertyGroup(String collectionName) { - return search.w3GetMinValuePropertyGroup(collectionName); - } - - /** - * - * @param collectionName - * @return 성공시 해당 속성 그룹의 최대값을 반환하며, 에러 발생시 음수를 반환 - */ - public int getMaxValuePropertyGroup(String collectionName) { - return search.w3GetMaxValuePropertyGroup(collectionName); - } - - /** - * - * @param collectionName - * @parma groupIndex - * @return 성공시 속성 그룹 결과의 최소값을 반환하며, 에러 발생시 음수를 반환 - */ - public int getMinValueInPropertyGroup(String collectionName, int groupIndex) { - return search.w3GetMinValueInPropertyGroup(collectionName, groupIndex); - } - - /** - * - * @param collectionName - * @parma groupIndex - * @return 성공시 속성 그룹 결과의 최대값을 반환하며, 에러 발생시 음수를 반환 - */ - public int getMaxValueInPropertyGroup(String collectionName, int groupIndex) { - return search.w3GetMaxValueInPropertyGroup(collectionName, groupIndex); - } - - /** - * - * @param collectionName - * @parma groupIndex - * @return 지정된 속성 그룹 내 문서개수를 반환 - */ - public int getDocumentCountInPropertyGroup(String collectionName, - int groupIndex) { - return search.w3GetDocumentCountInPropertyGroup(collectionName, - groupIndex); - } - - /** - * 그룹화된 문서 중 지정된 순서의 그룹 내에서 주어진 collection 결과 에서 index 번째 문서의 Collection ID를 - * 반환 - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 필드값 - */ - public String getCollectionIdInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetCollectionIdInGroup(collectionName, groupIndex, - docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 필드값 - */ - public long getRankInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetRankInGroup(collectionName, groupIndex, docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 필드값 - */ - public String getFieldInGroup(String collectionName, String fieldName, - int groupIndex, int docIndex) { - return search.w3GetFieldInGroup(collectionName, fieldName, groupIndex, - docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 uid값 - */ - public long getUidInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetUidInGroup(collectionName, groupIndex, docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 가중치 값 - */ - public long getWeightInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetWeightInGroup(collectionName, groupIndex, docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 날짜 정보 - */ - public String getDateInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetDateInGroup(collectionName, groupIndex, docIndex); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹에 속하는 문서중 원하는 문서의 sc 정보 - */ - public String getSearcherIdInGroup(String collectionName, int groupIndex, - int docIndex) { - return search.w3GetSearcherIdInGroup(collectionName, groupIndex, - docIndex); - } - - /** - * v4.x 호환 method v5.0에서는 삭제되었다. 하이라이팅될 문자열을 보여주는 함수이다. - * - * @return 하이라이팅될 문자열 public String getHighlightKeyword() { String keyWord = - * this.search.w3GetHighlightKeyword().trim(); return keyWord; } - */ - - /** - * 형태소 분석된 결과 문자열을 보여주는 함수이다. - * - * @param colName - * @param field - * @return 하이라이팅될 문자열 - */ - public String getHighlightKeywordByField(String colName, String searchField) { - String keyWord = this.search - .w3GetHighlightByField(colName, searchField); - return keyWord; - } - - /** - * - * @param collectionName - * @return 검색결과 개수 - */ - public int getResultCount(String collectionName) { - return search.w3GetResultCount(collectionName); - } - - /** - * - * @param collectionName - * @return 검색결과 총 개수 - */ - public int getResultTotalCount(String collectionName) { - return search.w3GetResultTotalCount(collectionName); - } - - /** - * - * @param collectionName - * @param idx - * @return 검색한 해당 문서의 중복문서 개수를 반환 - */ - public int getDuplicateDocumentCount(String collectionName, int idx) { - return search.w3GetDuplicateDocumentCount(collectionName, idx); - } - - /** - * - * @param collectionName - * @param groupIndex - * @param docIndex - * @return 그룹화된 문서 중 지정된 순서의 그룹 내에서 각 결과들이 중복된 문서의 개수를 반환 - */ - public int getDuplicateDocumentCountInGroup(String collectionName, - int groupIndex, int docIndex) { - return search.w3GetDuplicateDocumentCountInGroup(collectionName, - groupIndex, docIndex); - } - - /** - * 최근에 검색된 키워드리스트를 반환한다. - * - * @param count - * @return 최근에 검색된 키워드리스트 - */ - public String[] receiveRecentQueryListResult(int mode, int count) { - int ret = search.w3ReceiveRecentQueryListResult(mode, count); - if (ret < 0) { - systemOut("[W3ReceiveRecentQueryListResult] " - + search.w3GetErrorInfo() + ", ret=" + ret); - return null; - } - int size = search.w3GetRecentQueryListSize(); - String[] keyList = new String[size]; - for (int i = 0; i < size; i++) { - keyList[i] = search.w3GetRecentQuery(i); - } - return keyList; - } - - /** - * 최근에 검색된 키워드리스트를 반환한다. - * - * @param count - * @return 최근에 검색된 키워드리스트 - */ - public int receiveRecentQueryListResultAsXml(int mode, int count) { - int ret = search.w3ReceiveRecentQueryListResultAsXml(mode, count); - if (ret < 0) { - systemOut("[w3ReceiveRecentQueryListResultAsXml] " - + search.w3GetErrorInfo() + ", ret=" + ret); - return -1; - } - return ret; - } - - /** - * 최근에 검색된 키워드리스트를 반환한다. - * - * @param count - * @return 최근에 검색된 키워드리스트 - */ - public int receiveRecentQueryListResultAsJson(int mode, int count) { - int ret = search.w3ReceiveRecentQueryListResultAsJson(mode, count); - if (ret < 0) { - systemOut("[w3ReceiveRecentQueryListResultAsJson] " - + search.w3GetErrorInfo() + ", ret=" + ret); - return -1; - } - return ret; - } - - /** - */ - public String getSuggestedQuery() { - return search.w3GetSuggestedQuery(); - } - - /** - * v4.x 호환 method - * - * @param mode - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by - * {@link #receiveSearchQueryResult(int)} - */ - public int recvResult(int mode) { - int ret = search.w3ReceiveSearchQueryResult(mode); - return ret; - } - - /** - * - */ - public int recvDuplicateDocumentsResult(int mode) { - int ret = search.w3ReceiveDuplicateDocumentsResult(mode); - return ret; - } - - /** - * - */ - public int recvDuplicateDocumentsResultAsJson(int mode) { - int ret = search.w3ReceiveDuplicateDocumentsResultAsJson(mode); - return ret; - } - - /** - * - */ - public int recvDuplicateDocumentsResultAsXml(int mode) { - int ret = search.w3ReceiveDuplicateDocumentsResultAsXml(mode); - return ret; - } - - /** - * - * @param mode - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveSearchQueryResult(int mode) { - int ret = search.w3ReceiveSearchQueryResult(mode); - return ret; - } - - /** - * - * @param mode - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveSearchQueryResultAsXml(int mode) { - int ret = search.w3ReceiveSearchQueryResultAsXml(mode); - return ret; - } - - /** - * - * @param mode - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveSearchQueryResultAsJson(int mode) { - int ret = search.w3ReceiveSearchQueryResultAsJson(mode); - return ret; - } - - /** - * - * @return 성공이면 검색결과를 XML로 반환한다. - */ - public String getResultXml() { - String ret = search.w3GetResultXml(); - return ret; - } - - /** - * - * @return 성공이면 검색결과를 JSON data로 반환한다. - */ - public String getResultJson() { - String ret = search.w3GetResultJson(); - return ret; - } - - /** - * UID 검색을 검색기에 전달하고, 결과를 받는 함수이다. v4.x 호환 method - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by {@link #receiveUidResult(int)} - */ - public int recvDocument(int mode) { - int ret = search.w3ReceiveUidResult(mode); - return ret; - } - - /** - * UID 검색을 검색기에 전달하고, 결과를 받는 함수이다. - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveUidResult(int mode) { - int ret = search.w3ReceiveUidResult(mode); - return ret; - } - - /** - * UID 검색을 검색기에 전달하고, 결과를 받는 함수이다. - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveUidResultAsXml(int mode) { - int ret = search.w3ReceiveUidResultAsXml(mode); - return ret; - } - - /** - * UID 검색을 검색기에 전달하고, 결과를 받는 함수이다. - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveUidResultAsJson(int mode) { - int ret = search.w3ReceiveUidResultAsJson(mode); - return ret; - } - - /** - * v4.x 호환 method - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - * @deprecated As of v4.x, replaced by - * {@link #receiveMorphemeAnalysisResult(int)} - */ - public int recvAnalyzedQuery(int mode) { - int ret = search.w3ReceiveMorphemeAnalysisResult(mode); - return ret; - } - - /** - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveMorphemeAnalysisResult(int mode) { - int ret = search.w3ReceiveMorphemeAnalysisResult(mode); - return ret; - } - - /** - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveMorphemeAnalysisResultAsXml(int mode) { - int ret = search.w3ReceiveMorphemeAnalysisResultAsXml(mode); - return ret; - } - - /** - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int receiveMorphemeAnalysisResultAsJson(int mode) { - int ret = search.w3ReceiveMorphemeAnalysisResultAsJson(mode); - return ret; - } - - /** - * 주어진 collection 결과 에서 index 번째 문서의 Collection ID를 반환한다. - * - * @param coll - * @param idx - * @return FIELD VALUE - */ - public String getCollectionId(String coll, int idx) { - return search.w3GetCollectionId(coll, idx); - } - - /** - * - * @param coll - * @param field - * @param idx - * @return FIELD VALUE - */ - public String getField(String coll, String field, int idx) { - return search.w3GetField(coll, field, idx); - } - - /** - * - * @param coll - * @param idx - * @return DATE - */ - public String getDate(String coll, int idx) { - return search.w3GetDate(coll, idx); - } - - /** - * - * @param coll - * @param idx - * @return DATE - */ - public long getWeight(String coll, int idx) { - return search.w3GetWeight(coll, idx); - } - - /** - * - * @param coll - * @param idx - * @return RANK - */ - public long getRank(String coll, int idx) { - return search.w3GetRank(coll, idx); - } - - /** - * - * @param coll - * @param idx - * @return UID - */ - public long getUid(String coll, int idx) { - return search.w3GetUid(coll, idx); - } - - /** - * - * @param coll - * @param idx - * @return SearcherId - */ - public String getSearcherId(String coll, int idx) { - return search.w3GetSearcherId(coll, idx); - } - - /* - * 여러 컬렉션의 검색결과를 하나의 가상 컬렉션(Merge Collection) 결과로 통합하여 가져오기 원할 때 사용하는 함수 - * - * @param mergeCollection 통합 가상 컬렉션명 - * - * @param collections[] (통합대상) 컬렉션명 - * - * @param start (결과 중) 시작 문서 인덱스 - * - * @param count (결과 중) 가져올 문서 개수 - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addMergeCollectionInfo(String mergeCollection, - String[] collections, int start, int count) { - int collectionLen = collections.length; - int ret = 0; - - for (int i = 0; i < collectionLen; i++) { - - ret = search.w3AddMergeCollection(mergeCollection, collections[i]); - } - - ret = search.w3SetMergePageInfo(mergeCollection, start, count); - - return ret; - } - - /* - * 통합 컬렉션(Merge Collection)의 결과 필드(Document Field)와 통합될 개별 컬렉션의 결과 필드를 1:N ( - * 0 < N < 64 ) 관계로 연결시킨다 - * - * @param mergeCollection 통합 가상 컬렉션명 - * - * @param mergeFields[] 가상 통합 컬렉션의 결과 필드명 - * - * @param collections[] (통합대상) 컬렉션명 - * - * @param fields[,] (통합대상) 컬렉션의 결과 필드명 - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addMergeDocumentField(String mergeCollection, - String[] mergeFields, String[] collections, String[][] fields) { - int ret = 0; - int collectionLen = collections.length; - int fieldsLen = mergeFields.length; - - for (int i = 0; i < collectionLen; i++) { - - for (int j = 0; j < fieldsLen; j++) { - ret = search.w3AddMergeDocumentField(mergeCollection, - mergeFields[j], collections[i], fields[i][j]); - } - } - return ret; - } - - /* - * w3AddMergeDocumentField 함수가 통합 컬렉션의 결과 필드를 정의 하였다면, 이 함수는 통합 컬렉션의 - * MultiGroupBy 필드명의 정의 및 개별 컬렉션의 MultiGroupBy 필드명과 연결시키는 역할 - * - * @param mergeCollection 통합 가상 컬렉션명 - * - * @param mergeFields[] 가상 통합 컬렉션의 결과 필드명 - * - * @param collections[] (통합대상) 컬렉션명 - * - * @param fields[,] (통합대상) 컬렉션의 결과 필드명 - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addMergeMultiGroupByField(String mergeCollection, - String[] mergeFields, String[] collections, String[][] fields) { - int ret = 0; - int collectionLen = collections.length; - int fieldsLen = mergeFields.length; - for (int i = 0; i < collectionLen; i++) { - for (int j = 0; j < fieldsLen; j++) { - ret = search.w3AddMergeMultiGroupByField(mergeCollection, - mergeFields[j], collections[i], fields[i][j]); - } - } - return ret; - } - - /* - * 통합 컬렉션의 CategoryGroupBy 필드명의 정의 및 개별 컬렉션의 CategoryGroupBy 필드명과 연결시키는 역할 - * - * @param mergeCollection 통합 가상 컬렉션명 - * - * @param mergeFields[] 가상 통합 컬렉션의 결과 필드명 - * - * @param collections[] (통합대상) 컬렉션명 - * - * @param fields[,] (통합대상) 컬렉션의 결과 필드명 - * - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int addMergeCategoryGroupByField(String mergeCollection, - String[] mergeFields, String[] collections, String[][] fields) { - int ret = 0; - int collectionLen = collections.length; - int fieldsLen = mergeFields.length; - for (int i = 0; i < collectionLen; i++) { - for (int j = 0; j < fieldsLen; j++) { - ret = search.w3AddMergeCategoryGroupByField(mergeCollection, - mergeFields[j], collections[i], fields[i][j]); - } - } - return ret; - } - - /* - * 검색기에서 받아올 통합 컬렉션(Merge Collection) 결과의 시작 인덱스와 문서 개수를 설정 CategoryGroupBy - * 필드명과 연결시키는 역할 - * - * @param mergeCollection 통합 가상 컬렉션명 - * - * @param collections (통합대상) 컬렉션명 - * - * @return 문서 개수 반환한다. - */ - public int getResultTotalCountInMerge(String mergeCollection, - String collection) { - return search.w3GetResultTotalCountInMerge(mergeCollection, collection); - } - - /** - * 네트워크 종료 - */ - public void closeServer() { - if (search != null) { - search.w3CloseServer(); - search = null; - } - } - - /** - * 인자로 전달받은 collection의 검색결과의 에러가 발생하면 에러 코드와 메시지를 반환한다. - * - * @param collectionName - * @return - */ - public String getCollectionErrorInfo(String collectionName) { - String errorMsg = ""; - int errorCode = search.w3GetCollectionError(collectionName); - if (errorCode != 0) { - errorMsg = search.w3GetCollectionErrorInfo(collectionName); - errorMsg = errorMsg + "(code:" + errorCode - + ")"; - } - return errorMsg; - } - - /** - * 검색결과의 에러가 발생하면 에러 코드와 메시지를 반환한다. - * - * @return - */ - public String getErrorInfo() { - String errorMsg = ""; - int errorCode = search.w3GetError(); - if (errorCode != 0) { - errorMsg = search.w3GetErrorInfo(); - errorMsg = errorMsg + "(code:" + errorCode - + ")"; - } - return errorMsg; - } - - /** - * 검색 api의 버전정보를 반환한다. - * - * @return - */ - public String getVersionInfo() { - return search.w3GetVersionInfo(); - } - - /** - * 에러 코드에 대한 에러정보를 web application의 standard out log에 출력한다. - * - * @param msg - */ - public void systemOut(String msg) { - if (isDebug) { - //System.out.println(msg + "
"); - } - } - -} diff --git a/src/main/java/kccf/sch/common/WNDefine.java b/src/main/java/kccf/sch/common/WNDefine.java deleted file mode 100644 index 4099103c..00000000 --- a/src/main/java/kccf/sch/common/WNDefine.java +++ /dev/null @@ -1,73 +0,0 @@ -package kccf.sch.common; -public class WNDefine { - public final static int CONNECTION_TIMEOUT = 20000; - public final static String CHARSET = "UTF-8"; - public final static int REALTIME_COUNT=100; - public final static int PAGE_SCALE = 10; //view page list count - - public final static int CONNECTION_KEEP = 0; //recevive mode - public final static int CONNECTION_REUSE = 2; - public final static int CONNECTION_CLOSE = 3; - - public final static int ASC = 0; //order - public final static int DESC = 1; //order - - public final static int USE_KMA_OFFOFF = 0; //synonym, morpheme - public final static int USE_KMA_ONON = 1; - public final static int USE_KMA_ONOFF = 2; - - public final static int USE_RESULT_STRING = 0; //result data type - public final static int USE_RESULT_XML = 1; - public final static int USE_RESULT_JSON = 2; - public final static int USE_RESULT_DUPLICATE_STRING = 3; //uid result data type - public final static int USE_RESULT_DUPLICATE_XML = 4; - public final static int USE_RESULT_DUPLICATE_JSON = 5; - - public final static int IS_CASE_ON = 1; //case on, off - public final static int IS_CASE_OFF = 0; - - public final static int HI_SUM_OFFOFF = 0; //summarizing, highlighting - public final static int HI_SUM_OFFON = 1; - public final static int HI_SUM_ONOFF = 2; - public final static int HI_SUM_ONON = 3; - - public final static int COMMON_OR_WHEN_NORESULT_OFF = 0; - public final static int COMMON_OR_WHEN_NORESULT_ON = 1; - - public final static int INDEX_NAME = 0; - public final static int COLLECTION_NAME = 1; - public final static int PAGE_INFO = 2; - public final static int ANALYZER = 3; - public final static int SORT_FIELD = 4; - public final static int RANKING_OPTION = 5; - public final static int SEARCH_FIELD = 6; - public final static int RESULT_FIELD = 7; - public final static int DATE_RANGE = 8; - public final static int RANK_RANGE = 9; - public final static int EXQUERY_FIELD = 10; - public final static int COLLECTION_QUERY =11; - public final static int BOOST_QUERY =12; - public final static int FILTER_OPERATION = 13; - public final static int GROUP_BY = 14; - public final static int GROUP_SORT_FIELD = 15; - public final static int CATEGORY_BOOST = 16; - public final static int CATEGORY_GROUPBY = 17; - public final static int CATEGORY_QUERY = 18; - public final static int PROPERTY_GROUP = 19; - public final static int PREFIX_FIELD = 20; - public final static int FAST_ACCESS = 21; - public final static int MULTI_GROUP_BY = 22; - public final static int AUTH_QUERY = 23; - public final static int DEDUP_SORT_FIELD = 24; - public final static int COLLECTION_KOR = 25; - - public final static int MERGE_COLLECTION_NAME = 0; - public final static int MERGE_MAPPING_COLLECTION_NAME = 1; - public final static int MERGE_PAGE_INFO = 2; - public final static int MERGE_RESULT_FIELD = 3; - public final static int MERGE_MAPPING_RESULT_FIELD = 4; - public final static int MERGE_MULTI_GROUP_BY_FIELD = 5; - public final static int MERGE_MAPPING_MULTI_GROUP_BY_FIELD = 6; - public final static int MERGE_CATEGORY_GROUPBY_FIELD = 7; - public final static int MERGE_MAPPING_CATEGORY_GROUPBY_FIELD = 8; -} diff --git a/src/main/java/kccf/sch/common/WNSearch.java b/src/main/java/kccf/sch/common/WNSearch.java deleted file mode 100644 index 19909d69..00000000 --- a/src/main/java/kccf/sch/common/WNSearch.java +++ /dev/null @@ -1,2443 +0,0 @@ -package kccf.sch.common; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; -import static kccf.sch.common.WNUtils.*; -import static kccf.sch.common.WNDefine.*; - -import kccf.sch.service.vo.Sf1VO; - - - - -public class WNSearch { - private WNCommon common ; - private WNCollection wncol; - private String[] collection ; - private String[] mergeCollections ; - private String[] searchFields; - private String managerURL = ""; - private int hiSum = 0; - private int connectionOpt = 0; - private StringBuffer sb = null; - private StringBuffer warningMsg = null; - - private String searcherId = ""; - private boolean isDebug = false; - private boolean isUidSrch = false; - private int resultType = 0; - - public String realTimeKeywords= ""; - public String suggestedQuery = ""; - - private Sf1VO sf1Vo; - - public void setSf1Vo(Sf1VO sf1Vo) { - this.sf1Vo = sf1Vo; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param searcherId 검색 대상 sc id - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - */ - public WNSearch(String searcherId, boolean isDebug, boolean isUidSrch, - String[] collections, String[] searchFields){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - this.searcherId = searcherId; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param searcherId 검색 대상 sc id - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - * @param resultType 검색결과를 반환받고자 하는 데이터 형태 - */ - public WNSearch(String searcherId, boolean isDebug, boolean isUidSrch, - String[] collections, String[] searchFields, int resultType){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - this.searcherId = searcherId; - this.resultType = resultType; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param searcherId 검색 대상 sc id - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param mergeCollections 검색하고자 하는 가상통합컬렉션을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - * @param resultType 검색결과를 반환받고자 하는 데이터 형태 - */ - public WNSearch(String searcherId, boolean isDebug, boolean isUidSrch, - String[] collections, String[] mergeCollections, String[] searchFields, int resultType){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.mergeCollections = mergeCollections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - this.searcherId = searcherId; - this.resultType = resultType; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - * @param resultType 검색결과를 반환받고자 하는 데이터 형태 - */ - public WNSearch(boolean isDebug, boolean isUidSrch, String[] collections, - String[] searchFields, int resultType){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - this.resultType = resultType; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param mergeCollections 검색하고자 하는 가상통합컬렉션을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - * @param resultType 검색결과를 반환받고자 하는 데이터 형태 - */ - public WNSearch(boolean isDebug, boolean isUidSrch, String[] collections, - String[] mergeCollections, String[] searchFields, int resultType){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.mergeCollections = mergeCollections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - this.resultType = resultType; - } - - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - */ - public WNSearch(boolean isDebug, boolean isUidSrch, String[] collections, String[] searchFields){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - } - - /** - * WNCommon객체를 생성하고 검색 대상 컬렉션과 검색 대상 필드들을 설정한다. - * @param isDebug 검색설정을 화면에 출력할 것인지 여부를 결정 - * @param isUidSrch 키워드 검색을 할 것인지 UID 검색을 할 것인지 여부를 결정 - * @param collections 검색하고자 하는 컬렉션들을 Array로 지정한다. - * @param mergeCollections 검색하고자 하는 가상통합컬렉션을 Array로 지정한다. - * @param searchFields 검색하고자 하는 검색필드들을 Array로 지정한다. - */ - public WNSearch(boolean isDebug, boolean isUidSrch, String[] collections, - String[] mergeCollections, String[] searchFields){ - this.common = new WNCommon(); - this.wncol = new WNCollection(); - this.collection = collections; - this.mergeCollections = mergeCollections; - this.searchFields = searchFields; - this.sb = new StringBuffer(); - this.warningMsg = new StringBuffer(); - this.isDebug = isDebug; - this.isUidSrch = isUidSrch; - } - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int search(String query, boolean isRealQuery, String SEARCH_IP, int SEARCH_PORT) { - return search(query, isRealQuery, null, HI_SUM_ONON, COMMON_OR_WHEN_NORESULT_OFF, CONNECTION_CLOSE, false, SEARCH_IP, SEARCH_PORT); - } - - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @param useOrResult 검색결과 없을 때 OR로 검색할지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int search(String query, boolean isRealQuery, int useOrResult, String SEARCH_IP, int SEARCH_PORT) { - return search(query, isRealQuery, null, HI_SUM_ONON, useOrResult, CONNECTION_CLOSE, false, SEARCH_IP, SEARCH_PORT); - } - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @param connectionOpt 검색기와 연결을 유지할 것인지 끊을 것인지 여부를 결정 - * @param useSuggestedQuery speller 결과를 사용할 것인지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int search(String query, boolean isRealQuery, int connectionOpt, boolean useSuggestedQuery, String SEARCH_IP, int SEARCH_PORT) { - this.connectionOpt = connectionOpt; - return search(query, isRealQuery, null, HI_SUM_ONON, COMMON_OR_WHEN_NORESULT_OFF, connectionOpt, useSuggestedQuery, SEARCH_IP, SEARCH_PORT); - } - - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @param useOrResult 검색결과 없을 때 OR로 검색할지 여부를 결정 - * @param connectionOpt 검색기와 연결을 유지할 것인지 끊을 것인지 여부를 결정 - * @param useSuggestedQuery speller 결과를 사용할 것인지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int search(String query, boolean isRealQuery, int useOrResult, int connectionOpt, boolean useSuggestedQuery, String SEARCH_IP, int SEARCH_PORT) { - this.connectionOpt = connectionOpt; - return search(query, isRealQuery, null, HI_SUM_ONON, useOrResult, connectionOpt, useSuggestedQuery, SEARCH_IP, SEARCH_PORT); - } - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @param useOrResult 검색결과 없을 때 OR로 검색할지 여부를 결정 - * @param connectionOpt 검색기와 연결을 유지할 것인지 끊을 것인지 여부를 결정 - * @param hisum 하이라이팅과 요약을 사용할 옵션을 결정 - * @param useSuggestedQuery speller 결과를 사용할 것인지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int search(String query, boolean isRealQuery, int useOrResult, int connectionOpt, int hiSum, boolean useSuggestedQuery, String SEARCH_IP, int SEARCH_PORT) { - this.connectionOpt = connectionOpt; - return search(query, isRealQuery, null, hiSum, useOrResult, connectionOpt, useSuggestedQuery, SEARCH_IP, SEARCH_PORT); - } - - /** - * 검색 키워드를 설정한다. - * @param query 검색 키워드 - * @param isRealQuery 실시간 검색어를 출력한 것인지 여부를 결정 - * @param userInfo 사용자 정보를 QueryLog파일이 저장할 때 사용된다 - * @param hisum 하이라이팅과 요약을 사용할 옵션을 결정 - * @param useOrResult 검색결과 없을 때 OR로 검색할지 여부를 결정 - * @param connectionOpt 검색기와 연결을 유지할 것인지 끊을 것인지 여부를 결정 - * @param useSuggestedQuery speller 결과를 사용할 것인지 여부를 결정 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - private int search(String query, boolean isRealQuery, String[] userInfo, int hiSum, int useOrResult, int connectionOpt, boolean useSuggestedQuery, String SEARCH_IP, int SEARCH_PORT) { - this.connectionOpt = connectionOpt; - this.hiSum = hiSum; - int ret = 0; - if(!isUidSrch) { - ret = common.setCommonQuery(query, CHARSET, useOrResult, useSuggestedQuery, userInfo); - } else { - ret = common.setUidQuery(CHARSET); - } - - if( collection != null){ - for(int i=0; i", ""); - content = content.replaceAll("", ""); - } - return content; - } - - - /** - * 검색된 키워드의 분석 결과의 리스트를 얻어서 인자로 받은 문자열에 하이라이팅 한다. - * @param content 하이라이팅 하고자 하는 문자열 - * @param startTag 하이라이팅 하고자 하는 Tag의 시작 문자 - * @param endTag 하이라이팅 하고자 하는 Tag의 끝 문자 - * @return 하이라이팅된 문자열을 반환한다. - */ - public String getKeywordHl(String content, String startTag, String endTag) { - if(content != null) { - content = replace(content, "", startTag); - content = replace(content, "", endTag); - } - return content; - } - - - /** - * WNCollection에서 정의된 COLLECTIONS의 index를 얻는다. - * @param collName 검색하고자 하는 컬렉션의 이름 - * @return 컬렉션 index를 반환한다. - */ - public int getCollIdx(String collName) { - for(int i=0; i < WNCollection.COLLECTIONS.length; i++) { - if (WNCollection.COLLECTIONS[i].trim().equals(collName.trim())) return i; - } - return -1; - } - - /** - * WNCollection에서 정의된 MERGE COLLECTIONS의 index를 얻는다. - * @param collName 검색하고자 하는 컬렉션의 이름 - * @return 컬렉션 index를 반환한다. - */ - public int getMergeCollIdx(String collName) { - for(int i=0; i < WNCollection.MERGE_COLLECTIONS.length; i++) { - if( WNCollection.MERGE_COLLECTIONS[i].trim().equals(collName.trim()) ) return i; - } - return -1; - } - - /** - * 검색 후 해당 Collection의 Erro정보를 반환한다. - * @param collectionName 검색을 수행한 컬렉션 이름 - * @return collection의 에러정보 - */ - public String getCollectionErrorInfo(String collectionName) { - return common.getCollectionErrorInfo(collectionName); - } - - /** - * 검색 API의 버전정보를 반환한다. - * @return API 버전정보 - */ - public String getVersionInfo() { - return common.getVersionInfo(); - } - - /** - * 형태소 분석 및 대소문자 값을 체크한다. - * @param useKma 형태소 분석 값 - * @param isCase 대소문자 구분 여부 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkKeywordAnalyzer(String collectionName, int useKma, int isCase, int useOriginal, int useSynonym, int useDuplicateDetection) { - int chk = 0; - if(useKma != 0 && useKma != 1 && useKma != 2) { - appendWarnings("[WARNING] [w3SetQueryAnalyzer] [checkKeywordAnalyzer] ["+ collectionName + "] '" + useKma + "' is not kma option"); - return -1; - } - if(isCase != 0 && isCase != 1) { - appendWarnings("[WARNING] [w3SetQueryAnalyzer] [checkKeywordAnalyzer] ["+ collectionName + "] '" + isCase + "' is not case option"); - return -1; - } - if(useOriginal != 0 && useOriginal != 1) { - appendWarnings("[WARNING] [w3SetQueryAnalyzer] [checkKeywordAnalyzer] ["+ collectionName + "] '" + useOriginal + "' is not use original option"); - return -1; - } - if(useSynonym != 0 && useSynonym != 1) { - appendWarnings("[WARNING] [w3SetQueryAnalyzer] [checkKeywordAnalyzer] ["+ collectionName + "] '" + useSynonym + "' is not use synonym option"); - return -1; - } - if(useDuplicateDetection !=0 && useDuplicateDetection != 1) { - appendWarnings("[WARNING] [w3SetQueryAnalyzer] [checkKeywordAnalyzer] ["+ collectionName + "] '" + useDuplicateDetection + "' is not use duplicate detection option"); - return -1; - } - - return chk; - } - - - /** - * 검색하고자 하는 컬렉션을 체크한다. - * @param collectionName 검색하고자 하는 컬렉션 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkValidCollection(String msg, String collectionName) { - - int chk = getCollIdx(collectionName); - if(chk == -1 && mergeCollections != null) { //merge collection에서 check를 다시한다. - chk = getMergeCollIdx(collectionName); - } - - if(chk == -1) { - appendWarnings("[WARNING] "+msg+" [" + collectionName + "] Collection name is not exist."); - } - return chk; - } - - - /** - * 필드를 체크하는 각 함수에서 사용된다. - * @param collectionName 검색하고자 하는 컬렉션 - * @param field 필드 이름 - * @param item WNCollection에 지정된 상수 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkValidField(String collectionName, String field, int item) { - - int idx = getCollIdx(collectionName); - String[] fields = split(wncol.COLLECTION_INFO[idx][item], ","); - int chk = findArrayValue(field, fields); - return chk; - } - - - /** - * 필드를 체크하는 각 함수에서 사용된다. - * @param collectionName 검색하고자 하는 컬렉션 - * @param field 필드 이름 - * @param item WNCollection에 지정된 상수 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkValidDocumentField(String collectionName, String field, int item) { - int chk = -1; - int idx = getCollIdx(collectionName); - if(idx != -1){ - String[] fields = split(wncol.COLLECTION_INFO[idx][item], ","); - int length = fields.length; - - for(int i=0; i 0 && documentFields[0].equals(field)){ - chk = i; - } - } - }else{ //merge collection도 체크한다. - idx = getMergeCollIdx(collectionName); - if(idx != -1) { - String[] fields = split(wncol.MERGE_COLLECTION_INFO[idx][MERGE_RESULT_FIELD], ","); - int length = fields.length; - for(int i=0; i"}; - for(int i=0; i < replaceChar.length; i++) { - value = replace(value, replaceChar[i], " "); - } - - String[] fieldName = split(value, " "); - for(int i=0; i < fieldName.length; i++) { - int index = 0; - if(fieldName[i].indexOf(":", 0) != -1) { - index = fieldName[i].indexOf(":", 0); - fieldName[i] = fieldName[i].trim().substring(0, index); - } - // 확장검색 필드 검사 - if(checkValidField(collectionName, fieldName[i], PREFIX_FIELD) == -1) { - appendWarnings("[WARNING] " + msg + "[" + collectionName + "] " +fieldName[i]+ " is not prefix field."); - chk = -1; - } - } - return chk; - } - - /** - * 검색하고자 하는 컬렉션의 쿼리 필드 값을 체크한다. - * @param msg 화면에 출력할 메시지 - * @param collectionName 검색하고자 하는 컬렉션 - * @param value 체크하고자 하는 필드 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkCollectionQueryFieldName(String msg, String collectionName, String value) { - int chk = 0; - String[] replaceChar = new String[]{"!", "|", "(", ")", "[", "]", "{", "}", "\"", "^", "<", ">"}; - for(int i=0; i < replaceChar.length; i++) { - value = replace(value, replaceChar[i], " "); - } - - String[] fieldName = split(value, " "); - for(int i=0; i < fieldName.length; i++) { - int index = 0; - if(fieldName[i].indexOf(":", 0) != -1) { - index = fieldName[i].indexOf(":", 0); - fieldName[i] = fieldName[i].trim().substring(0, index); - } - String[] fields = fieldName[i].split(","); - for(int j=0;j < fields.length; j++){ - // 컬렉션 쿼리 필드 검사 - if(checkValidField(collectionName, fields[j], PREFIX_FIELD) != -1) { - appendWarnings("[WARNING] " + msg + "[" + collectionName + "] " +fields[j]+ " is prefix field."); - chk = -1; - } - } - } - return chk; - } - - /** - * 검색하고자 하는 컬렉션의 필터링 필드 값을 체크한다. - * @param msg 화면에 출력할 메시지 - * @param collectionName 검색하고자 하는 컬렉션 - * @param value 체크하고자 하는 필드 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkFilterFieldName(String msg, String collectionName, String value) { - int chk = 0; - String[] replaceChar = new String[]{"|", "(", ")", "[", "]", "{", "}", "\"", "^"}; - for(int i=0; i < replaceChar.length; i++) { - value = replace(value, replaceChar[i], " "); - } - - String[] fieldName = split(value, " "); - for(int i=0; i < fieldName.length; i++) { - int index = 0; - if(fieldName[i].indexOf("<", 0) != -1) { - index = fieldName[i].indexOf("<", 0); - fieldName[i] = fieldName[i].trim().substring(0, index); - // 필터링 검색 필드 검사 - if(checkValidField(collectionName, fieldName[i], FAST_ACCESS) == -1) { - appendWarnings("[WARNING] " + msg + " [" + collectionName + "] " +fieldName[i]+ " is not fastaccess field."); - chk = -1; - } - } - } - return chk; - } - - - /** - * 검색결과의 지정 범위를 체크한다. - * @param collectionName 검색하고자 하는 컬렉션 - * @param highlight 하이라이팅 옵션 값 - * @param startPos 검색결과 시작 offset - * @param resultCnt 검색 결과 count - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkSetPageInfo(String collectionName, int highlight, int startPos, int resultCnt) { - int chk = 0; - if(highlight < 0 || highlight> 3 || startPos < 0 || resultCnt < 0) { - appendWarnings("[WARNING] [] [checkSetPageInfo] [" + collectionName + "] Highlight: '" - + highlight + "', StartPosition: '"+startPos+ "', ResultCount: '"+resultCnt+"' is invalid value"); - return -1; - } - return chk; - } - - - /** - * 검색 정렬 필드를 체크한다. - * @param collectionName 검색하고자 하는 컬렉션 - * @param sortField 정렬필드 - * @param sortOrder 오름차순/내림차순 - * @return 성공이면 0을 반환한다. 실패면 0이 아닌 값을 반환한다. - */ - public int checkSortFieldName(String collectionName, String sortField, String sortOrder) { - if(sortField.toUpperCase().equals("DATE")) { - if(sortOrder.equals("DESC") == false && sortOrder.equals("ASC") == false) { - //DATE는 오름차순과 내림차순으로만 정렬 가능 - appendWarnings("[ERROR] [w3AddSortField] [checkSortFieldName] [" + collectionName + "] Date sortOrder is '" + sortOrder + "'. Only DESC or ASC is allowed."); - return -1; - } - } else if(sortField.toUpperCase().equals("RANK")) { - if(sortOrder.equals("DESC") == false) { - //RANK는 내림차순(1)으로만 정렬 가능 - appendWarnings("[ERROR] [w3AddSortField] [checkSortFieldName] [" + collectionName + "] RANK sortOrder is '" + sortOrder +"' Only DESC is allowed."); - return -1; - } - }else if(sortField.toUpperCase().equals("WEIGHT")) { - if(sortOrder.equals("DESC") == false && sortOrder.equals("ASC") == false) { - //WEIGHT는 오름차순(0)과 내림차순(1)으로만 정렬 가능 - appendWarnings("[ERROR] [w3AddSortField] [checkSortFieldName] [" + collectionName + "] WEIGHT sortOrder is '" + sortOrder +"' Only DESC or ASC is allowed"); - return -1; - } - }else { - // 정렬 필드 검사 - if(checkValidDocumentField(collectionName, sortField, RESULT_FIELD) == -1) { - appendWarnings("[ERROR] [w3AddSortField] [checkSortFieldName] [" + collectionName + "] '" + sortField + "' is not exist."); - return -1; - } - if(checkValidField(collectionName, sortField, FAST_ACCESS) == -1) { - // fastaccess가 지정되지 않은 필드에서 속도 느릴수 있음. - appendWarnings("[WARNING] [w3AddSortField] [checkSortFieldName] [" + collectionName + "] " +sortField+ " is not fastaccess field."); - } - } - return 0; - } - - /** - * 디버그 메시지를 구성한다. - * @param isRealQuery - * @param query - */ - public void debugMsg(boolean isRealQuery, String query, String SEARCH_IP, int SEARCH_PORT){ - sb.append("[CHARSET] " + CHARSET + " [QUERY] " + query); - sb.append("
[w3ConnectServer] [IP] " + SEARCH_IP + " [PORT] " + SEARCH_PORT + " [TIMEOUT]" + CONNECTION_TIMEOUT); - if(!isUidSrch) { - sb.append("
[w3RecvResult] Mode : " + this.connectionOpt); - if(isRealQuery){ - sb.append("
[W3ReceiveRecentQueryListResult] Set Count : " + REALTIME_COUNT); - } - } - - sb.append("
"); - for(int i=0; i < collection.length; i++) { - int idx = getCollIdx(collection[i]); - - if(idx < 0){ - return; - } - int count = 0; - - // 컬렉션 정보 - String content = wncol.COLLECTION_INFO[idx][INDEX_NAME]; - if(content != null && !content.equals("")){ - sb.append("
[w3AddCollection] " + content + ""); - } - if(!isUidSrch) { - //페이지 설정 - content = wncol.COLLECTION_INFO[idx][PAGE_INFO]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetPageInfo] " + content); - } - - //분석 정보 - content = wncol.COLLECTION_INFO[idx][ANALYZER]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetQueryAnalyzer] " + content); - } - - //하이라이팅 정보 - count = this.hiSum; - if(count >= 0){ - switch(count){ - case 0: - content = " : Highlight off, Snippet off.";break; - case 1: - content = " : Highlight off, Snippet on.";break; - case 2: - content = " : Highlight on, Snippet off.";break; - case 3: - content = " : Highlight on, Snippet on.";break; - default: - content = " : wrong infomation"; - } - sb.append("
[w3SetQueryAnalyzer] " + count + content); - } - - //정렬 정보 - content = wncol.COLLECTION_INFO[idx][SORT_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3AddSortField] " + content); - } - - //검색 필드 정보 - String search_field = wncol.COLLECTION_INFO[idx][SEARCH_FIELD]; - String[] searchField = search_field.split(","); - - content = wncol.COLLECTION_INFO[idx][SEARCH_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3AddSearchField] " ); - for(int k = 0; k[w3SetDateRange] " + content); - } - - //확장 검색 정보 - content = wncol.COLLECTION_INFO[idx][EXQUERY_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetPrefixQuery] " + content.replaceAll("<", "<").replaceAll(">", ">")); - } - - //카테고리 부스트 정보 - content = wncol.COLLECTION_INFO[idx][CATEGORY_BOOST]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetBoostCategory] " + content); - } - - //컬렉션 쿼리 정보 - content = wncol.COLLECTION_INFO[idx][COLLECTION_QUERY]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetCollectionQuery] " + content.replaceAll("<", "<").replaceAll(">", ">")); - } - - //필터 정보 - content = wncol.COLLECTION_INFO[idx][FILTER_OPERATION]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetFilterQuery] " + content.replaceAll("<", "<").replaceAll(">", ">")); - } - - //그룹화 정보 - content = wncol.COLLECTION_INFO[idx][GROUP_BY]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetGroupBy] " + content); - } - - //그룹 정렬 정보 - content = wncol.COLLECTION_INFO[idx][GROUP_SORT_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3AddSortFieldInGroup] " + content); - } - - - if(!wncol.COLLECTION_INFO[idx][GROUP_BY].equals("")){ - //전체 그룹 개수 정보 - count = getResultGroupCount(collection[i]); - if(count > 0){ - sb.append("
[w3GetGroupBycount] " + count); - } - } - - // dedup field - content = wncol.COLLECTION_INFO[idx][DEDUP_SORT_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetDuplicateDetectionCriterionField] " + content); - } - } - - //결과 필드 정보 - content = wncol.COLLECTION_INFO[idx][RESULT_FIELD]; - if(content != null && !content.equals("")){ - sb.append("
[w3AddDocumentField] " + content); - } - sb.append("
"); - } - - //merge collection debug info - if(mergeCollections != null) { - for(int i=0; i < mergeCollections.length; i++) { - int idx = getMergeCollIdx(mergeCollections[i]); - - if(idx < 0){ - return; - } - - //merge collection name 정보 - String content = wncol.MERGE_COLLECTION_INFO[idx][MERGE_COLLECTION_NAME]; - String mappingColl = wncol.MERGE_COLLECTION_INFO[idx][MERGE_MAPPING_COLLECTION_NAME]; - if(content != null && !content.equals("") && mappingColl != null && !mappingColl.equals("")){ - sb.append("
[w3AddMergeCollection] " + content + ", [Collection Name]" + mappingColl + ""); - } - - content = wncol.MERGE_COLLECTION_INFO[idx][MERGE_PAGE_INFO]; - if(content != null && !content.equals("")){ - sb.append("
[w3SetMergePageInfo] " + content); - } - - content = wncol.MERGE_COLLECTION_INFO[idx][MERGE_RESULT_FIELD]; - String mappingDocs = wncol.MERGE_COLLECTION_INFO[idx][MERGE_MAPPING_RESULT_FIELD]; - if(content != null && !content.equals("") && mappingDocs != null && !mappingDocs.equals("")){ - sb.append("
[w3AddMergeDocumentField] " + content + ", [Collection Document Fields]" + mappingDocs); - } - - content = wncol.MERGE_COLLECTION_INFO[idx][MERGE_MULTI_GROUP_BY_FIELD]; - String mappingMulti = wncol.MERGE_COLLECTION_INFO[idx][MERGE_MAPPING_MULTI_GROUP_BY_FIELD]; - if(content != null && !content.equals("") && mappingMulti != null && !mappingMulti.equals("")){ - sb.append("
[w3AddMergeMultiGroupByField] " + content + ", [Collection Multi-Groupby Fields]" + mappingMulti); - } - - content = wncol.MERGE_COLLECTION_INFO[idx][MERGE_CATEGORY_GROUPBY_FIELD]; - String mappingCategory = wncol.MERGE_COLLECTION_INFO[idx][MERGE_MAPPING_CATEGORY_GROUPBY_FIELD]; - if(content != null && !content.equals("") && mappingCategory != null && !mappingCategory.equals("")){ - sb.append("
[w3AddMergeCategoryGroupByField] " + content + ", [Collection Category Groupby Fields]" + mappingCategory); - } - } - - sb.append("
"); - } - } - - /** - * 경고 메시지를 버퍼에 저장한다. - * @param msg 경고 메시지 - */ - public void appendWarnings(String msg) { - if(isDebug && !msg.equals("")){ - warningMsg.append(msg + "
"); - } - } - - - /** - * 에러 메시지를 버퍼에 저장한다. - * @param msg 에러 메시지 - */ - public void appendErrors(String msg) { - if(!msg.equals("")){ - sb.append("
" + msg + "
"); - } - } - - /** - * 디버그 정보를 화면에 출력할 경우 메시지를 반환한다. - * @return 디버그 정보 반환 - */ - public String printDebug() { - if(!warningMsg.toString().equals("")){ - return sb.toString() + "
" + warningMsg.toString()+ "
"; - } - return sb.toString(); - } - - /** - * 관리도구의 경로를 지정한다. - * @param managerURL 관리도구 경로 - */ - public void setManagerMode(String managerURL){ - if(managerURL != null && !managerURL.trim().equals("")){ - this.managerURL = managerURL; - } - } - - /* - * 매니저 동작 준비 테그를 생성한다. - * @param colName 컬렉션 명 - * @param idx 결과 인덱스 - * @param docid 특정 결과 DOCID - * @return 매니저 동작 준비 테그 - */ - public String getManagerOperationTag(String colName, int idx, String docid){ - String uniid = colName + "_" + idx; - if (!this.managerURL.equals("")){ - return "" + docid + " "; - }else{ - return ""; - } - } - - /* - * 매니저 동작 테그를 생성한다. - * @param transferURL xml 파싱 파일 경로 - * @return 매니저 동작 테그 - */ - public String getManagerActionTag(String transferURL, String SEARCH_IP, int SEARCH_PORT) { - if (!this.managerURL.equals("")) - return ""; - else - return ""; - } - - /** - * 검색 결과 페이징 번호를 출력한다. - * @param startCount 검색 결과 시작 offset - * @param totalCount 검색 결과의 총 개수 - * @param viewListCount 검색결과로 요청된 offset의 개수 - * @param bundleCount 페이지 이동할 개수 - * @return 페이징 문자열 반환 - */ - public static String getPageLinks(int startCount, int totalCount, int viewListCount, int bundleCount) { - StringBuffer sbRet = new StringBuffer(); - WNAnchor wnanchor = getPageAnchor(startCount, totalCount, viewListCount, bundleCount); - - sbRet.append("
    "); - - if(wnanchor.getFirstPage() != -1) { - sbRet.append("
  • 처음으로
  • "); - sbRet.append("
  • 이전
  • "); - } else { - //sbRet.append("
  • 처음으로
  • "); - //sbRet.append("
  • 이전
  • "); - } - - int pageCount = wnanchor.getPageCount(); - String pages[][] = wnanchor.getPages(); - - for(int i=0; i" + pages[i][0] + ""); - } else { - sbRet.append("
  • "+pages[i][0]+"
  • "); - } - } - - if(wnanchor.getBundleNext() != -1) { - sbRet.append("
  • 다음
  • "); - sbRet.append("
  • 맨끝으로
  • "); - - } else { - //sbRet.append("
  • 다음
  • "); - //sbRet.append("
  • 맨끝으로
  • "); - } - sbRet.append("
"); - - return sbRet.toString(); - } - - /** - * 페이지 Anchor를 생성한다. - * @param startNum 검색 결과 시작 offset - * @param totalcount 검색 결과의 총 개수 - * @param resultCnt 검색결과로 요청된 offset의 개수 - * @param anchorSacle 페이지 이동할 개수 - * @return WNAnchor Object를 반환 - */ - public static WNAnchor getPageAnchor(int startNum, int totalcount, int resultCnt, int anchorSacle) { - WNAnchor anchor = new WNAnchor(); - - if(totalcount == 0) { //등록된 정보가 없으면 페이지 Anchor를 생성 하지 않는다. - return anchor; - } - - int curBunbleNum = startNum / (resultCnt * anchorSacle); - int totalPageCnt = totalcount / resultCnt; - if(totalcount % resultCnt > 0) { - totalPageCnt++; - } - - anchor.setTotalPgCount(totalPageCnt); // 전체 페이지 세팅 - - if ( startNum > 0){ // 이전 페이지 - int beforePg = startNum - resultCnt; - anchor.setBefore(beforePg); - } - - if( startNum+resultCnt < totalcount ){ // 다음페이지 - int nextPg = startNum + resultCnt; - anchor.setNext(nextPg); - } - - //번들 뒤로 이동 - int bunbleBeforePg = (curBunbleNum-1) * resultCnt * anchorSacle; //이전 번들로 이동하는 번호 - if(curBunbleNum > 0){ - anchor.setBundleBefore(bunbleBeforePg); - } - - //번들 앞으로 이동 - int bundleNextPg = (1 + curBunbleNum) * anchorSacle * resultCnt; - if( totalPageCnt >= anchorSacle && (curBunbleNum+1) * anchorSacle < totalPageCnt ){ - anchor.setBundleNext(bundleNextPg); - } - - //맨처음.. - if(startNum != 0 && curBunbleNum != 0){ - anchor.setFirstPage(0); - } - //맨끝... - int lastPage = (resultCnt * totalPageCnt) - resultCnt ; - if( totalPageCnt >= anchorSacle && (curBunbleNum+1) * anchorSacle < totalPageCnt ) { - anchor.setLastPage(lastPage); - } - - int pageCount = 1; - String[][] pages = new String[anchorSacle][2]; - for(int i = 0; i < anchorSacle; i++) { - int startCnt = ((curBunbleNum * anchorSacle) + i) * resultCnt; - int pageNum = (curBunbleNum * anchorSacle) + i + 1; - if(startCnt < totalcount) { - if (startCnt != startNum) { - pages[i][0] = Integer.toString(pageNum); - pages[i][1] = Integer.toString(startCnt); - } else { - pages[i][0] = Integer.toString(pageNum); - pages[i][1] = "-1"; - anchor.setCurPageNumber(pageNum); - } - anchor.setPageCount(pageCount); - pageCount++; - } - } - anchor.setPages(pages); - return anchor; - } - - - - /** - * 검색 결과 페이징 번호를 출력한다. - * @param startCount 검색 결과 시작 offset - * @param totalCount 검색 결과의 총 개수 - * @param viewListCount 검색결과로 요청된 offset의 개수 - * @param bundleCount 페이지 이동할 개수 - * @return 페이징 문자열 반환 - */ - /* public String getPageLinksWebAccess(String base, String url, int startCount, int totalCount, int viewListCount, int bundleCount) { - - String RequestURI = base; - String RequestURL = url; - - StringBuffer sbRet = new StringBuffer(); - WNAnchor wnanchor = getPageAnchor(startCount, totalCount, viewListCount, bundleCount); - String ppreImg=""; - String preImg=""; - String nextImg=""; - String nnextImg=""; - ppreImg = ""; - preImg = ""; - nextImg = ""; - nnextImg = ""; - - if(wnanchor.getFirstPage() != -1) { - sbRet.append(""+ppreImg+"  "); - } else { - sbRet.append(ppreImg+" "); - } - if(wnanchor.getBundleBefore() != -1) { - sbRet.append(""+preImg+"  "); - } else { - sbRet.append(preImg+" "); - } - - int pageCount = wnanchor.getPageCount(); - String pages[][] = wnanchor.getPages(); - - for(int i=0; i" + pages[i][0]+""); - } else { - sbRet.append(" "+pages[i][0]+" "); - } - if(pageCount > i+1) { - sbRet.append(" | ");// 페이지 경계 1 | 2 | 3 - } - } - if(wnanchor.getBundleNext() != -1) { - sbRet.append("  "+nextImg+""); - } else { - sbRet.append("  "+nextImg+""); - } - if(wnanchor.getLastPage() != -1) { - sbRet.append("  "+nnextImg+""); - } else { - sbRet.append("  "+nnextImg+""); - } - return sbRet.toString(); - }*/ - - - public String getCollectionKorName(String col) { - String value = ""; - for ( int idx=0;idx< WNCollection.COLLECTIONS.length; idx++){ - String coll = wncol.COLLECTION_INFO[idx][COLLECTION_NAME].trim(); - if ( coll.equals(col) ) - return wncol.COLLECTION_INFO[idx][COLLECTION_KOR]; - - } - - return value; - } - - public String getCollectionName(String col) { - String value = ""; - for ( int idx=0;idx< WNCollection.COLLECTIONS.length; idx++){ - if ( WNCollection.COLLECTIONS[idx].equals(col) ) { - return WNCollection.COLLECTIONS_NAME[idx]; - } - } - - return value; - } - - public List> getDocList(String collection, int colCount) { - List> docList = new ArrayList>(); - String resultFieldList = getCollectionInfoValue(collection, RESULT_FIELD); - Map docData = null; - for(int j = 0; j < colCount; j++) { - docData = new HashMap(); - for(String docField : resultFieldList.split(",")) { - if(docField.contains("/")) { - docField = docField.substring(0, docField.indexOf("/")); - } - if(collection.equals("kisa") && docField.toLowerCase().equals("title")) { - docData.put("filenm", getField(collection, docField, j, false).replaceAll("", "").replaceAll("","")); - docData.put(docField.toLowerCase(), getField(collection, docField, j, true)); - } else if(collection.equals("kisa") && docField.toLowerCase().equals("filedir")) { - docData.put("filedir", getField(collection, docField, j, false).replaceAll("", "").replaceAll("","")); - } else { - docData.put(docField.toLowerCase(), getField(collection, docField, j, true)); - } - } - docList.add(docData); - } - - return docList; - - } - - public String checkDupQuery(String[] queryList) { - String result = ""; - TreeSet ts = new TreeSet(); - for(String query : queryList) { - ts.add(query); - } - - Iterator it = ts.iterator(); - - while(it.hasNext()) { - result += it.next() + " "; - } - return result.trim(); - } - - /** - * 검색옵션 설정 - * @param query 검색키워드 - * @param searchField 추가검색필드 - * @param viewResultCount 한 화면에 나오는 건수 - * @param startCount 시작번호 - * @param sort 소팅필드 - * @param strOperation - * @param exquery - * @param startDate - * @param endDate - */ - public void set(String query, String searchField, int viewResultCount, int startCount, String sort, String sortDirection, String strOperation, String exquery, String startDate, String endDate) { - for (int i = 0; i < this.collection.length; i++) { - //출력건수 - this.setCollectionInfoValue(collection[i], PAGE_INFO, startCount+","+viewResultCount); - - //검색어가 없으면 DATE_RANGE 로 전체 데이터 출력 - if (!query.equals("") ) { - if(collection[i].contains("theme")){ - this.setCollectionInfoValue(collection[i], SORT_FIELD, "RANK/" + sortDirection); - }else{ - this.setCollectionInfoValue(collection[i], SORT_FIELD, sort + "/" + sortDirection); - } - } else { - this.setCollectionInfoValue(collection[i], DATE_RANGE, "1900/01/01,2030/12/31,-"); - this.setCollectionInfoValue(collection[i], SORT_FIELD, sort + "/" + sortDirection); - } - - //searchField 값이 있으면 설정, 없으면 기본검색필드 - if (!searchField.equals("") && !searchField.equals("WRITER") && searchField.indexOf("ALL") == -1 ) { - this.setCollectionInfoValue(collection[i], SEARCH_FIELD, searchField); - } - - //operation 설정 - if (!strOperation.equals("")) { - this.setCollectionInfoValue(collection[i], FILTER_OPERATION, strOperation); - } - - //exquery 설정 - if (!exquery.equals("")) { - this.setCollectionInfoValue(collection[i], EXQUERY_FIELD, exquery); - } - - //기간 설정 , 날짜가 모두 있을때 - if (!startDate.equals("") && !endDate.equals("")) { - this.setCollectionInfoValue(collection[i], DATE_RANGE, startDate.replaceAll("[.]","/") + "," + endDate.replaceAll("[.]","/") + ",-"); - } - }; - }; -} diff --git a/src/main/java/kccf/sch/common/WNUtils.java b/src/main/java/kccf/sch/common/WNUtils.java deleted file mode 100644 index fc0e2a0c..00000000 --- a/src/main/java/kccf/sch/common/WNUtils.java +++ /dev/null @@ -1,338 +0,0 @@ -package kccf.sch.common; - - -import java.io.UnsupportedEncodingException; -import java.text.DecimalFormat; -import java.text.FieldPosition; -import java.text.NumberFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.StringTokenizer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class WNUtils { - private static final Logger LOGGER = LoggerFactory.getLogger(WNUtils.class); - /* - * 문자셋 관련 설정 - */ - final static String ENCODE_ORI = "EUC-KR"; - final static String ENCODE_NEW = "UTF-8"; - - /** - * 문자 배열 값을 검색하여 키 값을 리턴 - * @param fieldName - * @param value - * @param operation - * @return - */ - public static int findArrayValue(String find, String[] arr) { - int findKey = -1; - for (int i = 0; i < arr.length; i++) { - if (find.equals(arr[i])){ - findKey = i; - break; - } - } - return findKey; - } - - /** - * - * @param s - * @param findStr - * @param replaceStr - * @return - */ - public static String replace(String s, String findStr, String replaceStr){ - int pos; - int index = 0; - - while ((pos = s.indexOf(findStr, index)) >= 0) { - s = s.substring(0, pos) + replaceStr + s.substring(pos + findStr.length()); - index = pos + replaceStr.length(); - } - - return s; - } - - /** - * - * @param s - * @return - */ - public static String trimDuplecateSpace(String s){ - StringBuffer sb = new StringBuffer(); - for(int i=0; i 0) { - try { - str = new String(str.getBytes(oriEncode), newEncode); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - LOGGER.info("UnsupportedEncodingException occurred"); - } - } - return str; - } - - - /** - * 구분자를 가지고 있는 문자열을 구분자를 기준으로 나누어주는 메소드 - * @param splittee 구분자를 가진 문자열 - * @param splitChar 구분자 - * @return - */ - public static String[] split(String splittee, String splitChar){ - String taRetVal[] = null; - StringTokenizer toTokenizer = null; - int tnTokenCnt = 0; - - try { - toTokenizer = new StringTokenizer(splittee, splitChar); - tnTokenCnt = toTokenizer.countTokens(); - taRetVal = new String[tnTokenCnt]; - - for(int i=0; i",""); - reqValue = reqValue.replaceAll(">",""); - reqValue = reqValue.replaceAll(">",""); - - //금지 문자열 리스트 - String blockchar[] = {"./", "..", "../", "..\\"}; - - // 금지할 문자열 포함 여부 체크 - for(int i=0; i",""); - req_value = req_value.replaceAll(">",""); - req_value = req_value.replaceAll(">",""); - return req_value; - } -} diff --git a/src/main/java/kccf/sch/service/ArkService.java b/src/main/java/kccf/sch/service/ArkService.java deleted file mode 100644 index fcde843d..00000000 --- a/src/main/java/kccf/sch/service/ArkService.java +++ /dev/null @@ -1,16 +0,0 @@ -package kccf.sch.service; - - -import kccf.sch.service.vo.ArkVO; -import kccf.sch.service.vo.Sf1VO; - -/** - * @Class Name : SearchService.java - * @Description : SearchService Class - * @Modification Information - * - */ -public interface ArkService { - /** 자동완성 */ - public String getArk(ArkVO arkVo , Sf1VO sf1Vo )throws Exception; -} diff --git a/src/main/java/kccf/sch/service/PopWordService.java b/src/main/java/kccf/sch/service/PopWordService.java deleted file mode 100644 index 8c219e54..00000000 --- a/src/main/java/kccf/sch/service/PopWordService.java +++ /dev/null @@ -1,10 +0,0 @@ -package kccf.sch.service; - - -import kccf.sch.service.vo.PopWordVO; -import kccf.sch.service.vo.Sf1VO; - -public interface PopWordService { - /** 인기검색어 */ - String getPopWord(PopWordVO popWordVo , Sf1VO sf1Vo )throws Exception; -} diff --git a/src/main/java/kccf/sch/service/SearchCollectionResult.java b/src/main/java/kccf/sch/service/SearchCollectionResult.java deleted file mode 100644 index 9364d2aa..00000000 --- a/src/main/java/kccf/sch/service/SearchCollectionResult.java +++ /dev/null @@ -1,112 +0,0 @@ -package kccf.sch.service; - -import java.util.ArrayList; - -import kccf.sch.service.vo.SearchCollectionVO; - - - -public class SearchCollectionResult { - /** 디버그 메세지 */ - private String debugStr = ""; - /** 엔진 에러 코드 */ - private int errorCode = 0; - /** 컬렉션 리스트 */ - private ArrayList collectionList = null; - public String getDebugStr() { - return debugStr; - } - public void setDebugStr(String debugStr) { - this.debugStr = debugStr; - } - public int getErrorCode() { - return errorCode; - } - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - } - public ArrayList getCollectionList() { - ArrayList collectionListRet = new ArrayList(); - collectionListRet.addAll(collectionList); - return collectionListRet; - } - public void setCollectionList(ArrayList collectionList) { - if(collectionList != null){ - this.collectionList = new ArrayList(); - for(int i = 0; i < collectionList.size(); ++i){ - this.collectionList.add(collectionList.get(i)); - } - } - } - - /** - * 검색 결과를 XML 형태로 제공(선언부) - * @param charset xml 선언부 언어셋(euc-kr , UTF-8) - * @return 검색 결과를 XML 형태 String 값 - */ - public String toXml(String charset){ - String encoding = "UTF-8"; - if(null != charset){ - if(charset.toUpperCase().equals("EUC-KR")){ - encoding = charset; - } - } - StringBuffer xmlBr = new StringBuffer(1024); - xmlBr.append("").append(System.getProperty("line.separator")); - xmlBr.append("").append(System.getProperty("line.separator")); - xmlBr.append("").append(System.getProperty("line.separator")); - xmlBr.append("").append(System.getProperty("line.separator")); - ArrayList collectionList = getCollectionList(); - int collectionListCount = collectionList.size(); - for(int i = 0 ; i < collectionListCount ; i++){ - SearchCollectionVO collVo = collectionList.get(i); - xmlBr.append(collVo.getXml()).append(System.getProperty("line.separator")); - } - xmlBr.append("").append(System.getProperty("line.separator")); - xmlBr.append(""); - return xmlBr.toString(); - } - - /** - * 검색결과를 json 형태로 반환 - * @return 검색결과를 json 형태 String 값 - */ - public String toJson(){ - StringBuffer jsonBr = new StringBuffer(1024); - jsonBr.append("{\"wisenutSearch\":{"); - jsonBr.append("\"DebugStr\":").append("\"").append(getDebugStr()).append("\","); - jsonBr.append("\"CollectionList\":"); - jsonBr.append("["); - ArrayList collectionList = getCollectionList(); - int collectionListCount = collectionList.size(); - for(int i = 0 ; i < collectionListCount ; i++){ - SearchCollectionVO collVo = collectionList.get(i); - jsonBr.append(collVo.getJson()); - if(i != collectionListCount-1 ){ - jsonBr.append(","); - } - } - jsonBr.append("]}}"); - return jsonBr.toString(); - - } - - /** - * 검색결과 String 형태로 반환 - * @return 검색결과를 문자열 형태 String 값 - */ - public String toStr(){ - StringBuffer br = new StringBuffer(1024); - br.append("[DebugStr:").append(getDebugStr()).append(System.getProperty("line.separator")); - ArrayList collectionList = getCollectionList(); - int collectionListCount = collectionList.size(); - for(int i = 0 ; i < collectionListCount ; i++){ - SearchCollectionVO collVo = collectionList.get(i); - br.append(collVo.getStr()); - } - return br.toString(); - } - - - -} diff --git a/src/main/java/kccf/sch/service/SearchService.java b/src/main/java/kccf/sch/service/SearchService.java deleted file mode 100644 index 97c0aa9e..00000000 --- a/src/main/java/kccf/sch/service/SearchService.java +++ /dev/null @@ -1,18 +0,0 @@ -package kccf.sch.service; - -import kccf.sch.service.vo.SearchVO; -import kccf.sch.service.vo.Sf1VO; - - - -public interface SearchService { - /** 검색결과 받기 */ - SearchCollectionResult getSearch(SearchVO searchVO , Sf1VO sf1Vo) throws Exception; - - String getSearchEtc(SearchVO searchVO , Sf1VO sf1Vo) throws Exception; - - int getSearch_All_cnt(SearchVO searchVO, Sf1VO sf1Vo) throws Exception; - - SearchCollectionResult getSearch_ajax(SearchVO searchVO , Sf1VO sf1Vo) throws Exception; - -} diff --git a/src/main/java/kccf/sch/service/impl/ArkServiceImpl.java b/src/main/java/kccf/sch/service/impl/ArkServiceImpl.java deleted file mode 100644 index 5dfd830e..00000000 --- a/src/main/java/kccf/sch/service/impl/ArkServiceImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -package kccf.sch.service.impl; - - -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import kccf.sch.service.ArkService; -import kccf.sch.service.vo.ArkVO; -import kccf.sch.service.vo.Sf1VO; - -@Service("ArkService") -public class ArkServiceImpl extends EgovAbstractServiceImpl implements ArkService{ - private static final Logger LOGGER = LoggerFactory.getLogger(ArkServiceImpl.class); - - /** - * 자동완성 호출 - */ - @Override - public String getArk(ArkVO arkVo, Sf1VO sf1Vo) throws Exception { - StringBuffer urlSb = new StringBuffer(); - urlSb.append("http://"); - urlSb.append(sf1Vo.getManagerIp()).append(":"); - urlSb.append(sf1Vo.getManagerPort()); - urlSb.append("/manager/WNRun.do?"); - - urlSb.append("target=").append(arkVo.getTarget()); - urlSb.append("&query=").append(URLEncoder.encode(arkVo.getQuery(), "UTF-8")); - urlSb.append("&convert=").append(arkVo.getConvert()); - /*urlSb.append("&eq=").append(arkVo.getCharset()); - urlSb.append("&es=").append(arkVo.getCharset());*/ - - String url = urlSb.toString(); - if(arkVo.getDebugType().equals("Y")){ - LOGGER.info("[getArk() URL]["+url+"]"); - LOGGER.info("[getArk() sf1Vo.toString()]["+sf1Vo.toString()+"]"); - LOGGER.info("[getArk() arkVo.toString()]["+arkVo.toString()+"]"); - } - return getHtmls(url, arkVo.getTimeOut() , arkVo.getDataType(), arkVo.getCharset()); - } - - /** - * 관리도구 자동완성 URL 호출해야 해당 결과 담기 - * @param receiverURL 관리도구 URL 정보 - * @param parameter ark 파라미터값 - * @param timeout ark 연결 시간 고정으로 1000 - * @param datatype 관리도구 web화면 데이타 타입 - * @param charset 케릭터 타임 - * @return dataType 에 따른 자동완성 결과 - */ - private String getHtmls(String receiverURL, int timeout, String datatype , String charset) { - StringBuffer receiveMsg = new StringBuffer(); - BufferedReader in = null; - int errorCode = 0; - try { - - // -- receive servlet connect - URL servletUrl = new URL(receiverURL); - HttpURLConnection uc = (HttpURLConnection)servletUrl.openConnection(); - uc.setReadTimeout(timeout); - uc.setRequestMethod("GET"); - uc.setDoOutput(true); - uc.setDoInput(true); - uc.setUseCaches(false); - uc.connect(); - // init - errorCode = 0; - //System.out.println("[URLConnection Response Code] " + uc.getResponseCode()); - // -- Network error check - if (uc.getResponseCode() == HttpURLConnection.HTTP_OK) { - String currLine = new String(); - //UTF-8인 경우 - in = new BufferedReader(new InputStreamReader(uc.getInputStream(), "UTF-8")); - while ((currLine = in.readLine()) != null) { - receiveMsg.append(currLine).append("\r\n"); - } - } else { - errorCode = uc.getResponseCode(); - return receiveMsg.toString(); - } - uc.disconnect(); - } catch(Exception ex) { - receiveMsg.setLength(0); - if(datatype.toLowerCase().equals("xml")){ - receiveMsg.append(""); - receiveMsg.append(""); - receiveMsg.append(""); - receiveMsg.append("0"); - receiveMsg.append(" "); - receiveMsg.append("0"); - receiveMsg.append(""); - receiveMsg.append(""); - receiveMsg.append(" 0"); - receiveMsg.append(""); - receiveMsg.append(""); - receiveMsg.append(""); - }else if(datatype.toLowerCase().equals("json")){ - receiveMsg.append("{\"responsestatus\":0,\"result\":[{\"totalcount\":0},{\"totalcount\":0}]}"); - } - LOGGER.debug("[getHtmls() URL]["+ receiverURL +"]"); - LOGGER.debug("[getHtmls() error][errorCode:"+errorCode+"]["+ex+"]"); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ex) { - LOGGER.info("IOException occurred"); - } - } - } - return receiveMsg.toString(); - } - - -} diff --git a/src/main/java/kccf/sch/service/impl/PopWordServiceImpl.java b/src/main/java/kccf/sch/service/impl/PopWordServiceImpl.java deleted file mode 100644 index 40dfd3bf..00000000 --- a/src/main/java/kccf/sch/service/impl/PopWordServiceImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -package kccf.sch.service.impl; - - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import kccf.sch.service.PopWordService; -import kccf.sch.service.vo.PopWordVO; -import kccf.sch.service.vo.Sf1VO; - -@Service("PopwordService") -public class PopWordServiceImpl extends EgovAbstractServiceImpl implements PopWordService{ - private static final Logger LOGGER = LoggerFactory.getLogger(PopWordServiceImpl.class); - /** - * 인기검색어 호출 - */ - @Override - public String getPopWord(PopWordVO popWordVo, Sf1VO sf1Vo) throws Exception { - StringBuffer urlSb = new StringBuffer(); - urlSb.append("http://"); - urlSb.append(sf1Vo.getManagerIp()).append(":"); - urlSb.append(sf1Vo.getManagerPort()); - urlSb.append("/manager/WNRun.do?"); - - urlSb.append("target=").append(popWordVo.getTarget()); - urlSb.append("&charset=").append(popWordVo.getCharset()); - urlSb.append("&range=").append(popWordVo.getRange()); - urlSb.append("&collection=").append(popWordVo.getCollection()); - urlSb.append("&datatype=").append(popWordVo.getDataType()); - - //urlSb.append("&convert=fw"); - - String url = urlSb.toString(); - if(popWordVo.getDebugType().equals("Y")){ - LOGGER.info("[getPopWord() URL]["+url+"]"); - LOGGER.info("[getPopWord() sf1Vo.toString()]["+sf1Vo.toString()+"]"); - LOGGER.info("[getPopWord() popWordVo.toString()]["+popWordVo.toString()+"]"); - } - return getHtmls(url, popWordVo.getTimeOut() , popWordVo.getRange() , popWordVo.getDataType() , popWordVo.getCharset()); - } - - /** - * 관리도구 자동완성 URL 호출해야 해당 결과 담기 - * @param receiverURL 호출 URL - * @param timeout 연결시간 - * @param range 인기검색어 조회 범위설정[D:하루 ,W:주 ,M:월] - * @param datatype 데이타 타입 [xml or json] - * @param charset 인코딩 셋 [euc-kr or UTF-8] - * @return - */ - public String getHtmls(String receiverURL, int timeout , String range , String datatype , String charset){ - StringBuffer receiveMsg = new StringBuffer(); - BufferedReader in = null; - int errorCode = 0; - try{ - - // -- receive servlet connect - URL servletUrl = new URL(receiverURL); - HttpURLConnection uc = (HttpURLConnection)servletUrl.openConnection(); - uc.setReadTimeout(timeout); - uc.setRequestMethod("POST"); - uc.setDoOutput(true); - uc.setDoInput(true); - uc.setUseCaches(false); - uc.connect(); - // init - errorCode = 0; - // -- Network error check - if(uc.getResponseCode() == HttpURLConnection.HTTP_OK){ - String currLine = new String(); - //UTF-8인 경우 - in = new BufferedReader(new InputStreamReader(uc.getInputStream(), "UTF-8")); - //BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream())); - while ((currLine = in.readLine()) != null){ - receiveMsg.append(currLine).append("\r\n"); - } - }else{ - /* - errorCode = uc.getResponseCode(); - return receiveMsg.toString(); - */ - errorCode = uc.getResponseCode(); - receiveMsg.setLength(0); - if(datatype.toLowerCase().equals("xml")){ - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("error:"+errorCode+"").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - }else if(datatype.toLowerCase().equals("json")){ - receiveMsg.append("{\"Data\":{\"MakeTime\":\"error\",\"Query\":[{}],\"Type\":{\"content\":\""+errorCode+"\",\"id\":\""+range+"\"},\"Label\":{\"content\":\""+errorCode+"\",\"id\":\""+range+"\"}}}"); - } - } - uc.disconnect(); - }catch(Exception ex){ - receiveMsg.setLength(0); - if(datatype.toLowerCase().equals("xml")){ - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("error").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - receiveMsg.append("").append("\r\n"); - }else if(datatype.toLowerCase().equals("json")){ - receiveMsg.append("{\"Data\":{\"MakeTime\":\"error\",\"Query\":[{}],\"Type\":{\"content\":\""+ex+"\",\"id\":\""+range+"\"},\"Label\":{\"content\":\""+ex+"\",\"id\":\""+range+"\"}}}"); - } - LOGGER.debug("[getHtmls() URL]["+receiverURL+"]"); - LOGGER.debug("[getHtmls() error][errorCode:"+errorCode+"]["+ex+"]"); - }finally { - if (in != null) { - try { - in.close(); - } catch (IOException ex) { - LOGGER.info("IOException occurred"); - } - } - } - return receiveMsg.toString(); - } - - - - -} diff --git a/src/main/java/kccf/sch/service/impl/SearchServiceImpl.java b/src/main/java/kccf/sch/service/impl/SearchServiceImpl.java deleted file mode 100644 index f1ce6496..00000000 --- a/src/main/java/kccf/sch/service/impl/SearchServiceImpl.java +++ /dev/null @@ -1,2470 +0,0 @@ -package kccf.sch.service.impl; - -import static kccf.sch.common.WNDefine.*; - -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -import kccf.sch.common.WNSearch; -import kccf.sch.common.WNUtils; -import kccf.sch.service.SearchCollectionResult; -import kccf.sch.service.SearchService; -import kccf.sch.service.vo.SearchCollectionVO; -import kccf.sch.service.vo.SearchVO; -import kccf.sch.service.vo.Sf1VO; - -import org.apache.commons.lang3.StringEscapeUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -@Service("searchService") -public class SearchServiceImpl implements SearchService{ - - /** SearchDAO - @Resource(name="searchDAO") - SearchDAO searchDAO; - */ - - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(SearchServiceImpl.class); - - - - /** 검색 결과 받기 */ - @Override - public SearchCollectionResult getSearch(SearchVO searchVO, Sf1VO sf1Vo) throws Exception { - try{ - boolean isDebug = true; //디버그 설정 - String[] collections = null; - String[] searchFields = null; - boolean isRealTimeKeyword = false; - boolean useSuggestedQuery = true; - - String exquery= ""; - String strOperation =""; - String exquery_info=""; - - - /** 검색어 */ - String query = searchVO.getQuery(); - query = StringEscapeUtils.unescapeHtml4(query); - query = WNUtils.checkReqXSS(query, ""); - searchVO.setQuery(query); - - /** 결과내 검색어 */ - String realQuery = searchVO.getRealQuery(); - realQuery = StringEscapeUtils.unescapeHtml4(realQuery); - realQuery = WNUtils.checkReqXSS(realQuery, ""); - - String reQuery = searchVO.getReQuery(); - reQuery = StringEscapeUtils.unescapeHtml4(reQuery); - reQuery = WNUtils.checkReqXSS(reQuery, ""); - searchVO.setReQuery(reQuery); - - /** 결과내 재검색 체크필드 */ - String rt = searchVO.getRt(); - rt = StringEscapeUtils.unescapeHtml4(rt); - - if(!reQuery.equals("")){ - rt = WNUtils.checkReqXSS(rt, "1"); - }else{ - rt = WNUtils.checkReqXSS(rt, ""); - } - - - /** 정렬조건 */ - String sortField = searchVO.getSortField(); - sortField = WNUtils.checkReqXSS(sortField, "RANK/DESC"); - searchVO.setSortField(sortField); - - /** 검색 필드*/ - String searchField = searchVO.getSearchField(); - searchField = WNUtils.checkReqXSS(searchField, "ALL"); - - - /** 검색 시작날짜 */ - String startDate = searchVO.getStartDate(); - startDate = WNUtils.checkReqXSS(startDate, "1970/01/01"); - - /** 검색 종료날짜*/ - String endDate = searchVO.getEndDate(); - endDate = WNUtils.checkReqXSS(endDate, WNUtils.getCurrentDate()); - - /** 컬렉션 이름*/ - String collection = searchVO.getCollection(); - if("".equals(collection)) searchVO.setCollection("ALL"); - collection = WNUtils.checkReqXSS(collection, "ALL"); - - - /** 시작위치 */ - int startCount = searchVO.getStartCount(); - if(startCount == 0 || collection.equals("ALL") || collection.equals("")){ - startCount =1; - } - - - /** 출력갯수 */ - int viewCount = searchVO.getViewCount(); - if ( collection.equals("ALL") || collection.equals("") ||viewCount == 0){ - viewCount = 4; - } - - /** 디버그 YN*/ - String debug = searchVO.getDebug(); - debug = WNUtils.checkReqXSS(debug, "Y"); - - /** 검색 연산자**/ - String operator = searchVO.getOperator(); - operator = WNUtils.checkReqXSS(operator, "N"); - String tmpQuery = query; - if("OR".equals(operator)){ - tmpQuery = tmpQuery.replaceAll(" ", "|"); - } - - /*********************고급 검색*********************************/ - //정확히 일치 - String exactQuery = searchVO.getExactQuery(); - exactQuery = StringEscapeUtils.unescapeHtml4(exactQuery); - exactQuery = WNUtils.checkReqXSS(exactQuery, ""); - searchVO.setExactQuery(exactQuery); - if(!exactQuery.equals("")){ - tmpQuery += "\"" + exactQuery + "\""; - } - - //반드시 포함 - String andQuery = searchVO.getAndQuery(); - andQuery = StringEscapeUtils.unescapeHtml4(andQuery); - andQuery = WNUtils.checkReqXSS(andQuery, ""); - searchVO.setAndQuery(andQuery); - if(!andQuery.equals("")){ - tmpQuery += " " + andQuery +"" ; - } - - //포함하지 않는 - String notQuery = searchVO.getNotQuery(); - notQuery = StringEscapeUtils.unescapeHtml4(notQuery); - notQuery = WNUtils.checkReqXSS(notQuery, ""); - searchVO.setNotQuery(notQuery); - if(!notQuery.equals("")){ - tmpQuery += "!" + notQuery +""; - } - - - /**********************상세 검색*********************************/ - //상세검색 - 관리번호(입력) - String mgnt_no = searchVO.getMgnt_no(); - mgnt_no = StringEscapeUtils.unescapeHtml4(mgnt_no); - mgnt_no = WNUtils.checkReqXSS(mgnt_no, ""); - //searchVO.setMgnt_no(mgnt_no); - if ( !mgnt_no.equals("") ) { - exquery += " "; - } - - //상세검색 - 시대(선택) - String trs_age = searchVO.getTrs_age(); - trs_age = StringEscapeUtils.unescapeHtml4(trs_age); - trs_age = WNUtils.checkReqXSS(trs_age, ""); - trs_age = trs_age.replace(",","|"); - if ( !trs_age.equals("") ) { - if(trs_age.indexOf("ALL") == -1){ - exquery += " "; - } - } - - //상세검색 - 주제분야(선택) - String second_category = searchVO.getSecond_category(); - second_category = StringEscapeUtils.unescapeHtml4(second_category); - second_category = WNUtils.checkReqXSS(second_category, ""); - second_category = second_category.replace(",","|"); - if ( !second_category.equals("") ) { - exquery += " "; - } - - //상세검색 - 문화테마(선택) - String series_cd = searchVO.getSeries_cd(); - series_cd = StringEscapeUtils.unescapeHtml4(series_cd); - series_cd = WNUtils.checkReqXSS(series_cd, ""); - series_cd = series_cd.replace(",","|"); - if ( !series_cd.equals("") ) { - exquery += " "; //역사문화유산^유교 - } - - - //상세검색 - 자료유형(선택) - String second_class = searchVO.getSecond_class(); - second_class = StringEscapeUtils.unescapeHtml4(second_class); - second_class = WNUtils.checkReqXSS(second_class, ""); - second_class = second_class.replace(",","|"); - if ( !second_class.equals("") ) { - exquery += " "; - } - - //상세검색 - 지역/문화원(선택) - String sojang_council = searchVO.getSojang_council(); - sojang_council = StringEscapeUtils.unescapeHtml4(sojang_council); - sojang_council = WNUtils.checkReqXSS(sojang_council, ""); - sojang_council = sojang_council.replace(",","|"); - if ( !sojang_council.equals("") && !sojang_council.equals("|")) { - exquery += " "; - } - - //상세검색 - 지역 (지역문화정보) - String search_area_council_info = searchVO.getSearch_area_council_info(); - search_area_council_info = StringEscapeUtils.unescapeHtml4(search_area_council_info); - search_area_council_info = WNUtils.checkReqXSS(search_area_council_info, ""); - search_area_council_info = search_area_council_info.replace(",","|"); - if ( !search_area_council_info.equals("") && !search_area_council_info.equals("|")) { - exquery_info+= " "; - } - - //상세검색 - 유형 (지역문화정보) - String content_type = searchVO.getContent_type(); - content_type = StringEscapeUtils.unescapeHtml4(content_type); - content_type = WNUtils.checkReqXSS(content_type, ""); - content_type = content_type.replace(",","|"); - if ( !content_type.equals("") && !content_type.equals("|")) { - exquery_info += " "; - } - - - //상세검색 - 발행년도(기간) - String genyear_start = searchVO.getGenyear_start(); - genyear_start = WNUtils.checkReqXSS(genyear_start, ""); - if( !genyear_start.equals("")) { - strOperation += " "; - } - - String genyear_end = searchVO.getGenyear_end(); - genyear_end = WNUtils.checkReqXSS(genyear_end, ""); - if( !genyear_end.equals("")) { - strOperation += ""; - } - - //상세검색 - 연대(기간) - String chronological_start = searchVO.getChronological_start(); - chronological_start = WNUtils.checkReqXSS(chronological_start, ""); - if( !chronological_start.equals("")) { - strOperation += " "; - } - - String chronological_end = searchVO.getChronological_end(); - chronological_end = WNUtils.checkReqXSS(chronological_end, ""); - if( !chronological_end.equals("")) { - strOperation += ""; - } - - /** 상세검색 컬렉션 체크박스 - String chkColls = searchVO.getChkColls(); - chkColls = WNUtils.checkReqXSS(chkColls, ""); - */ - - //쿼리 설정 - if (rt.equals("1")) { - realQuery = tmpQuery + " (" + reQuery+")"; //realQuery - } else if (!rt.equals("1") || "".equals(realQuery)) { - realQuery = tmpQuery; - } - - - String collection_real =""; - String[] collections_real = null; - - // 컬렉션 설정 - if(collection.equals("ALL") || collection.equals("")){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","total","toon"}; //COLLECTIONS; - collections_real = new String[]{"info","map","number","pick","reference","story","culturePost","total","toon"}; - collection_real = collection; - } - else if(collection.indexOf("_Coll") >= 0){ - collection_real = collection.replace("_Coll", ""); - if(collection.indexOf("culturePost") >= 0){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","culturePostHot","toon"}; - collections_real = new String[]{"culturePost","culturePostHot"}; - collection_real = "culturePost"; - }else{ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","toon"}; - collections_real = new String[]{collection_real}; - } - } - - - WNSearch wnsearch = new WNSearch(isDebug, false, collections, searchFields); - - wnsearch.setSf1Vo(sf1Vo); - - for (int i = 0; i < collections.length; i++) { - - // PAGE_INFO 페이지 - int tmpViewCnt =viewCount; - if(collections[i].equals("info")){ - if(tmpViewCnt == 4){ - tmpViewCnt = 6; - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+tmpViewCnt); - }else{ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * viewCount) +","+viewCount); - } - - } - else if(collections[i].equals("total")){ - tmpViewCnt=8; - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+tmpViewCnt); - } - else if(collections[i].equals("toon")){ //지역문화 툰 그리드형식으로 12건씩 출력 - if(collection.equals("ALL")||collection.equals("")){ //collection ALL일 경우 - tmpViewCnt = 6; - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+tmpViewCnt); - }else if(viewCount == 10){ - tmpViewCnt = 12; - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+tmpViewCnt); - }else{ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+viewCount); - } - } - else{ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * viewCount) +","+viewCount); - } - - // DATE_RANGE 날짜 - if("".equals(query) && "".equals(realQuery)){ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, "1970/01/01,2030/01/01,-"); - }else{ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, startDate.replaceAll("\\.","/") + "," + endDate.replaceAll("\\.","/") +",/"); - } - - // SORT_FIELD 정렬 필드 - if(collections[i].equals("total")){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, "READ_CNT/DESC,DATE/DESC,RANK/DESC" ); - }else{ - if((collections[i].equals("info") ||collections[i].equals("culturePost") )&& sortField.equals("READ_CNT/DESC") ){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, "RANK/DESC" ); - }else if (collections[i].equals("reference")){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, "MAIN_IMG_EXIST/DESC,ORG_OPEN_EXIST/DESC," + sortField ); - }else{ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, sortField ); - } - } - - //exquery 설정 - if ( !collections[i].equals("map")){ - if( !collections[i].equals("info") && !exquery.equals("") ){ - wnsearch.setCollectionInfoValue(collections[i], EXQUERY_FIELD, exquery ); - }else if( collections[i].equals("info") && (!exquery.equals("") || !exquery_info.equals(""))){ - wnsearch.setCollectionInfoValue(collections[i], EXQUERY_FIELD, exquery + exquery_info ); - } - } - - //SearchField 값이 있으면 설정, 없으면 기본검색필드 - if ( !(searchVO.getSearchField()).equals("") && (searchVO.getSearchField()).indexOf("ALL") == -1 ) wnsearch.setCollectionInfoValue(collections[i], SEARCH_FIELD, (searchVO.getSearchField()) ); - - //operation 설정 - if ( !strOperation.equals("") ) { - wnsearch.setCollectionInfoValue(collections[i], FILTER_OPERATION, strOperation); - } - - if(!"ALL".equals(collection)){ - if("culturePost".equals(collections[i]) && "culturePost".equals(collection_real)) { - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC,KEYWORDS:1/SC"); // - }else if ( "number".equals(collections[i]) && "number".equals(collection_real)){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN,SEARCH_THEME_CD:1/SN,SEARCH_THEME_CD:2/SN,SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN"); - }else if ( "story".equals(collections[i]) && "story".equals(collection_real)){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_THEME_CD:1/SN,SEARCH_THEME_CD:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); //TAGS:1/SN,TAGS:1/SN - }else if ( "reference".equals(collections[i])&& "reference".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN,SEARCH_CATEGORY:1/SN,SEARCH_CATEGORY:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); - }else if ( "info".equals(collections[i])&& "info".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "CONTENT_TYPE_NAME:1/SN,SEARCH_AREA_COUNCIL_INFO:1/SN"); - }else if ( "pick".equals(collections[i]) && "pick".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); //TAGS:1/SN,TAGS:1/SN - }else if ( "toon".equals(collections[i])&& "toon".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC"); - } - }else if("ALL".equals(collection)){ - if("total".equals(collections[i])) { - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC"); - } - } - - } - - wnsearch.search(realQuery, isRealTimeKeyword, CONNECTION_CLOSE, useSuggestedQuery, sf1Vo.getSearchIp(), sf1Vo.getSearchPort()); - - searchVO.setRealQuery(realQuery); - - // 결과 담기 - SearchCollectionResult collResultList = new SearchCollectionResult(); - - // 디버그 메시지 출력 - String debugMsg = wnsearch.printDebug() != null ? wnsearch.printDebug().trim() : ""; - collResultList.setDebugStr(debugMsg); - if(isDebug){ - System.out.println("\n\n\n\n\n\n\n/*****************debugMsg********************/"+debugMsg); - } - - - // 결과 arrList - ArrayList collList = new ArrayList(); - for (int i = 0; i < collections.length; i++) { - SearchCollectionVO colVo = new SearchCollectionVO(); - int totalCount = wnsearch.getResultTotalCount(collections[i]); - int resultCount = wnsearch.getResultCount(collections[i]); - String collectionName = wnsearch.getCollectionInfoValue(collections[i], INDEX_NAME); - - String resultField = wnsearch.getCollectionInfoValue(collections[i], RESULT_FIELD); - String[] resultFieldArr = resultField.split(","); - - /** map 방식 1. */ - ArrayList> resultList = new ArrayList>(); - - for(int j = 0 ; j < resultCount ; j++){ - Map resultMap = new HashMap(); - for(int k = 0 ; k < resultFieldArr.length ; k ++){ - String[] documentFields = WNUtils.split(resultFieldArr[k], "/"); - resultMap.put(documentFields[0],wnsearch.getField(collections[i],documentFields[0] , j , false).replace("", "").replace("", "") ); - } - resultList.add(j,resultMap); - } - - colVo.setTotalCount(totalCount); - colVo.setResultCount(resultCount); - colVo.setCollectionName(collectionName); - colVo.setSearchResultList(resultList); - collList.add(i,colVo); - - } - - - int cateListCnt = collections.length ; - - //자료유형 카테고리 - if (collections_real.length == 1 && (collection_real.equals("pick") || collection_real.equals("number") || collection_real.equals("reference") )) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CLASS", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CLASS", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CLASS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CLASS", 1, j); - - - resultMap.put("first_class_nm", node); - resultMap.put("first_class_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - } - - } - - colVo.setCollectionName("first_class_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CLASS", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CLASS", 2, j); - - - resultMap.put("second_class_nm", node); - resultMap.put("second_class_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - } - - colVo.setCollectionName("second_class_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - //지역문화원 - if (collections_real.length == 1 && (collection_real.equals("pick") || collection_real.equals("reference") || collection_real.equals("story"))) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 1, j); - - resultMap.put("first_council_nm", node); - resultMap.put("first_council_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - } - } - - colVo.setCollectionName("first_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - - } - } - - colVo.setCollectionName("second_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - - - if (collections_real.length == 1 && collection_real.equals("number")) { - String collection1 = collection_real; - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 2); - - //first - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - Map first_resultMap = new HashMap(); - - for (int j = 0; j < second_class_cnt; j++) { - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2 , j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - } - - //first - String[] first_node = node.split("\\^"); - if(first_resultMap.containsKey(first_node[0])){ - nodeCnt = first_resultMap.get(first_node[0]) + nodeCnt; - } - first_resultMap.put(first_node[0],nodeCnt); - } - - for (String key : first_resultMap.keySet()) { - Map resultMap = new HashMap(); - - resultMap.put("first_council_nm", key); - resultMap.put("first_council_cnt", first_resultMap.get(key)); - - resultList.add(j_result, resultMap); - j_result +=1; - - } - - colVo.setCollectionName("first_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - //second - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - - //second - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - - } - } - - colVo.setCollectionName("second_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - } - - - //지역,유형 - if (collections_real.length == 1 && collection_real.equals("info")) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL_INFO", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "CONTENT_TYPE_NAME", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL_INFO", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL_INFO", 1, j); - - resultMap.put("first_council_nm", node); - resultMap.put("first_council_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - } - } - - colVo.setCollectionName("first_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int nodeCnt_total = 0; - - int j_result = 0; - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"CONTENT_TYPE_NAME", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "CONTENT_TYPE_NAME", 1, j); - - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - } - } - - colVo.setCollectionName("second_council_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - - //주제분야 - if (collections_real.length == 1 && collection_real.equals("reference") ) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CATEGORY", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CATEGORY", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CATEGORY", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CATEGORY", 1, j); - - - resultMap.put("first_category_nm", node); - resultMap.put("first_category_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - } - - colVo.setCollectionName("first_category_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CATEGORY", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CATEGORY", 2, j); - - - resultMap.put("second_category_nm", node); - resultMap.put("second_category_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - } - } - - colVo.setCollectionName("second_category_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - //테마 - if (collections_real.length == 1 && ( collection_real.equals("number") || collection_real.equals("story") )) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_THEME_CD", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_THEME_CD", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_THEME_CD", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_THEME_CD", 1, j); - - resultMap.put("first_theme_cd", node); - resultMap.put("first_theme_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - } - - colVo.setCollectionName("first_theme_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_THEME_CD", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_THEME_CD", 2, j); - - resultMap.put("second_theme_cd", node); - resultMap.put("second_theme_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - } - - colVo.setCollectionName("second_theme_cate"); - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - - - //지역문화포스트 - if (collections_real.length == 2 && "culturePost".equals(collection_real) ) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "KEYWORDS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - //int j_result = 0; - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - - if (("null").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10 || ("^").equalsIgnoreCase(node)){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("culturePostHot_tags"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int cateCnt = 0; - for (int j = 0; j < second_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"KEYWORDS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "KEYWORDS", 1, j); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10){ - resultMap.put("keywords_nm", node); - resultMap.put("keywords_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("culturePostHot_keywords"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - } - - //지역문화툰 - if (collections_real.length == 1 && "toon".equals(collection_real) ) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - //int j_result = 0; - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - - if (("null").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10 || ("^").equalsIgnoreCase(node)){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("toon_tags"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - } - - //통합검색 total 태그 - if (collections_real.length != 1 && "ALL".equals(collection_real) ) { - String collection1 = "total"; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("total_tags"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - } - - - - collResultList.setCollectionList(collList); - - // 연결 종료 - if ( wnsearch != null ) { - wnsearch.closeServer(); - } - return collResultList; - }catch(Exception e){ - e.printStackTrace(); - } - return null; - } - - @Override - public String getSearchEtc(SearchVO searchVO ,Sf1VO sf1Vo) throws Exception { - StringBuffer receiverURL = new StringBuffer(); - receiverURL.append("http://"); - receiverURL.append(sf1Vo.getManagerIp()).append(":"); - receiverURL.append(sf1Vo.getManagerPort()); - receiverURL.append("/manage/Manager.do?"); - receiverURL.append("xml="+URLEncoder.encode(" Monitoring Start Module cmanager1 Program theme_k-static etc undefined undefined ", "UTF-8")); - - String receiverURLStr = receiverURL.toString(); - String ret = ""; - - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - LOGGER.info("InterruptedException occurred"); - } - - if(getHtmls(receiverURLStr, sf1Vo.getSearchTimeOut())){ - ret = "success"; - }else{ - ret = "fail"; - } - return ret; - } - - /** - * 관리도구 자동완성 URL 호출해야 해당 결과 담기 - * @param receiverURL 관리도구 URL 정보 - * @param parameter 배치 정보 관련 파라미터값 - * @param timeout 연결 시간 고정으로 3000 - */ - private boolean getHtmls(String receiverURL, int timeout) { - boolean result = false; - HttpURLConnection uc = null; - int errorCode = 0; - try { - URL servletUrl = new URL(receiverURL); - uc = (HttpURLConnection) servletUrl.openConnection(); - uc.setRequestProperty("Content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - uc.setRequestMethod("POST"); - uc.setDoOutput(true); - uc.setDoInput(true); - uc.setUseCaches(false); - uc.setConnectTimeout(timeout); - uc.setReadTimeout(timeout); - uc.connect(); - - // -- Network error check - //System.out.println("[URLConnection Response Code] " + uc.getResponseCode()); - if (uc.getResponseCode() == HttpURLConnection.HTTP_OK) { - errorCode = uc.getResponseCode(); - result = true; - } else { - errorCode = uc.getResponseCode(); - result = false; - } - } catch(Exception ex) { - LOGGER.debug("[getHtmls() URL]["+receiverURL+"]"); - LOGGER.debug("[getHtmls() error][errorCode:"+errorCode+"]["+ex+"]"); - } finally { - uc.disconnect(); - } - - return result; - } - - - - - - - - - - - /** 검색 결과 count */ - @Override - public int getSearch_All_cnt(SearchVO searchVO, Sf1VO sf1Vo) throws Exception { - try{ - boolean isDebug = true; - String[] collections = null; - String[] searchFields = null; - boolean isRealTimeKeyword = false; - boolean useSuggestedQuery = true; - isDebug = true; //디버그 설정 - - String exquery= ""; - String strOperation =""; - - - /** 검색어 */ - String query = searchVO.getQuery(); - query = StringEscapeUtils.unescapeHtml4(query); - query = WNUtils.checkReqXSS(query, ""); - searchVO.setQuery(query); - - /** 결과내 검색어 */ - String realQuery = searchVO.getRealQuery(); - realQuery = StringEscapeUtils.unescapeHtml4(realQuery); - realQuery = WNUtils.checkReqXSS(realQuery, ""); - - String reQuery = searchVO.getReQuery(); - reQuery = StringEscapeUtils.unescapeHtml4(reQuery); - reQuery = WNUtils.checkReqXSS(reQuery, ""); - searchVO.setReQuery(reQuery); - - /** 결과내 재검색 체크필드 */ - String rt = searchVO.getRt(); - rt = StringEscapeUtils.unescapeHtml4(rt); - - if(!reQuery.equals("")){ - rt = WNUtils.checkReqXSS(rt, "1"); - }else{ - rt = WNUtils.checkReqXSS(rt, ""); - } - - - /** 정렬조건 */ - String sortField = searchVO.getSortField(); - sortField = WNUtils.checkReqXSS(sortField, "RANK/DESC"); - searchVO.setSortField(sortField); - - /* *//** 정렬 방식*//* - String sortOrder = searchVO.getSortOrder(); - sortOrder = WNUtils.checkReqXSS(sortOrder, "DESC");*/ - - /** 검색 필드*/ - String searchField = searchVO.getSearchField(); - searchField = WNUtils.checkReqXSS(searchField, "ALL"); - - - /** 검색 시작날짜 */ - String startDate = searchVO.getStartDate(); - startDate = WNUtils.checkReqXSS(startDate, "1970/01/01"); - - /** 검색 종료날짜*/ - String endDate = searchVO.getEndDate(); - endDate = WNUtils.checkReqXSS(endDate, WNUtils.getCurrentDate()); - - /** 컬렉션 이름*/ - String collection = searchVO.getCollection(); - if("".equals(collection)) searchVO.setCollection("ALL"); - collection = WNUtils.checkReqXSS(collection, "ALL"); - - - /** 시작위치 */ - int startCount = searchVO.getStartCount(); - if(startCount == 0 || collection.equals("ALL") || collection.equals("")){ - startCount =1; - } - - - /** 출력갯수 */ - int viewCount = searchVO.getViewCount(); - if ( collection.equals("ALL") || collection.equals("") ||viewCount == 0){ - viewCount = 4; - } - - // searchVO.setViewCount(viewCount); - - /** 디버그 YN*/ - String debug = searchVO.getDebug(); - debug = WNUtils.checkReqXSS(debug, "Y"); - - /** 검색 연산자**/ - String operator = searchVO.getOperator(); - operator = WNUtils.checkReqXSS(operator, "N"); - String tmpQuery = query; - if("OR".equals(operator)){ - tmpQuery = tmpQuery.replaceAll(" ", "|"); - } - - /*********************고급 검색*********************************/ - //정확히 일치 - String exactQuery = searchVO.getExactQuery(); - exactQuery = StringEscapeUtils.unescapeHtml4(exactQuery); - exactQuery = WNUtils.checkReqXSS(exactQuery, ""); - searchVO.setExactQuery(exactQuery); - if(!exactQuery.equals("")){ - tmpQuery += "\"" + exactQuery + "\""; - } - - //반드시 포함 - String andQuery = searchVO.getAndQuery(); - andQuery = StringEscapeUtils.unescapeHtml4(andQuery); - andQuery = WNUtils.checkReqXSS(andQuery, ""); - searchVO.setAndQuery(andQuery); - if(!andQuery.equals("")){ - tmpQuery += " " + andQuery +"" ; - } - - //포함하지 않는 - String notQuery = searchVO.getNotQuery(); - notQuery = StringEscapeUtils.unescapeHtml4(notQuery); - notQuery = WNUtils.checkReqXSS(notQuery, ""); - searchVO.setNotQuery(notQuery); - if(!notQuery.equals("")){ - tmpQuery += "!" + notQuery +""; - } - - - /**********************상세 검색*********************************/ - //상세검색 - 관리번호(입력) - String mgnt_no = searchVO.getMgnt_no(); - mgnt_no = StringEscapeUtils.unescapeHtml4(mgnt_no); - mgnt_no = WNUtils.checkReqXSS(mgnt_no, ""); - //searchVO.setMgnt_no(mgnt_no); - if ( !mgnt_no.equals("") ) { - exquery += " "; - } - - //상세검색 - 시대(선택) - String trs_age = searchVO.getTrs_age(); - trs_age = StringEscapeUtils.unescapeHtml4(trs_age); - trs_age = WNUtils.checkReqXSS(trs_age, ""); - trs_age = trs_age.replace(",","|"); - if ( !trs_age.equals("") ) { - if(trs_age.indexOf("ALL") == -1){ - exquery += " "; - } - } - - //상세검색 - 주제분야(선택) - String second_category = searchVO.getSecond_category(); - second_category = StringEscapeUtils.unescapeHtml4(second_category); - second_category = WNUtils.checkReqXSS(second_category, ""); - second_category = second_category.replace(",","|"); - if ( !second_category.equals("") ) { - exquery += " "; - } - - //상세검색 - 문화테마(선택) - String series_cd = searchVO.getSeries_cd(); - series_cd = StringEscapeUtils.unescapeHtml4(series_cd); - series_cd = WNUtils.checkReqXSS(series_cd, ""); - series_cd = series_cd.replace(",","|"); - if ( !series_cd.equals("") ) { - exquery += " "; - } - - - //상세검색 - 자료유형(선택) - String second_class = searchVO.getSecond_class(); - second_class = StringEscapeUtils.unescapeHtml4(second_class); - second_class = WNUtils.checkReqXSS(second_class, ""); - second_class = second_class.replace(",","|"); - if ( !second_class.equals("") ) { - exquery += " "; - }/*else if(second_class.equals("")){ //chk - searchVO.setFirst_class(""); - }*/ - - - - //상세검색 - 지역/문화원(선택) - String sojang_council = searchVO.getSojang_council(); - sojang_council = StringEscapeUtils.unescapeHtml4(sojang_council); - sojang_council = WNUtils.checkReqXSS(sojang_council, ""); - sojang_council = sojang_council.replace(",","|"); - if ( !sojang_council.equals("") && !sojang_council.equals("|")) { - exquery += " "; - }/*else if(second_class.equals("")){ //chk - searchVO.setSido_name(""); - }*/ - - - //System.out.println("\n\n\n\n\n\n\n/*****************[totalCount-exquery]********************"+exquery); - - - //상세검색 - 발행년도(기간) - String genyear_start = searchVO.getGenyear_start(); - genyear_start = WNUtils.checkReqXSS(genyear_start, ""); - if( !genyear_start.equals("")) { - strOperation += " "; - } - - String genyear_end = searchVO.getGenyear_end(); - genyear_end = WNUtils.checkReqXSS(genyear_end, ""); - if( !genyear_end.equals("")) { - strOperation += ""; - } - - //상세검색 - 연대(기간) - String chronological_start = searchVO.getChronological_start(); - chronological_start = WNUtils.checkReqXSS(chronological_start, ""); - if( !chronological_start.equals("")) { - strOperation += " "; - } - - String chronological_end = searchVO.getChronological_end(); - chronological_end = WNUtils.checkReqXSS(chronological_end, ""); - if( !chronological_end.equals("")) { - strOperation += ""; - } - - - - //쿼리 설정 - if (rt.equals("1")) { - realQuery = tmpQuery + " (" + reQuery+")"; //realQuery - } else if (!rt.equals("1") || "".equals(realQuery)) { - realQuery = tmpQuery; - } - - - // 컬렉션 설정 - //if(collection.equals("ALL") || collection.equals("")){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost", "toon"}; - - WNSearch wnsearch = new WNSearch(isDebug, false, collections, searchFields); - - wnsearch.setSf1Vo(sf1Vo); - - for (int i = 0; i < collections.length; i++) { - - // PAGE_INFO 페이지 - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * viewCount) +","+viewCount); - - - // DATE_RANGE 날짜 - if("".equals(query) && "".equals(realQuery)){ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, "1970/01/01,2030/01/01,-"); - }else{ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, startDate.replaceAll("\\.","/") + "," + endDate.replaceAll("\\.","/") +",/"); - } - - // SORT_FIELD 정렬 필드 - /* if(collections[i].equals("total")){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, "READ_CNT/DESC" ); - }else{ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, sortField ); - } - else{ - if(sortField.equals("READ_CNT/DESC") && collections[i].equals("total") && collections[i].equals("total")){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, sortField ); - }else{ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, sortField ); - } - }*/ - - - //exquery 설정 - if ( !exquery.equals("") ){ - if(!collections[i].equals("map")){ - wnsearch.setCollectionInfoValue(collections[i], EXQUERY_FIELD, exquery ); - } - - } - - //SearchField 값이 있으면 설정, 없으면 기본검색필드 - if ( !(searchVO.getSearchField()).equals("") && (searchVO.getSearchField()).indexOf("ALL") == -1 ) wnsearch.setCollectionInfoValue(collections[i], SEARCH_FIELD, (searchVO.getSearchField()) ); - - //operation 설정 - if ( !strOperation.equals("") ) { - wnsearch.setCollectionInfoValue(collections[i], FILTER_OPERATION, strOperation); - } - - } - - wnsearch.search(realQuery, isRealTimeKeyword, CONNECTION_CLOSE, useSuggestedQuery, sf1Vo.getSearchIp(), sf1Vo.getSearchPort()); - searchVO.setRealQuery(realQuery); - - // 결과 담기 - SearchCollectionResult collResultList = new SearchCollectionResult(); - - // 디버그 메시지 출력 - String debugMsg = wnsearch.printDebug() != null ? wnsearch.printDebug().trim() : ""; - collResultList.setDebugStr(debugMsg); - //System.out.println("\n\n\n\n\n\n\n/*****************[totalCount-debugMsg]********************/"+debugMsg); - - int totalCount = 0 ; - - // 결과 arrList - for (int i = 0; i < collections.length; i++) { // 컬렉션 for - - totalCount += wnsearch.getResultTotalCount(collections[i]); - - } - - //System.out.println("\n\n\n\n\n\n\n/*****************[totalCount-totalCount]********************/"+totalCount); - - - // 연결 종료 - if ( wnsearch != null ) { - wnsearch.closeServer(); - } - return totalCount; - }catch(Exception e){ - e.printStackTrace(); - } - return 0; - } - - - - /** 검색 결과 받기 */ - @Override - public SearchCollectionResult getSearch_ajax(SearchVO searchVO, Sf1VO sf1Vo) throws Exception { - try{ - boolean isDebug = true; - String[] collections = null; - String[] searchFields = null; - boolean isRealTimeKeyword = false; - boolean useSuggestedQuery = true; - isDebug = true; //디버그 설정 - - String exquery= ""; - String strOperation =""; - String exquery_info=""; - - - /** 검색어 */ - String query = searchVO.getQuery(); - query = StringEscapeUtils.unescapeHtml4(query); - query = WNUtils.checkReqXSS(query, ""); - searchVO.setQuery(query); - - /** 결과내 검색어 */ - String realQuery = searchVO.getRealQuery(); - realQuery = StringEscapeUtils.unescapeHtml4(realQuery); - realQuery = WNUtils.checkReqXSS(realQuery, ""); - - String reQuery = searchVO.getReQuery(); - reQuery = StringEscapeUtils.unescapeHtml4(reQuery); - reQuery = WNUtils.checkReqXSS(reQuery, ""); - searchVO.setReQuery(reQuery); - - /** 결과내 재검색 체크필드 */ - String rt = searchVO.getRt(); - rt = StringEscapeUtils.unescapeHtml4(rt); - - if(!reQuery.equals("")){ - rt = WNUtils.checkReqXSS(rt, "1"); - }else{ - rt = WNUtils.checkReqXSS(rt, ""); - } - - - /** 정렬조건 */ - String sortField = searchVO.getSortField(); - sortField = WNUtils.checkReqXSS(sortField, "RANK/DESC"); - searchVO.setSortField(sortField); - - /** 검색 필드*/ - String searchField = searchVO.getSearchField(); - searchField = WNUtils.checkReqXSS(searchField, "ALL"); - - - /** 검색 시작날짜 */ - String startDate = searchVO.getStartDate(); - startDate = WNUtils.checkReqXSS(startDate, "1970/01/01"); - - /** 검색 종료날짜*/ - String endDate = searchVO.getEndDate(); - endDate = WNUtils.checkReqXSS(endDate, WNUtils.getCurrentDate()); - - /** 컬렉션 이름*/ - String collection = searchVO.getCollection(); - if("".equals(collection)) searchVO.setCollection("ALL"); - collection = WNUtils.checkReqXSS(collection, "ALL"); - - - /** 시작위치 */ - int startCount = searchVO.getStartCount(); - if(startCount == 0 || collection.equals("ALL") || collection.equals("")){ - startCount =1; - } - - - /** 출력갯수 */ - int viewCount = searchVO.getViewCount(); - if ( collection.equals("ALL") || collection.equals("") ||viewCount == 0){ - viewCount = 4; - } - - // searchVO.setViewCount(viewCount); - - /** 디버그 YN*/ - String debug = searchVO.getDebug(); - debug = WNUtils.checkReqXSS(debug, "Y"); - - /** 검색 연산자**/ - String operator = searchVO.getOperator(); - operator = WNUtils.checkReqXSS(operator, "N"); - String tmpQuery = query; - if("OR".equals(operator)){ - tmpQuery = tmpQuery.replaceAll(" ", "|"); - } - - /*********************고급 검색*********************************/ - //정확히 일치 - String exactQuery = searchVO.getExactQuery(); - exactQuery = StringEscapeUtils.unescapeHtml4(exactQuery); - exactQuery = WNUtils.checkReqXSS(exactQuery, ""); - searchVO.setExactQuery(exactQuery); - if(!exactQuery.equals("")){ - tmpQuery += "\"" + exactQuery + "\""; - } - - //반드시 포함 - String andQuery = searchVO.getAndQuery(); - andQuery = StringEscapeUtils.unescapeHtml4(andQuery); - andQuery = WNUtils.checkReqXSS(andQuery, ""); - searchVO.setAndQuery(andQuery); - if(!andQuery.equals("")){ - tmpQuery += " " + andQuery +"" ; - } - - //포함하지 않는 - String notQuery = searchVO.getNotQuery(); - notQuery = StringEscapeUtils.unescapeHtml4(notQuery); - notQuery = WNUtils.checkReqXSS(notQuery, ""); - searchVO.setNotQuery(notQuery); - if(!notQuery.equals("")){ - tmpQuery += "!" + notQuery +""; - } - - - /**********************상세 검색*********************************/ - //상세검색 - 관리번호(입력) - String mgnt_no = searchVO.getMgnt_no(); - mgnt_no = StringEscapeUtils.unescapeHtml4(mgnt_no); - mgnt_no = WNUtils.checkReqXSS(mgnt_no, ""); - //searchVO.setMgnt_no(mgnt_no); - if ( !mgnt_no.equals("") ) { - exquery += " "; - } - - //상세검색 - 시대(선택) - String trs_age = searchVO.getTrs_age(); - trs_age = StringEscapeUtils.unescapeHtml4(trs_age); - trs_age = WNUtils.checkReqXSS(trs_age, ""); - trs_age = trs_age.replace(",","|"); - if ( !trs_age.equals("") ) { - if(trs_age.indexOf("ALL") == -1){ - exquery += " "; - } - } - - //상세검색 - 주제분야(선택) - String second_category = searchVO.getSecond_category(); - second_category = StringEscapeUtils.unescapeHtml4(second_category); - second_category = WNUtils.checkReqXSS(second_category, ""); - second_category = second_category.replace(",","|"); - if ( !second_category.equals("") ) { - exquery += " "; - } - - //상세검색 - 문화테마(선택) - String series_cd = searchVO.getSeries_cd(); - series_cd = StringEscapeUtils.unescapeHtml4(series_cd); - series_cd = WNUtils.checkReqXSS(series_cd, ""); - series_cd = series_cd.replace(",","|"); - if ( !series_cd.equals("") ) { - exquery += " "; //역사문화유산^유교 - } - - - //상세검색 - 자료유형(선택) - String second_class = searchVO.getSecond_class(); - second_class = StringEscapeUtils.unescapeHtml4(second_class); - second_class = WNUtils.checkReqXSS(second_class, ""); - second_class = second_class.replace(",","|"); - if ( !second_class.equals("") ) { - exquery += " "; - }/*else if(second_class.equals("")){ //chk - searchVO.setFirst_class(""); - }*/ - - //상세검색 - 지역/문화원(선택) - String sojang_council = searchVO.getSojang_council(); - sojang_council = StringEscapeUtils.unescapeHtml4(sojang_council); - sojang_council = WNUtils.checkReqXSS(sojang_council, ""); - sojang_council = sojang_council.replace(",","|"); - if ( !sojang_council.equals("") && !sojang_council.equals("|")) { - exquery += " "; - } - - - - //상세검색 - 지역 (지역문화정보) - String search_area_council_info = searchVO.getSearch_area_council_info(); - search_area_council_info = StringEscapeUtils.unescapeHtml4(search_area_council_info); - search_area_council_info = WNUtils.checkReqXSS(search_area_council_info, ""); - search_area_council_info = search_area_council_info.replace(",","|"); - if ( !search_area_council_info.equals("") && !search_area_council_info.equals("|")) { - exquery_info+= " "; - } - - //상세검색 - 유형 (지역문화정보) - String content_type = searchVO.getContent_type(); - content_type = StringEscapeUtils.unescapeHtml4(content_type); - content_type = WNUtils.checkReqXSS(content_type, ""); - content_type = content_type.replace(",","|"); - if ( !content_type.equals("") && !content_type.equals("|")) { - exquery_info += " "; - } - - System.out.println("\n\n\n\n\n\n\n/*****************exquery********************"+exquery + exquery_info); - - - - //상세검색 - 발행년도(기간) - String genyear_start = searchVO.getGenyear_start(); - genyear_start = WNUtils.checkReqXSS(genyear_start, ""); - if( !genyear_start.equals("")) { - strOperation += " "; - } - - String genyear_end = searchVO.getGenyear_end(); - genyear_end = WNUtils.checkReqXSS(genyear_end, ""); - if( !genyear_end.equals("")) { - strOperation += ""; - } - - //상세검색 - 연대(기간) - String chronological_start = searchVO.getChronological_start(); - chronological_start = WNUtils.checkReqXSS(chronological_start, ""); - if( !chronological_start.equals("")) { - strOperation += " "; - } - - String chronological_end = searchVO.getChronological_end(); - chronological_end = WNUtils.checkReqXSS(chronological_end, ""); - if( !chronological_end.equals("")) { - strOperation += ""; - } - - /** 상세검색 컬렉션 체크박스*/ - //String chkColls = searchVO.getChkColls(); - //chkColls = WNUtils.checkReqXSS(chkColls, ""); - - - - //쿼리 설정 - if (rt.equals("1")) { - realQuery = tmpQuery + " (" + reQuery+")"; //realQuery - } else if (!rt.equals("1") || "".equals(realQuery)) { - realQuery = tmpQuery; - } - //System.out.println("\n\n\n\n\n\n\n/*****************tmpQuery********************/"+tmpQuery); - - String collection_real =""; - String[] collections_real = null; - - // 컬렉션 설정 - /*if(collection.indexOf("_Coll") >= 0){ - collection_real = collection.replace("_Coll", ""); - if(collection.indexOf("culturePost") >= 0){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","culturePostHot"}; - collections_real = new String[]{"culturePost","culturePostHot"}; - collection_real = "culturePost"; - }else{ - collections = new String[]{"info","map","number","pick","reference","story","culturePost"}; - collections_real = new String[]{collection_real}; - } - } - */ - - if(collection.equals("ALL") || collection.equals("")){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","total"};//COLLECTIONS; - collections_real = new String[]{"info","map","number","pick","reference","story","culturePost","total"}; - collection_real = collection; - } - else if(collection.indexOf("_Coll") >= 0){ - collection_real = collection.replace("_Coll", ""); - if(collection.indexOf("culturePost") >= 0){ - collections = new String[]{"info","map","number","pick","reference","story","culturePost","culturePostHot"}; - collections_real = new String[]{"culturePost","culturePostHot"}; - collection_real = "culturePost"; - }else{ - collections = new String[]{"info","map","number","pick","reference","story","culturePost"}; - collections_real = new String[]{collection_real}; - } - } - - System.out.println("\n\n\n\n#################################[collection_real]: "+collection_real); - - WNSearch wnsearch = new WNSearch(isDebug, false, collections, searchFields); - - wnsearch.setSf1Vo(sf1Vo); - - for (int i = 0; i < collections.length; i++) { - // PAGE_INFO 페이지 - int tmpViewCnt =viewCount; - if(collections[i].equals("info")){ - if(tmpViewCnt == 4){ - tmpViewCnt = 6; - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+tmpViewCnt); - }else{ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * viewCount) +","+viewCount); - } - - } - else if(collections[i].equals("total")){ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * tmpViewCnt) +","+8); - } - else{ - wnsearch.setCollectionInfoValue(collections[i], PAGE_INFO, ((startCount - 1 ) * viewCount) +","+viewCount); - } - - // DATE_RANGE 날짜 - if("".equals(query) && "".equals(realQuery)){ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, "1970/01/01,2030/01/01,-"); - }else{ - wnsearch.setCollectionInfoValue(collections[i], DATE_RANGE, startDate.replaceAll("\\.","/") + "," + endDate.replaceAll("\\.","/") +",/"); - } - - // SORT_FIELD 정렬 필드 - if(collections[i].equals("total")){ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, "READ_CNT/DESC,DATE/DESC,RANK/DESC" ); - }else{ - wnsearch.setCollectionInfoValue(collections[i], SORT_FIELD, sortField ); - } - - - //exquery 설정 - if ( !collections[i].equals("map")){ - if( !collections[i].equals("info") && !exquery.equals("") ){ - wnsearch.setCollectionInfoValue(collections[i], EXQUERY_FIELD, exquery ); - }else if( collections[i].equals("info") && (!exquery.equals("") || !exquery_info.equals(""))){ - wnsearch.setCollectionInfoValue(collections[i], EXQUERY_FIELD, exquery + exquery_info ); - } - } - - //SearchField 값이 있으면 설정, 없으면 기본검색필드 - if ( !(searchVO.getSearchField()).equals("") && (searchVO.getSearchField()).indexOf("ALL") == -1 ) wnsearch.setCollectionInfoValue(collections[i], SEARCH_FIELD, (searchVO.getSearchField()) ); - - //operation 설정 - if ( !strOperation.equals("") ) { - wnsearch.setCollectionInfoValue(collections[i], FILTER_OPERATION, strOperation); - } - - - if(!"ALL".equals(collection)){ - if("culturePost".equals(collections[i]) && "culturePost".equals(collection_real)) { - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC,KEYWORDS:1/SC"); // - }else if ( "number".equals(collections[i]) && "number".equals(collection_real)){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN,SEARCH_THEME_CD:1/SN,SEARCH_THEME_CD:2/SN,SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN"); - }else if ( "story".equals(collections[i]) && "story".equals(collection_real)){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_THEME_CD:1/SN,SEARCH_THEME_CD:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); //TAGS:1/SN,TAGS:1/SN - }else if ( "reference".equals(collections[i])&& "reference".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN,SEARCH_CATEGORY:1/SN,SEARCH_CATEGORY:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); - }else if ( "info".equals(collections[i])&& "info".equals(collection_real) ){ - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "CONTENT_TYPE_NAME:1/SN,SEARCH_AREA_COUNCIL_INFO:1/SN"); - }else if ( "pick".equals(collections[i]) && "pick".equals(collection_real) ){ - System.out.println(collections[i]+"########################pick:" + ( "pick".equals(collections[i]) && "pick".equals(collection_real) )); - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "SEARCH_CLASS:1/SN,SEARCH_CLASS:2/SN,SEARCH_AREA_COUNCIL:1/SN,SEARCH_AREA_COUNCIL:2/SN"); //TAGS:1/SN,TAGS:1/SN - }else if("toon".equals(collections[i]) && "toon".equals(collection_real)) { - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC"); // - } - }else if("ALL".equals(collection)){ - if("total".equals(collections[i])) { - wnsearch.setCollectionInfoValue(collections[i], CATEGORY_GROUPBY, "TAGS:1/SC"); - } - } - - } - - wnsearch.search(realQuery, isRealTimeKeyword, CONNECTION_CLOSE, useSuggestedQuery, sf1Vo.getSearchIp(), sf1Vo.getSearchPort()); - - searchVO.setRealQuery(realQuery); - - // 결과 담기 - SearchCollectionResult collResultList = new SearchCollectionResult(); - - // 디버그 메시지 출력 - String debugMsg = wnsearch.printDebug() != null ? wnsearch.printDebug().trim() : ""; - collResultList.setDebugStr(debugMsg); - if(isDebug){ - System.out.println("\n\n\n\n\n\n\n/*****************debugMsg********************/"+debugMsg); - } - - - // 결과 arrList - ArrayList collList = new ArrayList(); - for (int i = 0; i < collections.length; i++) { // 컬렉션 for - SearchCollectionVO colVo = new SearchCollectionVO(); - int totalCount = wnsearch.getResultTotalCount(collections[i]); - int resultCount = wnsearch.getResultCount(collections[i]); - //String collectionNameKr = wnsearch.getCollectionFieldValue(collections[i], WNCollection.COLLECTION_KOR); 안써 - String collectionName = wnsearch.getCollectionInfoValue(collections[i], INDEX_NAME); - - String resultField = wnsearch.getCollectionInfoValue(collections[i], RESULT_FIELD); //DOCID,DATE - String[] resultFieldArr = resultField.split(","); - - /** map 방식 1. */ - ArrayList> resultList = new ArrayList>(); - - for(int j = 0 ; j < resultCount ; j++){ // 검색 결과 for - Map resultMap = new HashMap(); - for(int k = 0 ; k < resultFieldArr.length ; k ++){ // 반환필드 결과 for - String[] documentFields = WNUtils.split(resultFieldArr[k], "/"); - //resultMap.put(documentFields[0],wnsearch.getField(collections[i],documentFields[0] , j , false)); - resultMap.put(documentFields[0],wnsearch.getField(collections[i],documentFields[0] , j , false).replace("", "").replace("", "") ); - } - resultList.add(j,resultMap); - } - - colVo.setTotalCount(totalCount); //info total - colVo.setResultCount(resultCount); - colVo.setCollectionName(collectionName); //info - colVo.setSearchResultList(resultList); - collList.add(i,colVo); - - } - - - - - - // int cateListCnt = collections.length ; - //int cateListCnt = collections_real.length ; - int cateListCnt = collections.length ; - - //자료유형 카테고리 - if (collections_real.length == 1 && (collection_real.equals("pick") || collection_real.equals("number") || collection_real.equals("reference") )) { - String collection1 = collection_real; - /** map 방식 1. */ - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CLASS", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CLASS", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CLASS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CLASS", 1, j); - - - resultMap.put("first_class_nm", node); - resultMap.put("first_class_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - } - - //resultList.add(j, resultMap); - //resultList.add(j_result, resultMap); - } - - colVo.setCollectionName("first_class_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CLASS", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CLASS", 2, j); - - - resultMap.put("second_class_nm", node); - resultMap.put("second_class_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - //System.out.println("node:" + node + "/cnt:" + nodeCnt); - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_class_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - //지역문화원 - if (collections_real.length == 1 && (collection_real.equals("pick") || collection_real.equals("reference") || collection_real.equals("story"))) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 1, j); - //System.out.println("node:" + node + "/cnt:" + nodeCnt); - - resultMap.put("first_council_nm", node); - resultMap.put("first_council_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("first_council_cate"); // info - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_council_cate"); // info - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - if (collections_real.length == 1 && collection_real.equals("number")) { - String collection1 = collection_real; - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL", 2); - - //first - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - Map first_resultMap = new HashMap(); - - for (int j = 0; j < second_class_cnt; j++) { - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2 , j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - //System.out.println("node:" + node + "/cnt:" + nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - } - - //first - String[] first_node = node.split("\\^"); - if(first_resultMap.containsKey(first_node[0])){ - nodeCnt = first_resultMap.get(first_node[0]) + nodeCnt; - } - first_resultMap.put(first_node[0],nodeCnt); - } - - for (String key : first_resultMap.keySet()) { // 검색 결과 - Map resultMap = new HashMap(); - - resultMap.put("first_council_nm", key); - resultMap.put("first_council_cnt", first_resultMap.get(key)); - - resultList.add(j_result, resultMap); - j_result +=1; - - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("first_council_cate"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - //second - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL", 2, j); - - //second - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_council_cate"); // info - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - } - - - //지역,유형 - if (collections_real.length == 1 && collection_real.equals("info")) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_AREA_COUNCIL_INFO", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "CONTENT_TYPE_NAME", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_AREA_COUNCIL_INFO", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_AREA_COUNCIL_INFO", 1, j); - - resultMap.put("first_council_nm", node); - resultMap.put("first_council_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("first_council_cate"); // info - //colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int nodeCnt_total = 0; - - int j_result = 0; - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"CONTENT_TYPE_NAME", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "CONTENT_TYPE_NAME", 1, j); - - resultMap.put("second_council_nm", node); - resultMap.put("second_council_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_council_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - - //주제분야 - if (collections_real.length == 1 && collection_real.equals("reference") ) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CATEGORY", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_CATEGORY", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CATEGORY", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CATEGORY", 1, j); - - - resultMap.put("first_category_nm", node); - resultMap.put("first_category_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - System.out.println("node:" + node + "/cnt:" + nodeCnt); - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("first_category_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_CATEGORY", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_CATEGORY", 2, j); - - - resultMap.put("second_category_nm", node); - resultMap.put("second_category_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_category_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - //테마 - if (collections_real.length == 1 && ( collection_real.equals("number") || collection_real.equals("story") )) { - String collection1 = collection_real; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_THEME_CD", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "SEARCH_THEME_CD", 2); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_THEME_CD", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_THEME_CD", 1, j); - - resultMap.put("first_theme_cd", node); - resultMap.put("first_theme_cnt", nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("first_theme_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int j_result = 0; - int nodeCnt_total = 0; - - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"SEARCH_THEME_CD", 2, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "SEARCH_THEME_CD", 2, j); - - resultMap.put("second_theme_cd", node); - resultMap.put("second_theme_cnt", nodeCnt); - - if (("null^null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else{ - resultList.add(j_result, resultMap); - j_result +=1; - nodeCnt_total += nodeCnt; - - } - //resultList.add(j, resultMap); - } - - colVo.setCollectionName("second_theme_cate"); // info - colVo.setTotalCount(nodeCnt_total); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - - } - - - //지역문화포스트 - if (collections_real.length == 2 && "culturePost".equals(collection_real) ) { - String collection1 = collection_real; - - /** map 방식 1. */ - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - int second_class_cnt= wnsearch.getCategoryCount(collection1, "KEYWORDS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - //int j_result = 0; - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - //System.out.println("node:" + node + "/cnt:" + nodeCnt); - - if (("null").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10 || ("^").equalsIgnoreCase(node)){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("culturePostHot_tags"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - if(second_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int cateCnt = 0; - for (int j = 0; j < second_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"KEYWORDS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "KEYWORDS", 1, j); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10){ - resultMap.put("keywords_nm", node); - resultMap.put("keywords_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("culturePostHot_keywords"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt+=1; - } - } - - //지역문화툰 - if (collections_real.length == 1 && "toon".equals(collection_real) ) { - String collection1 = collection_real; - - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - //int j_result = 0; - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - - if (("null").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10 || ("^").equalsIgnoreCase(node)){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("toon_tags"); - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - - } - - //통합검색 total 태그 - if (collections_real.length != 1 && "ALL".equals(collection_real) ) { - String collection1 = "total"; - int first_class_cnt= wnsearch.getCategoryCount(collection1, "TAGS", 1); - - if(first_class_cnt > 0){ - ArrayList> resultList = new ArrayList>(); - SearchCollectionVO colVo = new SearchCollectionVO(); - - int cateCnt = 0; - for (int j = 0; j < first_class_cnt; j++) { // 검색 결과 - Map resultMap = new HashMap(); - String node = wnsearch.getCategoryName(collection1,"TAGS", 1, j); - int nodeCnt = wnsearch.getDocumentCountInCategory(collection1, "TAGS", 1, j); - //System.out.println("node:" + node + "/cnt:" + nodeCnt); - - if (("null").equalsIgnoreCase(node) || ("^").equalsIgnoreCase(node)) { - continue; - }else if(cateCnt < 10){ - resultMap.put("tags_nm", node); - resultMap.put("tags_cnt", nodeCnt); - - resultList.add(cateCnt, resultMap); - cateCnt ++; - } - } - - colVo.setCollectionName("total_tags"); // info - colVo.setSearchResultList(resultList); - collList.add(cateListCnt, colVo); - - cateListCnt +=1; - } - } - - - collResultList.setCollectionList(collList); - - // 연결 종료 - if ( wnsearch != null ) { - wnsearch.closeServer(); - } - return collResultList; - }catch(Exception e){ - e.printStackTrace(); - } - return null; - } -} - - diff --git a/src/main/java/kccf/sch/service/vo/ArkVO.java b/src/main/java/kccf/sch/service/vo/ArkVO.java deleted file mode 100644 index 9e59b62c..00000000 --- a/src/main/java/kccf/sch/service/vo/ArkVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package kccf.sch.service.vo; - -public class ArkVO { - /** 키워드 */ - private String query = ""; - /** 자동완성 매칭방식 */ - private String convert = ""; - /** 자동완성 타겟 */ - private String target = ""; - /** 케릭터 셋 */ - private String charset = ""; - /** 데이타 타입 */ - private String dataType = ""; - /** 디버그 여부 */ - private String debugType = "N"; - /** 연결 시간 */ - private Integer timeOut = 3000; - - public String getQuery() { - return this.query; - } - public void setQuery(String query) { - this.query = query; - } - public String getConvert() { - return convert; - } - public void setConvert(String convert) { - this.convert = convert; - } - public String getTarget() { - return target; - } - public void setTarget(String target) { - this.target = target; - } - public String getCharset() { - return charset; - } - public void setCharset(String charset) { - this.charset = charset; - } - public String getDataType() { - return dataType; - } - public void setDataType(String dataType) { - this.dataType = dataType; - } - public String getDebugType() { - return debugType; - } - public void setDebugType(String debugType) { - this.debugType = debugType; - } - public int getTimeOut() { - return timeOut; - } - public void setTimeOut(Integer timeOut) { - this.timeOut = timeOut; - } - @Override - public String toString() { - return "ArkVO [query=" + getQuery() + ", convert=" + getConvert() + ", target=" - + getTarget() + ", charset=" + getCharset() + ", dataType=" + getDataType() - + ", debugType=" + getDebugType() + ", timeOut=" + getTimeOut() + "]"; - } - - - - - -} diff --git a/src/main/java/kccf/sch/service/vo/PopWordVO.java b/src/main/java/kccf/sch/service/vo/PopWordVO.java deleted file mode 100644 index 2c4f1d8e..00000000 --- a/src/main/java/kccf/sch/service/vo/PopWordVO.java +++ /dev/null @@ -1,86 +0,0 @@ -package kccf.sch.service.vo; - -public class PopWordVO { - /** 인기검색어 타겟 popword 고정 참조 */ - private String target = "popword"; - /** 인코딩 셋 */ - private String charset = ""; - /** 인기검색어 조회 범위설정 */ - private String range = ""; - /** collection 통계라벨ID */ - private String collection =""; - /** 데이타 타입 */ - private String dataType = ""; - /** 인코딩 셋 */ - private String eq = ""; - /** 인코딩 셋 */ - private String es = ""; - /** 디버그메시지 */ - private String debugType ="N"; - /** 타임 아웃 */ - private Integer timeOut =1000; - - public String getTarget() { - return target; - } - public void setTarget(String target) { - this.target = target; - } - public String getCharset() { - return charset; - } - public void setCharset(String charset) { - this.charset = charset; - } - public String getRange() { - return range; - } - public void setRange(String range) { - this.range = range; - } - public String getCollection() { - return collection; - } - public void setCollection(String collection) { - this.collection = collection; - } - public String getDataType() { - return dataType; - } - public void setDataType(String dataType) { - this.dataType = dataType; - } - public String getDebugType() { - return debugType; - } - public void setDebugType(String debugType) { - this.debugType = debugType; - } - public int getTimeOut() { - return timeOut; - } - public void setTimeOut(Integer timeOut) { - this.timeOut = timeOut; - } - public String getEq() { - return eq; - } - public void setEq(String eq) { - this.eq = eq; - } - public String getEs() { - return es; - } - public void setEs(String es) { - this.es = es; - } - @Override - public String toString() { - return "PopWordVO [target=" + getTarget() + ", charset=" + getCharset() - + ", range=" + getRange() + ", collection=" + getCollection() - + ", dataType=" + getDataType() + ", debugType=" + getDebugType() - + ", timeOut=" + getTimeOut() + ", eq=" + getEq() + ", es=" + getEs() + "]"; - } - - -} diff --git a/src/main/java/kccf/sch/service/vo/SearchCollectionVO.java b/src/main/java/kccf/sch/service/vo/SearchCollectionVO.java deleted file mode 100644 index 667ddc46..00000000 --- a/src/main/java/kccf/sch/service/vo/SearchCollectionVO.java +++ /dev/null @@ -1,140 +0,0 @@ -package kccf.sch.service.vo; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * 검색결과 컬렉션 VO - * - */ -public class SearchCollectionVO { - /** 컬렉션명*/ - private String CollectionName = ""; - /** 컬렉션의 총검색 건수 */ - private int totalCount = 0; - /** 컬렉션의 반환되는 검색 건수 */ - private int resultCount = 0; - /** 컬렉션의 검색결과 리스트 */ - private ArrayList> searchResultList = null; - - public String getCollectionName() { - return CollectionName; - } - - public void setCollectionName(String collectionName) { - CollectionName = collectionName; - } - - public int getTotalCount() { - return totalCount; - } - - public void setTotalCount(int totalCount) { - this.totalCount = totalCount; - } - - public int getResultCount() { - return resultCount; - } - - public void setResultCount(int resultCount) { - this.resultCount = resultCount; - } - - - @Override - public String toString() { - return "SearchCollectionVO [CollectionName=" + CollectionName - + ", totalCount=" + totalCount + ", resultCount=" + resultCount - + ", searchResultList=" + searchResultList + "]"; - } - - public ArrayList> getSearchResultList() { - ArrayList> searchResultListRet = new ArrayList>(); - searchResultListRet.addAll(searchResultList); - return searchResultListRet; - } - - public void setSearchResultList(ArrayList> searchResultList) { - if(searchResultList != null){ - this.searchResultList = new ArrayList>(); - for(int i = 0; i < searchResultList.size(); ++i){ - this.searchResultList.add(searchResultList.get(i)); - } - } - } - - /** - * 컬렉션 단위의 xml 모양 - * @return XML 모양의 String 값 - * @see toXml() 에서 사용됨 - */ - public String getXml(){ - StringBuffer xmlStr = new StringBuffer(1024); - xmlStr.append("").append(System.getProperty("line.separator")); - xmlStr.append("").append(System.getProperty("line.separator")); - xmlStr.append("").append(System.getProperty("line.separator")); - xmlStr.append("").append(System.getProperty("line.separator")); - List searchResultList = getSearchResultList(); - int searchResultListCount = searchResultList.size(); - - /* - for(int i = 0 ; i < SearchResultListCount ; i++){ - AbstractSearchResult resultVo = this.SearchResultList.get(i); - xmlStr.append(resultVo.getXml()); - } - */ - xmlStr.append("").append(System.getProperty("line.separator")); - xmlStr.append(""); - return xmlStr.toString(); - } - - /** - * 컬렉션 단위의 json 모양 - * @return json 형태의 String 값 - * @see toJson() 에서 사용됨 - */ - public String getJson(){ - StringBuffer jsonBr = new StringBuffer(1024); - jsonBr.append("{\"collection\":"); - jsonBr.append("{"); - jsonBr.append("\"totalCount\":\""+ getTotalCount()+"\","); - jsonBr.append("\"resultCount\":\""+ getResultCount()+"\","); - jsonBr.append("\"itemList\":["); - List searchResultList = getSearchResultList(); - int searchResultListCount = searchResultList.size(); - for(int i = 0 ; i < searchResultListCount ; i++){ - /* - AbstractSearchResult resultVo = SearchResultList.get(i); - jsonBr.append(resultVo.getJson()); - if(i != SearchResultListCount-1 ){ - jsonBr.append(","); - } - */ - } - jsonBr.append("]"); - jsonBr.append(",\"collectionName\":\""+ getCollectionName()+"\"}"); - jsonBr.append("}"); - return jsonBr.toString(); - } - /** - * 컬렉션 단위의 str 모양 - * @return - */ - public String getStr(){ - StringBuffer br = new StringBuffer(1024); - br.append("[collection][collectionName:").append(getCollectionName()).append("]").append(System.getProperty("line.separator")); - br.append("[collection][totalCount:").append(getTotalCount()).append("]").append(System.getProperty("line.separator")); - br.append("[collection][resultCount:").append(getResultCount()).append("]").append(System.getProperty("line.separator")); - List searchResultList = getSearchResultList(); - int searchResultListCount = searchResultList.size(); - for(int i = 0 ; i < searchResultListCount ; i++){ - /* - AbstractSearchResult resultVo = SearchResultList.get(i); - br.append("[").append(i).append("]").append(resultVo.getStr()).append(System.getProperty("line.separator")); - */ - } - return br.toString(); - } -} diff --git a/src/main/java/kccf/sch/service/vo/SearchVO.java b/src/main/java/kccf/sch/service/vo/SearchVO.java deleted file mode 100644 index 16595f37..00000000 --- a/src/main/java/kccf/sch/service/vo/SearchVO.java +++ /dev/null @@ -1,409 +0,0 @@ -package kccf.sch.service.vo; - -import java.util.Arrays; - -/** - * 이용문의 사용 VO - * @Class Name : QnaVO.java - * @author wisenut - * @since 2018-09-12 - * @version 1.0 - */ - -public class SearchVO { - - private String query ; //검색어 - - private String realQuery ; //검색어(최종) - private String reQuery = ""; //결과내 재검색 - private String operator = ""; //검색 연산자 - - private String rt; //결과내재검색 체크 - - private String notQuery ; //제외하는 검색어 - private String andQuery ; //반드시 포함하는 검색어 - private String exactQuery ; //정확히 일치하는 검색어 - - private String sortField = ""; //정렬조건 - private String range = ""; //검색기간 - private int viewCount = 0; //출력갯수(통합) - private String chkColls = ""; //상세검색 컬렉션 체크 - private String searchField = "" ; //검색필드 - - private int startCount = 1; //시작위치 - private String startDate = ""; //시작날짜 - private String endDate = ""; //끝날짜 - - private String collection = ""; //컬렉션이름 - private String debug = "N"; //디버그 Y/N - - /**filter query**/ - private String chronological_start ; //연대 앞 기간 - private String chronological_end ; //연대 뒤 기간 - private String genyear_start ; //발행년대 앞 기간 - private String genyear_end ; //발행년대 뒤 기간 - - /**exquery**/ - private String trs_age; //시대 - private String mgnt_no ; //관리번호 - private String first_category ; //주제분야(대) 선택 - private String second_category ; //주제분야(소) 선택 - private String theme ; //문화테마(대) 선택 - private String series ; //문화테마(소) 선택 - - private String theme_cd ; //이야기자료 테마코드(대) 선택 - private String theme_nm ; //이야기자료 테마(대) 선택 - private String series_cd ; //이야기자료 시리즈코드(소) 선택 - private String series_nm ; //이야기자료 시리즈(소) 선택 - - private String first_class ; //자료유형(대) 선택 - private String second_class; //자료유형(소) 선택 - private String sido_name; //지역문화원(대) 선택 - 카테고리 - private String sojang_council ; //지역문화원(소) 선택 - 카테고리 - //String keywords = ""; //키워드 - - private String search_area_council_info ; //지역문화정보(지역) - private String content_type ; //지역문화정보(유형) - - private String filter_class ; //필터 더보기버튼 유지+depth1 open - private String filter_sido ; //필터 더보기버튼 유지+depth1 open - private String filter_thema ; //필터 더보기버튼 유지+depth1 open - private String filter_category ; //필터 더보기버튼 유지+depth1 open - private String filter_info_sido ; //필터 더보기버튼 유지 - private String filter_info_type ; //필터 더보기버튼 유지 - - private String reQueryChk ="query"; //결과내재검색 체크 유지 - - private String filter_mylist; //검색결과 필터 순서 저장 - private String filter_info_mylist; //검색결과 필터 info 순서 저장 - - //임시 변수 - private String itemType; // 대출,열람,기타탭 - - public String getItemType() { - return itemType; - } - public void setItemType(String itemType) { - this.itemType = itemType; - } - public String getFilter_info_mylist() { - return filter_info_mylist; - } - public void setFilter_info_mylist(String filter_info_mylist) { - this.filter_info_mylist = filter_info_mylist; - } - public String getFilter_mylist() { - return filter_mylist; - } - public void setFilter_mylist(String filter_mylist) { - this.filter_mylist = filter_mylist; - } - public String getFilter_info_sido() { - return filter_info_sido; - } - public void setFilter_info_sido(String filter_info_sido) { - this.filter_info_sido = filter_info_sido; - } - public String getFilter_info_type() { - return filter_info_type; - } - public void setFilter_info_type(String filter_info_type) { - this.filter_info_type = filter_info_type; - } - public String getContent_type() { - return content_type; - } - public void setContent_type(String content_type) { - this.content_type = content_type; - } - public String getSearch_area_council_info() { - return search_area_council_info; - } - public void setSearch_area_council_info(String search_area_council_info) { - this.search_area_council_info = search_area_council_info; - } - public String getRt() { - return rt; - } - public void setRt(String rt) { - this.rt = rt; - } - public String getQuery() { - return query; - } - public void setQuery(String query) { - this.query = query; - } - public String getRealQuery() { - return realQuery; - } - public void setRealQuery(String realQuery) { - this.realQuery = realQuery; - } - public String getReQuery() { - return reQuery; - } - public void setReQuery(String reQuery) { - this.reQuery = reQuery; - } - - public String getSortField() { - return sortField; - } - public void setSortField(String sortField) { - this.sortField = sortField; - } - public String getRange() { - return range; - } - public void setRange(String range) { - this.range = range; - } - public int getViewCount() { - return viewCount; - } - public void setViewCount(int viewCount) { - this.viewCount = viewCount; - } - public String getChkColls() { - return chkColls; - } - public void setChkColls(String chkColls) { - this.chkColls = chkColls; - } - public String getSearchField() { - return searchField; - } - public void setSearchField(String searchField) { - this.searchField = searchField; - } - public int getStartCount() { - return startCount; - } - public void setStartCount(int startCount) { - this.startCount = startCount; - } - public String getCollection() { - return collection; - } - public void setCollection(String collection) { - this.collection = collection; - } - public String getDebug() { - return debug; - } - public void setDebug(String debug) { - this.debug = debug; - } - public String getChronological_start() { - return chronological_start; - } - public void setChronological_start(String chronological_start) { - this.chronological_start = chronological_start; - } - public String getChronological_end() { - return chronological_end; - } - public void setChronological_end(String chronological_end) { - this.chronological_end = chronological_end; - } - public String getGenyear_start() { - return genyear_start; - } - public void setGenyear_start(String genyear_start) { - this.genyear_start = genyear_start; - } - public String getGenyear_end() { - return genyear_end; - } - public void setGenyear_end(String genyear_end) { - this.genyear_end = genyear_end; - } - public String getTrs_age() { - return trs_age; - } - public void setTrs_age(String trs_age) { - this.trs_age = trs_age; - } - public String getMgnt_no() { - return mgnt_no; - } - public void setMgnt_no(String mgnt_no) { - this.mgnt_no = mgnt_no; - } - public String getFirst_category() { - return first_category; - } - public void setFirst_category(String first_category) { - this.first_category = first_category; - } - public String getSecond_category() { - return second_category; - } - public void setSecond_category(String second_category) { - this.second_category = second_category; - } - public String getTheme() { - return theme; - } - public void setTheme(String theme) { - this.theme = theme; - } - public String getSeries() { - return series; - } - public void setSeries(String series) { - this.series = series; - } - - public String getTheme_cd() { - return theme_cd; - } - public void setTheme_cd(String theme_cd) { - this.theme_cd = theme_cd; - } - public String getTheme_nm() { - return theme_nm; - } - public void setTheme_nm(String theme_nm) { - this.theme_nm = theme_nm; - } - public String getSeries_cd() { - return series_cd; - } - public void setSeries_cd(String series_cd) { - this.series_cd = series_cd; - } - public String getSeries_nm() { - return series_nm; - } - public void setSeries_nm(String series_nm) { - this.series_nm = series_nm; - } - public String getFirst_class() { - return first_class; - } - public void setFirst_class(String first_class) { - this.first_class = first_class; - } - public String getSecond_class() { - return second_class; - } - public void setSecond_class(String second_class) { - this.second_class = second_class; - } - public String getSido_name() { - return sido_name; - } - public void setSido_name(String sido_name) { - this.sido_name = sido_name; - } - public String getSojang_council() { - return sojang_council; - } - public void setSojang_council(String sojang_council) { - this.sojang_council = sojang_council; - } - public String getStartDate() { - return startDate; - } - public void setStartDate(String startDate) { - this.startDate = startDate; - } - public String getEndDate() { - return endDate; - } - public void setEndDate(String endDate) { - this.endDate = endDate; - } - public String getOperator() { - return operator; - } - public void setOperator(String operator) { - this.operator = operator; - } - public String getNotQuery() { - return notQuery; - } - public void setNotQuery(String notQuery) { - this.notQuery = notQuery; - } - public String getAndQuery() { - return andQuery; - } - public void setAndQuery(String andQuery) { - this.andQuery = andQuery; - } - public String getExactQuery() { - return exactQuery; - } - public void setExactQuery(String exactQuery) { - this.exactQuery = exactQuery; - } - public String getFilter_class() { - return filter_class; - } - public void setFilter_class(String filter_class) { - this.filter_class = filter_class; - } - public String getFilter_sido() { - return filter_sido; - } - public void setFilter_sido(String filter_sido) { - this.filter_sido = filter_sido; - } - public String getFilter_thema() { - return filter_thema; - } - public void setFilter_thema(String filter_thema) { - this.filter_thema = filter_thema; - } - public String getFilter_category() { - return filter_category; - } - public void setFilter_category(String filter_category) { - this.filter_category = filter_category; - } - @Override - public String toString() { - return "SearchVO [query=" + query + ", realQuery=" + realQuery - + ", reQuery=" + reQuery + ", operator=" + operator + ", rt=" - + rt + ", notQuery=" + notQuery + ", andQuery=" + andQuery - + ", exactQuery=" + exactQuery + ", sortField=" + sortField - + ", range=" + range + ", viewCount=" + viewCount - + ", chkColls=" + chkColls + ", searchField=" + searchField - + ", startCount=" + startCount + ", startDate=" + startDate - + ", endDate=" + endDate + ", collection=" + collection - + ", debug=" + debug + ", chronological_start=" - + chronological_start + ", chronological_end=" - + chronological_end + ", genyear_start=" + genyear_start - + ", genyear_end=" + genyear_end + ", trs_age=" + trs_age - + ", mgnt_no=" + mgnt_no + ", first_category=" + first_category - + ", second_category=" + second_category - + ", theme_cd=" + theme_cd - + ", theme_nm=" + theme_nm - + ", series_cd=" + series_cd - + ", series_nm=" + series_nm - + ", first_class=" + first_class - + ", second_class=" + second_class + ", sido_name=" + sido_name - + ", sojang_council=" + sojang_council - + ", search_area_council_info=" + search_area_council_info - + ", content_type=" + content_type + ", filter_class=" - + filter_class + ", filter_sido=" + filter_sido - + ", filter_thema=" + filter_thema + ", filter_category=" - + filter_category + ", filter_info_sido=" + filter_info_sido - + ", filter_info_type=" + filter_info_type + ", filter_mylist=" - + filter_mylist + ", filter_info_mylist=" + filter_info_mylist - + "]"; - } - public String getReQueryChk() { - return reQueryChk; - } - public void setReQueryChk(String reQueryChk) { - this.reQueryChk = reQueryChk; - } - - - - -} diff --git a/src/main/java/kccf/sch/service/vo/Sf1VO.java b/src/main/java/kccf/sch/service/vo/Sf1VO.java deleted file mode 100644 index 09100f85..00000000 --- a/src/main/java/kccf/sch/service/vo/Sf1VO.java +++ /dev/null @@ -1,53 +0,0 @@ -package kccf.sch.service.vo; - -public class Sf1VO { - /** 검색기 IP */ - private String searchIp = ""; - /** 검색기 PORT*/ - private Integer searchPort = 0; - /** 검색 타임아웃 */ - private Integer searchTimeOut = 3000; - /** */ - private String searchDebugType = "N"; - /** 관리도구 IP */ - private String managerIp; - /** 관리도구 PORT */ - private Integer managerPort; - - public String getSearchIp() { - return searchIp; - } - public void setSearchIp(String searchIp) { - this.searchIp = searchIp; - } - public Integer getSearchPort() { - return searchPort; - } - public void setSearchPort(Integer searchPort) { - this.searchPort = searchPort; - } - public Integer getSearchTimeOut() { - return searchTimeOut; - } - public void setSearchTimeOut(Integer searchTimeOut) { - this.searchTimeOut = searchTimeOut; - } - public String getSearchDebugType() { - return searchDebugType; - } - public void setSearchDebugType(String searchDebugType) { - this.searchDebugType = searchDebugType; - } - public String getManagerIp() { - return managerIp; - } - public void setManagerIp(String managerIp) { - this.managerIp = managerIp; - } - public Integer getManagerPort() { - return managerPort; - } - public void setManagerPort(Integer managerPort) { - this.managerPort = managerPort; - } -} diff --git a/src/main/java/kccf/sch/web/SearchController.java b/src/main/java/kccf/sch/web/SearchController.java deleted file mode 100644 index bc6b2d7e..00000000 --- a/src/main/java/kccf/sch/web/SearchController.java +++ /dev/null @@ -1,765 +0,0 @@ -package kccf.sch.web; - -import static kccf.sch.common.WNDefine.CONNECTION_CLOSE; - -import java.util.ArrayList; -import java.util.HashMap; -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 kccf.sch.common.WNSearch; -import kccf.sch.common.WNUtils; -import kccf.sch.service.ArkService; -import kccf.sch.service.PopWordService; -import kccf.sch.service.SearchCollectionResult; -import kccf.sch.service.SearchService; -import kccf.sch.service.vo.ArkVO; -import kccf.sch.service.vo.PopWordVO; -import kccf.sch.service.vo.SearchCollectionVO; -import kccf.sch.service.vo.SearchVO; -import kccf.sch.service.vo.Sf1VO; -import kccf.ton.service.LocalToonService; -import nlib.cmm.service.CodeService; -import nlib.cmm.service.NlibProperty; - -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.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import cmm.Constant; -import cmm.service.CmmActivityHstVO; -import cmm.service.CmmService; -import cmm.util.CmmUtil; -import cmm.util.DataMap; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; - -import egovframework.com.cmm.ComDefaultCodeVO; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.rte.fdl.property.EgovPropertyService; -import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -//추가 - -@Controller -public class SearchController { - /** LOGGER */ - //@SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(SearchController.class); - - @Resource(name = "searchService") - private SearchService searchService; - - @Resource(name = "nlibProperty") - protected NlibProperty nlibProperty; - - @Resource(name="ArkService") - private ArkService arkService; - - @Resource(name="PopwordService") - private PopWordService popWordService; - - @Resource(name = "localToonService") - private LocalToonService localToonService; - - /** CmmService */ - @Resource(name = "cmmService") - private CmmService cmmService; - - /** EgovCmmUseService */ - @Resource(name = "EgovCmmUseService") - private EgovCmmUseService cmmUseService; - - /** resourcesService */ - @Resource(name = "resourcesService") - private ResourcesService resourcesService; - - @Resource(name = "codeService") - private CodeService codeService; - - - /**SEARCHLIST**/ - @RequestMapping(value="/sch/totalSearchList.do") - public String totalSearchList ( - @ModelAttribute("searchVO") SearchVO searchVO - , String all_totalCount - , String gubun - , String gubun_ajax - , ModelMap model - , HttpServletRequest request - , HttpServletResponse res - - ) throws Exception - { - try{ - LOGGER.debug("[PATH][/sch/totalSearchList.do][searchVO][{}]",searchVO.toString()); - //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); - searchVO.setRealQuery("한복"); - searchVO.setQuery("한복"); - searchVO.setCollection("reference_Coll"); - // 검색관련 서버 설정 - String searchIp = nlibProperty.getString("search.searchIp"); - int searchPort = nlibProperty.getInt("search.searchPort"); - int searchTimeOut = nlibProperty.getInt("search.searchTimeOut"); - - Sf1VO sf1Vo = new Sf1VO(); - sf1Vo.setSearchIp(searchIp); - sf1Vo.setSearchPort(searchPort); - sf1Vo.setSearchTimeOut(searchTimeOut); - - SearchCollectionResult collResult = searchService.getSearch(searchVO, sf1Vo); - - all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo)); - - // 결과 - SearchCollectionVO collInfo = new SearchCollectionVO(); - SearchCollectionVO collMap = new SearchCollectionVO(); - SearchCollectionVO collNumber = new SearchCollectionVO(); - SearchCollectionVO collPick = new SearchCollectionVO(); - SearchCollectionVO collReferecne = new SearchCollectionVO(); - SearchCollectionVO collStory = new SearchCollectionVO(); - SearchCollectionVO collCulturePost = new SearchCollectionVO(); - SearchCollectionVO collCulturePostHot = new SearchCollectionVO(); - SearchCollectionVO collTotal = new SearchCollectionVO(); - SearchCollectionVO collToon = new SearchCollectionVO(); - - - int totalCount = 0; - int page_totalCount =0; - - ArrayList collList = collResult.getCollectionList(); - - int collListSize = collList.size(); - for(int i = 0 ; i < collListSize ; i++){ - SearchCollectionVO coll = collList.get(i); - String collEn = coll.getCollectionName(); - - - - if(collEn.indexOf("culturePostHot") < 0 && collEn.indexOf("total") < 0 && collEn.indexOf("_cate") < 0){ - totalCount = totalCount + coll.getTotalCount(); - } - - if( !searchVO.getCollection().equals("ALL") && searchVO.getCollection().indexOf("_Coll") >= 0){ - if(searchVO.getCollection().replace("_Coll", "").equals(collEn)){ - page_totalCount = coll.getTotalCount(); - } - } - - if(collEn.equals("info")){ - collInfo = coll; - } - else if(collEn.equals("map")){ - collMap = coll; - } - else if(collEn.equals("number")){ - collNumber = coll; - } - else if(collEn.equals("pick")){ - collPick = coll; - - } - else if(collEn.equals("reference")){ - collReferecne = coll; - for(int j = 0 ; j < collReferecne.getSearchResultList().size() ; j++){ - Map mapResult = collReferecne.getSearchResultList().get(j); - DataMap paramMap = new DataMap(); - paramMap.put("mId", mapResult.get("MEDIA_ID")); - if(StringUtils.isNotEmpty(mapResult.get("MEDIA_ID").toString())){ - DataMap media = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - String url=""; - /*String mediaId = media.getString("mid"); - String mediaInterfaceId = media.getString("interfaceId"); - String url = ""; - if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 - if(media.get("assetType") != null){ - if(media.get("assetType").toString().equals("문서") ){ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/npdfView.do?"; - url += "npdf="+Constant.UA_TYPE_R+mediaInterfaceId; // MEDIA 의 INTERFACE_ID 사용 - - }else if(media.get("assetType").toString().equals("링크")){ - url = media.get("linkData").toString(); - }else{ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/lib/libraryDetail.do?contentId="+mediaId; - url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 시 사용 - } - } - }*/ - mapResult.put("LINK_URL", url); - } - } - } - else if(collEn.equals("story")){ - collStory = coll; - } - else if(collEn.equals("culturePost")){ - collCulturePost = coll; - } - else if(collEn.equals("total")){ - collTotal = coll; - } - else if(collEn.equals("total_tags")){ - model.addAttribute("total_tags", coll); - } - else if(collEn.indexOf("_cate") >= 0){ //cate - if(collEn.equals("first_class_cate")){ - model.addAttribute("first_class_cate", coll); - } - else if(collEn.equals("second_class_cate")){ - model.addAttribute("second_class_cate", coll); - } - else if(collEn.equals("first_council_cate")){ - model.addAttribute("first_council_cate", coll); - } - else if(collEn.equals("second_council_cate")){ - model.addAttribute("second_council_cate", coll); - } - else if(collEn.equals("first_category_cate")){ - model.addAttribute("first_category_cate", coll); - } - else if(collEn.equals("second_category_cate")){ - model.addAttribute("second_category_cate", coll); - } - else if(collEn.equals("first_theme_cate")){ - model.addAttribute("first_theme_cate", coll); - } - else if(collEn.equals("second_theme_cate")){ - model.addAttribute("second_theme_cate", coll); - } - } - else if(collEn.indexOf("culturePostHot") >= 0){ //cate - if(collEn.equals("culturePostHot")){ - collCulturePostHot = coll; - } - else if(collEn.equals("culturePostHot_keywords")){ - model.addAttribute("culturePostHot_keywords", coll); - } - else if(collEn.equals("culturePostHot_tags")){ - model.addAttribute("culturePostHot_tags", coll); - } - } - } - - - // - 값 (검색엔진 오류 일때 0값 으로 ) - if(totalCount < 0){ - totalCount = 0; - } - model.addAttribute("totalCount",totalCount); - model.addAttribute("info", collInfo); - model.addAttribute("map", collMap); - model.addAttribute("number", collNumber); - model.addAttribute("pick", collPick); - model.addAttribute("reference", collReferecne); - model.addAttribute("story", collStory); - model.addAttribute("culturePost", collCulturePost); - model.addAttribute("culturePostHot", collCulturePostHot); - model.addAttribute("total", collTotal); - model.addAttribute("all_totalCount",all_totalCount); - model.addAttribute("toon",collToon); - - // 경로 - CmmUtil.setNfsPathModelMap(request,model); - - // 페이징 관련 - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getStartCount()); - if(searchVO.getCollection().indexOf("toon") >= 0){ - if(searchVO.getViewCount() == 10){ - paginationInfo.setRecordCountPerPage(12); - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - paginationInfo.setPageSize((CmmUtil.isMobile(request)) ? 5 :10); - //paginationInfo.setTotalRecordCount(totalCount); - - paginationInfo.setTotalRecordCount(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("") ? totalCount :page_totalCount ); - model.addAttribute("paginationInfo", paginationInfo); - - - //serviceVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - //serviceVO.setLastIndex(paginationInfo.getLastRecordIndex()); - //serviceVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - model.addAttribute("searchVO", searchVO); - //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); - - }catch(Exception e){ - e.printStackTrace(); - } - - String resultUrl =""; - - //자료유형 - model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD)); - model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD)); - - List councilList = resourcesService.selectCouncilList(); - model.addAttribute("councilList", councilList); - - resultUrl = "nlib/collection/searchReferenceListAjax"; - - //System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax+"/"+resultUrl); - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(request,model); - searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """)); - searchVO.setExactQuery(searchVO.getExactQuery().replaceAll("\\\"", """)); - - return resultUrl; - } - - - - - - /** POPWORD */ - @RequestMapping(value="/sch/popword.do") - public String popword(@ModelAttribute("PopWordVO") PopWordVO popWordVo, ModelMap model) throws Exception { - - String popWordStr = ""; - String managerIp = nlibProperty.getString("search.managerIp"); - int managerPort = nlibProperty.getInt("search.managerPort"); - - Sf1VO sf1Vo = new Sf1VO(); - sf1Vo.setManagerIp(managerIp); - sf1Vo.setManagerPort(managerPort); - - popWordStr = popWordService.getPopWord(popWordVo, sf1Vo); - model.addAttribute("popWordStr", popWordStr); - - return "kccf/sch/popword/popword.kccf-sch"; - } - - - /** ARK */ - @RequestMapping(value="/sch/ark.do") - public String ark(@ModelAttribute("ArkVO") ArkVO arkVO, ModelMap model) throws Exception { - String arkStr = ""; - String managerIp = nlibProperty.getString("search.managerIp"); - int managerPort = nlibProperty.getInt("search.managerPort") ; - - - Sf1VO sf1Vo = new Sf1VO(); - sf1Vo.setManagerIp(managerIp); - sf1Vo.setManagerPort(managerPort); - - arkStr = arkService.getArk(arkVO, sf1Vo); - - model.addAttribute("arkStr", arkStr); - - return "kccf/sch/ark/ark.kccf-sch"; - - } - - - @RequestMapping(value="/sch/totalSearchList_ajax.do") - public String totalSearchList_ajax ( - @ModelAttribute("searchVO") SearchVO searchVO - , String all_totalCount - , String gubun - , ModelMap model - , HttpServletRequest request - ,HttpServletResponse res - ) throws Exception - { - try{ - LOGGER.debug("[PATH][/sch/totalSearchList.do][searchVO][{}]",searchVO.toString()); - //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); - - // 검색관련 서버 설정 - String searchIp = nlibProperty.getString("search.searchIp"); - int searchPort = nlibProperty.getInt("search.searchPort"); - int searchTimeOut = nlibProperty.getInt("search.searchTimeOut"); - - Sf1VO sf1Vo = new Sf1VO(); - sf1Vo.setSearchIp(searchIp); - sf1Vo.setSearchPort(searchPort); - sf1Vo.setSearchTimeOut(searchTimeOut); - - SearchCollectionResult collResult = searchService.getSearch(searchVO, sf1Vo); - - if(gubun.equals("1")){ //&&(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")) - all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo)); - // all_totalCount = Integer.toString(collResult_all_cnt); -// System.out.println("################################"+searchVO.getCollection()+"/"+all_totalCount+"/"+gubun); - }else { - all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo)); //2019-11-27 gubun?? -// System.out.println("else ################################:"+searchVO.getCollection()+"/"+all_totalCount+"/"+gubun); - } - //System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax); - - // 결과 - SearchCollectionVO collInfo = new SearchCollectionVO(); - SearchCollectionVO collMap = new SearchCollectionVO(); - SearchCollectionVO collNumber = new SearchCollectionVO(); - SearchCollectionVO collPick = new SearchCollectionVO(); - SearchCollectionVO collReferecne = new SearchCollectionVO(); - SearchCollectionVO collStory = new SearchCollectionVO(); - SearchCollectionVO collCulturePost = new SearchCollectionVO(); - SearchCollectionVO collCulturePostHot = new SearchCollectionVO(); - SearchCollectionVO collTotal = new SearchCollectionVO(); - SearchCollectionVO collToon = new SearchCollectionVO(); - - - int totalCount = 0; - int page_totalCount =0; - - ArrayList collList = collResult.getCollectionList(); - - int collListSize = collList.size(); - for(int i = 0 ; i < collListSize ; i++){ - SearchCollectionVO coll = collList.get(i); - String collEn = coll.getCollectionName(); - - - - if(collEn.indexOf("culturePostHot") < 0 && collEn.indexOf("total") < 0 && collEn.indexOf("_cate") < 0){ - totalCount = totalCount + coll.getTotalCount(); - } - - if( !searchVO.getCollection().equals("ALL") && searchVO.getCollection().indexOf("_Coll") >= 0){ - if(searchVO.getCollection().replace("_Coll", "").equals(collEn)){ - page_totalCount = coll.getTotalCount(); - } - } - - if(collEn.equals("info")){ - collInfo = coll; - } - else if(collEn.equals("map")){ - collMap = coll; - } - else if(collEn.equals("number")){ - collNumber = coll; - } - else if(collEn.equals("pick")){ - collPick = coll; - - } - else if(collEn.equals("reference")){ - collReferecne = coll; - for(int j = 0 ; j < collReferecne.getSearchResultList().size() ; j++){ - Map mapResult = collReferecne.getSearchResultList().get(j); - DataMap paramMap = new DataMap(); - paramMap.put("mId", mapResult.get("MEDIA_ID")); - if(StringUtils.isNotEmpty(mapResult.get("MEDIA_ID").toString())){ - DataMap media = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); - String mediaId = media.getString("id"); - String mediaInterfaceId = media.getString("interfaceId"); - String url = ""; - if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 - if(media.get("assetType") != null){ - if(media.get("assetType").toString().equals("문서") ){ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/npdfView.do?"; - url += "npdf="+Constant.UA_TYPE_R+mediaInterfaceId; // MEDIA 의 INTERFACE_ID 사용 - - }else if(media.get("assetType").toString().equals("링크")){ - url = media.get("linkData").toString(); - }else{ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/lib/libraryDetail.do?contentId="+mediaId; - url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 시 사용 - } - } - } - mapResult.put("LINK_URL", url); - } - } - } - else if(collEn.equals("story")){ - collStory = coll; - } - else if(collEn.equals("culturePost")){ - collCulturePost = coll; - } - else if(collEn.equals("total")){ - collTotal = coll; - } - else if(collEn.equals("total_tags")){ - model.addAttribute("total_tags", coll); - } - else if(collEn.indexOf("_cate") >= 0){ //cate - if(collEn.equals("first_class_cate")){ - model.addAttribute("first_class_cate", coll); - } - else if(collEn.equals("second_class_cate")){ - model.addAttribute("second_class_cate", coll); - } - else if(collEn.equals("first_council_cate")){ - model.addAttribute("first_council_cate", coll); - } - else if(collEn.equals("second_council_cate")){ - model.addAttribute("second_council_cate", coll); - } - else if(collEn.equals("first_category_cate")){ - model.addAttribute("first_category_cate", coll); - } - else if(collEn.equals("second_category_cate")){ - model.addAttribute("second_category_cate", coll); - } - else if(collEn.equals("first_theme_cate")){ - model.addAttribute("first_theme_cate", coll); - } - else if(collEn.equals("second_theme_cate")){ - model.addAttribute("second_theme_cate", coll); - } - } - else if(collEn.indexOf("culturePostHot") >= 0){ //cate - if(collEn.equals("culturePostHot")){ - collCulturePostHot = coll; - } - else if(collEn.equals("culturePostHot_keywords")){ - model.addAttribute("culturePostHot_keywords", coll); - } - else if(collEn.equals("culturePostHot_tags")){ - model.addAttribute("culturePostHot_tags", coll); - } - } - else if(collEn.indexOf("toon") >= 0){ - if(collEn.equals("toon")){ - collToon = coll; - } - else if(collEn.equals("toon_tags")){ - model.addAttribute("toon_tags", coll); - } - // 최근열람툰 - CmmActivityHstVO cmmActivityHstVO = new CmmActivityHstVO(); - cmmActivityHstVO.setTargetId(CmmUtil.getCookieId(request)); - cmmActivityHstVO.setUaType(Constant.UA_TYPE_W); - cmmActivityHstVO.setActivityType(Constant.ACTIVITY_TYPE_O); - cmmActivityHstVO.setContentType(Constant.CONTENT_TYPE_T); - model.addAttribute("openPageList", localToonService.selectLocalToonOpenPageList(cmmActivityHstVO)); - model.addAttribute("openPageHotList", localToonService.selectLocalToonOpenPageHotList(cmmActivityHstVO)); - } - } - - - // - 값 (검색엔진 오류 일때 0값 으로 ) - if(totalCount < 0){ - totalCount = 0; - } - model.addAttribute("totalCount",totalCount); - model.addAttribute("info", collInfo); - model.addAttribute("map", collMap); - model.addAttribute("number", collNumber); - model.addAttribute("pick", collPick); - model.addAttribute("reference", collReferecne); - model.addAttribute("story", collStory); - model.addAttribute("culturePost", collCulturePost); - model.addAttribute("culturePostHot", collCulturePostHot); - model.addAttribute("total", collTotal); - model.addAttribute("all_totalCount",all_totalCount); - model.addAttribute("toon",collToon); - - // 경로 - CmmUtil.setNfsPathModelMap(request,model); - - // 페이징 관련 - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getStartCount()); - if(searchVO.getCollection().indexOf("toon") >= 0){ - if(searchVO.getViewCount() == 10){ - paginationInfo.setRecordCountPerPage(12); - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - paginationInfo.setPageSize((CmmUtil.isMobile(request)) ? 5 :10); - //paginationInfo.setTotalRecordCount(totalCount); - - paginationInfo.setTotalRecordCount(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("") ? totalCount :page_totalCount ); - model.addAttribute("paginationInfo", paginationInfo); - - - //serviceVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - //serviceVO.setLastIndex(paginationInfo.getLastRecordIndex()); - //serviceVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - - model.addAttribute("searchVO", searchVO); - //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); - - }catch(Exception e){ - e.printStackTrace(); - } - - String resultUrl =""; - - - /*if(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")){ - resultUrl = "kccf/sch/totalSearchList.kccf"; - }else if(searchVO.getCollection().equals("pick_Coll")){ - resultUrl = "kccf/sch/searchPickList.kccf"; - }else if(searchVO.getCollection().equals("culturePost_Coll")){ - resultUrl = "kccf/sch/searchCulturePostList.kccf"; - }else if(searchVO.getCollection().equals("number_Coll")){ - resultUrl = "kccf/sch/searchNumberList.kccf"; - }else if(searchVO.getCollection().equals("story_Coll")){ - resultUrl = "kccf/sch/searchStoryList.kccf"; - }else if(searchVO.getCollection().equals("reference_Coll")){ - resultUrl = "kccf/sch/searchReferenceList.kccf"; - }else if(searchVO.getCollection().equals("info_Coll")){ - resultUrl = "kccf/sch/searchInfoList.kccf"; - }*/ - - ComDefaultCodeVO CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS014); - model.addAttribute("firstCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS015); - model.addAttribute("secondCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS004); - model.addAttribute("themaList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS005); - model.addAttribute("seriesList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_MASTER_TYPE_DIV_CD); - model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_DTLS_TYPE_DIV_CD); - model.addAttribute("secondClassList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS016); - model.addAttribute("contentTypeList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - CodeVO = new ComDefaultCodeVO(); - CodeVO.setCodeId(Constant.CODE_ID_FMS018); - model.addAttribute("couSidoList", cmmUseService.selectCmmCodeDetail(CodeVO)); - - List councilList = resourcesService.selectCouncilList(); - model.addAttribute("councilList", councilList); - - if(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")){ - resultUrl = "kccf/sch/totalSearchListAjax"; - }else if(searchVO.getCollection().equals("pick_Coll")){ - resultUrl = "kccf/sch/searchPickListAjax"; - }else if(searchVO.getCollection().equals("culturePost_Coll")){ - resultUrl = "kccf/sch/searchCulturePostList"; - }else if(searchVO.getCollection().equals("number_Coll")){ - resultUrl = "kccf/sch/searchNumberListAjax"; - }else if(searchVO.getCollection().equals("story_Coll")){ - resultUrl = "kccf/sch/searchStoryListAjax"; - }else if(searchVO.getCollection().equals("reference_Coll")){ - resultUrl = "kccf/sch/searchReferenceListAjax"; - }else if(searchVO.getCollection().equals("info_Coll")){ - resultUrl = "kccf/sch/searchInfoListAjax"; - }else if(searchVO.getCollection().equals("toon_Coll")){ - resultUrl = "kccf/sch/searchToonListAjax"; - } - - //System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax+"/"+resultUrl); - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(request,model); - searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """)); - searchVO.setExactQuery(searchVO.getExactQuery().replaceAll("\\\"", """)); - - return resultUrl; - } - - /** - * OCR문서의 몇번째 문서인지 리턴하기 위한 api - * reference.js 에서 function reference_viewOcr(mediaId, query)로 호출 - * @param request - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value="/sch/getOcrId.do") - public String getOcrId (HttpServletRequest request, ModelMap model ) throws Exception { - //디버깅 보기 설정 - boolean isDebug = false; - String exquery = ""; // exquery 조건 필드 - String jsonStr = ""; - - int startCount = 0; //보여줄 페이지 번호 - String strOperation =""; - - int viewResultCount = WNUtils.parseInt(WNUtils.getCheckReqXSS(request, "LISTCOUNT", "1"), 1); // 출력건수 - String sort = WNUtils.getCheckReqXSS(request, "SORT", "ID"); // 정렬방식 - String sortOrder = WNUtils.getCheckReqXSS(request, "SORTORDER", "ASC"); // 정렬방식 - String collection = WNUtils.getCheckReqXSS(request, "COLLECTION", "ocr"); // 컬랙션 - String media_id = WNUtils.getCheckReqXSS(request, "MEDIA_ID", ""); // 메뉴 - String query = WNUtils.getCheckReqXSS(request, "query", ""); - - String[] collections = null; - if(collection.equals("ALL")) { //통합검색인 경우 - collections = new String[]{"info","map","number","pick","reference","story","culturePost","total","toon"}; //COLLECTIONS; - } else { //개별검색인 경우 - collections = new String[] { collection }; - } - - exquery += ""; - - // 검색관련 서버 설정 - String searchIp = nlibProperty.getString("search.searchIp"); - int searchPort = nlibProperty.getInt("search.searchPort"); - int searchTimeOut = nlibProperty.getInt("search.searchTimeOut"); - - Sf1VO sf1Vo = new Sf1VO(); - sf1Vo.setSearchIp(searchIp); - sf1Vo.setSearchPort(searchPort); - sf1Vo.setSearchTimeOut(searchTimeOut); - - WNSearch wnsearch = new WNSearch(isDebug, false, collections, null); -// WNSearch wnsearch = new WNSearch(isDebug, false, collections, null, WNDefine.USE_RESULT_JSON); - wnsearch.setSf1Vo(sf1Vo); - wnsearch.set(query, "ALL", viewResultCount, startCount, sort, sortOrder, strOperation, exquery, "1970.01.01", WNUtils.getCurrentDate()); - wnsearch.search(query, false, CONNECTION_CLOSE, true, sf1Vo.getSearchIp(), sf1Vo.getSearchPort()); - String debugMsg = wnsearch.printDebug() != null ? wnsearch.printDebug().trim() : ""; - - int min = viewResultCount; - if(wnsearch.getResultTotalCount("ocr") < viewResultCount){ - min = wnsearch.getResultTotalCount("ocr"); //가장 적은 수로 결과를 리턴 - } - - - Gson gson = new Gson(); - JsonArray doc = new JsonArray(); - String[] fields = {"ID","MEDIA_ID","FIRST_PAGE_NUM","LAST_PAGE_NUM","ORDER_NUM","FILE_NAME"}; - for(int idx =0 ; idx < min; idx++){ - JsonObject obj = new JsonObject(); - for(String field : fields){ - obj.addProperty(field, wnsearch.getField("ocr", field, idx, false)); - } - doc.add(obj); - } - - jsonStr = gson.toJson(doc); -// jsonStr = wnsearch.getResultJson(); - - model.addAttribute("jsonStr", jsonStr); - model.addAttribute("isDebug", isDebug); //디버그메시지출력여부 - model.addAttribute("debugMsg", debugMsg); //디버그 메시지 출력 - - - if ( wnsearch != null ) - wnsearch.closeServer(); - - return "kccf/sch/ocr/schOcrRetrunId.kccf-sch"; - } - -} diff --git a/src/main/java/kccf/ton/service/LocalToonService.java b/src/main/java/kccf/ton/service/LocalToonService.java deleted file mode 100644 index 55f9da81..00000000 --- a/src/main/java/kccf/ton/service/LocalToonService.java +++ /dev/null @@ -1,21 +0,0 @@ -package kccf.ton.service; - -import java.util.List; - -import cmm.service.CmmActivityHstVO; -import cmm.service.CmmAmsAssetMediaVO; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -public interface LocalToonService { - List selectLocalToonTopList(CmmAmsAssetMediaVO param) throws EgovBizException; - int selectLocalToonListTotCnt(CmmAmsAssetMediaVO param) throws EgovBizException; - List selectLocalToonList(CmmAmsAssetMediaVO param) throws EgovBizException; - List selectLocalToonOpenPageList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - List selectLocalToonOpenPageHotList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - CmmAmsAssetMediaVO selectLocalToonDetail(CmmAmsAssetMediaVO param) throws EgovBizException; - int selectLocalToonDetailListTotCnt(CmmAmsAssetMediaVO param) throws EgovBizException; - List selectLocalToonDetailList(CmmAmsAssetMediaVO param) throws EgovBizException; - List selectLocalToonOpenPageDetailList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException; - List selectLocalToonDetailListAll(CmmAmsAssetMediaVO param) throws EgovBizException; -} diff --git a/src/main/java/kccf/ton/service/LocalToonVO.java b/src/main/java/kccf/ton/service/LocalToonVO.java deleted file mode 100644 index f282253a..00000000 --- a/src/main/java/kccf/ton/service/LocalToonVO.java +++ /dev/null @@ -1,251 +0,0 @@ -package kccf.ton.service; - -import java.util.Date; - -import org.apache.commons.lang3.builder.ToStringBuilder; - -import cmm.util.CmmVO; - -@SuppressWarnings("serial") -public class LocalToonVO extends CmmVO{ - - private String id = ""; - private String contType = ""; - private String contentId = ""; - private String contentType = ""; - private String contentTypeId = ""; - private String contentTypeName = ""; - private String cat1 = ""; - private String cat1Name = ""; - private String cat2 = ""; - private String cat2Name = ""; - private String cat3 = ""; - private String cat3Name = ""; - private String title = ""; - private String summary = ""; - private String zipCode = ""; - private String tel = ""; - private String mainImage = ""; - private String latitude = ""; - private String longitude = ""; - private String sidoName = ""; - private String sigunguName = ""; - private String addr1 = ""; - private String addr2 = ""; - private String ntceBgnde = ""; - private String ntceEndde = ""; - private String website = ""; - private Date createdTime = null; - private Date modifiedTime = null; - - private String [] categoryArray1; - private String [] categoryArray2; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContType() { - return contType; - } - public void setContType(String contType) { - this.contType = contType; - } - public String getContentId() { - return contentId; - } - public void setContentId(String contentId) { - this.contentId = contentId; - } - public String getContentType() { - return contentType; - } - public void setContentType(String contentType) { - this.contentType = contentType; - } - public String getContentTypeId() { - return contentTypeId; - } - public void setContentTypeId(String contentTypeId) { - this.contentTypeId = contentTypeId; - } - public String getContentTypeName() { - return contentTypeName; - } - public void setContentTypeName(String contentTypeName) { - this.contentTypeName = contentTypeName; - } - public String getCat1() { - return cat1; - } - public void setCat1(String cat1) { - this.cat1 = cat1; - } - public String getCat1Name() { - return cat1Name; - } - public void setCat1Name(String cat1Name) { - this.cat1Name = cat1Name; - } - public String getCat2() { - return cat2; - } - public void setCat2(String cat2) { - this.cat2 = cat2; - } - public String getCat2Name() { - return cat2Name; - } - public void setCat2Name(String cat2Name) { - this.cat2Name = cat2Name; - } - public String getCat3() { - return cat3; - } - public void setCat3(String cat3) { - this.cat3 = cat3; - } - public String getCat3Name() { - return cat3Name; - } - public void setCat3Name(String cat3Name) { - this.cat3Name = cat3Name; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { - this.summary = summary; - } - public String getZipCode() { - return zipCode; - } - public void setZipCode(String zipCode) { - this.zipCode = zipCode; - } - public String getTel() { - return tel; - } - public void setTel(String tel) { - this.tel = tel; - } - public String getMainImage() { - return mainImage; - } - public void setMainImage(String mainImage) { - this.mainImage = mainImage; - } - public String getLatitude() { - return latitude; - } - public void setLatitude(String latitude) { - this.latitude = latitude; - } - public String getLongitude() { - return longitude; - } - public void setLongitude(String longitude) { - this.longitude = longitude; - } - public String getSidoName() { - return sidoName; - } - public void setSidoName(String sidoName) { - this.sidoName = sidoName; - } - public String getSigunguName() { - return sigunguName; - } - public void setSigunguName(String sigunguName) { - this.sigunguName = sigunguName; - } - public String getAddr1() { - return addr1; - } - public void setAddr1(String addr1) { - this.addr1 = addr1; - } - public String getAddr2() { - return addr2; - } - public void setAddr2(String addr2) { - this.addr2 = addr2; - } - public String getNtceBgnde() { - return ntceBgnde; - } - public void setNtceBgnde(String ntceBgnde) { - this.ntceBgnde = ntceBgnde; - } - public String getNtceEndde() { - return ntceEndde; - } - public void setNtceEndde(String ntceEndde) { - this.ntceEndde = ntceEndde; - } - public String getWebsite() { - return website; - } - public void setWebsite(String website) { - this.website = website; - } - public Date getCreatedTime() { - return createdTime; - } - public void setCreatedTime(Date createdTime) { - this.createdTime = createdTime; - } - public Date getModifiedTime() { - return modifiedTime; - } - public void setModifiedTime(Date modifiedTime) { - this.modifiedTime = modifiedTime; - } - public String[] getCategoryArray1() { - String[] ret = null; - if(this.categoryArray1 != null){ - ret = new String[categoryArray1.length]; - ret = this.categoryArray1; - } - return ret; - } - - public void setCategoryArray1(String[] categoryArray1) { - this.categoryArray1 = new String[categoryArray1.length]; - for(int i=0; i selectLocalToonTopList(CmmAmsAssetMediaVO param) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonTopList", param); - } - - @SuppressWarnings("deprecation") - public int selectLocalToonListTotCnt(CmmAmsAssetMediaVO param) throws DataAccessException{ - //return (Integer)getSqlMapClientTemplate().queryForObject("localToonDAO.selectLocalToonListTotCnt", param); - return 0; // DDDDDDDDD 임시 리턴값 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectLocalToonList(CmmAmsAssetMediaVO param) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonList", param); - } - @SuppressWarnings("unchecked") - public List selectLocalToonOpenPageList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonOpenPageList",cmmActivityHstVO); - } - @SuppressWarnings("unchecked") - public List selectLocalToonOpenPageHotList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonOpenPageHotList",cmmActivityHstVO); - } - public CmmAmsAssetMediaVO selectLocalToonDetail(CmmAmsAssetMediaVO param) throws DataAccessException{ - //return (CmmAmsAssetMediaVO)select("localToonDAO.selectLocalToonDetail", param); - return null; // DDDDDDDDD 임시 리턴값 처리 (2021.08.13) - } - @SuppressWarnings("deprecation") - public int selectLocalToonDetailListTotCnt(CmmAmsAssetMediaVO param) throws DataAccessException{ - //return (Integer)getSqlMapClientTemplate().queryForObject("localToonDAO.selectLocalToonDetailListTotCnt", param); - return 0; // DDDDDDDDD 임시 리턴값 처리 (2021.08.13) - } - @SuppressWarnings("unchecked") - public List selectLocalToonDetailList(CmmAmsAssetMediaVO param) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonDetailList", param); - } - @SuppressWarnings("unchecked") - public List selectLocalToonOpenPageDetailList(CmmActivityHstVO cmmActivityHstVO) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonOpenPageDetailList",cmmActivityHstVO); - } - @SuppressWarnings("unchecked") - public List selectLocalToonDetailListAll(CmmAmsAssetMediaVO param) throws DataAccessException { - return (List)list("localToonDAO.selectLocalToonDetailListAll", param); - } -} diff --git a/src/main/java/kccf/ton/service/impl/LocalToonServiceImpl.java b/src/main/java/kccf/ton/service/impl/LocalToonServiceImpl.java deleted file mode 100644 index 8b5f4a77..00000000 --- a/src/main/java/kccf/ton/service/impl/LocalToonServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package kccf.ton.service.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import kccf.ton.service.LocalToonService; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import cmm.service.CmmActivityHstVO; -import cmm.service.CmmAmsAssetMediaVO; -import cmm.util.DataMap; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; - -@Service("localToonService") -public class LocalToonServiceImpl extends EgovAbstractServiceImpl implements LocalToonService{ - /** LOGGER */ - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(LocalToonServiceImpl.class); - - /** localToonDAO */ - @Resource(name="localToonDAO") - private LocalToonDAO localToonDAO; - - @Override - public List selectLocalToonTopList(CmmAmsAssetMediaVO param) throws EgovBizException { - return (List)localToonDAO.selectLocalToonTopList(param); - } - - @Override - public int selectLocalToonListTotCnt(CmmAmsAssetMediaVO param) throws EgovBizException { - return (Integer)localToonDAO.selectLocalToonListTotCnt(param); - } - @Override - public List selectLocalToonList(CmmAmsAssetMediaVO param) throws EgovBizException { - return (List)localToonDAO.selectLocalToonList(param); - } - public List selectLocalToonOpenPageList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)localToonDAO.selectLocalToonOpenPageList(cmmActivityHstVO); - } - public List selectLocalToonOpenPageHotList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)localToonDAO.selectLocalToonOpenPageHotList(cmmActivityHstVO); - } - @Override - public CmmAmsAssetMediaVO selectLocalToonDetail(CmmAmsAssetMediaVO param) throws EgovBizException { - return (CmmAmsAssetMediaVO)localToonDAO.selectLocalToonDetail(param); - } - @Override - public int selectLocalToonDetailListTotCnt(CmmAmsAssetMediaVO param) throws EgovBizException { - return (Integer)localToonDAO.selectLocalToonDetailListTotCnt(param); - } - - public List selectLocalToonDetailList(CmmAmsAssetMediaVO param) throws EgovBizException { - return (List)localToonDAO.selectLocalToonDetailList(param); - } - public List selectLocalToonOpenPageDetailList(CmmActivityHstVO cmmActivityHstVO) throws EgovBizException{ - return (List)localToonDAO.selectLocalToonOpenPageDetailList(cmmActivityHstVO); - } - public List selectLocalToonDetailListAll(CmmAmsAssetMediaVO param) throws EgovBizException { - return (List)localToonDAO.selectLocalToonDetailListAll(param); - } - -} diff --git a/src/main/java/kccf/ton/web/LocalToonController.java b/src/main/java/kccf/ton/web/LocalToonController.java deleted file mode 100644 index 965eb3c8..00000000 --- a/src/main/java/kccf/ton/web/LocalToonController.java +++ /dev/null @@ -1,242 +0,0 @@ -package kccf.ton.web; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import kccf.ton.service.LocalToonService; - -import org.apache.commons.lang3.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.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import cmm.Constant; -import cmm.service.CmmActivityHstVO; -import cmm.service.CmmAmsAssetMediaVO; -import cmm.service.CmmAmsAssetsVO; -import cmm.service.CmmAmsDocTableOfContentsVO; -import cmm.service.CmmCmsContentsVO; -import cmm.service.CmmMetaVO; -import cmm.service.CmmService; -import cmm.service.ExtService; -import cmm.util.CmmUtil; -import cmm.util.DataMap; -//import egovframework.com.cmm.EgovMessageSource; -import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import egovframework.rte.fdl.property.EgovPropertyService; -import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; - - - -@Controller -public class LocalToonController { - - @SuppressWarnings("unused") - private static final Logger LOGGER = LoggerFactory.getLogger(LocalToonController.class); - - @Resource(name = "propertiesService") - protected EgovPropertyService propertiesService; - -// @Resource(name="egovMessageSource") -// EgovMessageSource egovMessageSource; - - @Resource(name = "localToonService") - private LocalToonService localToonService; - - @Resource(name = "extService") - private ExtService extService; - - @Resource(name = "cmmService") - private CmmService cmmService; - - @RequestMapping(value="/ton/localToonList.do") - public String selectLocalToonList ( - @ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO - , ModelMap model - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - - model.addAttribute("paramVO", cmmAmsAssetMediaVO); - - /**** paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit()); - paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize()); - - cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** paging ****/ - - - // 키 - cmmAmsAssetMediaVO.setSessionId(CmmUtil.getCookieId(req)); - // 이달의 툰 - model.addAttribute("resultTopList", localToonService.selectLocalToonTopList(cmmAmsAssetMediaVO)); - // 지역문화툰 - int totCnt = localToonService.selectLocalToonListTotCnt(cmmAmsAssetMediaVO); - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("resultList", localToonService.selectLocalToonList(cmmAmsAssetMediaVO)); - model.addAttribute("totCnt", totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - // 최근열람툰 - CmmActivityHstVO cmmActivityHstVO = new CmmActivityHstVO(); - cmmActivityHstVO.setTargetId(CmmUtil.getCookieId(req)); - cmmActivityHstVO.setUaType(Constant.UA_TYPE_W); - cmmActivityHstVO.setActivityType(Constant.ACTIVITY_TYPE_O); - cmmActivityHstVO.setContentType(Constant.CONTENT_TYPE_T); - model.addAttribute("openPageList", localToonService.selectLocalToonOpenPageList(cmmActivityHstVO)); - model.addAttribute("openPageHotList", localToonService.selectLocalToonOpenPageHotList(cmmActivityHstVO)); - - // 메타태그정보 - CmmMetaVO metaVO = new CmmMetaVO(); - metaVO.setTitle("지역문화툰"); - metaVO.setDescription("지역문화와 관련된 다양한 이야기와 정보로 재미있게 구성된 웹툰을 만나실 수 있습니다."); - metaVO.setUrl(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/ton/localToonList.do"); - metaVO.setImage(CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY) + "/images/kccf/bg/bg-subvisual-toon.jpg"); - model.addAttribute("metaResult", metaVO); - - return "kccf/ton/localToonList.kccf"; - } - - @RequestMapping(value="/ton/openPageList-data.do") - public ModelAndView selectOpenPageListAjax ( - @ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO - , ModelMap model - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - CmmActivityHstVO cmmActivityHstVO = new CmmActivityHstVO(); - cmmActivityHstVO.setTargetId(CmmUtil.getCookieId(req)); - cmmActivityHstVO.setUaType(Constant.UA_TYPE_W); - cmmActivityHstVO.setActivityType(Constant.ACTIVITY_TYPE_O); - cmmActivityHstVO.setContentType(Constant.CONTENT_TYPE_T); - - DataMap responseMap = new DataMap(); - - responseMap.put("contentsList", localToonService.selectLocalToonOpenPageList(cmmActivityHstVO)); - model.addAttribute("responseData", responseMap); - return modelAndView; - } - - @RequestMapping(value="/ton/localToonDetailList.do") - public String selectLocalToonDetailList ( - @ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO - , ModelMap model - , HttpServletRequest req - , HttpServletResponse res - ) throws EgovBizException { - model.addAttribute("paramVO", cmmAmsAssetMediaVO); - - model.addAttribute("cookieId", CmmUtil.getCookieId(req)); - CmmUtil.setNfsPathModelMap(req,model); - - cmmAmsAssetMediaVO.setMediaId(cmmAmsAssetMediaVO.getContentId()); - CmmAmsAssetMediaVO result = localToonService.selectLocalToonDetail(cmmAmsAssetMediaVO); - model.addAttribute("result", result); - - /**** paging ****/ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(cmmAmsAssetMediaVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(cmmAmsAssetMediaVO.getPageUnit()); - paginationInfo.setPageSize((CmmUtil.isMobile(req)) ? cmmAmsAssetMediaVO.getMobilePageSize() : cmmAmsAssetMediaVO.getPageSize()); - - cmmAmsAssetMediaVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - cmmAmsAssetMediaVO.setLastIndex(paginationInfo.getLastRecordIndex()); - cmmAmsAssetMediaVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - /**** paging ****/ - // 키 - cmmAmsAssetMediaVO.setSessionId(CmmUtil.getCookieId(req)); - - cmmAmsAssetMediaVO.setAssetId(result.getAssetId()); - int totCnt = localToonService.selectLocalToonDetailListTotCnt(cmmAmsAssetMediaVO); - paginationInfo.setTotalRecordCount(totCnt); - List resultList = localToonService.selectLocalToonDetailList(cmmAmsAssetMediaVO); - model.addAttribute("resultList", resultList); - model.addAttribute("totCnt", totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - // 최근열람툰 - CmmActivityHstVO cmmActivityHstVO = new CmmActivityHstVO(); - cmmActivityHstVO.setTargetId(CmmUtil.getCookieId(req)); - cmmActivityHstVO.setUaType(Constant.UA_TYPE_W); - cmmActivityHstVO.setActivityType(Constant.ACTIVITY_TYPE_O); - cmmActivityHstVO.setContentType(Constant.CONTENT_TYPE_T); - - cmmActivityHstVO.setParameter1(cmmAmsAssetMediaVO.getAssetId()); - cmmActivityHstVO.setParameter2(cmmAmsAssetMediaVO.getGroupId()); - - model.addAttribute("openPageDetailList", localToonService.selectLocalToonOpenPageDetailList(cmmActivityHstVO)); - - return "kccf/ton/localToonDetailList.kccf"; - } - - @RequestMapping(value="/ton/localToonDetail.do") - public String selectLocalToonDetail ( - @ModelAttribute("cmmAmsAssetMedia") CmmAmsAssetMediaVO cmmAmsAssetMediaVO - , BindingResult bindingResult - , ModelMap model - , HttpServletRequest req - ) throws EgovBizException { - - model.addAttribute("cookieId", CmmUtil.getCookieId(req)); - CmmUtil.setNfsPathModelMap(req,model); - - cmmAmsAssetMediaVO.setSessionId(CmmUtil.getCookieId(req)); - cmmAmsAssetMediaVO.setMediaId(cmmAmsAssetMediaVO.getContentId()); - CmmAmsAssetMediaVO result = localToonService.selectLocalToonDetail(cmmAmsAssetMediaVO); - model.addAttribute("result", result); - - cmmAmsAssetMediaVO.setSessionId(CmmUtil.getCookieId(req)); - cmmAmsAssetMediaVO.setAssetId(result.getAssetId()); - cmmAmsAssetMediaVO.setGroupId(result.getGroupId()); - List resultList = localToonService.selectLocalToonDetailListAll(cmmAmsAssetMediaVO); - model.addAttribute("resultList", resultList); - int defaultCount = 0; - for(int i=0; i 공연ㆍ행사 - - public static final String [] DF_COUNCIL_CODE_ARRAY = {"GW","GG","GB","GN","GJ","DG","DJ","BU","SU","SJ","US","IC","JB","JN","JJ","CB","CN"}; - public static final String [] AMS_ASSET_TYPE_ARRAY = {"이미지","동영상","오디오","문서","링크"}; - public static final String [] AMS_CATEGORY_ARRAY = {"A","B","C","D","E","F","G","H","I"}; - - public static final String USE_AT_Y = "Y"; - public static final String USE_AT_N = "N"; - - public static final String CMS_SERIES_DEFAULT = "마을신앙"; - - public static final String QNA_ANSW_N = "답변대기"; - public static final String QNA_ANSW_Y = "답변완료"; - public static final String QNA_PROC_P = "2"; - public static final String QNA_PROC_C = "3"; - - public static final String VIEW_TYPE_L = "L"; //목록 - public static final String VIEW_TYPE_D = "D"; //상세 - - - public static final String LOGIN_HIS_TYPE_I = "I"; - public static final String LOGIN_HIS_TYPE_O = "O"; - - public static final String CODE_ID_COM004 = "COM004"; // 게시판 - public static final String CODE_ID_COM013 = "COM013"; // 회원상태 - public static final String CODE_ID_COM034 = "COM034"; // 이용자 - public static final String CODE_ID_FMS004 = "FMS004"; // 테마 - public static final String CODE_ID_FMS005 = "FMS005"; // 시리즈 - public static final String CODE_ID_FMS006 = "FMS006"; // 시대 - public static final String CODE_ID_FMS007 = "FMS007"; // 자료유형 - public static final String CODE_ID_FMS008 = "FMS008"; // 콘텐츠유형 - public static final String CODE_ID_FMS009 = "FMS009"; // 지역 - public static final String CODE_ID_FMS012 = "FMS012"; // 자료유형(대분류) - public static final String CODE_ID_FMS013 = "FMS013"; // 자료유형(중분류) - public static final String CODE_ID_MASTER_TYPE_DIV_CD = "MASTER_TYPE_DIV_CD"; // 자료유형(대분류) - public static final String CODE_ID_DTLS_TYPE_DIV_CD = "DTLS_TYPE_DIV_CD"; // 자료유형(중분류) - public static final String CODE_ID_FMS014 = "FMS014"; // 주제분야(대주제) - public static final String CODE_ID_FMS015 = "FMS015"; // 주제분야(중주제) - public static final String CODE_ID_FMS016 = "FMS016"; // 지역문화정보 - public static final String CODE_ID_FMS017 = "FMS017"; // 배너위치 - public static final String CODE_ID_FMS018 = "FMS018"; // 문화원 지역 - public static final String CODE_ID_FMS019 = "FMS019"; // 지역문화 PICK(자산유형) - public static final String CODE_ID_FMS020 = "FMS020"; // 로고위치 - - public static final String [] ASSETS_CLASS_ARRAY = {"기획","일반","특화","기타"}; //콘텐츠유형 - public static final String [] ASSETS_CLASS_ARRAY_PICK = {"일반","특화"}; // 지역문화Pick 콘텐츠유형 - public static final String [] ASSETS_TYPE_ARRAY_PICK = {"문서", "이미지", "동영상", "오디오", "링크"}; // 지역문화Pick 자산유형 ("웹툰" 제외) - public static final String [] ASSETS_TYPE_ARRAY_PICK_ALL = {"문서", "이미지", "동영상", "오디오", "링크", "웹툰"}; - - public static final String RES_SEARCHTYPE = "문화원소장"; // 소장자료 검색조건 - - public static final String CODE_ID_COM013_P = "P"; // 회원 가입승인상태 - public static final String CODE_ID_COM013_D = "D"; // 회원삭제 상태 - - public static final String CODE_ID_FMS017_M01 = "M01"; // 배너위치 메인 - public static final String CODE_ID_FMS017_M02 = "M02"; // 배너위치 PICK - public static final String CODE_ID_FMS017_M99 = "M99"; // 배너위치 문화원 - - public static final int BBS_ID_NOTICE_MAIN_VIEW = 3; - public static final int BBS_ID_QNA_MAIN_VIEW = 4; - public static final int BBS_ID_CUL_MAIN_VIEW = 2; - - public static final String BASE_DISTANCE = "10"; - - public static final int CMM_CONTENTS_LIMIT_CNT = 6; // 지역문화Pick 목록 이미지 개수 변경 (2019.10.02) - public static final int CMM_TAGS_LIMIT_CNT = 9; - public static final int CMM_CONTENTS_SMALL_LIMIT_CNT = 2; - - public static final String RECOMMEND_YN_Y = "Y"; - public static final String RECOMMEND_YN_N = "N"; - - public static final String HAVE_DETAIL_CONDITION_Y = "Y"; - public static final String HAVE_DETAIL_CONDITION_N = "N"; - - public static final String SEARCH_TYPE_1 = "1"; - public static final String SEARCH_TYPE_2 = "2"; - - public static final String BBS_TOP_YN_Y = "Y"; - public static final int BBS_TOP_CNT = 4; - - public static final String PMS_CONT_TYPE_G = "EXT_GIA_INFO"; // 한국관광공사 - public static final String PMS_CONT_TYPE_C = "CMM_COUNCIL_INFO"; // 문화원 - - public static final String CONTENT_TYPE_A = "A"; // 지역문화 PICK - public static final String CONTENT_TYPE_B = "B"; // BBS - public static final String CONTENT_TYPE_C = "C"; // 지역문화이야기 - public static final String CONTENT_TYPE_G = "G"; // 지역문화체험 -한국관광공사 api - public static final String CONTENT_TYPE_I = "I"; // 문화원 - public static final String CONTENT_TYPE_P = "P"; // 지역문화포스트 - public static final String CONTENT_TYPE_T = "T"; // 지역문화툰 - - public static final String ACTIVITY_TYPE_B = "B"; // 스크랩 - public static final String ACTIVITY_TYPE_O = "O"; // 최근열람 - - public static final String[] M_TYPE_ARRAY = {"이미지","동영상","오디오","링크"}; - public static final String M_TYPE_I = "I"; // 이미지 - public static final String M_TYPE_V = "V"; // 비디오(동영상) - public static final String M_TYPE_A = "A"; // 오디오 - - // 사용 구분 - public static final String UA_TYPE_W = "W"; // 웹 - public static final String UA_TYPE_M = "M"; // 모바일웹 - public static final String UA_TYPE_A = "A"; // 앱 - public static final String UA_TYPE_R = "R"; // RIS - - - public static final String BBS_ID_NOTICE = "BBSMSTR_000000000001"; // 공지사항 - public static final String BBS_ID_FAQ = "BBSMSTR_000000000002"; // FAQ - public static final String BBS_ID_CUL = "BBSMSTR_000000000003"; // 문화원소식 - public static final String BBS_ID_OUR = "BBSMSTR_000000000004"; // 우리문화 - - public static final String [] BBS_ID_ARRAY = {BBS_ID_NOTICE,BBS_ID_FAQ,BBS_ID_CUL,BBS_ID_OUR}; - public static final String [] BBS_NAME_ARRAY = {"공지사항","FAQ","문화원소식","우리문화"}; - - public static final String [] BBS_MAIN_CUL_TYPE_ARRAY1 = {"공지","뉴스"}; - public static final String [] BBS_MAIN_CUL_TYPE_ARRAY2 = {"행사","축제"}; - - public static final String AUTH_GROUP_DEFAULT_ID = "GROUP_00000000000000"; - public static final String AUTH_ORGNZT_DEFAULT_ID = "ORGNZT_0000000000000"; - - public static final String AUTH_ROLE_ANONYMOUS = "ROLE_ANONYMOUS"; - public static final String AUTH_ROLE_KDM = "ROLE_KDM"; - public static final String AUTH_ROLE_KDM_URL = "/kdm/usr/kdmMgrList.do"; - public static final String AUTH_ROLE_SYM = "ROLE_SYM"; - public static final String AUTH_ROLE_SYM_URL = "/kdm/usr/kdmMgrList.do"; - - public static final String[] INTERCEPTOR_PASS_PATH_ARRAY = {"kdm"}; - - public static final String ANDROID = "android"; - public static final String IOS = "ios"; - public static final String PREFIX_M = "/m"; - - public static final String SCHEDULER_EXT_DF_INFO = "건강질병관리"; - public static final String SCHEDULER_EXT_FD_INFO = "문화정보"; - public static final String SCHEDULER_EXT_GIA_INFO = "관광정보"; - public static final String SCHEDULER_MAIN_A_INFO = "메인 지역문화PICK"; - public static final String SCHEDULER_MAIN_C_INFO = "메인 지역문화이야기"; - public static final String SCHEDULER_MAIN_G_INFO = "메인 지역문화정보"; - public static final String SCHEDULER_MAIN_P_INFO = "메인 지역문화포스트"; - public static final String SCHEDULER_MEDIA_HST_INFO = "월별 지방문화원 인기자료"; - - public static final String [] SCHEDULER_NAME_ARRAY = {SCHEDULER_EXT_DF_INFO,SCHEDULER_EXT_FD_INFO,SCHEDULER_EXT_GIA_INFO}; - - public static enum META_OG_TYPE { website, article }; - - public static final String [] NCULTURE_URL_ARRAY = {"www","www1","www2","cms","cms1","cms2","ams","ams1","ams2","vod","vod1","vod2","api","api1","api2","app","app1","app2","vr","cms-dev","ams-dev","kccf-jira","kccf-wiki","kccf-ci","cloud","kccf2019","doc","webzine","docs","minio","minio-dev","port-dev","app-dev","api-dev","vod-dev","newcms","ncms","ncms-dev","ncms-test","newcms-dev","ams-test","ci","local"}; -} diff --git a/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java b/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java index e973fce5..5f609bc4 100644 --- a/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java +++ b/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java @@ -1,6 +1,5 @@ package nlib.sch.service.impl; -import static kccf.sch.common.WNDefine.*; import java.io.BufferedReader; diff --git a/src/main/java/nlib/sch/util/NlibCmmUtil.java b/src/main/java/nlib/sch/util/NlibCmmUtil.java index 411473de..4501cc9f 100644 --- a/src/main/java/nlib/sch/util/NlibCmmUtil.java +++ b/src/main/java/nlib/sch/util/NlibCmmUtil.java @@ -33,9 +33,8 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.ui.ModelMap; -import cmm.Constant; -import cmm.service.CmmAmsDocTableOfContentsVO; -import cmm.service.CmmService; +import nlib.cmm.Constant; +import nlib.cmm.service.CmmAmsDocTableOfContentsVO; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -58,18 +57,13 @@ public class NlibCmmUtil { private static final Logger LOGGER = LoggerFactory.getLogger(NlibCmmUtil.class); public static String DEFAULT_DELIMITER = "-"; protected static EgovPropertyService propertyService; - protected static CmmService cmmService; @Resource(name = "propertiesService") private EgovPropertyService propertyServiceInstance; - @Resource(name = "cmmService") - private CmmService cmmServiceInstance; - @PostConstruct private void init() { propertyService = propertyServiceInstance; - cmmService = cmmServiceInstance; } public static String reflectionToString(Object obj) { return ToStringBuilder.reflectionToString(obj); @@ -1042,7 +1036,7 @@ public class NlibCmmUtil { DataMap param = new DataMap(); param.put("aId", aId); param.put("mId", mId); - DataMap media = new DataMap();/*cmmService.selectCmmAmsAssetsMediaDetail2(param);*/// asset id로 조회 + DataMap media = new DataMap(); String mediaId = media.getString("mediaId"); String mediaInterfaceId = media.getString("mediaInterfaceId"); diff --git a/src/main/java/nlib/sch/web/NlibSearchController.java b/src/main/java/nlib/sch/web/NlibSearchController.java index b48cc67d..0afe1132 100644 --- a/src/main/java/nlib/sch/web/NlibSearchController.java +++ b/src/main/java/nlib/sch/web/NlibSearchController.java @@ -29,13 +29,10 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import cmm.Constant; -import cmm.util.CmmUtil; +import nlib.cmm.Constant; import nlib.sch.service.CmmVO; -import cmm.util.DataMap; +import nlib.sch.util.DataMap; import egovframework.rte.fdl.cmmn.exception.EgovBizException; -import kccf.res.service.ResourcesService; -import kccf.sch.service.SearchService; import nlib.cmm.NlibCommonController; import nlib.cmm.service.CodeService; import nlib.cmm.service.NlibProperty; @@ -47,6 +44,7 @@ import nlib.col.service.InterestService; import nlib.col.service.RisService; import nlib.sch.service.NlibSearchService; import nlib.sch.service.NlibSearchVO; +import nlib.sch.util.NlibCmmUtil; import nlib.util.StringUtil; @Controller @@ -70,18 +68,12 @@ public class NlibSearchController extends NlibCommonController { @Resource(name = "nlibProperty") protected NlibProperty nlibProperty; - @Resource(name = "searchService") - private SearchService searchService; - @Resource(name = "collectionService") private CollectionService collectionService; @Resource(name = "nlibSearchService") private NlibSearchService nlibSearchService; - /** resourcesService */ - @Resource(name = "resourcesService") - private ResourcesService resourcesService; /** * 소장자료 화면을 호출한다. @@ -137,7 +129,7 @@ public class NlibSearchController extends NlibCommonController { searchVO.setResultList(operList); // 경로 - CmmUtil.setNfsPathModelMap(request,model); + NlibCmmUtil.setNfsPathModelMap(request,model); model.addAttribute("pageVO", pageVO); model.addAttribute("searchVO", searchVO); diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems.jsp deleted file mode 100644 index 6066cb0d..00000000 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems.jsp +++ /dev/null @@ -1,261 +0,0 @@ -<% -/** - *
- * @Class Name : listItems.jsp
- * 
- * @Description : 소장 자료를 조회한다.
- * 
- * 
- * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
- *
- * 
- * - * @ ------------ -------- --------------------------- - * @ 수정일 수정자 수정내용 - * @ ------------ -------- --------------------------- - * @ 2021. 7. 28. JSYOO 최초 생성 - * - * - * @author 이씨플라자 * DIGITALSHIP JSYOO - * @since 2021. 7. 28. - * @version 1.0 - * - */ - %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> - -소장 자료 - - - - - - -${pageTitle} - - - - - - - - - - -

${pageTitle }

- -
- - - - - - - - -
- - - - - -
- - -
-
-
- - -

    생산년도

    -
    - 전체
    - ~
    - (미상포함) - 적용 -
    -
-

    생산기관

    z -
-
- -
- - diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems20211012.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems20211012.jsp deleted file mode 100644 index 104479d5..00000000 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/listItems20211012.jsp +++ /dev/null @@ -1,266 +0,0 @@ -<% -/** - *
- * @Class Name : listItems.jsp
- * 
- * @Description : 소장 자료를 조회한다.
- * 
- * 
- * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
- *
- * 
- * - * @ ------------ -------- --------------------------- - * @ 수정일 수정자 수정내용 - * @ ------------ -------- --------------------------- - * @ 2021. 7. 28. JSYOO 최초 생성 - * - * - * @author 이씨플라자 * DIGITALSHIP JSYOO - * @since 2021. 7. 28. - * @version 1.0 - * - */ - %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> - -소장 자료 - - - - - - -${pageTitle} - - - - - - - - - - -

${pageTitle }

- -
- - - - - - - - -
- - - - - -
- - -
-
-
- - -

    생산년도

    -
    - 전체
    - ~
    - (미상포함) - 적용 -
    -
-

    생산기관

    -
-
- -
- - diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/schResultReferenceList.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/schResultReferenceList.jsp deleted file mode 100644 index 4a63ba4e..00000000 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/schResultReferenceList.jsp +++ /dev/null @@ -1,85 +0,0 @@ -<%@ page contentType="text/html; charset=utf-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%-- <%@ taglib prefix="cfn" uri="/WEB-INF/tlds/function.tld" %> --%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> -<%@ page import="cmm.util.CmmUtil" %> -<%@ page import="cmm.Constant" %> -<% - String pdfPath = CmmUtil.getPropertyStr(Constant.PDF_VIEW_KEY); -%> -
    - -
  • - -
    - <%-- ${result.TITLE} --%> - ${result.TITLE} -

    출처:${result.COPYRIGHT}

    -
    -
    - -
    -
    - -
    -
      -
    • <%--주제분야 : --%>${result.FIRST_CATEGORY_NM} > ${result.SECOND_CATEGORY_NM}
    • -
    • <%--자료유형 : --%>${result.FIRST_CLASS_NM} > ${result.SECOND_CLASS_NM}
    • -
    • ${result.PUBLISHER}
    • -
    • ${result.GENYEAR}년도
    • -
    -
      -
    • 소장처 : ${result.COUNCIL_NM_TOT}
    • -
    -

    ${result.SUMMARY}

    -
    - - - - - - - 사진보기 - 영상보기 - 음향듣기 - - <%-- 원본 연결 - 원문보기 - --%> - <%-- 분할파일 연결 (테스트query:임진란 임원선출) --%> - 원문보기 - - <%-- 원문보기 --%> - 원문보기 - - - - - - - - RIS - - - -
    -
    -
  • -
    -
- diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchReferenceListAjax.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/searchReferenceListAjax.jsp deleted file mode 100644 index a564e3f8..00000000 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchReferenceListAjax.jsp +++ /dev/null @@ -1,426 +0,0 @@ -<%@ page contentType="text/html; charset=utf-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> -<%@ page import="cmm.util.CmmUtil" %> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- - - diff --git a/src/main/webapp/test/test.html b/src/main/webapp/test/test.html new file mode 100644 index 00000000..c0d355e8 --- /dev/null +++ b/src/main/webapp/test/test.html @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +소장자료관 + + + + + + +
+ + + + + + + + + + + + +Insert title here + + +가입되셨습니다. 환영합니다 + + + + + + +
+ + + + + + + \ No newline at end of file