<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!-- Core and miscellaneous bean definitions -->
<beans>

    <!--                    -->
    <!--  PERSISTENCE       -->
    <!--                    -->

    <!-- Load runtime-dependent properties (e.g.: alfresco.jmx.dir).     -->
    <!-- Note:  This bean relies on PropertyPlaceholderConfigurer        -->
    <bean id="runtimeProperties"  class="org.alfresco.util.RuntimeSystemPropertiesSetter"/>


    <!-- load common properties -->
    <bean id="repository-properties" 
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/repository.properties</value>
                <value>classpath:alfresco/version.properties</value>
                <value>classpath:alfresco/domain/transaction.properties</value>
            </list>
        </property>
    </bean>


    <!-- Load properties that must be shared between the        -->
    <!-- Alfresco server and its remote clients.                -->
    <!--                                                        -->
    <!-- Note:  This is done in a seperate bean to make it      -->
    <!--        for users who have alrady overridden their      -->
    <!--        "repository-properties" in a dev-context.xml    -->
    <!--        or custom-db-and-data-context.xml file.         -->

    <bean id="shared-properties" 
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/alfresco-shared.properties</value>
            </list>
        </property>
    </bean>



    <!-- Custom MBeanServer -->
    <bean id="alfrescoMBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"/>

    <bean id="registry"   class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
        <property name="port" value="${avm.remote.port}"/>
    </bean>

    <!-- MBeanServer Connector (registers itself with custom alfrescoMBeanServer) -->
    <bean id="serverConnector" 
          class="org.springframework.jmx.support.ConnectorServerFactoryBean"
          depends-on="registry">

        <property name="server"      ref="alfrescoMBeanServer"/>
        <property name="objectName"  value="connector:name=rmi"/>
        <property name="serviceUrl"  value="service:jmx:rmi://localhost/jndi/rmi://localhost:${avm.remote.port}/alfresco/jmxrmi" />

        <property name="environment">
            <map>
                <!-- The following keys are only valid when sun jmx is used -->
                <entry key="jmx.remote.x.password.file" value="${alfresco.jmx.dir}/alfresco-jmxrmi.password"/>
                <entry key="jmx.remote.x.access.file"   value="${alfresco.jmx.dir}/alfresco-jmxrmi.access"/>
            </map>
        </property>
    </bean>

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
       <property name="server" ref="alfrescoMBeanServer"/>
       <property name="beans">
         <map>
           <!-- MBeans to register with alfrescoMBeanServer -->
           <entry key="Alfresco:Name=VirtServerRegistry,Type=VirtServerRegistry" value-ref="VirtServerRegistry"/>
           <entry key="Alfresco:Name=FileServerConfig,Type=FileServerConfig" value-ref="FileServerConfig"/>
         </map>
       </property>
    </bean>

    <!-- MBeans registered with alfrescoMBeanServer -->
    <bean id="VirtServerRegistry" 
          class="org.alfresco.mbeans.VirtServerRegistry"
          init-method="initialize" >

        <!-- Authentication info to contact remote virtualization server  -->
        <!-- NOTE:                                                        -->
        <!--    On the machine hosting the virtualization server,         -->
        <!--    $VIRTUAL_TOMCAT_HOME/conf/alfresco-jmxrmi.password and    -->
        <!--    $VIRTUAL_TOMCAT_HOME/conf/alfresco-jmxrmi.access          -->
        <!--    should have the same data as the corresponding files      -->
        <!--    contained here within the Alfresco webapp server.         -->
        <!--    By default, they do; however, if you change the password  -->
        <!--    file on one server, be sure to change it on the other.    -->
        <!--                                                              -->
        <!-- WARNING:                                                     -->
        <!--    For security, be certain that *only* the uid under which  -->
        <!--    the servers run have read access to the password files    -->
        <!--    (e.g.:  under Unix, chmod them to "400").                 -->

        <property name="passwordFile" 
                  value="${alfresco.jmx.dir}/alfresco-jmxrmi.password"/>

        <property name="accessFile"   
                  value="${alfresco.jmx.dir}/alfresco-jmxrmi.access"/>
    </bean>

	<bean id="FileServerConfig"
		  class="org.alfresco.filesys.server.config.FileServerConfig">
		<property name="fileServerConfiguration"><ref bean="fileServerConfiguration"/></property>
	</bean>

    <!-- Datasource bean -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName">
            <value>${db.driver}</value>
        </property>
        <property name="url">
            <value>${db.url}</value>
        </property>
        <property name="username">
            <value>${db.username}</value>
        </property>
        <property name="password">
            <value>${db.password}</value>
        </property>
        <property name="initialSize" >
            <value>${db.pool.initial}</value>
        </property>
        <property name="maxActive" >
            <value>${db.pool.max}</value>
        </property>
        <property name="defaultAutoCommit" >
            <value>false</value>
        </property>
    </bean>

    <!-- transaction service -->
    <bean id="transactionComponent" class="org.alfresco.repo.transaction.TransactionComponent">
        <property name="transactionManager">
            <ref bean="transactionManager" />
        </property>
        <property name="allowWrite">
            <value>${server.transaction.allow-writes}</value>
        </property>
    </bean>
    
    <bean id="retryingTransactionHelper" class="org.alfresco.repo.transaction.RetryingTransactionHelper">
    	<property name="transactionService">
    	    <ref bean="transactionComponent"/>
    	</property>
    	<property name="maxRetries">
    	    <value>20</value>
    	</property>
    </bean>

    <bean id="readWriteTransactionDefinition" class="org.springframework.transaction.support.DefaultTransactionDefinition">
        <property name="propagationBehaviorName">
            <value>PROPAGATION_REQUIRED</value>
        </property>
        <property name="readOnly">
            <value>false</value>
        </property>
    </bean>
	
    <bean id="readOnlyTransactionDefinition" class="org.springframework.transaction.support.DefaultTransactionDefinition">
        <property name="propagationBehaviorName">
            <value>PROPAGATION_REQUIRED</value>
        </property>
        <property name="readOnly">
            <value>true</value>
        </property>
    </bean>

    <bean id="retryingWriteTxnAdvice" class="org.alfresco.repo.transaction.RetryingTransactionAdvice">
        <property name="transactionManager">
            <ref bean="transactionManager"/>
        </property>
        <property name="transactionDefinition">
            <ref bean="readWriteTransactionDefinition"/>
        </property>
        <property name="maxRetries">
            <value>20</value>
        </property>
    </bean>

    <bean id="retryingReadTxnAdvice" class="org.alfresco.repo.transaction.RetryingTransactionAdvice">
        <property name="transactionManager">
            <ref bean="transactionManager"/>
        </property>
        <property name="transactionDefinition">
            <ref bean="readOnlyTransactionDefinition"/>
        </property>
        <property name="maxRetries">
            <value>20</value>
        </property>
    </bean>

    <!--                        -->
    <!-- I18N                   -->
    <!--                        -->

    <bean id="resourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
    	<property name="resourceBundles">
    		<list>
    			<value>alfresco.messages.system-messages</value>
    			<value>alfresco.messages.module-messages</value>
    			<value>alfresco.messages.dictionary-messages</value>
    			<value>alfresco.messages.version-service</value>
    			<value>alfresco.messages.permissions-service</value>
    			<value>alfresco.messages.content-service</value>
    			<value>alfresco.messages.coci-service</value>
    			<value>alfresco.messages.template-service</value>
    			<value>alfresco.messages.lock-service</value>
    			<value>alfresco.messages.patch-service</value>
    			<value>alfresco.messages.schema-update</value>
    			<value>alfresco.messages.webdav-messages</value>
    			<value>alfresco.messages.copy-service</value>
    		</list>
    	</property>
    </bean>


    <!--                        -->
    <!-- MAIL SERVICE           -->
    <!--                        -->

    <bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl">
        <property name="host">
            <value>${mail.host}</value>
        </property>
        <property name="port">
            <value>${mail.port}</value>
        </property>
        <property name="username">
            <value>${mail.username}</value>
        </property>
        <property name="password">
            <value>${mail.password}</value>
        </property>
        <property name="defaultEncoding">
            <value>${mail.encoding}</value>
        </property>
    </bean>

    <!--                         -->
    <!-- Indexing and Search API -->
    <!--                         -->

    <bean id="indexerComponent" class="org.alfresco.repo.search.IndexerComponent">
        <property name="indexerAndSearcherFactory">
            <ref bean="indexerAndSearcherFactory" />
        </property>
    </bean>

    <bean id="searchService" class="org.alfresco.repo.search.SearcherComponent">
        <property name="indexerAndSearcherFactory">
            <ref bean="indexerAndSearcherFactory" />
        </property>
    </bean>


    <!--                                                                               -->
    <!-- Generic factory for making indexers and searchers for a given protol or store -->
    <!--                                                                               -->
    <bean id="indexerAndSearcherFactory" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
        <property name="proxyInterface">
            <value>org.alfresco.repo.search.IndexerAndSearcher</value>
        </property>
        <property name="defaultBinding">
            <ref bean="luceneIndexerAndSearcherFactory"></ref>
        </property>
        <property name="redirectedProtocolBindings">
            <map>
                <entry key="workspace">
                    <ref bean="luceneIndexerAndSearcherFactory"></ref>
                </entry>
                <entry key="versionStore">
                    <ref bean="luceneIndexerAndSearcherFactory"></ref>
                </entry>
                <entry key="avm">
                    <ref bean="luceneIndexerAndSearcherFactory"></ref>
                </entry>
            </map>
        </property>
    </bean>

    <bean id="categoryService" class="org.alfresco.repo.service.StoreRedirectorProxyFactory">
        <property name="proxyInterface">
            <value>org.alfresco.service.cmr.search.CategoryService</value>
        </property>
        <property name="defaultBinding">
            <ref bean="luceneCategoryService"></ref>
        </property>
        <property name="redirectedProtocolBindings">
            <map>
                <entry key="workspace">
                    <ref bean="luceneCategoryService"></ref>
                </entry>
                <entry key="versionStore">
                    <ref bean="luceneCategoryService"></ref>
                </entry>
                <entry key="avm">
                    <ref bean="luceneCategoryService"></ref>
                </entry>
            </map>
        </property>
    </bean>


    <!-- Indexer and searchers for lucene -->
    <bean id="luceneIndexerAndSearcherFactory"
        class="org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcherFactory2">
        <property name="nodeService">
            <ref bean="mlAwareNodeService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="nameSpaceService">
            <ref bean="namespaceService" />
        </property>
        <property name="luceneFullTextSearchIndexer">
            <ref bean="LuceneFullTextSearchIndexer" />
        </property>
        <property name="indexRootLocation">
            <value>${dir.indexes}</value>
        </property>
        <property name="contentService">
            <ref bean="contentService" />
        </property>
        <property name="queryRegister">
            <ref bean="queryRegisterComponent" />
        </property>
        <property name="maxAtomicTransformationTime">
            <value>${lucene.maxAtomicTransformationTime}</value>  <!-- milliseconds allowed for inline text transformation -->
        </property>
        <property name="queryMaxClauses">
            <value>${lucene.query.maxClauses}</value>
        </property>
        <property name="indexerBatchSize">
            <value>${lucene.indexer.batchSize}</value>
        </property>
        <property name="lockDirectory">
            <value>${dir.indexes.lock}</value>
        </property>
        <property name="indexerMaxFieldLength">
            <value>${lucene.indexer.maxFieldLength}</value>
        </property>
        <property name="writeLockTimeout">
            <value>${lucene.write.lock.timeout}</value>
        </property>
        <property name="commitLockTimeout">
            <value>${lucene.commit.lock.timeout}</value>
        </property>
        <property name="lockPollInterval">
            <value>${lucene.lock.poll.interval}</value>
        </property>
		 <property name="defaultMLIndexAnalysisMode">
            <value>EXACT_LANGUAGE_AND_ALL</value>
        </property>
		<property name="defaultMLSearchAnalysisMode">
            <value>EXACT_LANGUAGE_AND_ALL</value>
        </property>
        
    </bean>

    <!-- Indexer and searchers for lucene -->
    <bean id="luceneCategoryService" class="org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService" />
        </property>
        <property name="indexerAndSearcher">
            <ref bean="luceneIndexerAndSearcherFactory" />
        </property>
    </bean>

    <!--                               -->
    <!--  Lock Service           -->
    <!--                               -->

    <bean id="lockService" class="org.alfresco.repo.lock.LockServiceImpl" init-method="initialise">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="authenticationService">
            <ref bean="authenticationServiceImpl"></ref>
        </property>
        <property name="ownableService">
            <ref bean="ownableService"></ref>
        </property>
        <property name="searchService">
            <ref bean="searchService"></ref>
        </property>
    </bean>

    <!--                               -->
    <!--  Version Service   -->
    <!--                               -->


    <bean id="versionService" class="org.alfresco.repo.version.VersionServiceImpl" init-method="initialise">
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <property name="dbNodeService">
            <ref bean="dbNodeService" />
        </property>
        <property name="versionCounterService">
            <ref bean="versionCounterService" />
        </property>
        <property name="searcher">
            <ref bean="searchService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="policyBehaviourFilter">
            <ref bean="policyBehaviourFilter" />
        </property>
    </bean>

    <bean id="versionNodeService" class="org.alfresco.repo.version.NodeServiceImpl">
        <property name="dbNodeService">
            <ref bean="dbNodeService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
    </bean>

    <bean id="versionCounterService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>org.alfresco.repo.version.common.counter.VersionCounterService</value>
        </property>
        <property name="transactionManager">
            <ref bean="transactionManager" />
        </property>
        <property name="target">
            <ref bean="versionCounterDaoComponent" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="*">${server.transaction.mode.default}, PROPAGATION_REQUIRES_NEW</prop>
            </props>
        </property>
    </bean>

    <bean id="versionableAspect" class="org.alfresco.repo.version.VersionableAspect" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="versionService">
            <ref bean="versionService"/>
        </property>
        <property name="nodeService">
            <ref bean="nodeService"/>
        </property>
    </bean>

    <!--                 -->
    <!-- Data Dictionary -->
    <!--                 -->

    <bean id="namespaceDAO" class="org.alfresco.repo.dictionary.NamespaceDAOImpl" />

	<bean id="dictionaryModelType" class="org.alfresco.repo.dictionary.DictionaryModelType" init-method="init">
		<property name="dictionaryDAO">
            <ref bean="dictionaryDAO" />
        </property>	
        <property name="namespaceDAO">
            <ref bean="namespaceDAO" />
        </property>
        <property name="nodeService">
        	<ref bean="nodeService"/>
        </property>        
        <property name="contentService">
        	<ref bean="contentService"/>
        </property>
        <property name="policyComponent">
        	<ref bean="policyComponent"/>
        </property>
	</bean>

    <bean id="dictionaryDAO" class="org.alfresco.repo.dictionary.DictionaryDAOImpl">
        <constructor-arg index="0">
            <ref bean="namespaceDAO" />
        </constructor-arg>
    </bean>

    <bean id="dictionaryService" class="org.alfresco.repo.dictionary.DictionaryComponent" depends-on="dictionaryBootstrap">
        <property name="dictionaryDAO">
            <ref bean="dictionaryDAO" />
        </property>
    </bean>

    <bean id="namespaceService" class="org.alfresco.repo.dictionary.DictionaryNamespaceComponent"
        depends-on="dictionaryDAO">
        <property name="namespaceDAO">
            <ref bean="namespaceDAO" />
        </property>
    </bean>

    <bean id="dictionaryModelBootstrap" class="org.alfresco.repo.dictionary.DictionaryBootstrap" init-method="bootstrap" abstract="true">
    	<property name="dictionaryDAO"><ref local="dictionaryDAO"/></property>
    </bean>

    <bean id="dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="resourceBundles">
        <property name="models">
            <list>
                <!-- System models  -->
                <value>alfresco/model/dictionaryModel.xml</value>
                <value>alfresco/model/systemModel.xml</value>
                <value>org/alfresco/repo/security/authentication/userModel.xml</value>

                <!-- Content models -->
                <value>alfresco/model/contentModel.xml</value>
                <value>alfresco/model/bpmModel.xml</value>
                <value>alfresco/model/wcmModel.xml</value>
                <value>alfresco/model/forumModel.xml</value>

                <!-- Content models -->
                <value>alfresco/model/applicationModel.xml</value>
                <value>alfresco/model/wcmAppModel.xml</value>
                
                <!-- Implementation models -->
                <value>org/alfresco/repo/action/actionModel.xml</value>
                <value>org/alfresco/repo/rule/ruleModel.xml</value>
                <value>org/alfresco/repo/version/version_model.xml</value>
                
                <!-- Deprecated types -->
                <value>alfresco/model/deprecated/deprecated_contentModel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/model/dataTypeAnalyzers</value>
                <value>alfresco/messages/system-model</value>
                <value>alfresco/messages/dictionary-model</value>
                <value>alfresco/messages/content-model</value>
                <value>alfresco/messages/bpm-messages</value>
                <value>alfresco/messages/application-model</value>
                <value>alfresco/messages/forum-model</value>
            </list>
        </property>
    </bean>

    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/model/defaultCustomModel.xml</value>
            </list>
        </property>
    </bean>
    
	<bean id="dictionaryRepositoryBootstrap" class="org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap" init-method="bootstrap">
		<property name="dictionaryDAO">
			<ref local="dictionaryDAO"/>
		</property>
		<property name="contentService">
			<ref bean="contentService"/>
		</property>
		<property name="searchService">
			<ref bean="searchService"/>
		</property>
        <property name="transactionService">
            <ref bean="transactionComponent"/>
        </property>
		<property name="authenticationComponent">
			<ref bean="authenticationComponent"/>
		</property>
	</bean>

    <!--                 -->
    <!-- Copy Service    -->
    <!--                 -->

    <!-- Note this uses the node service that enforces permissions so you can only copy what you can see -->

    <bean id="copyService" class="org.alfresco.repo.copy.CopyServiceImpl" init-method="init">
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="ruleService">
            <ref bean="ruleService" />
        </property>
        <property name="searchService">
            <ref bean="SearchService" />
        </property>
        <property name="permissionService">
            <ref bean="PermissionService" />
        </property>
        <property name="authenticationService">
            <ref bean="AuthenticationService" />
        </property>
        <property name="internalNodeService">
            <ref bean="nodeService" />
        </property>        
    </bean>

    <!--                           -->
    <!-- CheckOut/CheckIn Service  -->
    <!--                           -->

    <bean id="checkOutCheckInService" class="org.alfresco.repo.coci.CheckOutCheckInServiceImpl">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="versionService">
            <ref bean="versionService" />
        </property>
        <property name="lockService">
            <ref bean="LockService" />
        </property>
        <property name="copyService">
            <ref bean="CopyService" />
        </property>
        <property name="authenticationService">
            <ref bean="authenticationService" />
        </property>
        <property name="searchService">
            <ref bean="searchService" />
        </property>
        <property name="versionableAspect">
            <ref bean="versionableAspect" />
        </property>
    </bean>

    <bean id="workingCopyAspect" class="org.alfresco.repo.coci.WorkingCopyAspect" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <property name="lockService">
            <ref bean="LockService" />
        </property>
    </bean>
    
    <bean id="discussableAspect" class="org.alfresco.repo.forum.DiscussableAspect" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <property name="fileFolderService">
            <ref bean="FileFolderService" />
        </property>
    </bean>

    <!-- Bean to support full text search -->

    <bean id="LuceneFullTextSearchIndexer"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexer</value>
        </property>
        <property name="transactionManager">
            <ref bean="transactionManager" />
        </property>
        <property name="target">
            <bean class="org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl">
                <property name="luceneIndexerAndSearcherFactory">
                    <ref bean="luceneIndexerAndSearcherFactory" />
                </property>
            </bean>
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="*">${server.transaction.mode.default}</prop>
            </props>
        </property>
    </bean>
    
    <!-- Bean to backup Lucene indexes -->
    <bean id="luceneIndexBackupComponent"
          class="org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcherFactory2$LuceneIndexBackupComponent">
        <property name="transactionService">
            <ref bean="transactionComponent" />
        </property>
        <property name="factory">
            <ref bean="luceneIndexerAndSearcherFactory" />
        </property>
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="targetLocation">
            <value>${dir.root}/backup-lucene-indexes</value>
        </property>
    </bean>

    <!--                -->
    <!-- Thread Pool    -->
    <!--                -->
    
    <bean id="threadPoolExecutor" class="org.alfresco.util.ThreadPoolExecutorFactoryBean" singleton="true" >
        <property name="corePoolSize">
            <value>5</value>
        </property>
        <property name="maximumPoolSize">
            <value>20</value>
        </property>
        <property name="keepAliveTime">
            <value>60</value>
        </property>
    </bean>

    <!-- Query Register Component -->

    <bean id="queryRegisterComponent" class="org.alfresco.repo.search.QueryRegisterComponentImpl">
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService" />
        </property>
        <!-- Query collections should be loaded on demand using this component - once loaded thay are available for use -->
    </bean>

    <!-- Audit -->
    <bean id="auditableAspect" class="org.alfresco.repo.audit.AuditableAspect" init-method="init">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="authenticationService">
            <ref bean="authenticationService" />
        </property>
    </bean>

    <!-- Referenceable -->
    <bean id="referenceableAspect" class="org.alfresco.repo.node.ReferenceableAspect" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
    </bean>
    
    <!-- Temporary Aspect -->
    <bean id="temporaryAspect" class="org.alfresco.repo.node.TemporaryAspect" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
    </bean>

    <!-- Configurable service -->
    <bean id="configurableService" class="org.alfresco.repo.configuration.ConfigurableServiceImpl">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
    </bean>
    
    <!-- Registry service -->
    <bean id="registryService" class="org.alfresco.repo.admin.registry.RegistryServiceImpl" init-method="init">
        <property name="authenticationComponent">
            <ref bean="authenticationComponent" />
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService" />
        </property>
        <property name="searchService">
            <ref bean="SearchService" />
        </property>
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <!-- Root properties -->
        <property name="registryStore">
            <value>system://system</value>
        </property>
        <property name="registryRootPath">
            <value>/sys:system-registry</value>
        </property>
    </bean>

    <!-- A Simple Filesystem like API for the repo implementation.
	     Unfinished, experimental, and probably ephemeral. -->
    <bean id="repoRemoteService" class="org.alfresco.repo.remote.RepoRemoteService">
        <property name="nodeService">
        	<ref bean="dbNodeService"/>
        </property>
        <property name="fileFolderService">
            <ref bean="fileFolderService"/>
        </property>
        <property name="contentService">
            <ref bean="contentService"/>
        </property>
    </bean>	

	<!-- Transactionally wrapped version of above. -->
    <bean id="RepoRemoteService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="proxyInterfaces">
		    <value>org.alfresco.service.cmr.remote.RepoRemote</value>
		</property>    
		<property name="target">
		    <ref bean="repoRemoteService"/>
		</property>
		<property name="transactionManager">
		    <ref bean="transactionManager"/>
		</property>
		<property name="transactionAttributes">
		    <props>
		        <prop key="create*">${server.transaction.mode.default}</prop>
		        <prop key="get*">${server.transaction.mode.readOnly}</prop>
		        <prop key="lookup">${server.transaction.mode.readOnly}</prop>
		        <prop key="read*">${server.transaction.mode.readOnly}</prop>
		        <prop key="remove*">${server.transaction.mode.default}</prop>
		        <prop key="rename">${server.transaction.mode.default}</prop>
		        <prop key="write*">${server.transaction.mode.default}</prop>
		    </props>
		</property>
	</bean>

	<!-- The server side repo remote transport, to be exported via RMI, etc. -->
    <bean id="repoRemoteTransport" class="org.alfresco.repo.remote.RepoRemoteTransportService">
        <property name="authenticationService">
            <ref bean="authenticationService"/>
        </property>
        <property name="repoRemote">
            <ref bean="RepoRemoteService"/>
        </property>
        <property name="idleTimeout">
            <value>30000</value>
        </property>
	</bean>

	<!-- The RMI export of the repo remote transport. -->
    <bean id="repoRemoteTransportRMI" class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="service">
            <ref bean="repoRemoteTransport"/>
        </property>
        <property name="serviceInterface">
            <value>org.alfresco.service.cmr.remote.RepoRemoteTransport</value>
        </property>
        <property name="serviceName">
            <value>repo</value>
        </property>
        <property name="registryPort">
            <value>${avm.remote.port}</value>
        </property>
    </bean>

</beans>
