Enable creating an API using Spring Web #5
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -23,3 +23,5 @@ view/target
|
|||
*.log
|
||||
fitnesse/target/
|
||||
daisy-integration/target/
|
||||
war/target/
|
||||
api/target/
|
||||
|
|
101
GetToken.java
Normal file
101
GetToken.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Authenticator;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GetToken {
|
||||
public static void main(String[] args) throws IOException {
|
||||
URI baseUri = URI.create("http://localhost:59733");
|
||||
String clientId = "get-token";
|
||||
String clientSecret = "get-token-secret";
|
||||
|
||||
System.out.println("Browse to " + baseUri.resolve("authorize?response_type=code&client_id=" + clientId));
|
||||
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.authenticator(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(clientId, clientSecret.toCharArray());
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
HttpServer httpServer = HttpServer.create();
|
||||
httpServer.bind(new InetSocketAddress(59732), 0);
|
||||
|
||||
Thread thread = Thread.currentThread();
|
||||
|
||||
httpServer.createContext("/", exchange -> {
|
||||
exchange.sendResponseHeaders(200, 0);
|
||||
try (OutputStream responseBody = exchange.getResponseBody()) {
|
||||
responseBody.write("All done, close tab".getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
Map<String, List<String>> queryParams = getQueryParams(exchange);
|
||||
String code = queryParams.get("code").get(0);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||
.uri(baseUri.resolve("exchange"))
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.POST(HttpRequest.BodyPublishers.ofString("grant_type=authorization_code&code=" + code))
|
||||
.build();
|
||||
try {
|
||||
HttpResponse<String> response = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||
System.out.println(response.body());
|
||||
|
||||
// Try to copy the access token to the clipboard
|
||||
Matcher matcher = Pattern.compile("access_token\":\"([^\"]+)\"")
|
||||
.matcher(response.body());
|
||||
if (matcher.find()) {
|
||||
StringSelection clipboardData = new StringSelection(matcher.group(1));
|
||||
Toolkit.getDefaultToolkit()
|
||||
.getSystemClipboard()
|
||||
.setContents(clipboardData, clipboardData);
|
||||
try { Thread.sleep(1_000L); } catch (InterruptedException e) { }
|
||||
System.out.println("Access token copied to clipboard (probably)");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
thread.interrupt();
|
||||
}
|
||||
});
|
||||
|
||||
httpServer.start();
|
||||
try {
|
||||
Thread.sleep(Duration.ofMinutes(1L).toMillis());
|
||||
System.out.println("No authorization within one minute, exiting.");
|
||||
System.exit(1);
|
||||
} catch (InterruptedException ignored) {
|
||||
// expected
|
||||
}
|
||||
httpServer.stop(0);
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> getQueryParams(final HttpExchange exchange) {
|
||||
String query = exchange.getRequestURI()
|
||||
.getQuery();
|
||||
return Arrays.stream(query.split("&"))
|
||||
.map(s -> s.split("="))
|
||||
.collect(Collectors.groupingBy(
|
||||
split -> split[0],
|
||||
Collectors.mapping(split -> split[1], Collectors.toList())));
|
||||
}
|
||||
}
|
13
README.md
Normal file
13
README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
## Working with the API
|
||||
The API is protected by OAuth 2 acting as a [resource server](https://www.oauth.com/oauth2-servers/the-resource-server/)
|
||||
verifying tokens using [token introspection](https://datatracker.ietf.org/doc/html/rfc7662).
|
||||
|
||||
When developing it uses a locally running instance of an
|
||||
[authorization server](https://datatracker.ietf.org/doc/html/rfc6749#section-1.1)
|
||||
that is run inside [Docker](https://www.docker.com). It can be started with `docker compose -f docker-compose.yml up`.
|
||||
Since there is no frontend to interact with the authorization server there's a helper script in
|
||||
[GetToken.java](GetToken.java) that can be run directly with `java GetToken.java` to run through the authorization flow
|
||||
and get an access token.
|
||||
|
||||
Once the token has been obtained go to the [Swagger UI](http://localhost:8080/api/swagger) to interact with the API.
|
||||
Click the "Authorize" button in the top right and paste the access token to log in.
|
25
api/pom.xml
Normal file
25
api/pom.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>se.su.dsv.scipro</groupId>
|
||||
<artifactId>SciPro</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>se.su.dsv.scipro</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
29
api/src/main/java/se/su/dsv/scipro/api/ApiController.java
Normal file
29
api/src/main/java/se/su/dsv/scipro/api/ApiController.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
package se.su.dsv.scipro.api;
|
||||
tozh4728 marked this conversation as resolved
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
import se.su.dsv.scipro.system.UserService;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class ApiController {
|
||||
private final UserService userService;
|
||||
|
||||
@Inject
|
||||
niat8586 marked this conversation as resolved
niat8586
commented
Is @Inject needed because the UserService is in the core module? Because normally we don't need to @Inject when doing constructor based injection in Spring Is @Inject needed because the UserService is in the core module?
Because normally we don't need to @Inject when doing constructor based injection in Spring
|
||||
public ApiController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping("/hello-world")
|
||||
public String helloWorld(@RequestParam(value = "username", required = false) String username) {
|
||||
String name = Optional.ofNullable(username)
|
||||
.map(userService::findByUsername)
|
||||
.map(User::getFullName)
|
||||
.orElse("World");
|
||||
return "Hello, " + name + "!";
|
||||
}
|
||||
}
|
28
core/pom.xml
28
core/pom.xml
|
@ -12,14 +12,6 @@
|
|||
<artifactId>core</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject.extensions</groupId>
|
||||
<artifactId>guice-persist</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
|
@ -62,12 +54,9 @@
|
|||
<groupId>org.glassfish.jersey.inject</groupId>
|
||||
<artifactId>jersey-hk2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--Database stuff-->
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>test</scope>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--QueryDSL-->
|
||||
|
@ -87,10 +76,19 @@
|
|||
<groupId>jakarta.persistence</groupId>
|
||||
<artifactId>jakarta.persistence-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Additional stuff-->
|
||||
|
@ -130,8 +128,6 @@
|
|||
<version>4.0.5</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,160 +0,0 @@
|
|||
package modules;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.multibindings.Multibinder;
|
||||
import com.google.inject.multibindings.OptionalBinder;
|
||||
import se.su.dsv.scipro.activityplan.*;
|
||||
import se.su.dsv.scipro.checklist.*;
|
||||
import se.su.dsv.scipro.date.DateService;
|
||||
import se.su.dsv.scipro.date.DateServiceImpl;
|
||||
import se.su.dsv.scipro.events.EventModule;
|
||||
import se.su.dsv.scipro.finalseminar.*;
|
||||
import se.su.dsv.scipro.finalthesis.FinalThesisService;
|
||||
import se.su.dsv.scipro.finalthesis.FinalThesisServiceImpl;
|
||||
import se.su.dsv.scipro.finalthesis.PublishingConsentService;
|
||||
import se.su.dsv.scipro.finalthesis.PublishingConsentUnavailable;
|
||||
import se.su.dsv.scipro.firstmeeting.FirstMeetingService;
|
||||
import se.su.dsv.scipro.firstmeeting.FirstMeetingServiceImpl;
|
||||
import se.su.dsv.scipro.forum.ForumModule;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsService;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsServiceImpl;
|
||||
import se.su.dsv.scipro.group.GroupFacade;
|
||||
import se.su.dsv.scipro.group.GroupFacadeImpl;
|
||||
import se.su.dsv.scipro.group.GroupService;
|
||||
import se.su.dsv.scipro.group.GroupServiceImpl;
|
||||
import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepository;
|
||||
import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepositoryImpl;
|
||||
import se.su.dsv.scipro.integration.activityforum.ActivityThreadRepository;
|
||||
import se.su.dsv.scipro.integration.activityforum.ActivityThreadRepositoryImpl;
|
||||
import se.su.dsv.scipro.mail.MailModule;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodFacade;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriodFacadeImpl;
|
||||
import se.su.dsv.scipro.match.MatchModule;
|
||||
import se.su.dsv.scipro.milestones.service.*;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestoneActivityTemplateServiceImpl;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestonePhaseTemplateServiceImpl;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestoneServiceImpl;
|
||||
import se.su.dsv.scipro.milestones.service.impl.MilestoneStatisticsServiceImpl;
|
||||
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.NoteService;
|
||||
import se.su.dsv.scipro.notes.NoteServiceImpl;
|
||||
import se.su.dsv.scipro.notifications.NotificationModule;
|
||||
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.peer.*;
|
||||
import se.su.dsv.scipro.plagiarism.*;
|
||||
import se.su.dsv.scipro.project.ProjectNoteService;
|
||||
import se.su.dsv.scipro.project.ProjectPeopleStatisticsService;
|
||||
import se.su.dsv.scipro.project.ProjectPeopleStatisticsServiceImpl;
|
||||
import se.su.dsv.scipro.project.ProjectService;
|
||||
import se.su.dsv.scipro.project.ProjectServiceImpl;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerRepository;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerRepositoryImpl;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerService;
|
||||
import se.su.dsv.scipro.projectpartner.ProjectPartnerServiceImpl;
|
||||
import se.su.dsv.scipro.reflection.ReflectionModule;
|
||||
import se.su.dsv.scipro.report.*;
|
||||
import se.su.dsv.scipro.reviewing.ProjectFinalSeminarStatisticsService;
|
||||
import se.su.dsv.scipro.reviewing.ProjectFinalSeminarStatisticsServiceImpl;
|
||||
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.SupervisorService;
|
||||
import se.su.dsv.scipro.springdata.services.UnitService;
|
||||
import se.su.dsv.scipro.springdata.services.UserProfileService;
|
||||
import se.su.dsv.scipro.system.*;
|
||||
import se.su.dsv.scipro.thesislink.ExternalLinkService;
|
||||
import se.su.dsv.scipro.thesislink.ExternalLinkServiceImpl;
|
||||
|
||||
public class CoreModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new RepositoryModule());
|
||||
bind(FooterLinkService.class).to(FooterLinkServiceImpl.class);
|
||||
bind(ActivityThreadRepository.class).to(ActivityThreadRepositoryImpl.class);
|
||||
bind(ActivityFinalSeminarRepository.class).to(ActivityFinalSeminarRepositoryImpl.class);
|
||||
bind(UserService.class).to(UserServiceImpl.class);
|
||||
bind(MergeService.class).to(MergeServiceImpl.class);
|
||||
bind(PasswordService.class).to(PasswordServiceImpl.class);
|
||||
bind(GeneralSystemSettingsService.class).to(GeneralSystemSettingsServiceImpl.class);
|
||||
bind(ProjectTypeService.class).to(ProjectTypeServiceImpl.class);
|
||||
bind(UnitService.class).to(UnitServiceImpl.class);
|
||||
bind(ResearchAreaService.class).to(ResearchAreaServiceImpl.class);
|
||||
bind(DateService.class).to(DateServiceImpl.class);
|
||||
bind(ActivityPlanFacade.class).to(ActivityPlanFacadeImpl.class);
|
||||
bind(ProjectService.class).to(ProjectServiceImpl.class);
|
||||
bind(ProjectFinalSeminarStatisticsService.class).to(ProjectFinalSeminarStatisticsServiceImpl.class);
|
||||
bind(ProjectPeopleStatisticsService.class).to(ProjectPeopleStatisticsServiceImpl.class);
|
||||
bind(DeliveryConfigurationService.class).to(DeliveryConfigurationServiceImpl.class);
|
||||
bind(ReceiverConfigurationService.class).to(ReceiverConfigurationServiceImpl.class);
|
||||
bind(ActivityService.class).to(ActivityServiceImpl.class);
|
||||
bind(ActivityPlanService.class).to(ActivityPlanServiceImpl.class);
|
||||
bind(ActivityPlanTemplateService.class).to(ActivityPlanTemplateServiceImpl.class);
|
||||
bind(ChecklistService.class).to(ChecklistServiceImpl.class);
|
||||
bind(UserProfileService.class).to(UserProfileServiceImpl.class);
|
||||
bind(FinalSeminarService.class).to(FinalSeminarServiceImpl.class);
|
||||
bind(FinalSeminarSettingsService.class).to(FinalSeminarSettingsServiceImpl.class);
|
||||
bind(SupervisorService.class).to(SupervisorServiceImpl.class);
|
||||
bind(DaysService.class).to(DaysServiceImpl.class);
|
||||
bind(NonWorkDayPeriodService.class).to(NonWorkDayPeriodServiceImpl.class);
|
||||
bind(FinalSeminarOppositionService.class).to(FinalSeminarOppositionServiceImpl.class);
|
||||
bind(AuthorRepository.class).to(AuthorRepositoryImpl.class);
|
||||
bind(OppositionReportService.class).to(OppositionReportServiceImpl.class);
|
||||
bind(ApplicationPeriodFacade.class).to(ApplicationPeriodFacadeImpl.class);
|
||||
bind(GroupFacade.class).to(GroupFacadeImpl.class);
|
||||
bind(ExternalLinkService.class).to(ExternalLinkServiceImpl.class);
|
||||
bind(PeerRequestService.class).to(PeerRequestServiceImpl.class);
|
||||
bind(PeerReviewService.class).to(PeerReviewServiceImpl.class);
|
||||
bind(MilestoneActivityTemplateService.class).to(MilestoneActivityTemplateServiceImpl.class);
|
||||
bind(FinalThesisService.class).to(FinalThesisServiceImpl.class);
|
||||
OptionalBinder.newOptionalBinder(binder(), PublishingConsentService.class)
|
||||
.setDefault().to(PublishingConsentUnavailable.class);
|
||||
bind(ChecklistTemplateService.class).to(ChecklistTemplateServiceImpl.class);
|
||||
bind(PeerPortal.class).to(PeerPortalImpl.class);
|
||||
bind(FinalSeminarRespondentService.class).to(FinalSeminarRespondentServiceImpl.class);
|
||||
bind(ProjectPartnerService.class).to(ProjectPartnerServiceImpl.class);
|
||||
bind(GradingReportService.class).to(GradingReportServiceImpl.class);
|
||||
bind(GradeCalculatorService.class).to(GradeCalculatorServiceImpl.class);
|
||||
bind(UserNameService.class).to(UserNameServiceImpl.class);
|
||||
bind(MileStoneService.class).to(MilestoneServiceImpl.class);
|
||||
bind(MilestoneStatisticsService.class).to(MilestoneStatisticsServiceImpl.class);
|
||||
bind(MilestonePhaseTemplateService.class).to(MilestonePhaseTemplateServiceImpl.class);
|
||||
bind(ReportService.class).to(ReportServiceImpl.class);
|
||||
bind(CommentThreadService.class).to(CommentThreadServiceImpl.class);
|
||||
bind(CommentService.class).to(CommentServiceImpl.class);
|
||||
bind(PerformReviewService.class).to(PeerPortalImpl.class);
|
||||
bind(EventService.class).to(EventServiceImpl.class);
|
||||
bind(ChecklistAnswerService.class).to(ChecklistAnswerServiceImpl.class);
|
||||
bind(FinalSeminarUploadController.class).to(FinalSeminarUploadControllerImpl.class);
|
||||
bind(FinalSeminarActiveParticipationService.class).to(FinalSeminarActiveParticipationServiceImpl.class);
|
||||
bind(ExternalResourceService.class).to(ExternalResourceServiceImpl.class);
|
||||
bind(GroupService.class).to(GroupServiceImpl.class);
|
||||
bind(NoteService.class).to(NoteServiceImpl.class);
|
||||
bind(MilestoneActivator.class).asEagerSingleton();
|
||||
bind(ActivateCompletedMilestonesOnNewProjects.class).asEagerSingleton();
|
||||
bind(FirstMeetingService.class).to(FirstMeetingServiceImpl.class);
|
||||
bind(FinalSeminarCreationSubscribers.class).asEagerSingleton();
|
||||
bind(ProjectPartnerRepository.class).to(ProjectPartnerRepositoryImpl.class);
|
||||
bind(ProjectNoteService.class).to(ProjectServiceImpl.class);
|
||||
|
||||
install(new PlagiarismModule());
|
||||
install(new NotificationModule());
|
||||
install(new ProfileModule());
|
||||
install(new EventModule());
|
||||
install(new MatchModule());
|
||||
install(new MailModule());
|
||||
install(new ForumModule());
|
||||
install(new ReflectionModule());
|
||||
|
||||
Multibinder.newSetBinder(binder(), UserImportService.class);
|
||||
bind(UserSearchService.class).to(AggregateUserSearch.class);
|
||||
Multibinder.newSetBinder(binder(), UserSearchProvider.class)
|
||||
.addBinding().to(LocalUserSearch.class);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package modules;
|
||||
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.PrivateModule;
|
||||
import com.google.inject.name.Names;
|
||||
import se.su.dsv.scipro.profiles.CurrentProfile;
|
||||
|
||||
public class ProfileModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
requireBinding(Key.get(String.class, Names.named("profile")));
|
||||
bind(CurrentProfile.class).asEagerSingleton();
|
||||
expose(CurrentProfile.class);
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
package modules;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import se.su.dsv.scipro.checklist.ChecklistCategoryRepo;
|
||||
import se.su.dsv.scipro.checklist.ChecklistCategoryRepoImpl;
|
||||
import se.su.dsv.scipro.checklist.ChecklistQuestionRepo;
|
||||
import se.su.dsv.scipro.checklist.ChecklistQuestionRepoImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarActiveParticipationRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarActiveParticipationRepositoryImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOppositionRepo;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOppositionRepoImpl;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarRepositoryImpl;
|
||||
import se.su.dsv.scipro.milestones.MilestoneActivityTemplateRepository;
|
||||
import se.su.dsv.scipro.milestones.MilestoneActivityTemplateRepositoryImpl;
|
||||
import se.su.dsv.scipro.peer.CommentThreadRepo;
|
||||
import se.su.dsv.scipro.peer.CommentThreadRepoImpl;
|
||||
import se.su.dsv.scipro.peer.PeerRequestRepository;
|
||||
import se.su.dsv.scipro.peer.PeerRequestRepositoryImpl;
|
||||
import se.su.dsv.scipro.peer.PeerReviewRepository;
|
||||
import se.su.dsv.scipro.peer.PeerReviewRepositoryImpl;
|
||||
import se.su.dsv.scipro.project.ProjectRepo;
|
||||
import se.su.dsv.scipro.project.ProjectRepoImpl;
|
||||
import se.su.dsv.scipro.report.GradingReportTemplateRepo;
|
||||
import se.su.dsv.scipro.report.GradingReportTemplateRepoImpl;
|
||||
import se.su.dsv.scipro.report.OppositionReportRepo;
|
||||
import se.su.dsv.scipro.report.OppositionReportRepoImpl;
|
||||
import se.su.dsv.scipro.report.SupervisorGradingReportRepository;
|
||||
import se.su.dsv.scipro.report.SupervisorGradingReportRepositoryImpl;
|
||||
import se.su.dsv.scipro.reviewing.DecisionRepository;
|
||||
import se.su.dsv.scipro.reviewing.DecisionRepositoryImpl;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerTargetRepository;
|
||||
import se.su.dsv.scipro.reviewing.ReviewerTargetRepositoryImpl;
|
||||
import se.su.dsv.scipro.system.FooterAddressRepo;
|
||||
import se.su.dsv.scipro.system.FooterAddressRepoImpl;
|
||||
import se.su.dsv.scipro.system.FooterLinkRepo;
|
||||
import se.su.dsv.scipro.system.FooterLinkRepoImpl;
|
||||
import se.su.dsv.scipro.system.PasswordRepo;
|
||||
import se.su.dsv.scipro.system.PasswordRepoImpl;
|
||||
import se.su.dsv.scipro.system.UserRepo;
|
||||
import se.su.dsv.scipro.system.UserRepoImpl;
|
||||
|
||||
public class RepositoryModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ChecklistQuestionRepo.class).to(ChecklistQuestionRepoImpl.class);
|
||||
bind(FinalSeminarOppositionRepo.class).to(FinalSeminarOppositionRepoImpl.class);
|
||||
bind(FinalSeminarActiveParticipationRepository.class).to(FinalSeminarActiveParticipationRepositoryImpl.class);
|
||||
bind(GradingReportTemplateRepo.class).to(GradingReportTemplateRepoImpl.class);
|
||||
bind(MilestoneActivityTemplateRepository.class).to(MilestoneActivityTemplateRepositoryImpl.class);
|
||||
bind(OppositionReportRepo.class).to(OppositionReportRepoImpl.class);
|
||||
bind(PasswordRepo.class).to(PasswordRepoImpl.class);
|
||||
bind(ProjectRepo.class).to(ProjectRepoImpl.class);
|
||||
bind(UserRepo.class).to(UserRepoImpl.class);
|
||||
bind(PeerReviewRepository.class).to(PeerReviewRepositoryImpl.class);
|
||||
bind(PeerRequestRepository.class).to(PeerRequestRepositoryImpl.class);
|
||||
bind(ChecklistCategoryRepo.class).to(ChecklistCategoryRepoImpl.class);
|
||||
bind(CommentThreadRepo.class).to(CommentThreadRepoImpl.class);
|
||||
bind(FooterLinkRepo.class).to(FooterLinkRepoImpl.class);
|
||||
bind(FooterAddressRepo.class).to(FooterAddressRepoImpl.class);
|
||||
bind(FinalSeminarRepository.class).to(FinalSeminarRepositoryImpl.class);
|
||||
bind(ReviewerTargetRepository.class).to(ReviewerTargetRepositoryImpl.class);
|
||||
bind(DecisionRepository.class).to(DecisionRepositoryImpl.class);
|
||||
bind(SupervisorGradingReportRepository.class).to(SupervisorGradingReportRepositoryImpl.class);
|
||||
}
|
||||
}
|
1012
core/src/main/java/se/su/dsv/scipro/CoreConfig.java
Normal file
1012
core/src/main/java/se/su/dsv/scipro/CoreConfig.java
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.checklist.ChecklistCategory;
|
||||
import se.su.dsv.scipro.match.ApplicationPeriod;
|
||||
import se.su.dsv.scipro.match.Keyword;
|
||||
|
|
285
core/src/main/java/se/su/dsv/scipro/RepositoryConfiguration.java
Normal file
285
core/src/main/java/se/su/dsv/scipro/RepositoryConfiguration.java
Normal file
|
@ -0,0 +1,285 @@
|
|||
package se.su.dsv.scipro;
|
||||
|
||||
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.forum.notifications.ForumNotificationRepositoryImpl;
|
||||
import se.su.dsv.scipro.grading.GradingHistoryEventRepositoryImpl;
|
||||
import se.su.dsv.scipro.grading.NationalSubjectCategoryRepositoryImpl;
|
||||
import se.su.dsv.scipro.grading.PublicationMetadataRepositoryImpl;
|
||||
import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepositoryImpl;
|
||||
import se.su.dsv.scipro.integration.activityforum.ActivityThreadRepositoryImpl;
|
||||
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.notifications.NotificationEventRepositoryImpl;
|
||||
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.report.SupervisorGradingReportRepositoryImpl;
|
||||
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(proxyBeanMethods = false)
|
||||
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 ActivityThreadRepositoryImpl activityThreadRepository(Provider<EntityManager> em) {
|
||||
return new ActivityThreadRepositoryImpl(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 ForumNotificationRepositoryImpl forumNotificationRepository(Provider<EntityManager> em) {
|
||||
return new ForumNotificationRepositoryImpl(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 NationalSubjectCategoryRepositoryImpl nationalSubjectCategoryRepository(Provider<EntityManager> em) {
|
||||
return new NationalSubjectCategoryRepositoryImpl(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 PublicationMetadataRepositoryImpl publicationMetadataRepository(Provider<EntityManager> em) {
|
||||
return new PublicationMetadataRepositoryImpl(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);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NotificationEventRepositoryImpl notificationEventRepository(Provider<EntityManager> em) {
|
||||
return new NotificationEventRepositoryImpl(em);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SupervisorGradingReportRepositoryImpl supervisorGradingReportRepository(Provider<EntityManager> em) {
|
||||
return new SupervisorGradingReportRepositoryImpl(em);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.activityplan;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
|
|
|
@ -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.checklist;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.checklist;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.checklist;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.activityplan.QActivity;
|
||||
import se.su.dsv.scipro.activityplan.QActivityPlan;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.checklist;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package se.su.dsv.scipro.daisyExternal;
|
||||
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.PrivateModule;
|
||||
import com.google.inject.Scopes;
|
||||
import com.google.inject.name.Names;
|
||||
import se.su.dsv.scipro.daisyExternal.http.DaisyAPI;
|
||||
import se.su.dsv.scipro.daisyExternal.http.DaisyAPIImpl;
|
||||
|
||||
public class DaisyExternalModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
requireBinding(Key.get(String.class, Names.named("daisy.api.url")));
|
||||
requireBinding(Key.get(String.class, Names.named("daisy.api.username")));
|
||||
requireBinding(Key.get(String.class, Names.named("daisy.api.password")));
|
||||
|
||||
bind(DaisyAPI.class).to(DaisyAPIImpl.class).in(Scopes.SINGLETON);
|
||||
expose(DaisyAPI.class);
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package se.su.dsv.scipro.events;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.AbstractModule;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class EventModule extends AbstractModule {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EventModule.class);
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(EventBus.class).toInstance(new EventBus((throwable, context) -> LOGGER.error("Could not dispatch event: " + context.getSubscriber() + " to " + context.getSubscriberMethod(), throwable)));
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class FileModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(FileService.class).to(FileServiceImpl.class);
|
||||
bind(ProjectFileService.class).to(ProjectFileServiceImpl.class);
|
||||
bind(ProjectFileRepository.class).to(ProjectFileRepositoryImpl.class);
|
||||
bind(FileReferenceRepository.class).to(FileReferenceRepositoryImpl.class);
|
||||
bind(FileDescriptionRepo.class).to(FileDescriptionRepoImpl.class);
|
||||
|
||||
requireBinding(FileStore.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
interface FileReferenceRepository {
|
||||
public interface FileReferenceRepository {
|
||||
FileReference create(FileReference fileReference);
|
||||
|
||||
void delete(FileReference fileReference);
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.AbstractServiceImpl;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.file;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.finalseminar;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.system.ProjectType;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.finalseminar;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.finalseminar;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.finalseminar;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.AbstractServiceImpl;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.finalseminar;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import se.su.dsv.scipro.file.*;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.finalthesis;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Predicate;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package se.su.dsv.scipro.firstmeeting;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import se.su.dsv.scipro.firstmeeting.FirstMeetingReminderWorker.FirstMeetingReminderWorkerSchedule;
|
||||
|
||||
public class FirstMeetingModule extends AbstractModule {
|
||||
@Override
|
||||
public void configure() {
|
||||
bind(FirstMeetingReminderWorkerSchedule.class).asEagerSingleton();
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.PrivateModule;
|
||||
|
||||
public class ForumModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(AbstractThreadRepository.class).to(AbstractThreadRepositoryImpl.class);
|
||||
bind(ForumPostReadStateRepository.class).to(ForumPostReadStateRepositoryImpl.class);
|
||||
bind(ForumPostRepository.class).to(ForumPostRepositoryImpl.class);
|
||||
bind(ProjectThreadRepository.class).to(ProjectThreadRepositoryImpl.class);
|
||||
bind(GroupThreadRepository.class).to(GroupThreadRepositoryImpl.class);
|
||||
|
||||
expose(ProjectThreadRepository.class);
|
||||
expose(GroupThreadRepository.class);
|
||||
|
||||
bind(ProjectForumService.class).to(ProjectForumServiceImpl.class);
|
||||
bind(GroupForumService.class).to(GroupForumServiceImpl.class);
|
||||
|
||||
expose(ProjectForumService.class);
|
||||
expose(GroupForumService.class);
|
||||
|
||||
bind(BasicForumService.class).to(BasicForumServiceImpl.class);
|
||||
expose(BasicForumService.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.persistence.LockModeType;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPostReadState;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumThread;
|
||||
import se.su.dsv.scipro.forum.dataobjects.GroupThread;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.forum.dataobjects.GroupThread;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileSource;
|
||||
import se.su.dsv.scipro.file.ProjectFileService;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.forum;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ProjectThread;
|
||||
|
|
|
@ -2,7 +2,7 @@ package se.su.dsv.scipro.forum.notifications;
|
|||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.forum.dataobjects.ForumPost;
|
||||
import se.su.dsv.scipro.forum.ForumPostReadEvent;
|
||||
import se.su.dsv.scipro.forum.NewGroupForumReplyEvent;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package se.su.dsv.scipro.forum.notifications;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class ForumNotificationsModule extends AbstractModule {
|
||||
@Override
|
||||
public void configure() {
|
||||
bind(ForumNotificationRepository.class).to(ForumNotificationRepositoryImpl.class);
|
||||
bind(ForumNotifications.class).asEagerSingleton();
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package se.su.dsv.scipro.gdpr;
|
||||
|
||||
import com.google.inject.PrivateModule;
|
||||
|
||||
public class GDPRModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(Reporter.class).to(ZipReporter.class);
|
||||
|
||||
expose(Reporter.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.generalsystemsettings;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.AbstractServiceImpl;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.grading;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package se.su.dsv.scipro.grading;
|
||||
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.PrivateModule;
|
||||
import com.google.inject.name.Names;
|
||||
import se.su.dsv.scipro.report.GradingReportServiceImpl;
|
||||
|
||||
public class GradingModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
requireBinding(Key.get(String.class, Names.named("service.grading.url")));
|
||||
bind(GradingService.class).to(GradingServiceImpl.class);
|
||||
|
||||
expose(GradingService.class);
|
||||
|
||||
bind(PublicationMetadataRepository.class).to(PublicationMetadataRepositoryImpl.class);
|
||||
bind(PublicationMetadataService.class).to(PublicationMetadataServiceImpl.class);
|
||||
expose(PublicationMetadataService.class);
|
||||
|
||||
bind(ExaminerTimelineService.class).to(GradingHistory.class);
|
||||
expose(ExaminerTimelineService.class);
|
||||
bind(GradingHistoryEventRepository.class).to(GradingHistoryEventRepositoryImpl.class);
|
||||
bind(ThesisRejectionHistoryService.class).to(GradingHistory.class);
|
||||
expose(ThesisRejectionHistoryService.class);
|
||||
bind(ThesisApprovedHistoryService.class).to(GradingHistory.class);
|
||||
expose(ThesisApprovedHistoryService.class);
|
||||
bind(ThesisSubmissionHistoryService.class).to(GradingHistory.class);
|
||||
expose(ThesisSubmissionHistoryService.class);
|
||||
|
||||
bind(NationalSubjectCategoryRepository.class).to(NationalSubjectCategoryRepositoryImpl.class);
|
||||
bind(NationalSubjectCategoryService.class).to(NationalSubjectCategoryServiceImpl.class);
|
||||
expose(NationalSubjectCategoryService.class);
|
||||
|
||||
bind(GradingReportTemplateService.class).to(GradingReportServiceImpl.class);
|
||||
expose(GradingReportTemplateService.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.grading;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package se.su.dsv.scipro.grading;
|
|||
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
|
||||
interface PublicationMetadataRepository {
|
||||
public interface PublicationMetadataRepository {
|
||||
void save(PublicationMetadata publicationMetadata);
|
||||
|
||||
PublicationMetadata findByProject(Project project);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.grading;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
@ -8,9 +8,9 @@ import se.su.dsv.scipro.system.AbstractRepository;
|
|||
import jakarta.inject.Inject;
|
||||
import jakarta.inject.Provider;
|
||||
|
||||
class PublicationMetadataRepositoryImpl extends AbstractRepository implements PublicationMetadataRepository {
|
||||
public class PublicationMetadataRepositoryImpl extends AbstractRepository implements PublicationMetadataRepository {
|
||||
@Inject
|
||||
PublicationMetadataRepositoryImpl(Provider<EntityManager> em) {
|
||||
public PublicationMetadataRepositoryImpl(Provider<EntityManager> em) {
|
||||
super(em);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ import se.su.dsv.scipro.system.Language;
|
|||
import jakarta.inject.Inject;
|
||||
import java.util.Objects;
|
||||
|
||||
class PublicationMetadataServiceImpl implements PublicationMetadataService {
|
||||
public class PublicationMetadataServiceImpl implements PublicationMetadataService {
|
||||
private final PublicationMetadataRepository publicationMetadataRepository;
|
||||
|
||||
@Inject
|
||||
PublicationMetadataServiceImpl(PublicationMetadataRepository publicationMetadataRepository) {
|
||||
public PublicationMetadataServiceImpl(PublicationMetadataRepository publicationMetadataRepository) {
|
||||
this.publicationMetadataRepository = publicationMetadataRepository;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package se.su.dsv.scipro.integration.activityfinalseminar;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class ActivityFinalSeminarModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(FinalSeminarActivityHandler.class).asEagerSingleton();
|
||||
bind(ActivityFinalSeminarRepository.class).to(ActivityFinalSeminarRepositoryImpl.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.integration.activityfinalseminar;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminar;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package se.su.dsv.scipro.integration.activityforum;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class ActivityForumModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(PostActivityUploadToForum.class).asEagerSingleton();
|
||||
bind(ActivityThreadRepository.class).to(ActivityThreadRepositoryImpl.class);
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import se.su.dsv.scipro.file.FileDescription;
|
|||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
class PrintingMailer implements Mailer {
|
||||
public class PrintingMailer implements Mailer {
|
||||
@Override
|
||||
public MailResult mail(final String fromName, final String fromEmail, final String[] recipients, final String subject, final String message, final FileDescription attachment) {
|
||||
return new MailResult() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
class AllowAllIdeaCreationJudge implements IdeaCreationJudge {
|
||||
public class AllowAllIdeaCreationJudge implements IdeaCreationJudge {
|
||||
@Override
|
||||
public Decision ruling(Idea idea) {
|
||||
return Decision.allowed();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import se.su.dsv.scipro.system.PageRequest;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Predicate;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.multibindings.OptionalBinder;
|
||||
|
||||
public class MatchModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
OptionalBinder.newOptionalBinder(binder(), IdeaCreationJudge.class)
|
||||
.setDefault().to(AllowAllIdeaCreationJudge.class);
|
||||
bind(ProjectStartNotifier.class).asEagerSingleton();
|
||||
bind(AddActivityPlanOnProjectStart.class).asEagerSingleton();
|
||||
bind(ApplicationPeriodService.class).to(ApplicationPeriodServiceImpl.class);
|
||||
bind(IdeaService.class).to(IdeaServiceImpl.class);
|
||||
bind(FirstMeetingRepository.class).to(FirstMeetingRepositoryImpl.class);
|
||||
bind(KeywordService.class).to(KeywordServiceImpl.class);
|
||||
bind(MatchService.class).to(MatchServiceImpl.class);
|
||||
bind(ProgramService.class).to(ProgramServiceImpl.class);
|
||||
bind(MatchFollowUpService.class).to(MatchFollowUpServiceImpl.class);
|
||||
bind(TargetService.class).to(TargetServiceImpl.class);
|
||||
bind(ApplicationPeriodProjectTypeService.class).to(ApplicationPeriodProjectTypeServiceImpl.class);
|
||||
bind(PreliminaryMatchService.class).to(PreliminaryMatchServiceImpl.class);
|
||||
bind(IdeaRepository.class).to(IdeaRepositoryImpl.class);
|
||||
bind(TargetRepository.class).to(TargetRepositoryImpl.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.match;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import se.su.dsv.scipro.system.PageRequest;
|
||||
import se.su.dsv.scipro.system.Sort;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.milestones;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.milestones.dataobjects.MilestoneActivityTemplate;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.milestones.service.impl;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.Sort;
|
||||
import se.su.dsv.scipro.milestones.dataobjects.MilestonePhaseTemplate;
|
||||
import se.su.dsv.scipro.milestones.dataobjects.QMilestonePhaseTemplate;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package se.su.dsv.scipro.notifications;
|
||||
|
||||
import com.google.inject.ProvisionException;
|
||||
import se.su.dsv.scipro.data.dataobjects.Member;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminar;
|
||||
import se.su.dsv.scipro.group.Group;
|
||||
|
@ -94,7 +93,7 @@ public class NotificationControllerImpl implements NotificationController {
|
|||
try {
|
||||
return currentUserProvider.get().get();
|
||||
}
|
||||
catch (ProvisionException ignored) {
|
||||
catch (RuntimeException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package se.su.dsv.scipro.notifications;
|
||||
|
||||
import com.google.inject.PrivateModule;
|
||||
import se.su.dsv.scipro.notifications.interfaces.NotificationMailFormatter;
|
||||
import se.su.dsv.scipro.notifications.interfaces.impl.NotificationMailFormatterImpl;
|
||||
|
||||
public class NotificationModule extends PrivateModule {
|
||||
|
||||
public static final String NOTIFICATION_RELATIVE_PAGE_URL = "notification";
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(Notifications.class).asEagerSingleton();
|
||||
|
||||
bind(NotificationService.class).to(NotificationServiceImpl.class);
|
||||
expose(NotificationService.class);
|
||||
|
||||
bind(NotificationEventRepository.class).to(NotificationEventRepositoryImpl.class);
|
||||
bind(NotificationEventService.class).to(NotificationEventServiceImpl.class);
|
||||
expose(NotificationEventService.class);
|
||||
|
||||
bind(NotificationMailFormatter.class).to(NotificationMailFormatterImpl.class);
|
||||
expose(NotificationMailFormatter.class);
|
||||
bind(NotificationController.class).to(NotificationControllerImpl.class);
|
||||
expose(NotificationController.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.notifications;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Predicate;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
|
|
|
@ -8,7 +8,6 @@ import se.su.dsv.scipro.finalseminar.FinalSeminar;
|
|||
import se.su.dsv.scipro.finalseminar.FinalSeminarService;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettings;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettingsService;
|
||||
import se.su.dsv.scipro.notifications.NotificationModule;
|
||||
import se.su.dsv.scipro.notifications.dataobject.*;
|
||||
import se.su.dsv.scipro.notifications.interfaces.NotificationMailFormatter;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
|
@ -158,7 +157,7 @@ public class NotificationMailFormatterImpl implements NotificationMailFormatter
|
|||
private String getAbsoluteURL(final Notification notification) {
|
||||
final String baseUrl = systemSettingsService.getGeneralSystemSettingsInstance().getSciproURL();
|
||||
long id = notification.getNotificationEvent().getId();
|
||||
return baseUrl + "/" + NotificationModule.NOTIFICATION_RELATIVE_PAGE_URL + "?id=" + id;
|
||||
return baseUrl + "/" + "notification" + "?id=" + id;
|
||||
}
|
||||
|
||||
String makeProperty(Object... parts) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.notifications.settings.service;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.notifications.dataobject.Notification;
|
||||
import se.su.dsv.scipro.notifications.dataobject.Notification.Type;
|
||||
import se.su.dsv.scipro.notifications.settings.entities.DeliveryConfiguration;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.notifications.settings.service;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.data.dataobjects.Member;
|
||||
import se.su.dsv.scipro.notifications.dataobject.Notification;
|
||||
import se.su.dsv.scipro.notifications.settings.entities.QReceiverConfiguration;
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
package se.su.dsv.scipro.oauth;
|
||||
|
||||
import com.google.inject.PrivateModule;
|
||||
import com.google.inject.Provides;
|
||||
|
||||
import jakarta.inject.Named;
|
||||
|
||||
public class OAuthModule extends PrivateModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(OAuthService.class).to(OAuthServiceImpl.class);
|
||||
|
||||
expose(OAuthService.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
OAuthSettings settings(
|
||||
@Named("oauth.uri") String uri,
|
||||
@Named("oauth.redirectUri") String redirectUri,
|
||||
@Named("oauth.clientId") String clientId,
|
||||
@Named("oauth.clientSecret") String clientSecret)
|
||||
{
|
||||
return new OAuthSettings(uri, redirectUri, clientId, clientSecret);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package se.su.dsv.scipro.oauth;
|
||||
|
||||
record OAuthSettings(String uri, String redirectUri, String clientId, String clientSecret) {
|
||||
public record OAuthSettings(String uri, String redirectUri, String clientId, String clientSecret) {
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.multibindings.Multibinder;
|
||||
import se.su.dsv.scipro.system.Lifecycle;
|
||||
|
||||
public class PeerModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
Multibinder.newSetBinder(binder(), Lifecycle.class)
|
||||
.addBinding().to(PeerWorkerSchedules.class);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
|
@ -152,7 +152,7 @@ public class PeerPortalImpl implements PeerPortal, PerformReviewService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(ignore = {TooShortCommentException.class, MissingAnswerException.class})
|
||||
@Transactional(dontRollbackOn = {TooShortCommentException.class, MissingAnswerException.class})
|
||||
public void submit(PeerReview review, Optional<FileUpload> upload) {
|
||||
review.submit();
|
||||
final Optional<FileReference> fileDescription = storePeerReviewFileUpload(upload);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.peer;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.plagiarism;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileDescription;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package se.su.dsv.scipro.plagiarism;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class PlagiarismModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(PlagiarismControl.class).to(PlagiarismControlImpl.class);
|
||||
bind(PlagiarismRequestRepository.class).to(PlagiarismRequestRepositoryImpl.class);
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package se.su.dsv.scipro.plagiarism.urkund;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Scopes;
|
||||
import se.su.dsv.scipro.sukat.Sukat;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
public class UrkundModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(UrkundService.class).to(UrkundServiceImpl.class);
|
||||
bind(UrkundSubmissionRepository.class).to(UrkundSubmissionRepositoryImpl.class);
|
||||
bind(UrkundApi.class).to(UrkundApiImpl.class).in(Scopes.SINGLETON);
|
||||
bind(UrkundSettingsRepository.class).to(UrkundSettingsRepositoryImpl.class);
|
||||
|
||||
requireBinding(EntityManager.class);
|
||||
requireBinding(Sukat.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
public UrkundSettings urkundSettings(UrkundSettingsRepository urkundSettingsRepository) {
|
||||
return urkundSettingsRepository.getSettings();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.plagiarism.urkund;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileDescription;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package se.su.dsv.scipro.profiles;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.inject.Named;
|
||||
|
||||
public class CurrentProfile {
|
||||
|
||||
private String currentProfileString;
|
||||
|
||||
@Inject
|
||||
public void setCurrentProfileString(@Named("profile") String currentProfileString) {
|
||||
public void setCurrentProfileString(String currentProfileString) {
|
||||
this.currentProfileString = currentProfileString;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.project;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.JpaRepository;
|
||||
import se.su.dsv.scipro.system.QueryDslPredicateExecutor;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.project;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.GenericRepo;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.project;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Predicate;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.projectpartner;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.system.AbstractRepository;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.projectpartner;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.jpa.JPAExpressions;
|
||||
import se.su.dsv.scipro.system.Pageable;
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package se.su.dsv.scipro.reflection;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import se.su.dsv.scipro.finalseminar.AuthorRepository;
|
||||
|
||||
public class ReflectionModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
requireBinding(AuthorRepository.class);
|
||||
|
||||
bind(ReflectionService.class).to(ReflectionServiceImpl.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.reflection;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.finalseminar.AuthorRepository;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarService;
|
||||
import se.su.dsv.scipro.project.Author;
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.report;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOpposition;
|
||||
import se.su.dsv.scipro.grading.GradingBasis;
|
||||
import se.su.dsv.scipro.grading.GradingReportTemplateService;
|
||||
|
@ -133,6 +133,7 @@ public class GradingReportServiceImpl implements GradingReportTemplateService, G
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<SupervisorGradingReport> getSupervisorGradingReports(Project project) {
|
||||
List<SupervisorGradingReport> gradingReports = new ArrayList<>();
|
||||
for (User user : project.getProjectParticipants()) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package se.su.dsv.scipro.report;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import com.querydsl.jpa.JPAExpressions;
|
||||
import com.querydsl.jpa.JPQLQuery;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.grading.GradingReportTemplateUpdate;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.system.GenericRepo;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.report;
|
||||
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarOpposition;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package se.su.dsv.scipro.report;
|
||||
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.file.FileUpload;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package se.su.dsv.scipro.reviewing;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.inject.persist.Transactional;
|
||||
import jakarta.transaction.Transactional;
|
||||
import se.su.dsv.scipro.file.FileReference;
|
||||
import se.su.dsv.scipro.file.FileService;
|
||||
import se.su.dsv.scipro.file.FileUpload;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user
Serves as placeholder, will be cleaned up later.