중간백업
This commit is contained in:
parent
c1f5d1617f
commit
365498e6ca
@ -10,7 +10,7 @@
|
|||||||
<noticeNo>1</noticeNo>
|
<noticeNo>1</noticeNo>
|
||||||
<noticeType>101</noticeType>
|
<noticeType>101</noticeType>
|
||||||
<title>공지사항 테스트</title>
|
<title>공지사항 테스트</title>
|
||||||
<readCount>55</readCount>
|
<readCount>15</readCount>
|
||||||
<regDate>2021-07-19</regDate>
|
<regDate>2021-07-19</regDate>
|
||||||
</record>
|
</record>
|
||||||
<record>
|
<record>
|
||||||
@ -90,5 +90,6 @@
|
|||||||
<readCount>55</readCount>
|
<readCount>55</readCount>
|
||||||
<regDate>2021-07-19</regDate>
|
<regDate>2021-07-19</regDate>
|
||||||
</record>
|
</record>
|
||||||
|
<end>3333</end>
|
||||||
</result>
|
</result>
|
||||||
|
|
||||||
|
|||||||
@ -1,95 +0,0 @@
|
|||||||
package nlib.cmm.util;
|
|
||||||
|
|
||||||
import java.util.AbstractMap;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import com.thoughtworks.xstream.converters.Converter;
|
|
||||||
import com.thoughtworks.xstream.converters.MarshallingContext;
|
|
||||||
import com.thoughtworks.xstream.converters.UnmarshallingContext;
|
|
||||||
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
|
|
||||||
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <pre>
|
|
||||||
* @Class Name : MapEntryConverter.java
|
|
||||||
*
|
|
||||||
* @Description : XML 문자열을 Map 객체로 변환 처리
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 수정일 수정자 수정내용
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 2021. 6. 22. KNKIM 최초 생성
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
|
||||||
* @since 2021. 6. 22.
|
|
||||||
* @version 1.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class MapEntryConverter implements Converter {
|
|
||||||
|
|
||||||
public boolean canConvert(Class clazz) {
|
|
||||||
return AbstractMap.class.isAssignableFrom(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) {
|
|
||||||
AbstractMap map = (AbstractMap) value;
|
|
||||||
for (Object obj : map.entrySet()) {
|
|
||||||
Entry entry = (Entry) obj;
|
|
||||||
Object entryValue = entry.getValue();
|
|
||||||
|
|
||||||
if (entryValue instanceof Map) {
|
|
||||||
writer.startNode(entry.getKey().toString());
|
|
||||||
marshal(entry.getValue(), writer, context);
|
|
||||||
writer.endNode();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
writer.startNode(entry.getKey().toString());
|
|
||||||
writer.setValue(entryValue.toString());
|
|
||||||
writer.endNode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
while (reader.hasMoreChildren()) {
|
|
||||||
reader.moveDown();
|
|
||||||
if (reader.hasMoreChildren()) {
|
|
||||||
Map<String, Object> childMap = new HashMap<String, Object>();
|
|
||||||
map.put(reader.getNodeName(), childMap);
|
|
||||||
unmarshalHierarchical(reader, context, childMap);
|
|
||||||
reader.moveUp();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
map.put(reader.getNodeName(), reader.getValue());
|
|
||||||
reader.moveUp();
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void unmarshalHierarchical(HierarchicalStreamReader reader, UnmarshallingContext context,
|
|
||||||
Map<String, Object> map) {
|
|
||||||
while (reader.hasMoreChildren()) {
|
|
||||||
reader.moveDown();
|
|
||||||
if (reader.hasMoreChildren()) {
|
|
||||||
Map<String, Object> childMap = new HashMap<String, Object>();
|
|
||||||
map.put(reader.getNodeName(), childMap);
|
|
||||||
unmarshalHierarchical(reader, context, childMap);
|
|
||||||
reader.moveUp();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
map.put(reader.getNodeName(), reader.getValue());
|
|
||||||
reader.moveUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -148,7 +148,9 @@ $("#jsGrid").jsGrid({
|
|||||||
|
|
||||||
|
|
||||||
/* 이하만 설정 */
|
/* 이하만 설정 */
|
||||||
|
/*
|
||||||
data: clients,
|
data: clients,
|
||||||
|
*/
|
||||||
|
|
||||||
fields: [
|
fields: [
|
||||||
{ title:"번호", name: "noticeNo" , type: "number" , width: 50, align: "center"},
|
{ title:"번호", name: "noticeNo" , type: "number" , width: 50, align: "center"},
|
||||||
@ -178,7 +180,9 @@ function fn_search_article() {
|
|||||||
data: JSON.stringify(inputData),
|
data: JSON.stringify(inputData),
|
||||||
dataType:'json', /* Server Response Data Type */
|
dataType:'json', /* Server Response Data Type */
|
||||||
success: function(returnData, status){
|
success: function(returnData, status){
|
||||||
alert("returnData=" + JSON.stringify(returnData));
|
var jsonObj = JSON.parse(returnData);
|
||||||
|
alert("record=" + JSON.stringify(jsonObj.info.record));
|
||||||
|
$("#jsGrid").jsGrid("loadData", jsonObj.info.record)
|
||||||
},
|
},
|
||||||
error: function(data){
|
error: function(data){
|
||||||
alert("조회에 실패하였습니다.\n" + data.code + " : " + data.message);
|
alert("조회에 실패하였습니다.\n" + data.code + " : " + data.message);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user