
<%
/************************************************************@@
  * Program Name	: doc_regist.jsp
  * Description		: /집계자/내문서함/등록함/문서 등록
  * Author				: 강원중
  * Create Date		: 2004.10.11
  * History				:
@@************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8"
	import="java.net.URLEncoder" import="java.net.URLDecoder"
	import="kr.co.kihyun.beans.user.HttpSSOLogin" import="java.util.*"
	import="java.io.StringReader"
	import="javax.swing.text.html.parser.ParserDelegator"
	import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.util.Stopwatch"
	import="kr.co.kihyun.text.html.TagFilter"
	import="kr.co.kihyun.text.html.ServletUtil"
	import="kr.co.kihyun.text.html.CallbackHandler"
	import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.moumi.doc.MDoc"
	import="kr.co.kihyun.moumi.doc.table.MTable"
	import="kr.co.kihyun.moumi.doc.table.TableDefine"
	import="kr.co.kihyun.moumi.doc.table.TableCreation"
	import="kr.co.kihyun.moumi.doc.table.item.MItem"
	import="kr.co.kihyun.lang.MInteger" import="kr.co.kihyun.lang.MLong"
	import="kr.co.kihyun.lang.MString"
	import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction"
	import="kr.co.kihyun.beans.entity.util.*"%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>

<%
PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
Transaction tx = pm.currentTransaction();
try{
	/*********** 소요시간 체크 ***********/
	Stopwatch stopwatch = new Stopwatch();
	long startTime = stopwatch.start();

	/********** session내의 userId **********/
	String usID = HttpSSOLogin.getLoginID(request);
	int sysAuth = HttpSSOLogin.getSysAuth(request);
	
	/********** parameter **********/
	String docForm = clearXSS(request.getParameter("docForm"),"");
	Long docID  = MLong.parseLong(request.getParameter("docID"),null);
	String url = "form";

	TotDoc totDoc = null;
	totDoc = docID == null ? null : pm.getObjectById(TotDoc.class, docID);
	String docName = totDoc.getName();
	
	%>

<%@page import="kr.co.kihyun.beans.entity.TotDoc"%>
<%@page import="kr.co.kihyun.beans.entity.TotDocType"%><HTML>
<HEAD>
<TITLE><%=Moumi.getTitle()%></TITLE>
<!--link rel="stylesheet" href="/totsys/common/css/text.css" type="text/css"-->
<link rel="stylesheet" href="/totsys/common/css/kecttep.css" type="text/css">
<link rel="stylesheet" href="/totsys/common/css/tabs.css" type="text/css">
<link rel="stylesheet" href="/totsys/common/css/SquareButtons.css" type="text/css">



<script language="javascript">
			function docDel(){
				var frm = document.Del;
				if(confirm('<%=TotDocType.FORM_DOC %>을 삭제 하시겠습니까?')){
					frm.submit();
				}
			}
			
			function formView(){
				location.href="/totsys/totper/mydocbox/formbox/doc_view.jsp?docID=<%= docID %>";
			}
			
			function reg_use(){
				location.href="/totsys/totper/mydocbox/regbox/doc_regist.jsp?reuseDocID=<%= docID %>&reuseDocName=<%= docName %>&isFromFormBox=true";
			}
			
			function propertiesUpdate(){
				location.href="/totsys/totper/mydocbox/formbox/doc_form_modify.jsp?docID=<%= docID %>";
			}
		</script>
</HEAD>

<body style='' BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0"
	MARGINWIDTH="0" MARGINHEIGHT="0">
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<!------------------------------- top menu start ------------------------------->
	<jsp:include page="/totsys/common/inc/title/title.jsp" flush="true" />
	<!------------------------------- top menu end ------------------------------->
</table>
</div>

<div id="header">
<ul id="primary">
	<li><a href="#" onclick="formView();"><%=TotDocType.FORM_DOC %>정보</a></li>
	<li><span class="kecttep_menu_focous"><%=TotDocType.FORM_DOC%>수정</span></li>
	<!--<li><a href="#" onclick="propertiesUpdate();">속성수정</a></li>-->
</ul>
</div>

<div id="main">
<div id="contents">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr class="toolbar">
		<td align="left">
            <%--
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<%if(sysAuth == Moumi.TOTPER){%>
				<td><a class="simplebutton" href="#" onclick="reg_use();"><span
					class="regist"><%= Moumi.getMessageBundle().getString("moumi.message.button.docReprss") %></span></a>
				</td>
				<%}%>
				<td <%if(sysAuth == Moumi.TOTPER){%> class="kecttep_button_td" <%}%>>
				<a class="simplebutton" href="#" onclick="docDel();"><span
					class="remove"><%= Moumi.getMessageBundle().getString("moumi.message.button.docDel") %></span></a>
				</td>
			</tr>
		</table>
        --%>
		</td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<!------------------------------- form config start ------------------------------->
	<jsp:include page="./form_re_config.jsp" flush="true">
		<jsp:param name="docName"
			value='<%= URLEncoder.encode(docName, "UTF-8") %>' />
		<jsp:param name="docForm" value="<%= docForm%>" />
		<jsp:param name="docID" value="<%= docID %>" />
                <jsp:param name="pageName" value="doc_reform_config" />
	</jsp:include>
	<!------------------------------- form config end ------------------------------->
</table>
</div>
</div>
<!------------------------------- top menu start ------------------------------->
<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
<!------------------------------- top menu end ------------------------------->
<FORM name="Del"
	action="/servlet/kr.co.kihyun.beans.totsys.doc.HttpDocDeleter"
	method="post"><INPUT type="hidden" name="docID"
	value="<%= docID %>"> <INPUT type="hidden" name="userID"
	value="<%= usID %>"> <INPUT type="hidden" name="url"
	value="<%= url %>"></FORM>
</BODY>
<div id="SetWin" style="position: absolute; visibility: hidden; width: 100px; height: 100px; background: silver; border: 1px solid #333333; line-height: 1.4em; padding: 3px 3px"></div>
</HTML>
<%
}catch(Exception ex){ex.printStackTrace();
	out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
}finally{
	if(tx.isActive())
	tx.rollback();
	pm.close();
}
%>
