<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2005-2014 The Kuali Foundation

    Licensed under the Educational Community License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.opensource.org/licenses/ecl2.php

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  
  <bean id="TravelAccountMaintenanceDocument" parent="uifMaintenanceDocumentEntry">
    <property name="dataObjectClass" value="org.kuali.rice.krad.demo.travel.dataobject.TravelAccount"/>
    <property name="documentTypeName" value="TravelAccountMaintenanceDocument"/>
    <property name="lockingKeys">
      <list>
        <value>number</value>
      </list>
    </property>
  </bean>

  <bean id="TravelAccount-MaintenanceView" parent="Uif-MaintenanceView">
    <property name="headerText" value="Travel Account Maintenance"/>
    <property name="title" value="Travel Account Maintenance"/>
    <property name="dataObjectClassName" value="org.kuali.rice.krad.demo.travel.dataobject.TravelAccount"/>
    <property name="items">
      <list merge="true">
        <bean parent="Uif-MaintenanceGridSection">
          <property name="headerText" value="Account Information"/>
          <property name="items">
            <list>
              <bean parent="Uif-InputField" p:propertyName="number"/>
              <bean parent="Uif-InputField" p:propertyName="name"/>
              <bean parent="Uif-InputField" p:propertyName="accountTypeCode" p:required="true" />
              <bean parent="Uif-InputField" p:propertyName="foId"/>
              <bean parent="Uif-InputField" p:propertyName="createDate" p:readOnly="true" p:defaultValue="#{T(org.joda.time.DateTime).now().toDate()}"/>
              <bean parent="Uif-InputField" p:propertyName="subsidizedPercent"/>
            </list>
          </property>
        </bean>
        <bean parent="Uif-MaintenanceStackedCollectionSection">
          <property name="headerText" value="Sub Accounts"/>
          <property name="collectionObjectClass" value="org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount"/>
          <property name="propertyName" value="subAccounts"/>
          <property name="items">
            <list>
              <bean parent="Uif-InputField" p:propertyName="subAccount" p:uppercaseValue="true" p:readOnly="@{!#isAddLine}"/>
              <bean parent="Uif-InputField" p:propertyName="subAccountName" p:readOnly="@{!#isAddLine}"/>
            </list>
          </property>
          <property name="duplicateLinePropertyNames">
            <list>
              <value>subAccount</value>
            </list>
          </property>
          <property name="lineActions">
            <list>
              <bean parent="Uif-DeleteLineAction" p:render="@{isAddedCollectionItem(#line)}"/>
              <bean parent="Uif-SaveLineAction"/>
            </list>
          </property>
          <property name="layoutManager.summaryTitle" value="Sub Account"/>
          <property name="layoutManager.summaryFields">
            <list>
              <value>subAccount</value>
            </list>
          </property>
        </bean>
      </list>
    </property>
  </bean>

</beans>