<%@ page contentType="text/html; charset=utf-8" %> <%@page import="com.eactive.eai.rms.common.util.CommonConstants" %> <%@page import="java.util.List" %> <%@page import="java.util.HashMap" %> <%@page import="java.util.ArrayList" %> <%@page import="com.eactive.eai.rms.common.login.SessionManager" %> <%@page import="com.eactive.eai.rms.common.login.LoginVo" %> <%@page import="com.eactive.eai.common.util.SystemUtil" %> <%@page import="com.eactive.eai.rms.common.util.StringUtils" %> <%@page import="com.eactive.eai.rms.common.datasource.DataSourceType" %> <%@page import="com.eactive.eai.rms.common.datasource.DataSourceTypeManager" %> <%@page import="com.eactive.eai.common.util.ApplicationContextProvider" %> <%@page import="com.eactive.eai.rms.data.entity.man.role.RoleMenuAuthService" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@ include file="/jsp/common/include/localemessage.jsp" %> <% String serviceKey = SessionManager.getServiceTypeKey(request); String serviceText = DataSourceTypeManager.getDataSourceType(serviceKey).getText(); final String SITEMAP_MENU_ID = "0510013"; RoleMenuAuthService roleMenuAuthService = ApplicationContextProvider.getContext().getBean(RoleMenuAuthService.class); String sitemapMenuAuth = roleMenuAuthService.getRoleList(SessionManager.getUserId(request), SITEMAP_MENU_ID, serviceKey); boolean showSitemapLink = "R".equals(sitemapMenuAuth) || "W".equals(sitemapMenuAuth); String roleScreenId = (String) request.getAttribute("roleScreenId"); String mainPage = (String) request.getAttribute("mainPage"); String menuId = (String) request.getAttribute("menuId"); String themeName = (String) request.getAttribute("themeName"); if (roleScreenId != null && roleScreenId.length() > 3) { // 중메뉴 아이디를 비교하기 위해서 세부메뉴아이디인 우측 3자리는 제외시킨다. //roleScreenId = roleScreenId.substring(0, roleScreenId.length() - 3); } StringBuffer top_img = new StringBuffer(); // top메뉴 이미지 순서 StringBuffer subLayer = new StringBuffer(); // sub메뉴 레이어 int firstSubCnt = 0; int topCnt = 0; int topListSize = 0; String firstTopMenuId = ""; String firstSubMenuId = ""; String firstSubMenuUrl = ""; String firstLayerName = "menu1"; String menuUrlFromMenuId = ""; int topPosition = 1; int topCount = 0; int subPosition = 1; int subCount = 0; List list = (List) request.getAttribute("topMenuList"); //메뉴관련 데이터 정렬 - sub관련 정의를 subMap에 담아 subList에 담기 -> 해당 subList를 topMap에 담기 -> topMap을 topList에 담아 두기. HashMap map = null; String topTemp = ""; String subTemp = ""; List topList = new ArrayList(); List subList = null; HashMap topMap = null; HashMap subMap = null; /** menuRender **/ if (menuId != null ? !menuId.equals("") : false) { for (int i = 0; i < list.size(); i++) { map = (HashMap) list.get(i); if (((String) map.get("LEV4_ID")).equals(menuId)) { menuUrlFromMenuId = (String) map.get("LEV4_URL"); } } } for (int i = 0; i < list.size(); i++) { map = (HashMap) list.get(i); String thisTop = (String) map.get("LEV2_ID"); String thisTopNm = (String) map.get("LEV2_NAME"); String thisSub = (String) map.get("LEV3_ID"); if (!thisTop.equals(topTemp)) { //top end 관련 if (topCnt > 0) { topMap.put("SUB_MAP", subList); topList.add(topMap); } //top start 관련 topMap = new HashMap(); subList = new ArrayList(); topMap.put("TOP_ID", thisTop); topMap.put("TOP_NAME", thisTopNm); topMap.put("TOP_IMG", (String) map.get("LEV2_IMG")); topMap.put("TOP_LEFTID", (String) map.get("LEV3_ID")); if (!"NAN".equals((String) map.get("LEV2_URL"))) { topMap.put("TOP_URLID", (String) map.get("LEV2_ID")); topMap.put("TOP_URL", (String) map.get("LEV2_URL")); } else { topMap.put("TOP_URLID", (String) map.get("LEV4_ID")); topMap.put("TOP_URL", (String) map.get("LEV4_URL")); } topCnt++; topTemp = thisTop; subMap = new HashMap(); subMap.put("SUB_ID", map.get("LEV3_ID")); subMap.put("SUB_NAME", map.get("LEV3_NAME")); subMap.put("SUB_URL", map.get("LEV4_URL")); subMap.put("SUB_URLID", map.get("LEV4_ID")); subList.add(subMap); } else { //top 같을때 - sub가 다를경우에만 담아둠 if (!thisSub.equals(subTemp)) { subMap = new HashMap(); subMap.put("SUB_ID", map.get("LEV3_ID")); subMap.put("SUB_NAME", map.get("LEV3_NAME")); subMap.put("SUB_URL", map.get("LEV4_URL")); subMap.put("SUB_URLID", map.get("LEV4_ID")); subList.add(subMap); } } subTemp = thisSub; //top end 관련 if (i + 1 == list.size()) { topMap.put("SUB_MAP", subList); topList.add(topMap); } } //메뉴 구성하기 topListSize = topList.size(); int layerLeft = 0; topCount = topListSize; // default String tmpScrId = roleScreenId; if (tmpScrId != null && tmpScrId.length() > 3) { tmpScrId = roleScreenId.substring(0, roleScreenId.length() - 3); } if (topListSize > 0) { HashMap displayMap = new HashMap(); HashMap displaySubMap = new HashMap(); int topIndex = 0; int subListSize = 0; String topUrl = ""; for (int i = 0; i < topListSize; i++) { topIndex = i + 1; displayMap = (HashMap) topList.get(i); List subMenuList = (List) displayMap.get("SUB_MAP"); subListSize = subMenuList.size(); int subIndex = 0; String subId = ""; String subName = ""; String subUrl = ""; String subUrlId = ""; for (int j = 0; j < subListSize; j++) { displaySubMap = (HashMap) subMenuList.get(j); subIndex = j + 1; layerLeft = 20; subId = (String) displaySubMap.get("SUB_ID"); subName = (String) displaySubMap.get("SUB_NAME"); subUrlId = (String) displaySubMap.get("SUB_URLID"); subUrl = displaySubMap.get("SUB_URL") + "?menuId=" + subUrlId; if (j == 0) { //첫번째 메뉴의 서브카운트 갯수 -> loading시 실행될 js에서 사용하기 위함 if (i == 0) { firstSubCnt = subListSize; subCount = firstSubCnt; // default firstTopMenuId = subId; firstSubMenuId = subId; firstSubMenuUrl = subUrl; } //div start ( for default value ) subLayer.append("
  • "); subLayer.append("" + displayMap.get("TOP_NAME") + ""); subLayer.append("
    "); subLayer.append(""); subLayer.append("
  • "); } if (subUrlId != null && tmpScrId != null && subUrlId.startsWith(tmpScrId)) { // 현재 왼쪽의 첫번째 메뉴만 사용할 수 있으나 // 차후에 기타메뉴도 초기화면에서 선택할수 있도록 수정해야 할것. // 서브메뉴의 하위항목 비교를 수행하면 된다. firstTopMenuId = subId; firstSubMenuId = subUrlId; firstSubMenuUrl = subUrl; firstLayerName = "menu" + topIndex; topPosition = topIndex; subPosition = subIndex; topCount = topListSize; subCount = subListSize; } } } } //마지막 로그인일시 String LastLoginYms = ""; //마지막 로그인Ip String LastLoginIp = ""; if (session.getAttribute("LastLoginYms") != null) { LastLoginYms = (String) session.getAttribute("LastLoginYms"); } if (session.getAttribute("LastLoginIp") != null) { LastLoginIp = (String) session.getAttribute("LastLoginIp"); } if (!"".equals(LastLoginYms.trim())) { LastLoginYms = LastLoginYms.substring(0, 4) + "-" + LastLoginYms.substring(4, 6) + "-" + LastLoginYms.substring(6, 8) + " " + LastLoginYms.substring(8, 10) + ":" + LastLoginYms.substring(10, 12) + ":" + LastLoginYms.substring(12, 14); } %> <%= localeMessage.getString("screen.title") %> "/> "/>

    <%=serviceText%>
      <% LoginVo loginVo = (LoginVo) session.getAttribute(CommonConstants.LOGIN); String useServiceType = loginVo.getUseServiceTypes(); if (useServiceType.equals(CommonConstants.USER_SERVICETYPE_NO_CHECK)) { for (DataSourceType d : DataSourceTypeManager.getDynamicDataSourceTypes()) { %>
    • <%= d.getText() %>
    • <% } } else { String[] serviceTypes = useServiceType.split(","); for (String serviceType : serviceTypes) { DataSourceType d = DataSourceTypeManager.getDataSourceType(serviceType); %>
    • <%= d.getText() %>
    • <% } %>
    <% } %>