<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

  <!-- ********************************************************************* -->
  <!-- core                                                                  -->
  <!-- ********************************************************************* -->
  <bean id="account" class="org.unitedfront2.domain.Account" scope="prototype">
    <property name="accountDao" ref="accountDao"/>
  </bean>

  <bean id="accountTable" class="org.unitedfront2.domain.AccountTable">
    <property name="accountDao" ref="accountDao"/>
  </bean>

  <bean id="domainFactory" class="org.unitedfront2.domain.SpringBeanDomainFactory"/>

  <bean id="emailForwardingTable" class="org.unitedfront2.domain.EmailForwardingTable">
    <property name="emailForwardingDao" ref="emailForwardingDao"/>
  </bean>

  <bean id="simpleUser" class="org.unitedfront2.domain.SimpleUser" scope="prototype">
    <property name="dateDao" ref="dateDao"/>
    <property name="simpleUserDao" ref="simpleUserDao"/>
    <property name="profileTable" ref="profileTable"/>
  </bean>

  <bean id="simpleUserTable" class="org.unitedfront2.domain.SimpleUserTable">
    <property name="dateDao" ref="dateDao"/>
    <property name="simpleUserDao" ref="simpleUserDao"/>
  </bean>

  <bean id="simpleUserValidator" class="org.unitedfront2.domain.SimpleUserValidator">
    <property name="simpleUserTable" ref="simpleUserTable"/>
  </bean>

  <bean id="widgetTable" class="org.unitedfront2.domain.WidgetTable">
    <property name="widgetDao" ref="widgetDao"/>
  </bean>

  <!-- ********************************************************************* -->
  <!-- accesscontrol                                                         -->
  <!-- ********************************************************************* -->
  <bean id="accessControlTable" class="org.unitedfront2.domain.accesscontrol.AccessControlTable">
    <property name="accessControlDao" ref="accessControlDao"/>
  </bean>

  <bean id="authorOnly" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.AuthorOnly">
        <property name="accessControlDao" ref="accessControlDao"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <bean id="friendOnly" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.FriendOnly">
        <property name="accessControlDao" ref="accessControlDao"/>
        <property name="profileTable" ref="profileTable"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <bean id="friendsOfFriendsOnly" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.FriendsOfFriendsOnly">
        <property name="accessControlDao" ref="accessControlDao"/>
        <property name="profileTable" ref="profileTable"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <bean id="ownerOnly" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.OwnerOnly">
        <property name="accessControlDao" ref="accessControlDao"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <bean id="public" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.Public">
        <property name="accessControlDao" ref="accessControlDao"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <bean id="userOnly" class="org.unitedfront2.domain.accesscontrol.AccessControlProxy" scope="prototype">
    <property name="accessControl">
      <bean class="org.unitedfront2.domain.accesscontrol.UserOnly">
        <property name="accessControlDao" ref="accessControlDao"/>
      </bean>
    </property>
    <property name="domainFactory" ref="domainFactory"/>
  </bean>

  <!-- ********************************************************************* -->
  <!-- communication                                                         -->
  <!-- ********************************************************************* -->
  <bean id="blog" class="org.unitedfront2.domain.communication.Blog" scope="prototype">
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="blogDao" ref="blogDao"/>
  </bean>

  <bean id="blogEntry" class="org.unitedfront2.domain.communication.BlogEntry" scope="prototype">
    <property name="blogDao" ref="blogDao"/>
  </bean>

  <bean id="blogEntryTable" class="org.unitedfront2.domain.communication.BlogEntryTable">
    <property name="domainFactory" ref="domainFactory"/>
    <property name="messageTable" ref="messageTable"/>
  </bean>

  <bean id="blogTable" class="org.unitedfront2.domain.communication.BlogTable">
    <property name="blogDao" ref="blogDao"/>
    <property name="emailForwardingTable" ref="emailForwardingTable"/>
  </bean>

  <bean id="comment" class="org.unitedfront2.domain.communication.Comment" scope="prototype">
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="commentDao" ref="commentDao"/>
    <property name="dateDao" ref="dateDao"/>
  </bean>

  <bean id="commentTable" class="org.unitedfront2.domain.communication.CommentTable">
    <property name="commentDao" ref="commentDao"/>
  </bean>

  <bean id="communityTable" class="org.unitedfront2.domain.communication.CommunityTable">
    <property name="communityDao" ref="communityDao"/>
  </bean>

  <bean id="mail" class="org.unitedfront2.domain.communication.Mail" scope="prototype">
    <property name="accountTable" ref="accountTable"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="mailDao" ref="mailDao"/>
    <property name="dateDao" ref="dateDao"/>
  </bean>

  <bean id="mailTable" class="org.unitedfront2.domain.communication.MailTable">
    <property name="mailDao" ref="mailDao"/>
    <property name="emailForwardingTable" ref="emailForwardingTable"/>
  </bean>

  <bean id="mailValidator" class="org.unitedfront2.domain.communication.MailValidator"/>

  <bean id="message" class="org.unitedfront2.domain.communication.Message" scope="prototype">
    <property name="availableLocales" ref="availableLocales"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="messageDao" ref="messageDao"/>
    <property name="dateDao" ref="dateDao"/>
  </bean>

  <bean id="messageTable" class="org.unitedfront2.domain.communication.MessageTable">
    <property name="messageDao" ref="messageDao"/>
  </bean>

  <bean id="messageValidator" class="org.unitedfront2.domain.communication.MessageValidator">
    <property name="messageTable" ref="messageTable"/>
  </bean>

  <bean id="multiThreadCommunity" class="org.unitedfront2.domain.communication.MultiThreadCommunity" scope="prototype">
    <property name="communityDao" ref="communityDao"/>
    <property name="domainFactory" ref="domainFactory"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
  </bean>

  <bean id="profile" class="org.unitedfront2.domain.communication.Profile" scope="prototype">
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="messageTable" ref="messageTable"/>
    <property name="blogTable" ref="blogTable"/>
    <property name="footmarkDao" ref="footmarkDao"/>
    <property name="friendDao" ref="friendDao"/>
    <property name="friendSubscriptionDao" ref="friendSubscriptionDao"/>
    <property name="selfIntroductionDao" ref="selfIntroductionDao"/>
  </bean>

  <bean id="profileTable" class="org.unitedfront2.domain.communication.ProfileTable">
    <property name="domainFactory" ref="domainFactory"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="profileDao" ref="profileDao"/>
    <property name="selfIntroductionDao" ref="selfIntroductionDao"/>
  </bean>

  <bean id="singleThreadCommunity" class="org.unitedfront2.domain.communication.SingleThreadCommunity" scope="prototype">
    <property name="domainFactory" ref="domainFactory"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="communityDao" ref="communityDao"/>
  </bean>

  <bean id="thread" class="org.unitedfront2.domain.communication.Thread" scope="prototype">
    <property name="domainFactory" ref="domainFactory"/>
    <property name="simpleUserTable" ref="simpleUserTable"/>
    <property name="threadDao" ref="threadDao"/>
    <property name="messageTable" ref="messageTable"/>
  </bean>

  <bean id="threadTable" class="org.unitedfront2.domain.communication.ThreadTable">
    <property name="threadDao" ref="threadDao"/>
  </bean>

</beans>
