-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduced dependency injection for controllers
Refs: DEV-12343
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/main/java/ch/sbb/polarion/extension/pdf_exporter/PdfExporterInternModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package ch.sbb.polarion.extension.pdf_exporter; | ||
|
||
import ch.sbb.polarion.extension.generic.service.PolarionService; | ||
import ch.sbb.polarion.extension.pdf_exporter.converter.HtmlToPdfConverter; | ||
import ch.sbb.polarion.extension.pdf_exporter.converter.PdfConverter; | ||
import ch.sbb.polarion.extension.pdf_exporter.converter.PdfConverterJobsService; | ||
import ch.sbb.polarion.extension.pdf_exporter.converter.PropertiesUtility; | ||
import ch.sbb.polarion.extension.pdf_exporter.service.PdfExporterPolarionService; | ||
import ch.sbb.polarion.extension.pdf_exporter.util.PdfValidationService; | ||
import com.google.inject.AbstractModule; | ||
import com.polarion.platform.core.PlatformContext; | ||
import com.polarion.platform.security.ISecurityService; | ||
|
||
public class PdfExporterInternModule extends AbstractModule { | ||
|
||
@Override | ||
protected void configure() { | ||
PdfExporterPolarionService pdfExporterPolarionService = new PdfExporterPolarionService(); | ||
PdfConverter pdfConverter = new PdfConverter(); | ||
ISecurityService securityService = PlatformContext.getPlatform().lookupService(ISecurityService.class); | ||
|
||
bind(PolarionService.class).toInstance(pdfExporterPolarionService); | ||
bind(PdfConverter.class).toInstance(pdfConverter); | ||
bind(ISecurityService.class).toInstance(securityService); | ||
bind(PdfValidationService.class).toInstance(new PdfValidationService(pdfConverter)); | ||
bind(PdfConverterJobsService.class).toInstance(new PdfConverterJobsService(pdfConverter, securityService)); | ||
bind(PropertiesUtility.class).toInstance(new PropertiesUtility()); | ||
bind(HtmlToPdfConverter.class).toInstance(new HtmlToPdfConverter()); | ||
} | ||
} |