Enable creating an API using Spring Web #5
@ -9,7 +9,7 @@ import jakarta.persistence.EntityManager;
|
||||
public class ChecklistAnswerServiceImpl extends AbstractServiceImpl<ChecklistAnswer, Long> implements ChecklistAnswerService {
|
||||
|
||||
@Inject
|
||||
protected ChecklistAnswerServiceImpl(Provider<EntityManager> em) {
|
||||
public ChecklistAnswerServiceImpl(Provider<EntityManager> em) {
|
||||
super(em, ChecklistAnswer.class, QChecklistAnswer.checklistAnswer);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package se.su.dsv.scipro.file;
|
||||
|
||||
interface FileReferenceRepository {
|
||||
public interface FileReferenceRepository {
|
||||
FileReference create(FileReference fileReference);
|
||||
|
||||
void delete(FileReference fileReference);
|
||||
|
@ -7,10 +7,10 @@ import jakarta.inject.Inject;
|
||||
import jakarta.inject.Provider;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
class FileReferenceRepositoryImpl extends AbstractRepository implements FileReferenceRepository {
|
||||
public class FileReferenceRepositoryImpl extends AbstractRepository implements FileReferenceRepository {
|
||||
|
||||
@Inject
|
||||
FileReferenceRepositoryImpl(final Provider<EntityManager> em) {
|
||||
public FileReferenceRepositoryImpl(final Provider<EntityManager> em) {
|
||||
super(em);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import jakarta.inject.Provider;
|
||||
|
||||
public class FinalSeminarRepositoryImpl extends AbstractRepository implements FinalSeminarRepository {
|
||||
@Inject
|
||||
protected FinalSeminarRepositoryImpl(Provider<EntityManager> em) {
|
||||
public FinalSeminarRepositoryImpl(Provider<EntityManager> em) {
|
||||
super(em);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
public class CommentServiceImpl extends AbstractServiceImpl<Comment, Long> implements CommentService {
|
||||
|
||||
@Inject
|
||||
protected CommentServiceImpl(Provider<EntityManager> em) {
|
||||
public CommentServiceImpl(Provider<EntityManager> em) {
|
||||
super(em, Comment.class, QComment.comment1);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class UrkundApiImpl implements UrkundApi {
|
||||
private final FileService fileService;
|
||||
|
||||
@Inject
|
||||
UrkundApiImpl(final UrkundSettingsRepository urkundSettingsRepository, FileService fileService) {
|
||||
public UrkundApiImpl(final UrkundSettingsRepository urkundSettingsRepository, FileService fileService) {
|
||||
this.urkundSettingsRepository = urkundSettingsRepository;
|
||||
this.fileService = fileService;
|
||||
objectMapper = new ObjectMapper();
|
||||
|
@ -10,7 +10,7 @@ import jakarta.persistence.EntityManager;
|
||||
public class ProjectPeopleStatisticsServiceImpl extends AbstractServiceImpl<Project, Long> implements ProjectPeopleStatisticsService {
|
||||
|
||||
@Inject
|
||||
protected ProjectPeopleStatisticsServiceImpl(Provider<EntityManager> em) {
|
||||
public ProjectPeopleStatisticsServiceImpl(Provider<EntityManager> em) {
|
||||
super(em, Project.class, QProject.project);
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,12 @@ import se.su.dsv.scipro.system.User;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
class ReflectionServiceImpl implements ReflectionService {
|
||||
public class ReflectionServiceImpl implements ReflectionService {
|
||||
private final AuthorRepository authorRepository;
|
||||
private final FinalSeminarService finalSeminarService;
|
||||
|
||||
@Inject
|
||||
ReflectionServiceImpl(AuthorRepository authorRepository, FinalSeminarService finalSeminarService) {
|
||||
public ReflectionServiceImpl(AuthorRepository authorRepository, FinalSeminarService finalSeminarService) {
|
||||
this.authorRepository = authorRepository;
|
||||
this.finalSeminarService = finalSeminarService;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import static com.querydsl.core.types.dsl.Expressions.anyOf;
|
||||
public class ProjectFinalSeminarStatisticsServiceImpl extends AbstractServiceImpl<Project, Long> implements ProjectFinalSeminarStatisticsService {
|
||||
|
||||
@Inject
|
||||
protected ProjectFinalSeminarStatisticsServiceImpl(Provider<EntityManager> em) {
|
||||
public ProjectFinalSeminarStatisticsServiceImpl(Provider<EntityManager> em) {
|
||||
super(em, Project.class, QProject.project);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class ReviewerCapacityServiceImpl implements ReviewerCapacityService, ReviewerAssignmentService {
|
||||
public class ReviewerCapacityServiceImpl implements ReviewerCapacityService, ReviewerAssignmentService {
|
||||
private final ReviewerTargetRepository reviewerTargetRepository;
|
||||
private final DecisionRepository decisionRepository;
|
||||
private final UserService userService;
|
||||
@ -33,7 +33,7 @@ class ReviewerCapacityServiceImpl implements ReviewerCapacityService, ReviewerAs
|
||||
private final EventBus eventBus;
|
||||
|
||||
@Inject
|
||||
ReviewerCapacityServiceImpl(
|
||||
public ReviewerCapacityServiceImpl(
|
||||
ReviewerTargetRepository reviewerTargetRepository,
|
||||
DecisionRepository decisionRepository,
|
||||
UserService userService,
|
||||
|
@ -1,6 +1,6 @@
|
||||
package se.su.dsv.scipro.reviewing;
|
||||
|
||||
interface ReviewerDeadlineSettingsRepository {
|
||||
public interface ReviewerDeadlineSettingsRepository {
|
||||
ReviewerDeadlineSettings findOne(long instanceId);
|
||||
|
||||
ReviewerDeadlineSettings save(ReviewerDeadlineSettings entity);
|
||||
|
@ -6,12 +6,12 @@ import se.su.dsv.scipro.system.AbstractRepository;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.inject.Provider;
|
||||
|
||||
class ReviewerDeadlineSettingsRepositoryImpl
|
||||
public class ReviewerDeadlineSettingsRepositoryImpl
|
||||
extends AbstractRepository
|
||||
implements ReviewerDeadlineSettingsRepository
|
||||
{
|
||||
@Inject
|
||||
ReviewerDeadlineSettingsRepositoryImpl(Provider<EntityManager> em) {
|
||||
public ReviewerDeadlineSettingsRepositoryImpl(Provider<EntityManager> em) {
|
||||
super(em);
|
||||
}
|
||||
|
||||
|
@ -5,32 +5,139 @@ import jakarta.inject.Provider;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
import se.su.dsv.scipro.CurrentUserFromWicketSession;
|
||||
import se.su.dsv.scipro.FileSystemStore;
|
||||
import se.su.dsv.scipro.activityplan.ActivityPlanFacade;
|
||||
import se.su.dsv.scipro.activityplan.ActivityPlanFacadeImpl;
|
||||
import se.su.dsv.scipro.activityplan.ActivityPlanServiceImpl;
|
||||
import se.su.dsv.scipro.activityplan.ActivityPlanTemplateServiceImpl;
|
||||
import se.su.dsv.scipro.activityplan.ActivityServiceImpl;
|
||||
import se.su.dsv.scipro.checklist.ChecklistAnswerServiceImpl;
|
||||
import se.su.dsv.scipro.checklist.ChecklistServiceImpl;
|
||||
import se.su.dsv.scipro.checklist.ChecklistTemplateService;
|
||||
import se.su.dsv.scipro.checklist.ChecklistTemplateServiceImpl;
|
||||
import se.su.dsv.scipro.daisyExternal.http.DaisyAPIImpl;
|
||||
import se.su.dsv.scipro.date.DateServiceImpl;
|
||||
import se.su.dsv.scipro.file.FileDescriptionRepo;
|
||||
import se.su.dsv.scipro.file.FileReferenceRepository;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.file.FileServiceImpl;
|
||||
import se.su.dsv.scipro.file.FileStore;
|
||||
import se.su.dsv.scipro.forum.AbstractThreadRepository;
|
||||
import se.su.dsv.scipro.forum.AbstractThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.file.ProjectFileRepository;
|
||||
import se.su.dsv.scipro.file.ProjectFileService;
|
||||
import se.su.dsv.scipro.file.ProjectFileServiceImpl;
|
||||
import se.su.dsv.scipro.finalseminar.AuthorRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarActiveParticipationRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarActiveParticipationServiceImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOppositionRepo;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOppositionServiceImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarRespondentServiceImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarServiceImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarSettingsServiceImpl;
|
||||
import se.su.dsv.scipro.finalthesis.FinalThesisService;
|
||||
import se.su.dsv.scipro.finalthesis.FinalThesisServiceImpl;
|
||||
import se.su.dsv.scipro.firstmeeting.FirstMeetingServiceImpl;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsService;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsServiceImpl;
|
||||
import se.su.dsv.scipro.grading.GradingHistory;
|
||||
import se.su.dsv.scipro.grading.GradingHistoryEventRepository;
|
||||
import se.su.dsv.scipro.grading.GradingServiceImpl;
|
||||
import se.su.dsv.scipro.grading.ThesisSubmissionHistoryService;
|
||||
import se.su.dsv.scipro.group.GroupServiceImpl;
|
||||
import se.su.dsv.scipro.mail.MailEventService;
|
||||
import se.su.dsv.scipro.mail.MailEventServiceImpl;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodProjectTypeServiceImpl;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodService;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodServiceImpl;
|
||||
import se.su.dsv.scipro.match.FirstMeetingRepository;
|
||||
import se.su.dsv.scipro.match.IdeaRepository;
|
||||
import se.su.dsv.scipro.match.IdeaService;
|
||||
import se.su.dsv.scipro.match.IdeaServiceImpl;
|
||||
import se.su.dsv.scipro.match.KeywordServiceImpl;
|
||||
import se.su.dsv.scipro.match.MatchServiceImpl;
|
||||
import se.su.dsv.scipro.match.PreliminaryMatchServiceImpl;
|
||||
import se.su.dsv.scipro.match.ProgramServiceImpl;
|
||||
import se.su.dsv.scipro.match.TargetRepository;
|
||||
import se.su.dsv.scipro.match.TargetServiceImpl;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestonePhaseTemplateServiceImpl;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestoneServiceImpl;
|
||||
import se.su.dsv.scipro.misc.DaysService;
|
||||
import se.su.dsv.scipro.misc.DaysServiceImpl;
|
||||
import se.su.dsv.scipro.nonworkperiod.NonWorkDayPeriodService;
|
||||
import se.su.dsv.scipro.nonworkperiod.NonWorkDayPeriodServiceImpl;
|
||||
import se.su.dsv.scipro.notes.NoteServiceImpl;
|
||||
import se.su.dsv.scipro.notifications.NotificationController;
|
||||
import se.su.dsv.scipro.notifications.NotificationControllerImpl;
|
||||
import se.su.dsv.scipro.notifications.NotificationServiceImpl;
|
||||
import se.su.dsv.scipro.notifications.interfaces.NotificationMailFormatter;
|
||||
import se.su.dsv.scipro.notifications.interfaces.impl.NotificationMailFormatterImpl;
|
||||
import se.su.dsv.scipro.notifications.settings.service.DeliveryConfigurationService;
|
||||
import se.su.dsv.scipro.notifications.settings.service.DeliveryConfigurationServiceImpl;
|
||||
import se.su.dsv.scipro.notifications.settings.service.ReceiverConfigurationService;
|
||||
import se.su.dsv.scipro.notifications.settings.service.ReceiverConfigurationServiceImpl;
|
||||
import se.su.dsv.scipro.oauth.OAuthSettings;
|
||||
import se.su.dsv.scipro.peer.CommentServiceImpl;
|
||||
import se.su.dsv.scipro.peer.PeerRequestServiceImpl;
|
||||
import se.su.dsv.scipro.peer.PeerReviewRepository;
|
||||
import se.su.dsv.scipro.peer.PeerReviewServiceImpl;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismControl;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismControlImpl;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismRequestRepository;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundApi;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundApiImpl;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundServiceImpl;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSettingsRepository;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSubmissionRepository;
|
||||
import se.su.dsv.scipro.project.ProjectPeopleStatisticsServiceImpl;
|
||||
import se.su.dsv.scipro.project.ProjectRepo;
|
||||
import se.su.dsv.scipro.project.ProjectService;
|
||||
import se.su.dsv.scipro.project.ProjectServiceImpl;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerServiceImpl;
|
||||
import se.su.dsv.scipro.reflection.ReflectionService;
|
||||
import se.su.dsv.scipro.reflection.ReflectionServiceImpl;
|
||||
import se.su.dsv.scipro.report.GradingReportService;
|
||||
import se.su.dsv.scipro.report.GradingReportServiceImpl;
|
||||
import se.su.dsv.scipro.report.GradingReportTemplateRepo;
|
||||
import se.su.dsv.scipro.report.OppositionReportRepo;
|
||||
import se.su.dsv.scipro.report.OppositionReportServiceImpl;
|
||||
import se.su.dsv.scipro.report.ReportServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.DecisionRepository;
|
||||
import se.su.dsv.scipro.reviewing.FinalSeminarApprovalServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.ProjectFinalSeminarStatisticsServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerCapacityServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerDeadlineSettingsRepository;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerDeadlineSettingsService;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerDeadlineSettingsServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerTargetRepository;
|
||||
import se.su.dsv.scipro.reviewing.ReviewingServiceImpl;
|
||||
import se.su.dsv.scipro.reviewing.RoughDraftApprovalService;
|
||||
import se.su.dsv.scipro.reviewing.RoughDraftApprovalServiceImpl;
|
||||
import se.su.dsv.scipro.springdata.serviceimpls.SupervisorServiceImpl;
|
||||
import se.su.dsv.scipro.springdata.serviceimpls.UnitServiceImpl;
|
||||
import se.su.dsv.scipro.springdata.serviceimpls.UserProfileServiceImpl;
|
||||
import se.su.dsv.scipro.springdata.services.UserProfileService;
|
||||
import se.su.dsv.scipro.sukat.LDAP;
|
||||
import se.su.dsv.scipro.sukat.Sukat;
|
||||
import se.su.dsv.scipro.survey.QuestionRepository;
|
||||
import se.su.dsv.scipro.survey.SurveyRepository;
|
||||
import se.su.dsv.scipro.survey.SurveyServiceImpl;
|
||||
import se.su.dsv.scipro.system.CurrentUser;
|
||||
import se.su.dsv.scipro.system.EventServiceImpl;
|
||||
import se.su.dsv.scipro.system.FooterLinkRepo;
|
||||
import se.su.dsv.scipro.system.FooterLinkServiceImpl;
|
||||
import se.su.dsv.scipro.system.ProjectTypeServiceImpl;
|
||||
import se.su.dsv.scipro.system.ResearchAreaServiceImpl;
|
||||
import se.su.dsv.scipro.system.UserNameServiceImpl;
|
||||
import se.su.dsv.scipro.system.UserService;
|
||||
import se.su.dsv.scipro.system.UserServiceImpl;
|
||||
import se.su.dsv.scipro.thesislink.ExternalLinkServiceImpl;
|
||||
import se.su.dsv.scipro.workerthreads.WorkerDataServiceImpl;
|
||||
|
||||
import java.time.Clock;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(
|
||||
basePackages = "se.su.dsv.scipro",
|
||||
includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*Impl$"),
|
||||
excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
|
||||
".*Abstract.*",
|
||||
".*[Dd]aisy.*",
|
||||
".*GradingServiceImpl"
|
||||
}))
|
||||
public class CoreConfig {
|
||||
@Bean
|
||||
public EventBus eventBus() {
|
||||
@ -62,12 +169,6 @@ public class CoreConfig {
|
||||
return new OAuthSettings(uri, redirectUri, clientId, clientSecret);
|
||||
}
|
||||
|
||||
@Bean
|
||||
// weird name, both abstract and impl
|
||||
public AbstractThreadRepository abstractThreadRepository(Provider<EntityManager> em) {
|
||||
return new AbstractThreadRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Sukat sukat() {
|
||||
return new LDAP();
|
||||
@ -86,4 +187,497 @@ public class CoreConfig {
|
||||
public GradingServiceImpl gradingService(@Value("${service.grading.url}") final String url) {
|
||||
return new GradingServiceImpl(url);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarApprovalServiceImpl finalSeminarApprovalService(
|
||||
Provider<EntityManager> em,
|
||||
FileService fileDescriptionService,
|
||||
EventBus eventBus,
|
||||
DaysService daysService,
|
||||
ReviewerDeadlineSettingsService reviewerDeadlineSettingsService)
|
||||
{
|
||||
return new FinalSeminarApprovalServiceImpl(em, fileDescriptionService, eventBus, daysService, reviewerDeadlineSettingsService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RoughDraftApprovalServiceImpl roughDraftApprovalService(
|
||||
Provider<EntityManager> em,
|
||||
FileService fileDescriptionService,
|
||||
EventBus eventBus,
|
||||
DaysService daysService,
|
||||
ReviewerDeadlineSettingsService reviewerDeadlineSettingsService)
|
||||
{
|
||||
return new RoughDraftApprovalServiceImpl(em, eventBus, fileDescriptionService, daysService, reviewerDeadlineSettingsService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ActivityPlanServiceImpl activityPlanService(Provider<EntityManager> em) {
|
||||
return new ActivityPlanServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ActivityPlanTemplateServiceImpl activityPlanTemplateService(Provider<EntityManager> em) {
|
||||
return new ActivityPlanTemplateServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ActivityServiceImpl activityService(Provider<EntityManager> em) {
|
||||
return new ActivityServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ActivityPlanFacadeImpl activityPlanFacade(
|
||||
EventBus eventBus,
|
||||
ProjectFileService projectFileService,
|
||||
ChecklistTemplateService checklistTemplateService,
|
||||
DaysService daysService,
|
||||
FileService fileService
|
||||
)
|
||||
{
|
||||
return new ActivityPlanFacadeImpl(eventBus, projectFileService, checklistTemplateService, daysService,
|
||||
fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ApplicationPeriodProjectTypeServiceImpl applicationPeriodProjectTypeService(Provider<EntityManager> em) {
|
||||
return new ApplicationPeriodProjectTypeServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ApplicationPeriodServiceImpl applicationPeriodService(Provider<EntityManager> em, Clock clock) {
|
||||
return new ApplicationPeriodServiceImpl(em, clock);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChecklistAnswerServiceImpl checklistAnswerService(Provider<EntityManager> em) {
|
||||
return new ChecklistAnswerServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChecklistServiceImpl checklistService(Provider<EntityManager> em) {
|
||||
return new ChecklistServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChecklistTemplateServiceImpl checklistTemplateService(Provider<EntityManager> em) {
|
||||
return new ChecklistTemplateServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommentServiceImpl commentService(Provider<EntityManager> em) {
|
||||
return new CommentServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DateServiceImpl dateService() {
|
||||
return new DateServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DaysServiceImpl daysService(NonWorkDayPeriodService nonWorkDayPeriodService) {
|
||||
return new DaysServiceImpl(nonWorkDayPeriodService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DeliveryConfigurationServiceImpl deliveryConfigurationService(
|
||||
Provider<EntityManager> em,
|
||||
UserProfileService userProfileService)
|
||||
{
|
||||
return new DeliveryConfigurationServiceImpl(em, userProfileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public EventServiceImpl eventService(Provider<EntityManager> em) {
|
||||
return new EventServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ExternalLinkServiceImpl externalLinkService(Provider<EntityManager> em) {
|
||||
return new ExternalLinkServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FileServiceImpl fileService(
|
||||
Provider<EntityManager> em,
|
||||
FileStore fileStore,
|
||||
FileReferenceRepository fileReferenceRepository,
|
||||
FileDescriptionRepo fileDescriptionRepository)
|
||||
{
|
||||
return new FileServiceImpl(em, fileReferenceRepository, fileDescriptionRepository, fileStore);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarActiveParticipationServiceImpl finalSeminarActiveParticipationService(Provider<EntityManager> em) {
|
||||
return new FinalSeminarActiveParticipationServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarOppositionServiceImpl finalSeminarOppositionService(Provider<EntityManager> em) {
|
||||
return new FinalSeminarOppositionServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarRespondentServiceImpl finalSeminarRespondentService(Provider<EntityManager> em) {
|
||||
return new FinalSeminarRespondentServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarServiceImpl finalSeminarService(
|
||||
Provider<EntityManager> em,
|
||||
EventBus eventBus,
|
||||
FileService fileService,
|
||||
AuthorRepository authorRepository,
|
||||
FinalSeminarOppositionRepo finalSeminarOppositionRepository,
|
||||
FinalSeminarActiveParticipationRepository finalSeminarActiveParticipationRepository,
|
||||
FinalSeminarRepository finalSeminarRepository,
|
||||
Clock clock,
|
||||
RoughDraftApprovalService roughDraftApprovalService)
|
||||
{
|
||||
return new FinalSeminarServiceImpl(
|
||||
em,
|
||||
eventBus,
|
||||
authorRepository,
|
||||
fileService,
|
||||
finalSeminarOppositionRepository,
|
||||
finalSeminarActiveParticipationRepository,
|
||||
finalSeminarRepository,
|
||||
clock,
|
||||
roughDraftApprovalService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarSettingsServiceImpl finalSeminarSettingsService(Provider<EntityManager> em) {
|
||||
return new FinalSeminarSettingsServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalThesisServiceImpl finalThesisService(
|
||||
Provider<EntityManager> em,
|
||||
NotificationController notification,
|
||||
ProjectFileService projectFile,
|
||||
FileService fileService,
|
||||
EventBus eventBus,
|
||||
PlagiarismControl plagiarismControl,
|
||||
GradingReportService gradingReportService)
|
||||
{
|
||||
return new FinalThesisServiceImpl(em, notification, projectFile,
|
||||
fileService, eventBus, plagiarismControl, gradingReportService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FirstMeetingServiceImpl firstMeetingService(
|
||||
Provider<EntityManager> em,
|
||||
ActivityPlanFacade activityPlanFacade)
|
||||
{
|
||||
return new FirstMeetingServiceImpl(em, activityPlanFacade);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooterLinkServiceImpl footerLinkService(FooterLinkRepo footerLinkRepository) {
|
||||
return new FooterLinkServiceImpl(footerLinkRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GeneralSystemSettingsServiceImpl generalSystemSettingsService(Provider<EntityManager> em) {
|
||||
return new GeneralSystemSettingsServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GradingReportServiceImpl gradingReportService(
|
||||
Provider<EntityManager> em,
|
||||
EventBus eventBus,
|
||||
ThesisSubmissionHistoryService thesisSubmissionHistoryService,
|
||||
Clock clock)
|
||||
{
|
||||
return new GradingReportServiceImpl(em, eventBus, thesisSubmissionHistoryService, clock);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupServiceImpl groupService(Provider<EntityManager> em) {
|
||||
return new GroupServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public IdeaServiceImpl ideaService(
|
||||
Provider<EntityManager> em,
|
||||
ApplicationPeriodService applicationPeriodService,
|
||||
FirstMeetingRepository firstMeetingRepository,
|
||||
NotificationController notificationController,
|
||||
ProjectService projectService,
|
||||
GeneralSystemSettingsService generalSystemSettingsService,
|
||||
TargetRepository targetRepository,
|
||||
IdeaRepository ideaRepository,
|
||||
Clock clock)
|
||||
{
|
||||
return new IdeaServiceImpl(em, applicationPeriodService, firstMeetingRepository, notificationController,
|
||||
projectService, generalSystemSettingsService, targetRepository, ideaRepository, clock);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public KeywordServiceImpl keywordService(Provider<EntityManager> em) {
|
||||
return new KeywordServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MailEventServiceImpl mailEventService(Provider<EntityManager> em) {
|
||||
return new MailEventServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MatchServiceImpl matchService(Provider<EntityManager> em) {
|
||||
return new MatchServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MilestonePhaseTemplateServiceImpl milestonePhaseTemplateService(Provider<EntityManager> em) {
|
||||
return new MilestonePhaseTemplateServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MilestoneServiceImpl milestoneService(
|
||||
Provider<EntityManager> em,
|
||||
NotificationController notificationController)
|
||||
{
|
||||
return new MilestoneServiceImpl(notificationController, em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NonWorkDayPeriodServiceImpl nonWorkDayPeriodService(Provider<EntityManager> em) {
|
||||
return new NonWorkDayPeriodServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NoteServiceImpl noteService(Provider<EntityManager> em) {
|
||||
return new NoteServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NotificationServiceImpl notificationService(Provider<EntityManager> em) {
|
||||
return new NotificationServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public OppositionReportServiceImpl oppositionReportService(
|
||||
OppositionReportRepo oppositionReportRepository,
|
||||
GradingReportTemplateRepo gradingReportTemplateRepository,
|
||||
FileService fileService,
|
||||
FinalSeminarOppositionRepo finalSeminarOppositionRepository)
|
||||
{
|
||||
return new OppositionReportServiceImpl(oppositionReportRepository, gradingReportTemplateRepository,
|
||||
fileService, finalSeminarOppositionRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PeerRequestServiceImpl peerRequestService(
|
||||
Provider<EntityManager> em,
|
||||
EventBus eventBus,
|
||||
FileService fileService)
|
||||
{
|
||||
return new PeerRequestServiceImpl(em, eventBus, fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PeerReviewServiceImpl peerReviewService(
|
||||
Provider<EntityManager> em,
|
||||
PeerReviewRepository peerReviewRepository)
|
||||
{
|
||||
return new PeerReviewServiceImpl(em, peerReviewRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PlagiarismControlImpl plagiarismControl(
|
||||
FileService fileService,
|
||||
PlagiarismRequestRepository plagiarismRequestRepository,
|
||||
UrkundSubmissionRepository urkundSubmissionRepository)
|
||||
{
|
||||
return new PlagiarismControlImpl(plagiarismRequestRepository, urkundSubmissionRepository, fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PreliminaryMatchServiceImpl preliminaryMatchService(Provider<EntityManager> em, IdeaService ideaService) {
|
||||
return new PreliminaryMatchServiceImpl(em, ideaService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProgramServiceImpl programService(Provider<EntityManager> em) {
|
||||
return new ProgramServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectFileServiceImpl projectFileService(
|
||||
FileService fileService,
|
||||
ProjectFileRepository projectFileRepository)
|
||||
{
|
||||
return new ProjectFileServiceImpl(fileService, projectFileRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectFinalSeminarStatisticsServiceImpl projectFinalSeminarStatisticsService(Provider<EntityManager> em) {
|
||||
return new ProjectFinalSeminarStatisticsServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectPartnerServiceImpl projectPartnerService(Provider<EntityManager> em) {
|
||||
return new ProjectPartnerServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectPeopleStatisticsServiceImpl projectPeopleStatisticsService(Provider<EntityManager> em) {
|
||||
return new ProjectPeopleStatisticsServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectServiceImpl projectService(
|
||||
Provider<EntityManager> em,
|
||||
EventBus eventBus,
|
||||
ProjectRepo projectRepo,
|
||||
Clock clock)
|
||||
{
|
||||
return new ProjectServiceImpl(projectRepo, clock, eventBus, em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectTypeServiceImpl projectTypeService(Provider<EntityManager> em) {
|
||||
return new ProjectTypeServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReflectionServiceImpl reflectionService(
|
||||
AuthorRepository authorRepository,
|
||||
FinalSeminarServiceImpl finalSeminarService)
|
||||
{
|
||||
return new ReflectionServiceImpl(authorRepository, finalSeminarService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReceiverConfigurationServiceImpl receiverConfigurationService(Provider<EntityManager> em) {
|
||||
return new ReceiverConfigurationServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReportServiceImpl reportService(Provider<EntityManager> em, FileService fileService) {
|
||||
return new ReportServiceImpl(em, fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResearchAreaServiceImpl researchAreaService(Provider<EntityManager> em) {
|
||||
return new ResearchAreaServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewingServiceImpl reviewingService(
|
||||
Provider<EntityManager> em,
|
||||
EventBus eventBus,
|
||||
FileService fileService)
|
||||
{
|
||||
return new ReviewingServiceImpl(em, fileService, eventBus);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerCapacityServiceImpl reviewerCapacityService(
|
||||
ReviewerTargetRepository reviewerTargetRepository,
|
||||
DecisionRepository decisionRepository,
|
||||
UserService userService,
|
||||
ProjectService projectService,
|
||||
EventBus eventBus)
|
||||
{
|
||||
return new ReviewerCapacityServiceImpl(reviewerTargetRepository, decisionRepository, userService,
|
||||
projectService, eventBus);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerDeadlineSettingsServiceImpl reviewerDeadlineSettingsService(
|
||||
ReviewerDeadlineSettingsRepository reviewerDeadlineSettingsRepository)
|
||||
{
|
||||
return new ReviewerDeadlineSettingsServiceImpl(reviewerDeadlineSettingsRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SupervisorServiceImpl supervisorService(Provider<EntityManager> em) {
|
||||
return new SupervisorServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SurveyServiceImpl surveyService(
|
||||
SurveyRepository surveyRepository,
|
||||
QuestionRepository questionRepository,
|
||||
FinalThesisService finalThesisService,
|
||||
GeneralSystemSettingsService generalSystemSettingsService,
|
||||
ReflectionService reflectionService)
|
||||
{
|
||||
return new SurveyServiceImpl(surveyRepository, questionRepository, finalThesisService,
|
||||
generalSystemSettingsService, reflectionService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TargetServiceImpl targetService(Provider<EntityManager> em, IdeaService ideaService) {
|
||||
return new TargetServiceImpl(em, ideaService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UnitServiceImpl unitService(Provider<EntityManager> em) {
|
||||
return new UnitServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UrkundApiImpl urkundApi(
|
||||
UrkundSettingsRepository urkundSettingsRepository,
|
||||
FileService fileService)
|
||||
{
|
||||
return new UrkundApiImpl(urkundSettingsRepository, fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UrkundServiceImpl urkundService(
|
||||
UrkundApi urkundApi,
|
||||
UrkundSubmissionRepository urkundSubmissionRepository,
|
||||
Sukat sukat,
|
||||
FileService fileService)
|
||||
{
|
||||
return new UrkundServiceImpl(urkundApi, urkundSubmissionRepository, sukat, fileService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserNameServiceImpl userNameService(Provider<EntityManager> em) {
|
||||
return new UserNameServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserProfileServiceImpl userProfileService(Provider<EntityManager> em) {
|
||||
return new UserProfileServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserServiceImpl userService(Provider<EntityManager> em) {
|
||||
return new UserServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WorkerDataServiceImpl workerDataService(Provider<EntityManager> em) {
|
||||
return new WorkerDataServiceImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NotificationControllerImpl notificationController(
|
||||
NotificationServiceImpl notificationService,
|
||||
NotificationMailFormatter notificationMailFormatter,
|
||||
MailEventService mailEventService,
|
||||
ReceiverConfigurationService receiverConfigurationService,
|
||||
DeliveryConfigurationService deliveryConfigurationService,
|
||||
Provider<CurrentUser> currentUserProvider)
|
||||
{
|
||||
return new NotificationControllerImpl(notificationService,
|
||||
notificationMailFormatter,
|
||||
mailEventService, receiverConfigurationService, deliveryConfigurationService, currentUserProvider);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NotificationMailFormatterImpl notificationMailFormatter() {
|
||||
return new NotificationMailFormatterImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CurrentUserFromWicketSession currentUserFromWicketSession() {
|
||||
return new CurrentUserFromWicketSession();
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter;
|
||||
import se.su.dsv.scipro.SciProApplication;
|
||||
import se.su.dsv.scipro.profiles.CurrentProfile;
|
||||
import se.su.dsv.scipro.system.AggregateUserSearch;
|
||||
import se.su.dsv.scipro.system.Lifecycle;
|
||||
import se.su.dsv.scipro.system.ResearchArea;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
import se.su.dsv.scipro.system.UserImportService;
|
||||
@ -37,7 +38,7 @@ import java.util.Set;
|
||||
|
||||
@SpringBootApplication
|
||||
@EntityScan("se.su.dsv.scipro")
|
||||
@Import({CoreConfig.class, ApiConfig.class, WorkerConfig.class, MailConfig.class})
|
||||
@Import({CoreConfig.class, ApiConfig.class, WorkerConfig.class, MailConfig.class, RepositoryConfiguration.class})
|
||||
public class Main extends SpringBootServletInitializer implements ServletContainerInitializer {
|
||||
@Override
|
||||
public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {
|
||||
@ -127,6 +128,24 @@ public class Main extends SpringBootServletInitializer implements ServletContain
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Exists because Spring refuses to inject a collection of beans if there are no beans of that type.
|
||||
*/
|
||||
@Bean
|
||||
public Lifecycle dummyLifecycle() {
|
||||
return new Lifecycle() {
|
||||
@Override
|
||||
public void start() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
// do nothing
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserSearchService aggregateSearchService(
|
||||
Set<UserSearchProvider> userSearchProviders,
|
||||
|
@ -0,0 +1,249 @@
|
||||
package se.su.dsv.scipro.war;
|
||||
|
||||
import jakarta.inject.Provider;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import se.su.dsv.scipro.checklist.ChecklistCategoryRepoImpl;
|
||||
import se.su.dsv.scipro.checklist.ChecklistQuestionRepoImpl;
|
||||
import se.su.dsv.scipro.file.FileDescriptionRepoImpl;
|
||||
import se.su.dsv.scipro.file.FileReferenceRepositoryImpl;
|
||||
import se.su.dsv.scipro.file.ProjectFileRepositoryImpl;
|
||||
import se.su.dsv.scipro.finalseminar.AuthorRepositoryImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarActiveParticipationRepositoryImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOppositionRepoImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarRepositoryImpl;
|
||||
import se.su.dsv.scipro.forum.AbstractThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.forum.ForumPostReadStateRepositoryImpl;
|
||||
import se.su.dsv.scipro.forum.ForumPostRepositoryImpl;
|
||||
import se.su.dsv.scipro.forum.GroupThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.forum.ProjectThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.grading.GradingHistoryEventRepositoryImpl;
|
||||
import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepositoryImpl;
|
||||
import se.su.dsv.scipro.match.FirstMeetingRepositoryImpl;
|
||||
import se.su.dsv.scipro.match.IdeaRepositoryImpl;
|
||||
import se.su.dsv.scipro.match.TargetRepositoryImpl;
|
||||
import se.su.dsv.scipro.milestones.MilestoneActivityTemplateRepositoryImpl;
|
||||
import se.su.dsv.scipro.peer.CommentThreadRepoImpl;
|
||||
import se.su.dsv.scipro.peer.PeerRequestRepositoryImpl;
|
||||
import se.su.dsv.scipro.peer.PeerReviewRepositoryImpl;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismRequestRepositoryImpl;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSettingsRepositoryImpl;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSubmissionRepositoryImpl;
|
||||
import se.su.dsv.scipro.project.ProjectRepoImpl;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerRepositoryImpl;
|
||||
import se.su.dsv.scipro.report.GradingReportTemplateRepoImpl;
|
||||
import se.su.dsv.scipro.report.OppositionReportRepoImpl;
|
||||
import se.su.dsv.scipro.reviewing.DecisionRepositoryImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerDeadlineSettingsRepositoryImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerTargetRepositoryImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.survey.QuestionRepositoryImpl;
|
||||
import se.su.dsv.scipro.survey.SurveyRepositoryImpl;
|
||||
import se.su.dsv.scipro.system.FooterAddressRepoImpl;
|
||||
import se.su.dsv.scipro.system.FooterLinkRepoImpl;
|
||||
import se.su.dsv.scipro.system.PasswordRepoImpl;
|
||||
import se.su.dsv.scipro.system.UserRepoImpl;
|
||||
|
||||
@Configuration
|
||||
public class RepositoryConfiguration {
|
||||
@Bean
|
||||
public GradingHistoryEventRepositoryImpl gradingHistoryEventRepository(Provider<EntityManager> em) {
|
||||
return new GradingHistoryEventRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbstractThreadRepositoryImpl abstractThreadRepository(Provider<EntityManager> em) {
|
||||
return new AbstractThreadRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ActivityFinalSeminarRepositoryImpl activityFinalSeminarRepository(Provider<EntityManager> em) {
|
||||
return new ActivityFinalSeminarRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthorRepositoryImpl authorRepository(Provider<EntityManager> em) {
|
||||
return new AuthorRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChecklistCategoryRepoImpl checklistCategoryRepo(Provider<EntityManager> em) {
|
||||
return new ChecklistCategoryRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChecklistQuestionRepoImpl checklistQuestionRepo(Provider<EntityManager> em) {
|
||||
return new ChecklistQuestionRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommentThreadRepoImpl commentThreadRepo(Provider<EntityManager> em) {
|
||||
return new CommentThreadRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DecisionRepositoryImpl decisionRepository(Provider<EntityManager> em) {
|
||||
return new DecisionRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FileDescriptionRepoImpl fileDescriptionRepo(Provider<EntityManager> em) {
|
||||
return new FileDescriptionRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarActiveParticipationRepositoryImpl finalSeminarActiveParticipationRepository(Provider<EntityManager> em) {
|
||||
return new FinalSeminarActiveParticipationRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarRepositoryImpl finalSeminarRepository(Provider<EntityManager> em) {
|
||||
return new FinalSeminarRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FileReferenceRepositoryImpl fileReferenceRepository(Provider<EntityManager> em) {
|
||||
return new FileReferenceRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FinalSeminarOppositionRepoImpl finalSeminarOppositionRepo(Provider<EntityManager> em) {
|
||||
return new FinalSeminarOppositionRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FirstMeetingRepositoryImpl firstMeetingRepository(Provider<EntityManager> em) {
|
||||
return new FirstMeetingRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooterAddressRepoImpl footerAddressRepo(Provider<EntityManager> em) {
|
||||
return new FooterAddressRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooterLinkRepoImpl footerLinkRepo(Provider<EntityManager> em) {
|
||||
return new FooterLinkRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ForumPostReadStateRepositoryImpl forumPostReadStateRepository(Provider<EntityManager> em) {
|
||||
return new ForumPostReadStateRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ForumPostRepositoryImpl forumPostRepository(Provider<EntityManager> em) {
|
||||
return new ForumPostRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GradingReportTemplateRepoImpl gradingReportTemplateRepo(Provider<EntityManager> em) {
|
||||
return new GradingReportTemplateRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupThreadRepositoryImpl groupThreadRepository(Provider<EntityManager> em) {
|
||||
return new GroupThreadRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public IdeaRepositoryImpl ideaRepository(Provider<EntityManager> em) {
|
||||
return new IdeaRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MilestoneActivityTemplateRepositoryImpl milestoneActivityTemplateRepository(Provider<EntityManager> em) {
|
||||
return new MilestoneActivityTemplateRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public OppositionReportRepoImpl oppositionReportRepo(Provider<EntityManager> em) {
|
||||
return new OppositionReportRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PasswordRepoImpl passwordRepo(Provider<EntityManager> em) {
|
||||
return new PasswordRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PeerRequestRepositoryImpl peerRequestRepository(Provider<EntityManager> em) {
|
||||
return new PeerRequestRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PeerReviewRepositoryImpl peerReviewRepository(Provider<EntityManager> em) {
|
||||
return new PeerReviewRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectPartnerRepositoryImpl projectPartnerRepository(Provider<EntityManager> em) {
|
||||
return new ProjectPartnerRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectRepoImpl projectRepo(Provider<EntityManager> em) {
|
||||
return new ProjectRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectThreadRepositoryImpl projectThreadRepository(Provider<EntityManager> em) {
|
||||
return new ProjectThreadRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public QuestionRepositoryImpl questionRepository(Provider<EntityManager> em) {
|
||||
return new QuestionRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerDeadlineSettingsRepositoryImpl reviewerDeadlineSettingsRepository(Provider<EntityManager> em) {
|
||||
return new ReviewerDeadlineSettingsRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerTargetRepositoryImpl reviewerTargetRepository(Provider<EntityManager> em) {
|
||||
return new ReviewerTargetRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerThreadRepositoryImpl reviewerThreadRepository(Provider<EntityManager> em) {
|
||||
return new ReviewerThreadRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SurveyRepositoryImpl surveyRepository(Provider<EntityManager> em) {
|
||||
return new SurveyRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TargetRepositoryImpl targetRepository(Provider<EntityManager> em) {
|
||||
return new TargetRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UrkundSettingsRepositoryImpl urkundSettingsRepository(Provider<EntityManager> em) {
|
||||
return new UrkundSettingsRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UrkundSubmissionRepositoryImpl urkundSubmissionRepository(Provider<EntityManager> em) {
|
||||
return new UrkundSubmissionRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserRepoImpl userRepo(Provider<EntityManager> em) {
|
||||
return new UserRepoImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PlagiarismRequestRepositoryImpl plagiarismRequestRepository(Provider<EntityManager> em) {
|
||||
return new PlagiarismRequestRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectFileRepositoryImpl projectFileRepository(Provider<EntityManager> em) {
|
||||
return new ProjectFileRepositoryImpl(em);
|
||||
}
|
||||
}
|
@ -1,44 +1,57 @@
|
||||
package se.su.dsv.scipro.war;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import jakarta.inject.Provider;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarService;
|
||||
import se.su.dsv.scipro.firstmeeting.FirstMeetingService;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsService;
|
||||
import se.su.dsv.scipro.mail.MailEventService;
|
||||
import se.su.dsv.scipro.mail.MailEventWorker;
|
||||
import se.su.dsv.scipro.mail.Mailer;
|
||||
import se.su.dsv.scipro.match.AllowAllIdeaCreationJudge;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodService;
|
||||
import se.su.dsv.scipro.match.IdeaCreationJudge;
|
||||
import se.su.dsv.scipro.match.IdeaService;
|
||||
import se.su.dsv.scipro.misc.DaysService;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismRequestRepository;
|
||||
import se.su.dsv.scipro.plagiarism.PlagiarismSubmitter;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.StatusPollingWorker;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundApi;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundService;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSettings;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSettingsRepository;
|
||||
import se.su.dsv.scipro.plagiarism.urkund.UrkundSubmissionRepository;
|
||||
import se.su.dsv.scipro.project.ProjectService;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerRepository;
|
||||
import se.su.dsv.scipro.projectpartner.RemoveFulfilledPartnerAdsWorker;
|
||||
import se.su.dsv.scipro.reviewing.MyReviewService;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerDecisionReminderWorker;
|
||||
import se.su.dsv.scipro.sukat.Sukat;
|
||||
import se.su.dsv.scipro.workerthreads.GradeFinalSeminarParticipantReminderWorker;
|
||||
import se.su.dsv.scipro.workerthreads.IdeaExportWorker;
|
||||
import se.su.dsv.scipro.workerthreads.ManualMatchRemindWorker;
|
||||
import se.su.dsv.scipro.workerthreads.NotificationCompilationWorker;
|
||||
import se.su.dsv.scipro.workerthreads.Scheduler;
|
||||
import se.su.dsv.scipro.workerthreads.SchedulerImpl;
|
||||
import se.su.dsv.scipro.workerthreads.TemporaryWorkerScheduler;
|
||||
import se.su.dsv.scipro.workerthreads.ThesisUploadDeadlineWorker;
|
||||
import se.su.dsv.scipro.workerthreads.ThesisUploadReminderWorker;
|
||||
import se.su.dsv.scipro.workerthreads.WorkerTransactionManager;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(
|
||||
basePackages = "se.su.dsv.scipro",
|
||||
includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*Worker$"),
|
||||
excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*[Dd]aisy.*")
|
||||
)
|
||||
@Import(WorkerConfig.Workers.class)
|
||||
public class WorkerConfig {
|
||||
private static final int NUMBER_OF_WORKER_THREADS = 4;
|
||||
|
||||
@ -47,6 +60,14 @@ public class WorkerConfig {
|
||||
return Executors.newScheduledThreadPool(NUMBER_OF_WORKER_THREADS);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SchedulerImpl scheduler(
|
||||
ScheduledExecutorService scheduledExecutorService,
|
||||
EntityManagerFactory entityManagerFactory)
|
||||
{
|
||||
return new SchedulerImpl(scheduledExecutorService, entityManagerFactory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TemporaryWorkerScheduler temporaryWorkerScheduler(
|
||||
Scheduler scheduler,
|
||||
@ -91,4 +112,92 @@ public class WorkerConfig {
|
||||
public WorkerTransactionManager workerTransactionManager(PlatformTransactionManager platformTransactionManager) {
|
||||
return new SpringManagedWorkerTransactions(platformTransactionManager);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
public static class Workers {
|
||||
@Bean
|
||||
public MailEventWorker mailEventWorker(
|
||||
MailEventService mailEventService,
|
||||
GeneralSystemSettingsService generalSystemSettingsService,
|
||||
Mailer mailer)
|
||||
{
|
||||
return new MailEventWorker(mailEventService, generalSystemSettingsService, mailer);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NotificationCompilationWorker notificationCompilationWorker() {
|
||||
return new NotificationCompilationWorker();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public IdeaExportWorker ideaExportWorker(
|
||||
IdeaService ideaService,
|
||||
MailEventService mailEventService,
|
||||
ProjectService projectService,
|
||||
IdeaCreationJudge ideaCreationJudge,
|
||||
EventBus eventBus,
|
||||
FirstMeetingService firstMeetingService)
|
||||
{
|
||||
return new IdeaExportWorker(ideaService, mailEventService, projectService, ideaCreationJudge, eventBus,
|
||||
firstMeetingService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ThesisUploadReminderWorker thesisUploadReminderWorker() {
|
||||
return new ThesisUploadReminderWorker();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ThesisUploadDeadlineWorker thesisUploadDeadlineWorker() {
|
||||
return new ThesisUploadDeadlineWorker();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ManualMatchRemindWorker manualMatchRemindWorker(
|
||||
ApplicationPeriodService applicationPeriodService,
|
||||
MailEventService mailEventService,
|
||||
GeneralSystemSettingsService generalSystemSettingsService,
|
||||
IdeaService ideaService,
|
||||
Clock clock)
|
||||
{
|
||||
return new ManualMatchRemindWorker(applicationPeriodService, mailEventService, generalSystemSettingsService,
|
||||
ideaService, clock);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ReviewerDecisionReminderWorker reviewerDecisionReminderWorker(
|
||||
MyReviewService myReviewService,
|
||||
DaysService daysService,
|
||||
MailEventService mailEventService)
|
||||
{
|
||||
return new ReviewerDecisionReminderWorker(myReviewService, daysService, mailEventService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public StatusPollingWorker statusPollingWorker(
|
||||
UrkundSubmissionRepository urkundSubmissionRepository,
|
||||
UrkundApi urkundApi,
|
||||
Provider<UrkundSettings> urkundSettingsProvider,
|
||||
Sukat sukat)
|
||||
{
|
||||
return new StatusPollingWorker(urkundSubmissionRepository, urkundApi, urkundSettingsProvider, sukat);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RemoveFulfilledPartnerAdsWorker removeFulfilledPartnerAdsWorker(
|
||||
IdeaService ideaService,
|
||||
ProjectPartnerRepository projectPartnerRepository)
|
||||
{
|
||||
return new RemoveFulfilledPartnerAdsWorker(ideaService, projectPartnerRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GradeFinalSeminarParticipantReminderWorker gradeFinalSeminarParticipantReminderWorker(
|
||||
MailEventService mailEventService,
|
||||
GeneralSystemSettingsService generalSystemSettingsService,
|
||||
FinalSeminarService finalSeminarService)
|
||||
{
|
||||
return new GradeFinalSeminarParticipantReminderWorker(finalSeminarService, mailEventService, generalSystemSettingsService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user