Skip to content

Commit

Permalink
feat: Introduced dependency injection for controllers
Browse files Browse the repository at this point in the history
Refs: DEV-12343
  • Loading branch information
nirikash committed Dec 27, 2024
1 parent 3acd54d commit 6586a13
Showing 1 changed file with 30 additions and 0 deletions.
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());
}
}

0 comments on commit 6586a13

Please sign in to comment.