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

<beans default-lazy-init="true">

   <bean id="org.sakaiproject.metaobj.utils.mvc.impl.beans.AdditionalViewResources.repository"
      class="org.sakaiproject.metaobj.utils.mvc.impl.beans.AdditionalViewResources" init-method="init"
      lazy-init="false">
      <property name="baseNames">
         <list>
            <value>repository-views</value>
         </list>
      </property>
   </bean>

   <bean id="fileArtifactValidator" class="org.sakaiproject.metaobj.repository.control.FileArtifactValidator">
      <property name="fileNameValidator">
         <ref bean="fileValidator"/>
      </property>
   </bean>

   <bean id="nodeMgtController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.NodeMgtController">

            <property name="navigationController">
               <bean class="org.sakaiproject.metaobj.repository.control.NavigationController">
                  <property name="repositoryManager">
                     <ref bean="repositoryManager"/>
                  </property>
                  <property name="authnManager">
                     <ref bean="authManager"/>
                  </property>
                  <property name="idManager">
                     <ref bean="idManager"/>
                  </property>
               </bean>
            </property>
            <property name="authnManager">
               <ref bean="authManager"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
            <property name="fileValidator">
               <ref bean="fileValidator"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.RepositoryFormBean</value>
      </property>
      <property name="formView">
         <value>repository</value>
      </property>
   </bean>

   <bean id="moveNodeController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.MoveNodeController">
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
            <prop key="failure">repositoryForward</prop>
         </props>
      </property>
      <property name="formView">
         <value>moveNode</value>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.NodeFormBean</value>
      </property>
   </bean>

   <bean id="deleteNodeController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.DeleteNodeController">
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
         </bean>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idListCustomEditor"/>
         </list>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
            <prop key="failure">repositoryForward</prop>
         </props>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.DeleteFormBean</value>
      </property>
   </bean>

   <bean id="copyNodeController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.CopyNodeController">
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
            <property name="authnManager">
               <ref bean="authManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
            <prop key="failure">repositoryForward</prop>
         </props>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.NodeFormBean</value>
      </property>
   </bean>

   <bean id="fileUploadController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.FileUploadController">
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authnManager">
               <ref bean="authManager"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
            <property name="worksiteManager">
               <ref bean="org.sakaiproject.metaobj.worksite.mgt.WorksiteManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
         </props>
      </property>
      <property name="commandName">
         <value>file</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.FileArtifactWrapper</value>
      </property>
      <property name="formView">
         <value>fileUpload</value>
      </property>
      <property name="validator">
         <ref bean="fileArtifactValidator"/>
      </property>
   </bean>

   <bean id="editFileArtifactController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.EditFileArtifactController">
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="validator">
         <ref bean="fileArtifactValidator"/>
      </property>
      <property name="commandName">
         <value>bean</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.impl.FileArtifactImpl</value>
      </property>
      <property name="formView">
         <value>editFileArtifact</value>
      </property>
   </bean>

   <bean id="viewFileArtifactController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.ViewFileController">
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">fileArtifactView</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="commandName">
         <value>bean</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.impl.FileArtifactImpl</value>
      </property>
   </bean>

   <bean id="webDavInstructionController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.WebDAVInstructionController">
            <property name="authnManager">
               <ref bean="authManager"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">webDavInstructions</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="commandName">
         <value>bean</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.impl.FileArtifactImpl</value>
      </property>
   </bean>

   <bean id="fileUploadDirPermissionsController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.DirectoryPermissionsController">
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="oldsuccess">fileUploadForward</prop>
            <prop key="success">editFileArtifactForward</prop>
            <prop key="failure">repositoryForward</prop>
         </props>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.NodeFormBean</value>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.security.mgt.ToolPermissionManager.repository"
      class="org.sakaiproject.metaobj.repository.model.impl.RepositoryToolListener">

      <property name="repositoryManager">
         <ref bean="repositoryManager"/>
      </property>
      <property name="idManager">
         <ref bean="idManager"/>
      </property>
      <property name="permissionManager">
         <ref bean="org.sakaiproject.metaobj.security.mgt.PermissionManager"/>
      </property>
      <property name="agentManager">
         <ref bean="agentManager"/>
      </property>
      <property name="permissionEditName">
         <value>repository</value>
      </property>
      <property name="functions">
         <list>
            <value>osp.repository.read</value>
            <value>osp.repository.write</value>
            <value>osp.repository.delete</value>
            <value>osp.repository.move</value>
         </list>
      </property>
      <property name="defaultPermissions">
         <map>
            <entry key="maintain">
               <list>
                  <value>osp.repository.read</value>
                  <value>osp.repository.write</value>
                  <value>osp.repository.delete</value>
                  <value>osp.repository.move</value>
               </list>
            </entry>
            <entry key="access">
               <list>
                  <value>osp.repository.read</value>
               </list>
            </entry>
         </map>
      </property>
   </bean>

   <bean id="viewNodeController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.ViewNodeController">
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="folder">folder</prop>
            <prop key="artifact">artifactRedirect</prop>
         </props>
      </property>
      <property name="commandName">
         <value>node</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.control.NodeFormBean</value>
      </property>
   </bean>

   <bean id="createFolderController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.CreateFolderController">
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <!--             <property name="authzManager"><ref bean="authzManager"/></property>
                        <property name="authnManager"><ref bean="authManager"/></property> -->
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="validator">
         <ref bean="fileArtifactValidator"/>
      </property>
      <property name="commandName">
         <value>bean</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.impl.FolderImpl</value>
      </property>
      <property name="formView">
         <value>createFolder</value>
      </property>
   </bean>

   <bean id="editFolderController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.FormControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.EditFolderController">
            <property name="homeFactory">
               <ref bean="homeFactory"/>
            </property>
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
         </bean>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="success">repositoryRedirect</prop>
         </props>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="validator">
         <ref bean="fileArtifactValidator"/>
      </property>
      <property name="commandName">
         <value>bean</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.impl.FolderImpl</value>
      </property>
      <property name="formView">
         <value>editFolder</value>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.moveFile"
      class="org.sakaiproject.metaobj.repository.mgt.MoveFilePickerFilter">
      <property name="repositoryManager">
         <ref bean="repositoryManager"/>
      </property>
      <property name="idManager">
         <ref bean="idManager"/>
      </property>
      <property name="authzManager">
         <ref bean="authzManager"/>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.templateXslFileFilter"
      class="org.sakaiproject.metaobj.repository.mgt.FileExtensionFilter">
      <property name="mimeTypes">
         <list>
            <bean class="org.sakaiproject.metaobj.shared.model.MimeType">
               <property name="primaryType">
                  <value>text</value>
               </property>
               <property name="subType">
                  <value>xml</value>
               </property>
            </bean>
         </list>
      </property>
      <property name="acceptedExtensions">
         <list>
            <value>xsl</value>
         </list>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.zipFileFilter"
      class="org.sakaiproject.metaobj.repository.mgt.FileExtensionFilter">
      <property name="mimeTypes">
         <list>
            <bean class="org.sakaiproject.metaobj.shared.model.MimeType">
               <property name="primaryType">
                  <value>application</value>
               </property>
               <property name="subType">
                  <value>zip</value>
               </property>
            </bean>
            <bean class="org.sakaiproject.metaobj.shared.model.MimeType">
               <property name="primaryType">
                  <value>application</value>
               </property>
               <property name="subType">
                  <value>x-zip-compressed</value>
               </property>
            </bean>
         </list>
      </property>
      <property name="acceptedExtensions">
         <list>
            <value>zip</value>
         </list>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.templatePropertiesFileFilter"
      class="org.sakaiproject.metaobj.repository.mgt.FileExtensionFilter">
      <property name="mimeTypes">
         <list>
            <bean class="org.sakaiproject.metaobj.shared.model.MimeType">
               <property name="primaryType">
                  <value>text</value>
               </property>
               <property name="subType">
                  <value>xml</value>
               </property>
            </bean>
         </list>
      </property>
      <property name="postProcessor">
         <ref bean="org.sakaiproject.metaobj.repository.PostFilePickerProcessor.documentRootPostProcessor"/>
      </property>
      <property name="acceptedExtensions">
         <list>
            <value>xsd</value>
         </list>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.templateAsscFileFilter"
      class="org.sakaiproject.metaobj.repository.mgt.ArtifactTypeFilter">
      <property name="acceptableType">
         <list>
            <value>fileArtifact</value>
         </list>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.repository.FilePickerFilter.attachToCell"
      class="org.sakaiproject.metaobj.repository.mgt.ArtifactTypeFilter">
      <property name="acceptableType">
         <list>
            <value>fileArtifact</value>
         </list>
      </property>
   </bean>

   <bean id="filePickerController" class="org.sakaiproject.metaobj.utils.mvc.impl.servlet.ViewControllerImpl">
      <property name="controller">
         <bean class="org.sakaiproject.metaobj.repository.control.FilePickerController">
            <property name="repositoryManager">
               <ref bean="repositoryManager"/>
            </property>
            <property name="idManager">
               <ref bean="idManager"/>
            </property>
            <property name="authzManager">
               <ref bean="authzManager"/>
            </property>
            <property name="filterMap">
               <map>
                  <entry key="templateAsscFileFilter">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.templateAsscFileFilter"/>
                  </entry>
                  <entry key="zipFileFilter">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.zipFileFilter"/>
                  </entry>
                  <entry key="moveFilePicker">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.moveFile"/>
                  </entry>
                  <entry key="templateXslFileFilter">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.templateXslFileFilter"/>
                  </entry>
                  <entry key="templatePropertiesFileFilter">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.templatePropertiesFileFilter"/>
                  </entry>
                  <entry key="attachFilePicker">
                     <ref bean="org.sakaiproject.metaobj.repository.FilePickerFilter.attachToCell"/>
                  </entry>
               </map>
            </property>
         </bean>
      </property>
      <property name="customTypedEditors">
         <list>
            <ref bean="idCustomEditor"/>
         </list>
      </property>
      <property name="screenMappings">
         <props>
            <prop key="error">filePickerError</prop>
            <prop key="show">repositoryRedirect</prop>
            <prop key="close">filePickerClose</prop>
            <prop key="setAndClose">filePickerSetAndClose</prop>
            <prop key="blank">blankFilePicker</prop>
         </props>
      </property>
      <property name="commandName">
         <value>filePickerState</value>
      </property>
      <property name="commandClass">
         <value>org.sakaiproject.metaobj.repository.model.FilePickerState</value>
      </property>
   </bean>

   <bean id="org.sakaiproject.metaobj.utils.mvc.impl.beans.AdditionalHandlers.repository"
      class="org.sakaiproject.metaobj.utils.mvc.impl.beans.AdditionalHandlers" init-method="init"
      lazy-init="false">
      <property name="mapper">
         <ref bean="urlMapping"/>
      </property>
      <property name="urlMap">
         <props>
            <prop key="/member/repositoryUpdate.osp">nodeMgtController</prop>
            <prop key="/member/repositoryMove.osp">moveNodeController</prop>
            <prop key="/member/repositoryDelete.osp">deleteNodeController</prop>
            <prop key="/member/fileUpload.osp">fileUploadController</prop>
            <prop key="/member/fileUploadDirPermissions.osp">fileUploadDirPermissionsController</prop>
            <prop key="/member/editFileArtifact.osp">editFileArtifactController</prop>
            <prop key="/member/editFolder.osp">editFolderController</prop>
            <prop key="/member/repositoryCopy.osp">copyNodeController</prop>
            <prop key="/member/filePicker.osp">filePickerController</prop>

            <prop key="/member/createFolder.osp">createFolderController</prop>
            <prop key="/member/repositoryUpdate.osp">nodeMgtController</prop>

            <prop key="/mercury/sakai.repository/mercury">nodeMgtController</prop>   <!--  This is the root folder, default from Mercury dispatcher-->
            <!--
            <prop key="/sakai2-repository/member/repositoryUpdate.osp">nodeMgtController</prop>   --> <!--  This is the root folder, default from Mercury dispatcher-->


            <prop key="/member/webdavInstruction.osp">webDavInstructionController</prop>
            <prop key="/mercury/webdavInstructions/mercury">webDavInstructionController</prop>
         </props>
      </property>
   </bean>

</beans>
