<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld" 
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:head headType="init" />
<!-- history.back() で戻るボタンを表示します。	-->
<jsp:directive.include file="/jsp/common/history_back.jsp" /><br />

<og:upload
	fileURL     = "{@USER.ID}"
	maxPostSize = "0"
/>

<og:columnCheck
	command   = "NEW"
	nullCheck = "file1,SYSTEM_ID"
/>

<og:file fileURL="{@USER.ID}" file1="{@file1}" action="existsLength" >
	<og:message lbl="MSG0064" comment="ファイルが存在していません。" />
	<og:text>fileURL="{@USER.ID}" file1="{@file1}"</og:text>
</og:file>

<og:value command="SQL" action="ALL_MAPOBJ" >
	select GENBUN,YAKU
	from  GF28
	where SYSTEM_ID = '{@SYSTEM_ID}'
	and   KEYWORD   = '{@file1}'
	and   KBYAKU    = '4'
	and   KBHORYU   = '1'
	and   FGJ       = '1'
	and   LANG_YAKU = 'zh'
</og:value>

<og:value command="SET" key="inFile" value="{@SYS.REAL_PATH}{@SYS.FILE_URL}{@USER.ID}/{@file1}" />

<pre>
<jsp:scriptlet>
	// valueタグの MAPOBJ は、通常リクエスト変数に保管される。
	final java.util.Map&lt;String,String&gt; map = (java.util.Map&lt;String,String&gt;)request.getAttribute( "GENBUN" );
//	for( java.util.Map.Entry&lt;String,String&gt; entry : map.entrySet() ) {
//		out.println( entry.getKey() + ":" + entry.getValue() );
//	}

	final String fileIn = (String)request.getAttribute( "inFile" );

	final java.io.File file = new java.io.File( fileIn );
	final org.opengion.fukurou.model.ExcelModel excel = new org.opengion.fukurou.model.ExcelModel( file , true );

	excel.textConverter( map );

	excel.saveFile( file );
</jsp:scriptlet>
</pre>

<og:link href="{@SYS.CONTEXT_URL}{@SYS.FILE_URL}{@USER.ID}/{@file1}" target="_blank" useGamenId="false" >
	<img src="{@SYS.JSP}/image/floppy.gif" alt="Excel Open" />{@file1}　　<og:message lbl="MSG0056" />
</og:link>

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
