cleaned up as much as is seemingly possible. now one seemingly only needs to specify test beans in testapplicationcontext manually if there is more than one option
This commit is contained in:
parent
1c85d337d8
commit
1cea8e5745
src/main
java/se/su/dsv/scipro
resources
@ -50,7 +50,7 @@ import edu.emory.mathcs.backport.java.util.Collections;
|
||||
@Service
|
||||
public class ProjectScheduleFacade {
|
||||
// @Qualifier("projectDao")
|
||||
@Autowired
|
||||
@Autowired
|
||||
private ProjectDao projectDao;
|
||||
// @Qualifier("projectScheduleEventDao")
|
||||
@Autowired
|
||||
|
@ -16,24 +16,18 @@
|
||||
*/
|
||||
package se.su.dsv.scipro.repository.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.jcr.Repository;
|
||||
import javax.jcr.RepositoryException;
|
||||
import javax.jcr.Session;
|
||||
|
||||
import org.apache.jackrabbit.commons.cnd.CndImporter;
|
||||
import org.apache.jackrabbit.commons.cnd.ParseException;
|
||||
import org.apache.jackrabbit.core.RepositoryImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import se.su.dsv.scipro.repository.ContentProperties;
|
||||
|
||||
import javax.jcr.Repository;
|
||||
import javax.jcr.RepositoryException;
|
||||
import javax.jcr.Session;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* http://www.xaloon.org
|
||||
*
|
||||
@ -44,7 +38,7 @@ import se.su.dsv.scipro.repository.ContentProperties;
|
||||
public class RepositoryManager implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
@Autowired
|
||||
private ContentProperties contentProperties;
|
||||
|
||||
private transient Repository repository;
|
||||
|
@ -1,31 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
|
||||
default-autowire="byType">
|
||||
|
||||
<!-- Sets up spring autowire configuration based on annotations -->
|
||||
<context:annotation-config />
|
||||
<context:component-scan base-package="se.su.dsv.scipro" />
|
||||
|
||||
<!-- STORAGE REPOSITORY CONFIG -->
|
||||
<bean id="contentProperties" class="se.su.dsv.scipro.repository.ContentProperties">
|
||||
<property name="jcrRepository" value="/jackrabbit"/>
|
||||
<property name="jcrUsername" value="username"/>
|
||||
<property name="jcrPassword" value="password"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<!--Not sure why these beans are here and commented out-->
|
||||
<!-- <bean id="repositoryManager" class="se.su.dsv.scipro.repository.RepositoryManager"></bean>-->
|
||||
|
||||
<!-- <bean id="fileRepository" class="se.su.dsv.scipro.repository.FileRepositoryImpl"></bean>-->
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
|
@ -18,17 +18,7 @@
|
||||
<context:annotation-config/>
|
||||
<context:component-scan base-package="se.su.dsv.scipro"/>
|
||||
|
||||
|
||||
<!--<bean id="propertyPlaceholderConfigurer"-->
|
||||
<!--class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">-->
|
||||
<!--<property name="locations">-->
|
||||
<!--<list>-->
|
||||
<!--<value>classpath:application.properties</value>-->
|
||||
<!--</list>-->
|
||||
<!--</property>-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
<!--entityManagerFactory-->
|
||||
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="persistenceUnitName" value="testPersistenceUnit"/>
|
||||
@ -42,6 +32,7 @@
|
||||
<meta key="class" value="se.su.dsv.scipro.match.dataobject.KeyWordable"/>
|
||||
</bean>
|
||||
|
||||
<!--Data source for tests is not the usual DB, but in-memory-->
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="url" value="jdbc:hsqldb:mem:test"/>
|
||||
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
|
||||
@ -57,14 +48,10 @@
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory"/>
|
||||
</bean>
|
||||
|
||||
<!-- STORAGE REPOSITORY CONFIG -->
|
||||
<bean id="contentProperties" class="se.su.dsv.scipro.repository.ContentProperties">
|
||||
<property name="jcrRepository" value="/jackrabbit"/>
|
||||
<property name="jcrUsername" value="username"/>
|
||||
<property name="jcrPassword" value="password"/>
|
||||
</bean>
|
||||
|
||||
<!--Jackrabbit stuff from repositoryContext.xml file-->
|
||||
<import resource="META-INF/repositoryContext.xml"/>
|
||||
|
||||
<!--These beans are seemingly not needed-->
|
||||
<!--<bean id="matchingStrategy" class="se.su.dsv.scipro.match.MatchAllDummyMatchingAlgorithm">-->
|
||||
<!--</bean>-->
|
||||
|
||||
@ -74,230 +61,11 @@
|
||||
<!--<bean id="matchingStrategy" class="se.su.dsv.scipro.match.MatchAllDummyMatchingAlgorithm">-->
|
||||
<!--</bean>-->
|
||||
|
||||
<bean id="matchingAlgorithm" class="se.su.dsv.scipro.match.MatchAllDummyMatchingAlgorithm">
|
||||
</bean>
|
||||
|
||||
<!--private MatchingAlgorithm matchingAlgorithm;-->
|
||||
|
||||
<!--@SpringBean(name="GreedyMatchingAlgorithm")-->
|
||||
<!--@Autowired-->
|
||||
<!--private MatchingAlgorithm matchingAlgorithm;-->
|
||||
|
||||
<!--<bean id="notificationController" class="se.su.dsv.scipro.data.controllers.impl.NotificationControllerImpl">-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
<!--<!– Load data initializer for default table-data –>-->
|
||||
<!--<bean class="se.su.dsv.scipro.DataInitialiser" init-method="dataInit"/>-->
|
||||
<!--<!– Importer used for remote importing work, use "ExternalImporterDefaultImpl" if you have no remote-import implementation capable of satisfying "ExternalImporter" interface. –>-->
|
||||
<!--<bean id="externalImporter" class="se.su.dsv.scipro.io.impl.ExternalImporterDaisyImpl"/>-->
|
||||
<!--<!– Defines global settings for the application –>-->
|
||||
<!--<bean id="applicationSettings" class="se.su.dsv.scipro.ApplicationSettings">-->
|
||||
<!--<property name="remoteLookupUrl" value="https://api.dsv.su.se/rest"/>-->
|
||||
<!--<property name="remoteLookupUser" value="thesis"/>-->
|
||||
<!--<property name="remoteLookupPassword" value="dqyhIM8LU5LQ53T3aJNz4SVXeTQ95dLGkN7JlLOv7X7jeTR2NR"/>-->
|
||||
<!--<!– This property points to the location of the remote system used for json requests –>-->
|
||||
<!--<!– External auth support (via J2EE standard mechanism REMOTE_USER), if true: other authentication mechanics will be bypassed.–>-->
|
||||
<!--<property name="acceptExternalAuthentication" value="true"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
<!--<bean id="projectScheduleDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectScheduleDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="applicationPeriodFacade" class="se.su.dsv.scipro.match.facade.ApplicationPeriodFacade">-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="userDao" class="se.su.dsv.scipro.data.dao.jpa.UserDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="userNameDao" class="se.su.dsv.scipro.data.dao.jpa.UserNameDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectScheduleEventDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectScheduleEventDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="scheduleTemplateDao" class="se.su.dsv.scipro.data.dao.jpa.ScheduleTemplateDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="checklistTemplateDao" class="se.su.dsv.scipro.data.dao.jpa.CheckListTemplateDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="roleDao" class="se.su.dsv.scipro.data.dao.jpa.RoleDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectClassDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectClassDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="checkListDao" class="se.su.dsv.scipro.data.dao.jpa.CheckListDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="fileDescriptionDao" class="se.su.dsv.scipro.data.dao.jpa.FileDescriptionDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
|
||||
<!--<bean id="projectScheduleFacade" class="se.su.dsv.scipro.activityplan.facade.ProjectScheduleFacade">-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectIdeaDao" class="se.su.dsv.scipro.match.dao.jpa.ProjectIdeaDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="applicationPeriodDao" class="se.su.dsv.scipro.match.dao.jpa.ApplicationPeriodDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="matchDao" class="se.su.dsv.scipro.match.dao.jpa.MatchDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="authorDao" class="se.su.dsv.scipro.match.dao.jpa.AuthorDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="supervisorDao" class="se.su.dsv.scipro.match.dao.jpa.SupervisorDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="keywordDao" class="se.su.dsv.scipro.match.dao.jpa.KeywordDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="keywordTypeDao" class="se.su.dsv.scipro.match.dao.jpa.KeywordTypeDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="languageDao" class="se.su.dsv.scipro.data.dao.jpa.LanguageDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="checkListQuestionDao" class="se.su.dsv.scipro.data.dao.jpa.CheckListQuestionDaoJPAImp">-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
|
||||
<!--<bean id="webNotificationDao" class="se.su.dsv.scipro.data.dao.jpa.WebNotificationDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="generalSystemSettingsDao" class="se.su.dsv.scipro.data.dao.jpa.GeneralSystemSettingsDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="mailEventDao" class="se.su.dsv.scipro.data.dao.jpa.MailEventDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="exemptionDao" class="se.su.dsv.scipro.match.dao.jpa.ExemptionDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="userSettingsDao" class="se.su.dsv.scipro.data.dao.jpa.UserSettingsDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="peerRequestDao" class="se.su.dsv.scipro.peer.data.dao.jpa.PeerRequestDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
<!--<bean id="peerReviewDao" class="se.su.dsv.scipro.peer.data.dao.jpa.PeerReviewDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="boardMessageDao" class="se.su.dsv.scipro.data.dao.jpa.BoardMessageDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="messageBoardDao" class="se.su.dsv.scipro.data.dao.jpa.MessageBoardDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="categoryDao" class="se.su.dsv.scipro.data.dao.jpa.CategoryDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="checkListCategoryDao" class="se.su.dsv.scipro.data.dao.jpa.ChecklistCategoryDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="seminarDao" class="se.su.dsv.scipro.data.dao.jpa.FinalSeminarDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="finalSeminarOppositionDao" class="se.su.dsv.scipro.data.dao.jpa.FinalSeminarOppositionDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="checkPlagiarismEventDao" class="se.su.dsv.scipro.data.dao.jpa.CheckPlagiarismEventDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
<!--<bean id="projectEventTemplateDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectEventTemplateDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="commentDao" class="se.su.dsv.scipro.data.dao.jpa.CommentDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
<!--<bean id="commentThreadDao" class="se.su.dsv.scipro.data.dao.jpa.CommentThreadDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="activeListenerDao" class="se.su.dsv.scipro.data.dao.jpa.FinalSeminarActiveParticipationDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="reviewRatingDao" class="se.su.dsv.scipro.peer.data.dao.jpa.ReviewRatingDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectFollowerDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectFollowerDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="privateMessageDao" class="se.su.dsv.scipro.data.dao.jpa.PrivateMessageDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="projectPartnerDao" class="se.su.dsv.scipro.data.dao.jpa.ProjectPartnerDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="ratableDao" class="se.su.dsv.scipro.data.dao.jpa.RatableDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="resourceDao" class="se.su.dsv.scipro.data.dao.jpa.ResourceDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="ratingDao" class="se.su.dsv.scipro.data.dao.jpa.RatingDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="recipientDao" class="se.su.dsv.scipro.data.dao.jpa.RecipientDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="tagDao" class="se.su.dsv.scipro.data.dao.jpa.TagDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="stringResourceDao" class="se.su.dsv.scipro.data.dao.jpa.StringResourceDaoJPAImp">-->
|
||||
<!--<property name="entityManagerFactory" ref="entityManagerFactory"/>-->
|
||||
<!--</bean>-->
|
||||
<!--But this one needs to be specified since there is more than one option-->
|
||||
<bean id="matchingAlgorithm" class="se.su.dsv.scipro.match.MatchAllDummyMatchingAlgorithm">
|
||||
</bean>
|
||||
|
||||
</beans>
|
Loading…
x
Reference in New Issue
Block a user