<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ page import="org.apache.struts.Globals"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/sj.tld" prefix="sj" %>

<html:html locale="true">
<%@ include file="../common/begin.jsp" %>

<body class="content">
<html:form action="/ApplyEjbSessionConfiguration">
<html:hidden property="action"/>
<html:hidden property="objectName"/>
<html:hidden property="type"/>
<sj:titleContent usingWhere="true" tomThumb="true"/>
<sj:tabs usingWhere="true" heightTab="20">
  <sj:tab forward="ActionListContainers"><bean:message key="tab.ejbcontainers"/></sj:tab>
  <sj:tab forward="ActionViewContainer"><bean:write name="containerForm" property="filename"/></sj:tab>
  <sj:tab forward="ActionEditContainerStatistic"><bean:message key="tab.container.statistic"/></sj:tab>
  <sj:tab forward="ActionViewContainerEjbs"><bean:message key="tab.container.ejbs"/></sj:tab>
  <sj:tab forward="Ejb Session" selected="true"><bean:write name="ejbForm" property="name"/></sj:tab>
  <logic:equal name="ejbForm" property="dependency" value="true">
    <sj:tab forward="Ejb Dependency"><bean:message key="tab.ejb.dependency"/></sj:tab>
  </logic:equal>
  <sj:panel>
	<logic:present name="<%=Globals.ERROR_KEY%>">
      <sj:jonasgrid>
        <sj:gridrow styleClass="errors">
          <sj:gridcol styleClass="errors"><html:errors/></sj:gridcol>
        </sj:gridrow>
      </sj:jonasgrid>
      <sj:panelSeparator/>
    </logic:present>

   <logic:equal name="ejbForm" property="type" value="StatelessSessionBean">
    <sj:jonasgrid>
      <sj:jgRowTitle level="2">
        <sj:jgColTitle><bean:message key="title.ejb.action"/></sj:jgColTitle>
      </sj:jgRowTitle>
    </sj:jonasgrid>
    <sj:jonasgrid>
      <sj:gridrow changeStyle="true">
        <sj:gridcol>
          <sj:grid cellPadding="10">
            <sj:gridrow>
              <sj:gridcol>
                <bean:define id="actionReduceCache" value="reduceCache"/>
                <sj:jonasbutton forward="ActionExecuteEjb" paramId="action" paramName="actionReduceCache">
                  <bean:message key="button.ejb.type.session.sbl.reduceCache"/>
                </sj:jonasbutton>
              </sj:gridcol>
            </sj:gridrow>
          </sj:grid>
        </sj:gridcol>
      </sj:gridrow>
    </sj:jonasgrid>
    <sj:panelSeparator/>
   </logic:equal>

    <sj:jonasgrid>
      <sj:jgRowTitle>
        <sj:jgColTitle><bean:write name="ejbForm" property="type"/></sj:jgColTitle>
      </sj:jgRowTitle>
    </sj:jonasgrid>
    <sj:jonasgrid>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.name"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="name"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.file"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="file"/></sj:jgValue>
      </sj:gridrow>
    </sj:jonasgrid>

    <sj:panelSeparator/>

    <sj:jonasgrid>
      <sj:jgRowTitle level="2">
        <sj:jgColTitle><bean:message key="title.ejb.naming"/></sj:jgColTitle>
      </sj:jgRowTitle>
    </sj:jonasgrid>
    <sj:jonasgrid>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.class"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="ejbClass"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.jndiName"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="jndiName"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.homeClass"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="homeClass"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.remoteClass"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="remoteClass"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.localHomeClass"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="localHomeClass"/></sj:jgValue>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.naming.localClass"/></sj:jgName>
        <sj:jgValue><bean:write name="ejbForm" property="localClass"/></sj:jgValue>
      </sj:gridrow>
    </sj:jonasgrid>

    <sj:panelSeparator/>

    <sj:jonasgrid>
      <sj:jgRowTitle level="2">
        <sj:jgColTitle><bean:message key="title.ejb.memory"/></sj:jgColTitle>
      </sj:jgRowTitle>
    </sj:jonasgrid>
    <sj:jonasgrid>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.memory.poolSize"/></sj:jgName>
        <sj:gridcol><bean:write name="ejbForm" property="poolSize"/></sj:gridcol>
        <sj:gridcol width="60%"><bean:message key="comment.ejb.memory.poolSize"/></sj:gridcol>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.memory.cacheSize"/></sj:jgName>
        <sj:gridcol><bean:write name="ejbForm" property="cacheSize"/></sj:gridcol>
        <sj:gridcol width="60%"><bean:message key="comment.ejb.memory.cacheSize"/></sj:gridcol>
      </sj:gridrow>
    </sj:jonasgrid>

    <sj:panelSeparator/>

    <sj:jonasgrid>
      <sj:jgRowTitle level="2">
        <sj:jgColTitle><bean:message key="title.ejb.type.session"/></sj:jgColTitle>
      </sj:jgRowTitle>
    </sj:jonasgrid>
    <sj:jonasgrid>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.type.message.minPoolSize"/></sj:jgName>
        <sj:gridcol><bean:write name="ejbForm" property="minPoolSize"/></sj:gridcol>
        <sj:gridcol width="60%"><bean:message key="comment.ejb.type.entity.minPoolSize"/></sj:gridcol>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.type.message.maxCacheSize"/></sj:jgName>
        <sj:gridcol><bean:write name="ejbForm" property="maxCacheSize"/></sj:gridcol>
        <sj:gridcol width="60%"><bean:message key="comment.ejb.type.entity.maxCacheSize"/></sj:gridcol>
      </sj:gridrow>
      <sj:gridrow>
        <sj:jgName><bean:message key="label.ejb.type.session.sessionTimeOut"/></sj:jgName>
	    <logic:greaterThan name="ejbForm" property="sessionTimeOut" value="0">
		  <sj:gridcol><html:text property="sessionTimeOut"/></sj:gridcol>
	    </logic:greaterThan>
	    <logic:equal name="ejbForm" property="sessionTimeOut" value="0" >
		  <html:messages id="defaultTO" property="defaultSessionTimeOut" message="true">
			<sj:gridcol><html:text property="sessionTimeOut" value="<%=defaultTO %>" /></sj:gridcol>
          </html:messages>
	    </logic:equal>
        <sj:gridcol width="60%"><bean:message key="comment.ejb.type.message.sessionTimeOut"/></sj:gridcol>
      </sj:gridrow>
    </sj:jonasgrid>

 <sj:panelSeparator/>

    <sj:jonasgrid globalRowStyleClass="panel">
      <sj:gridrow>
        <sj:jgName></sj:jgName>
        <sj:gridcol>
          <html:button property="btn_apply" styleClass="button"
            onclick="submitHidden('ejbForm','action','apply')">
            <bean:message key="button.apply"/>
          </html:button>
          &nbsp;&nbsp;
          <html:reset styleClass="button"><bean:message key="button.reset"/></html:reset>
        </sj:gridcol>
      </sj:gridrow>
    </sj:jonasgrid>
  </sj:panel>
</sj:tabs>
</html:form>

<%@ include file="../common/end.jsp" %>
</body>
</html:html>

