package jeus_jspwork._moniter._search;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.List;
import java.sql.Timestamp;
import org.kldp.ebmsh.moniter.persistant.MessageStore;
import org.kldp.ebmsh.moniter.persistant.EbmsMoniterManager;
import org.kldp.ebmsh.moniter.persistant.Tracker;
import org.kldp.ebmsh.moniter.persistant.InComingMessage;
import org.kldp.ebmsh.moniter.persistant.MessageStatus;
import org.kldp.ebmsh.moniter.persistant.MessageStatusConstraints;

public final class _500_messageInfoView_5fjsp extends jeus.servlet.jsp2.runtime.HttpJspBase
    implements jeus.servlet.jsp2.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=euc-kr");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

	String documentId = request.getParameter("documentId");
	String messageId = request.getParameter("messageId");

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!--검색-->\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"\r\n");
      out.write("\tbgcolor=\"#CDDCED\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 10px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#FFFFFF\">\r\n");
      out.write("\t\t\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\t\t\t\tcellspacing=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<td width=\"15\">\r\n");
      out.write("\t\t\t\t\t\t<img src=\"");
      out.print( request.getContextPath() );
      out.write("/image/search/icon_arrow.gif\" width=\"11\" height=\"11\">\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t<span class=\"style2\">메세지정보</span>\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td height=\"5\"></td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td style=\"PADDING-LEFT: 20px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\" bgcolor=\"#F7F7F7\">\r\n");
      out.write("\t\t\t<div id=\"MessageInfo\">\r\n");
      out.write("\t\t\t\t<div class=\"ContentArea\">\r\n");
      out.write("\t\t\t\t\t<ul>\r\n");
      out.write("\t\t\t\t\t\t<li><span class=\"MessageInfoLabel\">문서 ID </span>: \r\n");
      out.write("\t\t\t\t\t\t");

							if(documentId == null) 
								out.println("-");
							else
								out.println(documentId);
						
      out.write("\r\n");
      out.write("\t\t\t\t\t\t</li>\r\n");
      out.write("\t\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t\t<li><span class=\"MessageInfoLabel\">메시지 ID </span>: ");
      out.print( messageId );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t</ul>\r\n");
      out.write("\t\t\t\t</div>\r\n");
      out.write("\t\t\t</div>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");

	EbmsMoniterManager manager = new EbmsMoniterManager();
	
	List trackerDetailList = manager.getTrackers(messageId);

      out.write("\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"\r\n");
      out.write("\tbgcolor=\"#CDDCED\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 10px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#FFFFFF\">\r\n");
      out.write("\t\t\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\t\t\t\tcellspacing=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<td width=\"15\">\r\n");
      out.write("\t\t\t\t\t\t<img src=\"");
      out.print( request.getContextPath() );
      out.write("/image/search/icon_arrow.gif\" width=\"11\" height=\"11\">\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t<span class=\"style2\">Tracking 정보</span>\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<!--/검색-->\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td height=\"5\"></td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 20px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#F7F7F7\">\r\n");
      out.write("\t\t\t<div id=\"TrackingInfo\">\r\n");
      out.write("\t\t\t\t<div class=\"ContentArea\">\r\n");
      out.write("\t\t\t\t<table>\r\n");
      out.write("\t\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t\t<th id=\"trackingTime\">\r\n");
      out.write("\t\t\t\t\t\t\t시 간\r\n");
      out.write("\t\t\t\t\t\t</th>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\t\t\t\t<th id=\"state\">\r\n");
      out.write("\t\t\t\t\t\t\t상 태\r\n");
      out.write("\t\t\t\t\t\t</th>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\t\t\t\t<th id=\"information\">\r\n");
      out.write("\t\t\t\t\t\t\t설 명\r\n");
      out.write("\t\t\t\t\t\t</th>\r\n");
      out.write("\t\t\t\t\t</tr>\r\n");
      out.write("\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t");

						for(int i = 0; i < trackerDetailList.size(); i++) {
							Tracker tracker = (Tracker)trackerDetailList.get(i);
		
							Timestamp trackingTime = tracker.getTrackingTime();
							String state = tracker.getState();
							String information = tracker.getInformation();
							
							if( information == null )
								information = "";
					
      out.write("\r\n");
      out.write("\t\t\t\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t\t\t\t");
      out.print( trackingTime );
      out.write("\r\n");
      out.write("\t\t\t\t\t\t\t\t</td>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\t\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t\t\t\t");
      out.print( state );
      out.write("\r\n");
      out.write("\t\t\t\t\t\t\t\t</td>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\t\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t\t\t\t");
      out.print( information );
      out.write("\r\n");
      out.write("\t\t\t\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t\t\t</tr>\r\n");
      out.write("\t\t\t\t\t");

						}
					
      out.write("\r\n");
      out.write("\t\t\t\t</table>\r\n");
      out.write("\t\t\t</div>\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");

	MessageStore messageStore = manager.getMessageStoreMessage(messageId);

	InComingMessage incomingMessage = manager.getInComingMessage(messageId);
	
	MessageStatus messageStatus = manager.getMessageStatus(messageId);

      out.write("\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"\r\n");
      out.write("\tbgcolor=\"#CDDCED\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 10px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#FFFFFF\">\r\n");
      out.write("\t\t\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\t\t\t\tcellspacing=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<td width=\"15\">\r\n");
      out.write("\t\t\t\t\t\t<img src=\"");
      out.print( request.getContextPath() );
      out.write("/image/search/icon_arrow.gif\" width=\"11\" height=\"11\">\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t<span class=\"style2\">Ebxml 메시지 정보</span>\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<!--/검색-->\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td height=\"5\"></td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 20px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#F7F7F7\">\r\n");
      out.write("\t\t\t<div id=\"EbxmlMessageInfo\">\r\n");
      out.write("\t\t\t\t<div class=\"ContentArea\">\r\n");
      out.write("\t\t\t\t");

					if( messageStore == null ) {
				
      out.write("\r\n");
      out.write("\t\t\t\t\t\t<div class=\"NoEbxmlInformation\">Ebxml 메시지 정보가 없습니다.</div>\r\n");
      out.write("\t\t\t\t");

					}
					else {
				
      out.write("\r\n");
      out.write("\t\t\t\t\t\t<ul>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">Message ID </span>: ");
      out.print( messageStore.getMessageId() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">Cpa </span>: ");
      out.print( messageStore.getCpaId() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">From </span>: ");
      out.print( messageStore.getFromPartyId() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">To </span>: ");
      out.print( messageStore.getToPartyId() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">Conversation ID </span>: ");
      out.print( messageStore.getConversationId() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">Service </span>: ");
      out.print( messageStore.getService() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t\t<li><span class=\"EbxmlMessageInfoLabel\">Action </span>: ");
      out.print( messageStore.getAction() );
      out.write("</li>\r\n");
      out.write("\t\t\t\t\t\t</ul>\r\n");
      out.write("\t\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t\t<div class=\"ViewEbxmlMessage\">\r\n");
      out.write("\t\t\t\t\t\t\t<a href=\"viewEbxmlMessage.jsp?messagePath=");
      out.print( incomingMessage.getMSGFilePath() );
      out.write("\" target=\"_blank\">메시지 원문 보기</a>\r\n");
      out.write("\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t");

					}
				
      out.write("\r\n");
      out.write("\t\t\t\t</div>\r\n");
      out.write("\t\t\t</div>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"\r\n");
      out.write("\tbgcolor=\"#CDDCED\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 10px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#FFFFFF\">\r\n");
      out.write("\t\t\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\t\t\t\tcellspacing=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<td width=\"15\">\r\n");
      out.write("\t\t\t\t\t\t<img src=\"");
      out.print( request.getContextPath() );
      out.write("/image/search/icon_arrow.gif\" width=\"11\" height=\"11\">\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t<span class=\"style2\">메시지 처리</span>\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<!--/검색-->\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td height=\"5\"></td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 20px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#F7F7F7\">\r\n");
      out.write("\t\t\t<div id=\"MessageProcess\">\r\n");
      out.write("\t\t\t<div class=\"ContentArea\">\r\n");
      out.write("\t\t");

			if( messageStatus == null || messageStatus.getStatus() == MessageStatusConstraints.Receive || messageStatus.getStatus() == MessageStatusConstraints.Fail ) {
		
      out.write("\r\n");
      out.write("\t\t\t\t<div class=\"NoMessageProcess\">\r\n");
      out.write("\t\t\t\t\t메시지를 재처리 할 수 없습니다.\r\n");
      out.write("\t\t\t\t</div>\r\n");
      out.write("\t\t");

			}
			else {
		
      out.write("\r\n");
      out.write("\t\t\t\t<ul>\r\n");
      out.write("\t\t\t\t\t<li><a href=\"applicationLayerProcess.jsp?messageId=");
      out.print( messageStore.getMessageId() );
      out.write("&messagePath=");
      out.print( incomingMessage.getMSGFilePath() );
      out.write("\">메시지 다시 처리</a></li>\r\n");
      out.write("\t\t\t\t</ul>\r\n");
      out.write("\t\t");

			}
		
      out.write("\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
