123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>Untitle</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <source>
- <source/>
- </source>
- <destination>
- <destination/>
- <destination2/>
- <des/>
- </destination>
- <app/>
- <appimpl/>
- <mgr/>
- <mgrimpl/>
- <dao/>
- <daoimpl/>
- <mgrnm>eqmtmgt</mgrnm>
- <daonm>eqmtinfoDao</daonm>
- <xml/>
- <des/>
- </root>
- </instance>
- <script type="javascript">
- <![CDATA[
- //Replace
- function fReplace(strStep1, strDelete)
- {
- var t1, t2;
- var flag1 = 0;
- var flag2 = 0;
- t1=strStep1.replace(strDelete, "");
- for (var i=0;i<=900;i++){
- if ((i%2)== 0){
- t2=t1.replace(strDelete, "");
- flag1 = 0;
- flag2 = 1;
- }else{
- t1=t2.replace(strDelete, "");
- flag1 = 1;
- flag2 = 0;
- }
- }
- if (flag1==1){return t1;}
-
- if (flag2==1){return t2;}
- }
-
- function fMakeComment() {
- var xmlArray, temp, strSource, strStep1;
- var xmlTypeArr, strXmlType;
- temp=model.getValue("/root/source/source");
- xmlTypeArr=temp.split("submit id=");
- temp=fReplace(xmlTypeArr[1], '"');
- strXmlType=temp.substr(0, 2);
-
-
- temp=model.getValue("/root/source/source");
- strSource=temp.replace('\"', '');
- xmlArray=strSource.split("--");
-
- strStep1 = "/** \n";
- strStep1 = strStep1 + " * <p>"+xmlArray[1]+"</p>\n";
-
- model.setValue("/root/des", xmlArray[1]);
- strStep1 = strStep1 + " * "+xmlArray[1]+"\n";
- strStep1 = strStep1 + " * \n";
- strStep1 = strStep1 + " * @param pVOs ValueObjectAssembler\n";
- var strSource=model.getValue("/root/source/source");
- var xmlArray=strSource.split("table id=");
- var xmlArray2 = xmlArray[1].split("count_ref");
- strStep1 = strStep1 + " * <p>"+xmlArray2[0]+" : 입력데이터\n";
- strStep1 = strStep1 + " * <ul>\n";
-
- var xmlArray=xmlArray2[1];
- var xmlArray2=xmlArray.split("column id=");
- for (var i=1;i<xmlArray2.length;i++){
- xmlArray = xmlArray2[i].split("desc=");
- var temp = xmlArray[1].split("ref=");
- strStep1 = strStep1 + " * <li>"+xmlArray[0]+" "+temp[0]+"\n";
-
- }
- strStep1 = strStep1 + " * </ul>\n";
- if ((strXmlType=="TR") || (strXmlType=="tr")){
- strStep1 = strStep1 + " * @return ValueObjectAssembler\n";
- temp=model.getValue("/root/source/source");
- strSource=temp.replace('\"', '');
- xmlArray=strSource.split("output path");
- xmlArray2=xmlArray[1].split("table id=");
- xmlArray=xmlArray2[1].split("count_ref");
- strStep1 = strStep1 + " * <p>"+xmlArray[0]+" : 출력데이터\n";
- strStep1 = strStep1 + " * <ul>\n";
- var xmlArray=xmlArray2[1];
- var xmlArray2=xmlArray.split("column id=");
- for (var i=1;i<xmlArray2.length;i++){
-
- xmlArray = xmlArray2[i].split("desc=");
- var temp = xmlArray[1].split("ref=");
- strStep1 = strStep1 + " * <li>"+xmlArray[0]+" "+temp[0]+"\n";
-
- }
- var strStep2;
- strStep2=fReplace(strStep1, '"string"');
- strStep1=fReplace(strStep2, '"CDATA"');
- strStep2=fReplace(strStep1, 'type=');
- strStep1=fReplace(strStep2, "=");
- strStep2=fReplace(strStep1, '"int"');
- strStep1=fReplace(strStep2, '"cdata"');
- strStep2=fReplace(strStep1, '"STRING"');
- strStep1=fReplace(strStep2, '"');
- strStep1 = strStep1 + " * </ul>\n";
- strStep1 = strStep1 + " * @throws LiveException\n";
- strStep1 = strStep1 + " */\n";
-
- }else{
- var strStep2;
- strStep2=fReplace(strStep1, '"string"');
- strStep1=fReplace(strStep2, '"CDATA"');
- strStep2=fReplace(strStep1, 'type=');
- strStep1=fReplace(strStep2, "=");
- strStep2=fReplace(strStep1, '"int"');
- strStep1=fReplace(strStep2, '"cdata"');
- strStep2=fReplace(strStep1, '"STRING"');
- strStep1=fReplace(strStep2, '"');
-
- strStep1 = strStep1 + " * @return int\n";
- strStep1 = strStep1 + " * @throws LiveException\n";
- strStep1 = strStep1 + " */\n";
- }
- model.setValue("/root/destination/destination", strStep1);
- model.refresh();
-
- }
- function fMakeComment2() {
- var xmlArray, temp, strSource, strStep1;
- var xmlTypeArr, strXmlType;
- temp=model.getValue("/root/source/source");
- xmlTypeArr=temp.split("submit id=");
- temp=fReplace(xmlTypeArr[1], '"');
- strXmlType=temp.substr(0, 2);
-
-
- temp=model.getValue("/root/source/source");
- strSource=temp.replace('\"', '');
- xmlArray=strSource.split("--");
-
- strStep1 = "/** \n";
- strStep1 = strStep1 + " * <p>"+xmlArray[1]+"</p>\n";
- strStep1 = strStep1 + " * "+xmlArray[1]+"\n";
- strStep1 = strStep1 + " * \n";
- strStep1 = strStep1 + " * @param pVO ValueObject\n";
- var strSource=model.getValue("/root/source/source");
- var xmlArray=strSource.split("table id=");
- var xmlArray2 = xmlArray[1].split("count_ref");
-
- strStep1 = strStep1 + " * <ul>\n";
-
- var xmlArray=xmlArray2[1];
- var xmlArray2=xmlArray.split("column id=");
- for (var i=1;i<xmlArray2.length;i++){
- xmlArray = xmlArray2[i].split("desc=");
- var temp = xmlArray[1].split("ref=");
- strStep1 = strStep1 + " * <li>"+xmlArray[0]+" "+temp[0]+"\n";
-
- }
- strStep1 = strStep1 + " * </ul>\n";
- if ((strXmlType=="TR") || (strXmlType=="tr")){
- strStep1 = strStep1 + " * @return ValueObject\n";
- temp=model.getValue("/root/source/source");
- strSource=temp.replace('\"', '');
- xmlArray=strSource.split("output path");
- xmlArray2=xmlArray[1].split("table id=");
- xmlArray=xmlArray2[1].split("count_ref");
- strStep1 = strStep1 + " * <p>"+xmlArray[0]+" : 출력데이터\n";
- strStep1 = strStep1 + " * <ul>\n";
- var xmlArray=xmlArray2[1];
- var xmlArray2=xmlArray.split("column id=");
- for (var i=1;i<xmlArray2.length;i++){
-
- xmlArray = xmlArray2[i].split("desc=");
- var temp = xmlArray[1].split("ref=");
- strStep1 = strStep1 + " * <li>"+xmlArray[0]+" "+temp[0]+"\n";
-
- }
- var strStep2;
- strStep2=fReplace(strStep1, '"string"');
- strStep1=fReplace(strStep2, '"CDATA"');
- strStep2=fReplace(strStep1, 'type=');
- strStep1=fReplace(strStep2, "=");
- strStep2=fReplace(strStep1, '"int"');
- strStep1=fReplace(strStep2, '"cdata"');
- strStep2=fReplace(strStep1, '"STRING"');
- strStep1=fReplace(strStep2, '"');
- strStep1 = strStep1 + " * </ul>\n";
- strStep1 = strStep1 + " * @throws LiveException\n";
- strStep1 = strStep1 + " */\n";
-
- }else{
- var strStep2;
- strStep2=fReplace(strStep1, '"string"');
- strStep1=fReplace(strStep2, '"CDATA"');
- strStep2=fReplace(strStep1, 'type=');
- strStep1=fReplace(strStep2, "=");
- strStep2=fReplace(strStep1, '"int"');
- strStep1=fReplace(strStep2, '"cdata"');
- strStep2=fReplace(strStep1, '"STRING"');
- strStep1=fReplace(strStep2, '"');
-
- strStep1 = strStep1 + " * @return int\n";
- strStep1 = strStep1 + " * @throws LiveException\n";
- strStep1 = strStep1 + " */\n";
- }
- model.setValue("/root/destination/destination2", strStep1);
- model.refresh();
-
- }
-
- function fMakeCodeInfo() {
- var strapp="";
- var strappimpl="";
- var funcnm = "";
- var listnm = "";
-
- var xmlArray, temp, strSource, strStep1;
- var xmlTypeArr, strXmlType;
- temp=model.getValue("/root/source/source");
- xmlTypeArr=temp.split("method=");
-
- temp=fReplace(xmlTypeArr[1], '"');
-
- var arr = temp.split(">");
-
- var funcnm = arr[0].substring(3, 4).toLowerCase() + arr[0].substring(4, arr[0].length);
-
- var flag;
-
- var aftfuncnm = funcnm.substring(3, funcnm.length);
-
- if(funcnm.substring(0, 3) == "get") {
- flag = "1";
- } else {
- flag = "2";
- }
-
- if(flag == "1") {
-
- xmlTypeArr = temp.split("<output");
- xmlTypeArr = xmlTypeArr[1].split("<table id=");
- xmlTypeArr = xmlTypeArr[1].split(" count_ref");
-
- listnm = xmlTypeArr[0];
- } else {
- xmlTypeArr = temp.split("<input");
- xmlTypeArr = xmlTypeArr[1].split("<table id=");
- xmlTypeArr = xmlTypeArr[1].split(" count_ref");
-
- listnm = xmlTypeArr[0];
- }
-
- var mgrnm = model.getValue("/root/mgrnm");
- var daonm = model.getValue("/root/daonm");
-
- var strapp;
- var strappimpl;
- var strmgr;
- var strmgrimpl;
- var strdao;
- var strdaoimpl;
- var xml;
-
- var appcomment = model.getValue("/root/destination/destination");
- var mgrcomment = model.getValue("/root/destination/destination2");
- var stmtcomment = model.getValue("/root/destination/des") + "\n";
-
- if(flag == "1") {
-
- strapp = appcomment;
- strapp += " public ValueObjectAssembler " + arr[0] + "(ValueObjectAssembler pVOs) throws LiveException;";
- strmgr = mgrcomment;
- strmgr += " public ValueObject " + funcnm + "(ValueObject pVO) throws LiveException;";
- strappimpl = appcomment;
- strappimpl += " public ValueObjectAssembler " + arr[0] + "(ValueObjectAssembler pVOs) throws LiveException {\n"
- + " ValueObject reqVO = pVOs.get(\"req\");\n"
- + " ValueObject getVO = null;\n"
- + " ValueObjectAssembler retVOs = new ValueObjectAssembler();\n"
- + " try {\n"
- + " getVO = " + mgrnm + "." + funcnm + "(reqVO);\n"
- + " retVOs.set(\"" + listnm + "\", getVO);\n\n"
- + " } catch (Exception ex) {\n"
- + " setRollbackOnly();\n"
- + " if(ex instanceof LiveException) {\n"
- + " throw (LiveException) ex;\n"
- + " } else {\n"
- + " throw new LiveException(\"com.error.90000\", ex);\n"
- + " }\n"
- + " }\n"
- + " return retVOs;\n"
- + " }"
-
- strmgrimpl = mgrcomment;
- strmgrimpl+= " public ValueObject " + funcnm + "(ValueObject pVO) throws LiveException {\n"
- + " return " + daonm + "." + funcnm + "(pVO);\n"
- + " }";
- strdaoimpl =mgrcomment;
- strdaoimpl+= " public ValueObject " + funcnm + "(ValueObject pVO) throws LiveException {\n"
- + " ValueObject getVO = null;\n"
- + " SqlQuery sql = sqlPage.getQuery(\"" + funcnm.toLowerCase() + "\");\n"
- + " getVO = executeQuery(sql, pVO);\n"
-
- + " return getVO;\n"
- + " }";
- xml = " <statement id=\"" + funcnm.toLowerCase() + "\"><![CDATA[\n\n"
- + " \]\]>\n"
- + " </statement>\n"
- } else {
- strapp = appcomment;
- strapp += " public ValueObjectAssembler " + arr[0] + "(ValueObjectAssembler pVOs) throws LiveException;";
-
- strappimpl = appcomment;
- strappimpl += " public ValueObjectAssembler " + arr[0] + "(ValueObjectAssembler pVOs) throws LiveException {\n"
- + " ValueObject reqVO = pVOs.get(\"req\");\n"
- + " ValueObject insVO = new ValueObject();\n"
- + " ValueObject setVO = new ValueObject();\n"
- + " ValueObject delVO = new ValueObject();\n"
- + " int insCnt = 0;\n"
- + " int setCnt = 0;\n"
- + " int delCnt = 0;\n"
- + " String rowStatus = null;\n"
- + " \n"
- + " try {\n"
- + " for (int i = 0; i < reqVO.size(); i++) {\n"
- + " rowStatus = reqVO.getString(i, \"status\");\n"
- + " \n"
- + " if(\"i\".equals(rowStatus)) {\n"
- + " insVO.addRow(reqVO.getRow(i));\n"
- + " }\n\n"
- + " if(\"u\".equals(rowStatus)) {\n"
- + " setVO.addRow(reqVO.getRow(i));\n"
- + " }\n\n"
- + " if(\"d\".equals(rowStatus)) {\n"
- + " delVO.addRow(reqVO.getRow(i));\n"
- + " }\n\n"
- + " }\n\n"
- + " if(insVO.size() > 0) {\n"
- + " insCnt = " + mgrnm + ".ins" + aftfuncnm + "(insVO);\n"
- + " }\n\n"
- + " if(setVO.size() > 0) {\n"
- + " setCnt = " + mgrnm + ".set" + aftfuncnm + "(setVO);\n"
- + " }\n\n"
- + " if(delVO.size() > 0) {\n"
- + " delCnt = " + mgrnm + ".del" + aftfuncnm + "(delVO);\n"
- + " }\n\n"
- + " } catch (Exception ex) {\n"
- + " setRollbackOnly();\n"
- + " if(ex instanceof LiveException) {\n"
- + " throw (LiveException) ex;\n"
- + " } else {\n"
- + " throw new LiveException(\"com.error.90000\", ex);\n"
- + " }\n"
- + " }\n"
- + " return pVOs;\n"
- + " }\n";
-
- strmgr = mgrcomment;
- strmgr += " public int " + "ins" + aftfuncnm + "(ValueObject pVO) throws LiveException;\n\n"
- + mgrcomment
- + " public int " + "set" + aftfuncnm + "(ValueObject pVO) throws LiveException;\n\n"
- + mgrcomment
- + " public int " + "del" + aftfuncnm + "(ValueObject pVO) throws LiveException;\n\n"
-
- strmgrimpl = mgrcomment
- + " public int " + "ins" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " return " + daonm + "." + "ins" + aftfuncnm + "(pVO);\n"
- + " }\n\n"
- + mgrcomment
- + " public int " + "set" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " return " + daonm + "." + "set" + aftfuncnm + "(pVO);\n"
- + " }\n\n"
- + mgrcomment
- + " public int " + "del" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " return " + daonm + "." + "del" + aftfuncnm + "(pVO);\n"
- + " }\n\n"
- ;
- strdaoimpl = mgrcomment
- + " public int " + "ins" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " int cnt[] = null;\n"
- + " SqlQuery sql = sqlPage.getQuery(\"" + "ins" + aftfuncnm.toLowerCase() + "\");\n"
- + " cnt = executeBatch(sql, pVO);\n\n"
-
- + " return cnt.length;\n"
- + " }\n\n"
- + mgrcomment
- + " public int " + "set" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " int cnt[] = null;\n"
- + " SqlQuery sql = sqlPage.getQuery(\"" + "set" + aftfuncnm.toLowerCase() + "\");\n"
- + " cnt = executeBatch(sql, pVO);\n\n"
-
- + " return cnt.length;\n"
- + " }\n\n"
- + mgrcomment
- + " public int " + "del" + aftfuncnm + "(ValueObject pVO) throws LiveException {\n"
- + " int cnt[] = null;\n"
- + " SqlQuery sql = sqlPage.getQuery(\"" + "del" + aftfuncnm.toLowerCase() + "\");\n"
- + " cnt = executeBatch(sql, pVO);\n\n"
-
- + " return cnt.length;\n"
- + " }\n\n";
-
-
- xml = " <statement id=\"" + "ins" + aftfuncnm.toLowerCase() + "\"><![CDATA[\n\n"
- + " \]\]>\n"
- + " </statement>\n\n"
- + " <statement id=\"" + "set" + aftfuncnm.toLowerCase() + "\"><![CDATA[\n\n"
- + " \]\]>\n"
- + " </statement>\n\n"
- + " <statement id=\"" + "del" + aftfuncnm.toLowerCase() + "\"><![CDATA[\n\n"
- + " \]\]>\n"
- + " </statement>\n\n"
- }
-
- model.setValue("/root/app", strapp);
- model.setValue("/root/appimpl", strappimpl);
-
- model.setValue("/root/mgr", strmgr);
- model.setValue("/root/mgrimpl", strmgrimpl);
-
- model.setValue("/root/dao", strmgr);
- model.setValue("/root/daoimpl", strdaoimpl);
- model.setValue("/root/xml", xml);
-
-
- model.refresh();
- }
- ]]>
- </script>
- </model>
- </xhtml:head>
- <xhtml:body>
- <button id="button1" style="left:25px; top:480px; width:110px; height:40px; ">
- <caption>실행</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- fMakeComment();
- ]]>
- </script>
- </button>
- <textarea id="textarea1" ref="/root/source/source" style="left:10px; top:60px; width:265px; height:400px; "/>
- <textarea id="textarea2" ref="/root/destination/destination" style="left:285px; top:60px; width:360px; height:180px; "/>
- <button id="button2" style="left:150px; top:480px; width:110px; height:40px; ">
- <caption>지우기</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- model.setValue("/root/source/source", "");
- model.setValue("/root/destination/destination", "");
- model.refresh();
- ]]>
- </script>
- </button>
- <caption id="caption4" class="tit_2" style="left:15px; top:20px; width:179px; height:25px; ">map 파일을 붙여 넣어 주세요.</caption>
- <caption id="caption1" class="tit_2" style="left:455px; top:20px; width:179px; height:25px; ">처리된 내용입니다.</caption>
- <button id="button3" style="left:30px; top:525px; width:100px; height:20px; ">
- <caption>실행2</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fMakeComment();
- fMakeComment2();
- fMakeCodeInfo();
- ]]>
- </script>
- </button>
- <textarea id="textarea5" ref="/root/mgr" style="left:655px; top:45px; width:365px; height:60px; "/>
- <textarea id="textarea6" ref="/root/mgrimpl" style="left:655px; top:125px; width:365px; height:110px; "/>
- <caption id="caption2" class="tit_2" style="left:285px; top:40px; width:29px; height:15px; ">app</caption>
- <caption id="caption3" class="tit_2" style="left:285px; top:250px; width:29px; height:15px; ">app</caption>
- <caption id="caption5" class="tit_2" style="left:290px; top:325px; width:51px; height:15px; ">appimpl</caption>
- <caption id="caption6" class="tit_2" style="left:660px; top:25px; width:29px; height:15px; ">mgr</caption>
- <caption id="caption7" class="tit_2" style="left:660px; top:110px; width:51px; height:15px; ">mgrimpl</caption>
- <textarea id="textarea7" ref="/root/daoimpl" style="left:655px; top:350px; width:365px; height:110px; "/>
- <caption id="caption8" class="tit_2" style="left:660px; top:250px; width:29px; height:15px; ">dao</caption>
- <caption id="caption9" class="tit_2" style="left:660px; top:335px; width:51px; height:15px; ">daoimpl</caption>
- <textarea id="textarea8" ref="/root/dao" style="left:655px; top:270px; width:365px; height:60px; "/>
- <input id="input1" ref="/root/mgrnm" style="left:10px; top:605px; width:100px; height:20px; "/>
- <input id="input2" ref="/root/daonm" style="left:15px; top:665px; width:100px; height:20px; "/>
- <caption id="caption10" class="tit_2" style="left:655px; top:510px; width:62px; height:15px; ">statement</caption>
- <textarea id="textarea9" ref="/root/xml" style="left:655px; top:530px; width:365px; height:110px; "/>
- <textarea id="textarea3" ref="/root/app" style="left:285px; top:60px; width:365px; height:265px; "/>
- <caption id="caption11" style="left:15px; top:630px; width:218px; height:20px; vertical-align:middle; ">app단에서 mgr호출할때 쓰는 객체명</caption>
- <caption id="caption12" style="left:15px; top:690px; width:218px; height:20px; vertical-align:middle; ">mgt단에서 dao호출할때 쓰는 객체명</caption>
- <textarea id="textarea4" ref="/root/appimpl" style="left:285px; top:345px; width:365px; height:425px; "/>
- </xhtml:body>
- </xhtml:html>
|