1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.document.datadictionary;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.ole.sys.document.web.renderers.GroupTotalRenderer;
20 import org.kuali.ole.sys.document.web.renderers.Renderer;
21 import org.kuali.rice.krad.datadictionary.exception.AttributeValidationException;
22
23
24
25
26
27 public class AccountingLineGroupTotalDefinition extends TotalDefinition{
28 private String totalProperty;
29 private String representedProperty;
30 private boolean nestedProperty;
31 private String containingPropertyName;
32 private String totalLabelProperty = "accounting.line.group.total.label";
33
34
35
36
37
38 public String getTotalProperty() {
39 return totalProperty;
40 }
41
42
43
44
45
46 public void setTotalProperty(String totalProperty) {
47 this.totalProperty = totalProperty;
48 }
49
50
51
52
53
54 public String getTotalLabelProperty() {
55 return totalLabelProperty;
56 }
57
58
59
60
61
62 public void setTotalLabelProperty(String totalLabelProperty) {
63 this.totalLabelProperty = totalLabelProperty;
64 }
65
66
67
68
69
70 @Override
71 public Renderer getTotalRenderer() {
72 GroupTotalRenderer renderer = new GroupTotalRenderer();
73
74 renderer.setTotalLabelProperty(totalLabelProperty);
75 renderer.setRepresentedCellPropertyName(representedProperty);
76
77 final String actualTotalProperty = this.getActualPropertyName(containingPropertyName, totalProperty);
78 renderer.setTotalProperty(actualTotalProperty);
79
80 return renderer;
81 }
82
83
84
85
86
87 public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
88 if (StringUtils.isBlank(totalProperty)) {
89 throw new AttributeValidationException("Please specify a totalProperty for the AccountingLineGroupTotalRenderer");
90 }
91 }
92
93
94
95
96
97 public String getRepresentedProperty() {
98 return representedProperty;
99 }
100
101
102
103
104
105 public void setRepresentedProperty(String representedProperty) {
106 this.representedProperty = representedProperty;
107 }
108
109
110
111
112 public boolean isNestedProperty() {
113 return nestedProperty;
114 }
115
116
117
118
119
120 public void setNestedProperty(boolean nestedProperty) {
121 this.nestedProperty = nestedProperty;
122 }
123
124
125
126
127 public void setContainingPropertyName(String containingPropertyName) {
128 this.containingPropertyName = containingPropertyName;
129 }
130 }