diff --git a/WebContent/color.jsp b/WebContent/color.jsp new file mode 100644 index 0000000..4664d2e --- /dev/null +++ b/WebContent/color.jsp @@ -0,0 +1,71 @@ +<%@ page language="java" contentType="text/html; charset=utf-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<% + String systemColor = System.getProperty("theme.color"); + String range = (String)request.getParameter("range"); + String color = (String)request.getParameter("color"); + String change = (String)request.getParameter("change"); + if(color == null || color.length() == 0) color= systemColor; + + if("all".equals(range)) { + System.setProperty("theme.color", color); + } +%> + + + + + + + Change Theme Color + "/> + " /> + + + + + + + +
+
" method="get"> + + + + + + + + + + + + + + +
Theme Color + +
Range + +

+ +
+
+
+ + + diff --git a/WebContent/common/errors/error.jsp b/WebContent/common/errors/error.jsp index 26a78a4..7b6e1bc 100644 --- a/WebContent/common/errors/error.jsp +++ b/WebContent/common/errors/error.jsp @@ -35,7 +35,7 @@
diff --git a/WebContent/img/ic_eai_favi_black.png b/WebContent/img/ic_eai_favi_black.png new file mode 100644 index 0000000..7b9e2d7 Binary files /dev/null and b/WebContent/img/ic_eai_favi_black.png differ diff --git a/WebContent/img/ic_eai_favi_pink.png b/WebContent/img/ic_eai_favi_pink.png new file mode 100644 index 0000000..e165d25 Binary files /dev/null and b/WebContent/img/ic_eai_favi_pink.png differ diff --git a/WebContent/img/ic_eai_favi_yellow.png b/WebContent/img/ic_eai_favi_yellow.png new file mode 100644 index 0000000..541a37a Binary files /dev/null and b/WebContent/img/ic_eai_favi_yellow.png differ diff --git a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp index fa3deb8..09bb0f7 100644 --- a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp +++ b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp @@ -427,7 +427,7 @@ if('Y' == data.transformYn){ $('#toggleTransformYn').bootstrapToggle('on'); } - if('Y' == data.sinYn){ + if('Y' == data.simYn){ $('#toggleSimYn').bootstrapToggle('on'); } if('Y' == data.apiEnabledYn){ @@ -1317,6 +1317,7 @@ +<%-- --%>
${rmsMenuName}
-
+
@@ -1368,6 +1369,10 @@
+
+
+ +
@@ -1424,14 +1429,17 @@

-
- - - - + + + + - +
@@ -1702,8 +1710,11 @@ 응답 수신 메소드
diff --git a/WebContent/loglevel.jsp b/WebContent/loglevel.jsp new file mode 100644 index 0000000..bea8feb --- /dev/null +++ b/WebContent/loglevel.jsp @@ -0,0 +1,83 @@ +<%@ page contentType="text/html;charset=utf-8"%> +<%@page import="ch.qos.logback.core.*"%> +<%@page import="ch.qos.logback.classic.*"%> +<%@page import="org.slf4j.*"%> +<%@page import="java.util.*"%> +<% + + String loggerName = request.getParameter("loggerName"); + String slevel = request.getParameter("level"); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + if (loggerName != null && !"".equals(loggerName) && slevel != null && !"".equals(slevel)){ + Level level = Level.ERROR; + if ("DEBUG".equals(slevel)){ + level = Level.DEBUG; + }else if ("INFO".equals(slevel)){ + level = Level.INFO; + }else if ("WARN".equals(slevel)){ + level = Level.WARN; + }else if ("ERROR".equals(slevel)){ + level = Level.ERROR; + }else if ("TRACE".equals(slevel)){ + level = Level.TRACE; + } + + lc.getLogger(loggerName).setLevel(level); +%> + <%=loggerName %> 의 로그 level이 <%=slevel %> 로 변경되었습니다. +<% + } + + List logs = lc.getLoggerList();; + +%> + + + + + + + +<% + ArrayList al = new ArrayList(); + for(ch.qos.logback.classic.Logger log : logs){ + if (log.getLevel() != null){ + al.add(log.getName()); + } + } + al.sort(null); + for(String name : al){ + ch.qos.logback.classic.Logger l = lc.getLogger(name); +%> + + + +<% + } +%> +
<%=l.getName() %> +
diff --git a/WebContent/runSql.jsp b/WebContent/runSql.jsp new file mode 100644 index 0000000..9c44fa6 --- /dev/null +++ b/WebContent/runSql.jsp @@ -0,0 +1,409 @@ +<%@page import="com.eactive.eai.rms.common.datasource.DataSourceTypeManager"%> +<%@ page language="java" contentType="text/html; charset=utf-8"%> +<%@ page import="java.io.*, +java.util.*, +javax.xml.parsers.*, +org.w3c.dom.*, +javax.xml.xpath.*, +java.sql.*, +javax.sql.*, +com.eactive.eai.agent.command.*, +com.eactive.eai.agent.*, +com.eactive.eai.rms.onl.common.util.*, +com.eactive.eai.rms.common.datasource.*, +org.apache.commons.logging.Log, +org.apache.commons.logging.LogFactory, +java.util.Arrays, +com.eactive.eai.rms.common.util.StringUtils, +com.eactive.eai.common.util.* +" %> + + +<%! +private static final Logger logger = Logger.getLogger("runSql.jsp"); + +private String NEW_LINE = "\n"; +private int MAX_FETCH_SIZE = 1000; + +private static Object obj = new Object(); + +public StringBuffer ListToString(List list){ + StringBuffer sb = new StringBuffer(); + //first item is ColName + boolean isHead = true; + for(int row=1;row list,String displayType, String serviceType ) throws Exception { + Connection conn = null; + Statement stmt = null; + String driver = null; + String url = null; + String id =null; + String pwd=null; + ResultSet rs = null; + + HashMap results = new HashMap(); + StringBuffer sb = new StringBuffer(); + + StringBuffer errorBuff = new StringBuffer(); + + int rownum = 0; + try { + DataSourceType dataType = DataSourceTypeManager.getDataSourceType(serviceType); + + String jndiName = dataType.getJndiName(); + ServiceLocator sl = ServiceLocator.getInstance(); + DataSource ds = sl.getDataSource( jndiName); + + conn = ds.getConnection(); + stmt = conn.createStatement(); + + int cnt = 0; + for(String sql : list) { + try{ + + sql = sql.trim(); + if(sql.length() == 0) continue; +// System.out.println(sql); + if(sql.toUpperCase().startsWith("SELECT")){ + + // 메모리 문제로 조회건수를 100건으로 제한하도록 한다. // 요건에 따라 변경 필요 + sql = sql + "\n fetch first "+MAX_FETCH_SIZE+" rows only"; // DB2 + stmt.execute(sql); + rs = stmt.getResultSet(); + + List ret = new ArrayList(); + int maxColumn = rs.getMetaData().getColumnCount(); + ResultSetMetaData rsmd = rs.getMetaData(); + String[] colName = new String[maxColumn]; + int[] colSize = new int[maxColumn]; + //get Col Name + for(int i =1; i<=maxColumn; i++){ + colName[i-1] = rsmd.getColumnName(i); + colSize[i-1] = rsmd.getPrecision(i); + } + ret.add(colSize); + ret.add(colName); + while(rs.next()) { + String[] row = new String[maxColumn]; + for (int i=0;i Execute - ["+sql.trim()+"], affected "+ affected +" rows").append(NEW_LINE); + } + + }catch(Exception e){ + errorBuff.append("==> Error - ["+sql + "] : " +e.getMessage()).append(NEW_LINE); + } + } + }catch(Exception e) { + logger.error(e.getMessage(),e); + throw e; + } + finally { + try { + if(stmt != null) stmt.close(); + if(conn != null) conn.close(); + if(rs != null) rs.close(); + } + catch (SQLException sqle) { + logger.error("SQLException was thrown: " + sqle.getMessage()); + } + } + + HashMap retMap = new HashMap(); + retMap.put("records",results); + retMap.put("result", sb.toString()); + retMap.put("error", errorBuff.toString()); + return retMap; +} + +public HashMap execute(String statements, String displayType,String serviceType,ServletRequest request) throws Exception { + String[] results = new String[2]; + + String[] arr = statements.split(";"); + List list = Arrays.asList(arr); + + return runSql(list, displayType, serviceType); +} +%> + + +<% + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "no-cache"); + response.setHeader("Expires", "0"); +%> + +<% + request.setCharacterEncoding("utf-8"); + String filter = request.getParameter("filter"); + + String displayType = request.getParameter("displayType"); + String serviceType = request.getParameter("serviceType"); + String statement = request.getParameter("statement"); + String userType=request.getParameter("userType"); + String run=request.getParameter("run"); + + if (run == null) run = ""; + if (displayType == null) displayType = "GRID"; + if (serviceType == null) serviceType = ""; + if (statement == null) statement = ""; + + HashMap runResult =new HashMap(); + + String errorMessage = ""; + + if (!"".equals(run) ){ + runResult = execute(statement,displayType, serviceType,request); + //response.sendRedirect("/monitoring/jsp/common/jsonResult.jsp"); + errorMessage = (String)runResult.get("error"); + if(errorMessage == null) errorMessage = ""; + }else{ + ; + } +%> + + + + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> +<%@ include file="/jsp/common/include/localemessage.jsp" %> + + + +<%-- + --%> + + + +
+
+ +
+
+
+ + +<%-- " level="W" style="cursor:hand;"/> --%> +<%-- " level="w" style="cursor:hand;"/> --%> +
+
Data Explorer
+ + + + + + + + + +
+ Database : + +
+ +
+
+ DIsplay : + +
+ +
+
+ + + + + + + + + + + + + + + <% + if("FLAT".equals(displayType)) { + %> + + + + + <% + } + else { + HashMap recordsMap = (HashMap)runResult.get("records"); + if(recordsMap != null) { + %> + + + + <% + } + } + %> +
<%= localeMessage.getString("runSql.excute") %> : max fetch size <%= MAX_FETCH_SIZE %>
+ + +
<%= localeMessage.getString("runSql.result") %>
<%= errorMessage %>
+ <%--
+ + +
--%> + +
<% + for(int sel=0; sel <= 10;sel++) { + ArrayList resultList = (ArrayList)recordsMap.get("SEL"+sel); +// System.out.println("SEL"+sel+" = "+resultList); + if(resultList == null) { + break; + } + %>
+ + + + <% + int[] colSize = (int[])resultList.get(0); + int cellWidth = 40; + for(int index = 1; index + + <% + for(int p = 0; p cellWidth) cellWidth = colSize[p]; + cellWidth = cellWidth * 10; + out.println(String.format("", cellWidth, rows[p] )); + } + else { + out.println(String.format("", rows[p])); + } + + } + %> + + <% + } + %> +
%s%s
+
+ <% } + %> +
+ + + + + + + + diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java index 9629911..c401f87 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java @@ -709,6 +709,8 @@ public class ApiInterfaceService extends OnlBaseService { sheet.setColumnWidth(ci++, 200 * 30); sheet.setColumnWidth(ci++, 300 * 30); sheet.setColumnWidth(ci++, 200 * 30); + sheet.setColumnWidth(ci++, 200 * 30); + sheet.setColumnWidth(ci++, 300 * 30); sheet.setColumnWidth(ci, 300 * 30); int rowNum = 0; @@ -730,6 +732,8 @@ public class ApiInterfaceService extends OnlBaseService { createCell(row, cellIndex++, textStyle, apiInterfaceUI.getEaiSvcDesc()); createCell(row, cellIndex++, headerStyle, "변환여부(Y/N)"); createCell(row, cellIndex++, textStyle, apiInterfaceUI.getTransformYn()); + createCell(row, cellIndex++, headerStyle, "Sync/Async 타입"); + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getSyncAsyncType()); rowNum = addTitle(sheet, ++rowNum, titleStyle, "어댑터 설정"); row = sheet.createRow(rowNum++); @@ -738,8 +742,23 @@ public class ApiInterfaceService extends OnlBaseService { createCell(row, cellIndex++, headerStyle, "인바운드 어댑터"); createCell(row, cellIndex++, textStyle, apiInterfaceUI.getFromAdapter()); createCell(row, cellIndex++, headerStyle, "아웃바운드 어댑터"); - createCell(row, cellIndex, textStyle, apiInterfaceUI.getToAdapter()); - + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getToAdapter()); + + //SYNC TYPE 에 따라 추가정보 생성 + String syncAsyncType = apiInterfaceUI.getSyncAsyncType(); + + if (syncAsyncType.equals("asyncSync") || syncAsyncType.equals("syncAsync")) { + + if (apiInterfaceUI.getSyncAsyncType().equals("asyncSync")) { + createCell(row, cellIndex++, headerStyle, "INBOUND (ASYNC) 응답 어댑터"); + createCell(row, cellIndex, textStyle, apiInterfaceUI.getFromResponseAdapter()); + } else { + createCell(row, cellIndex++, headerStyle, "OUTBOUND (ASYNC) 응답 어댑터"); + createCell(row, cellIndex, textStyle, apiInterfaceUI.getToResponseAdapter()); + } + + } + rowNum = addTitle(sheet, ++rowNum, titleStyle, "REST 설정"); row = sheet.createRow(rowNum++); row.setHeightInPoints(height); // 행 높이를 20 포인트로 설정 @@ -747,14 +766,30 @@ public class ApiInterfaceService extends OnlBaseService { createCell(row, cellIndex++, headerStyle, "수신 메소드"); createCell(row, cellIndex++, textStyle, apiInterfaceUI.getInboundHttpMethod()); createCell(row, cellIndex++, headerStyle, "수신 PATH(URL)"); - createCell(row, cellIndex, textStyle, apiInterfaceUI.getInboundRestPath()); + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getInboundRestPath()); + + if(apiInterfaceUI.getSyncAsyncType().equals("asyncSync")) { + createCell(row, cellIndex++, headerStyle, "응답 송신 메소드"); + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getInboundResponseHttpMethod()); + createCell(row, cellIndex++, headerStyle, "응답 송신 REST PATH(URL)"); + createCell(row, cellIndex, textStyle, apiInterfaceUI.getInboundResponseRestPath()); + } + row = sheet.createRow(rowNum++); row.setHeightInPoints(height); // 행 높이를 20 포인트로 설정 cellIndex = 0; // 초기 셀 인덱스 createCell(row, cellIndex++, headerStyle, "송신 메소드"); createCell(row, cellIndex++, textStyle, apiInterfaceUI.getOutboundHttpMethod()); createCell(row, cellIndex++, headerStyle, "송신 PATH(URL)"); - createCell(row, cellIndex, textStyle, apiInterfaceUI.getOutboundRestPath()); + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getOutboundRestPath()); + + if(apiInterfaceUI.getSyncAsyncType().equals("syncAsync")) { + createCell(row, cellIndex++, headerStyle, "응답 수신 메소드"); + createCell(row, cellIndex++, textStyle, apiInterfaceUI.getOutboundResponseHttpMethod()); + createCell(row, cellIndex++, headerStyle, "송신 REST PATH(URL)"); + createCell(row, cellIndex, textStyle, apiInterfaceUI.getOutboundResponseRestPath()); + } + if ("Y".equals(apiInterfaceUI.getTransformYn())) { rowNum = addTitle(sheet, ++rowNum, titleStyle, "변환 설정"); @@ -808,9 +843,27 @@ public class ApiInterfaceService extends OnlBaseService { String interfaceDesc = PoiUtils.getCellValue(sheet, 2, 1); String transformYn = PoiUtils.getCellValue(sheet, 2, 3); + String syncAsyncType = PoiUtils.getCellValue(sheet, 2, 5); String inboundAdapterGroupName = PoiUtils.getCellValue(sheet, 5, 1); String outboundAdapterGroupName = PoiUtils.getCellValue(sheet, 5, 3); + String inboundResponseHttpMethod = ""; + String inboundResponseRestPath = ""; + String fromResponseAdapter = ""; + + String outboundResponseHttpMethod = ""; + String outboundResponseRestPath = ""; + String toResponseAdapter = ""; + + if (syncAsyncType.equals("asyncSync")) { + inboundResponseHttpMethod = PoiUtils.getCellValue(sheet, 8, 5); + inboundResponseRestPath = PoiUtils.getCellValue(sheet, 8, 7); + fromResponseAdapter = PoiUtils.getCellValue(sheet, 5, 5); + } else if (syncAsyncType.equals("syncAsync")) { + outboundResponseHttpMethod = PoiUtils.getCellValue(sheet, 9, 5); + outboundResponseRestPath = PoiUtils.getCellValue(sheet, 9, 7); + toResponseAdapter = PoiUtils.getCellValue(sheet, 5, 5); + } String inboundHttpMethod = PoiUtils.getCellValue(sheet, 8, 1); String inboundRestPath = PoiUtils.getCellValue(sheet, 8, 3); @@ -824,6 +877,7 @@ public class ApiInterfaceService extends OnlBaseService { apiInterfaceUI.setEaiSvcName(elinkServiceId); apiInterfaceUI.setEaiSvcDesc(interfaceDesc); apiInterfaceUI.setTransformYn(transformYn); + apiInterfaceUI.setSyncAsyncType(syncAsyncType); apiInterfaceUI.setFromAdapter(inboundAdapterGroupName); apiInterfaceUI.setToAdapter(outboundAdapterGroupName); @@ -832,6 +886,14 @@ public class ApiInterfaceService extends OnlBaseService { apiInterfaceUI.setInboundRestPath(inboundRestPath); apiInterfaceUI.setOutboundHttpMethod(outboundHttpMethod); apiInterfaceUI.setOutboundRestPath(outboundRestPath); + + apiInterfaceUI.setInboundResponseHttpMethod(inboundResponseHttpMethod); + apiInterfaceUI.setInboundResponseRestPath(inboundResponseRestPath); + apiInterfaceUI.setFromResponseAdapter(fromResponseAdapter); + + apiInterfaceUI.setOutboundResponseHttpMethod(outboundResponseHttpMethod); + apiInterfaceUI.setOutboundResponseRestPath(outboundResponseRestPath); + apiInterfaceUI.setToResponseAdapter(toResponseAdapter); apiInterfaceUI.setIsHeaderRouting(false); diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/mapping/ApiInterfaceUIMapper.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/mapping/ApiInterfaceUIMapper.java index fb9e897..c70d363 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/mapping/ApiInterfaceUIMapper.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/mapping/ApiInterfaceUIMapper.java @@ -110,6 +110,10 @@ public interface ApiInterfaceUIMapper { syncAsyncType = "asyncSync"; } vo.setSyncAsyncType(syncAsyncType); + + // 가상응답 여부 + String simYn = "T".equals(eaiMessageEntity.getTrantype()) ? "Y" : "N"; + vo.setSimYn(simYn); vo.setToAdapter(requestEntity.getPsvsysadptrbzwkgroupname()); vo.setToutVal(requestEntity.getToutval()); @@ -186,6 +190,11 @@ public interface ApiInterfaceUIMapper { if(vo == null || vo.getSyncAsyncType() == null){ return; } + + // 가상응답 여부 + String tranType = "Y".equals(vo.getSimYn()) ? "T" : "R"; + entity.setTrantype(tranType); + switch(vo.getSyncAsyncType()){ case "async": case "asyncSync": @@ -193,4 +202,4 @@ public interface ApiInterfaceUIMapper { break; } } -} +} \ No newline at end of file