1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.service.impl;
17
18 import org.kuali.ole.gl.service.PreScrubberService;
19 import org.kuali.ole.sys.service.DocumentNumberAwareReportWriterService;
20 import org.kuali.ole.sys.service.impl.ScrubberListingReportWriterTextServiceImpl;
21
22 public class PreScrubberReportWriterTextServiceImpl extends ScrubberListingReportWriterTextServiceImpl implements DocumentNumberAwareReportWriterService {
23 protected boolean enabled;
24 protected PreScrubberService preScrubberService;
25
26 @Override
27 public void destroy() {
28 enabled = true;
29 super.destroy();
30 }
31
32 @Override
33 public void initialize() {
34 if (preScrubberService.deriveChartOfAccountsCodeIfSpaces()) {
35 enabled = true;
36 super.initialize();
37 }
38 else {
39 enabled = false;
40 }
41 }
42
43 @Override
44 public void pageBreak() {
45 if (enabled) {
46 super.pageBreak();
47 }
48 }
49
50 @Override
51 public void writeFormattedMessageLine(String format, Object... args) {
52 if (enabled) {
53 super.writeFormattedMessageLine(format, args);
54 }
55 }
56
57 public void setPreScrubberService(PreScrubberService preScrubberService) {
58 this.preScrubberService = preScrubberService;
59 }
60 }