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

<og:head headType="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system   = "GE:エンジンサンプル"
	pgid     = "GE0020"
	title    = "データロール"
	date     = "2007/12/12"
	author   = "K.HASEGAWA"
	text     = "ZZZZ"
	version  = "001"
/>

<!-- ワーニングメッセージです。ここでは、登録完了のメッセージを表示します。 -->
<og:errorMessage command="{@command}" clear="{@clear}" displayMsg="{@displayMsg}" />

<og:columnCheck
	command   = "{@command}"
	columns   = "SYSTEM_ID,GUIKEY,NAME_JA,ROLE"
/>

<!-- 取り消しボタンが押された時に必要です。 -->
<og:entry command = "{@command}" />

<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		select case
				when A.GUILVL = '1' then '0'
				when A.GUILVL = '2' then '0'
				else '1' end WRITABLE
				,A.SYSTEM_ID,A.GUIKEY, A.NAME_JA, A.ROLES, A.UNIQ, 'RLS_'||B.ROLE ROLE
				,case when '|'{@DBF.CON}A.ROLES{@DBF.CON}'|' like '%|'||B.ROLE||'|%' then '1' else '0' end IS_CHECK
		from	GEA11 A inner join GEA05 B
		on		A.SYSTEM_ID	= B.SYSTEM_ID
	</jsp:text>
		<og:where startKey="and">
			<og:and value = "B.ROLE	like '{@ROLE}%'" />
			<og:and value = "B.KBROLE	= '1'" />
			<og:and value = "B.FGJ		= '1'" />
		</og:where>
	<og:where>
		<og:and value = "A.FGJ					=		'1'"			/>
		<og:and value = "SUBSTR(A.RWMODE,1,1)	=		'm'"			/>
		<og:and value = "A.SYSTEM_ID			=		'{@SYSTEM_ID}'"	/>
		<og:and value = "A.GUIKEY				like	'{@GUIKEY}%'"	/>
		<og:and value = "A.NAME_JA				like	'{@NAME_JA}%'"	/>
		<og:and value = "A.ROLES				like	'%{@ROLES}%'"	/>
	</og:where>
	<og:appear startKey = "order by" value = "{@ORDER_BY}"
				defaultVal = "A.SYSTEM_ID,A.SEQNO,B.ROLE" />
</og:query>

<og:tableFilter classId="ROTATE" selectedAll="true"
	keys="ROTATE_CLM,KEY_CLM,VALUE_CLM" vals='ROLE,"WRITABLE,SYSTEM_ID,GUIKEY,NAME_JA,ROLES,UNIQ",IS_CHECK' />

<og:columnEditor columns="ROLES" renderer="SLABEL" parameter="4" />

<og:columnEditor columns="RLS*" renderer="chbox" editor="chbox" />
<og:columnEditor columns="RLS*" useLabelMap="true">
	select 'RLS_'{@DBF.CON}ROLE, NMROLE{@DBF.CON}'&lt;br&gt;('{@DBF.CON}ROLE{@DBF.CON}')'
	from GEA05
	where SYSTEM_ID	= '{@SYSTEM_ID}'
	and KBROLE		= '1'
	and FGJ			= '1'
</og:columnEditor>

<table border="1">
	<tr>
		<td><b><og:message lbl="GEM0037" /></b></td>
		<td><og:message lbl="GEM0036" /></td>
	</tr>
	<tr>
		<td><b><og:message lbl="GEM0038" /></b></td>
		<td><og:message lbl="GEM0039" /></td>
	</tr>
</table>

<form onSubmit="return oneClick();" method="POST" action="forward.jsp" target="RESULT">
<og:writeCheck>
	<og:submit  value="update"   lbl="MODIFY"    command="MODIFY" accesskey="M"
		keys="noWritable,noDisplay" vals='"GUIKEY,NAME_JA,ROLES","SYSTEM_ID,UNIQ"' />
	<og:submit  value="update"   lbl="DIRECT_MODIFY"    command="MODIFY" accesskey="C"
		keys="columnWritable,noDisplay,direct" vals='"ROLES","SYSTEM_ID,UNIQ",true' />

	<og:link gamenId="GE0017" href="index.jsp" target="CONTENTS"
		keys="command,SYSTEM_ID,KBROLE,FGJ"
		vals="NEW,{@SYSTEM_ID},1,1">[{@LBL.GE0017}]</og:link>
	<og:link gamenId="GE0019" href="index.jsp" target="CONTENTS"
		keys="command,SYSTEM_ID,KBROLE"
		vals="NEW,{@SYSTEM_ID},1">[{@LBL.GE0019}]</og:link>
<br />
</og:writeCheck>

<og:view
	viewFormType = "HTMLTable"
	command		= "{@command}"
	noDisplay	= "SYSTEM_ID,UNIQ"
	checked		= "{@checked}"
	startNo		= "{@startNo}"
	pageSize	= "{@pageSize}" />
</form>

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