| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.krad.datadictionary; |
| 17 | |
|
| 18 | |
import org.apache.commons.lang.StringUtils; |
| 19 | |
import org.kuali.rice.krad.bo.Exporter; |
| 20 | |
import org.kuali.rice.krad.datadictionary.InactivationBlockingDefinition; |
| 21 | |
import org.kuali.rice.krad.datadictionary.exception.AttributeValidationException; |
| 22 | |
import org.kuali.rice.krad.datadictionary.validation.capability.MustOccurConstrainable; |
| 23 | |
import org.kuali.rice.krad.datadictionary.validation.constraint.MustOccurConstraint; |
| 24 | |
|
| 25 | |
import java.util.List; |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | 0 | public class DataObjectEntry extends DataDictionaryEntryBase implements MustOccurConstrainable { |
| 34 | |
|
| 35 | |
protected String name; |
| 36 | |
protected Class<?> dataObjectClass; |
| 37 | |
|
| 38 | |
protected String titleAttribute; |
| 39 | |
protected String objectLabel; |
| 40 | |
protected String objectDescription; |
| 41 | |
|
| 42 | |
protected List<String> primaryKeys; |
| 43 | |
protected Class<? extends Exporter> exporterClass; |
| 44 | |
|
| 45 | |
protected List<MustOccurConstraint> mustOccurConstraints; |
| 46 | |
|
| 47 | |
protected List<String> groupByAttributesForEffectiveDating; |
| 48 | |
|
| 49 | |
protected HelpDefinition helpDefinition; |
| 50 | |
|
| 51 | |
|
| 52 | 0 | protected boolean boNotesEnabled = false; |
| 53 | |
|
| 54 | |
protected List<InactivationBlockingDefinition> inactivationBlockingDefinitions; |
| 55 | |
|
| 56 | |
@Override |
| 57 | |
public void completeValidation() { |
| 58 | |
|
| 59 | 0 | if (StringUtils.isBlank(getObjectLabel())) { |
| 60 | 0 | throw new AttributeValidationException("Object label cannot be blank for class " + dataObjectClass.getName()); |
| 61 | |
} |
| 62 | |
|
| 63 | 0 | super.completeValidation(); |
| 64 | 0 | } |
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
@Override |
| 70 | |
public String getJstlKey() { |
| 71 | 0 | if (dataObjectClass == null) { |
| 72 | 0 | throw new IllegalStateException("cannot generate JSTL key: dataObjectClass is null"); |
| 73 | |
} |
| 74 | |
|
| 75 | 0 | return (dataObjectClass != null) ? dataObjectClass.getSimpleName() : dataObjectClass.getSimpleName(); |
| 76 | |
} |
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
@Override |
| 82 | |
public String getFullClassName() { |
| 83 | 0 | return dataObjectClass.getName(); |
| 84 | |
} |
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
@Override |
| 90 | |
public Class<?> getEntryClass() { |
| 91 | 0 | return dataObjectClass; |
| 92 | |
} |
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
public Class<?> getDataObjectClass() { |
| 98 | 0 | return this.dataObjectClass; |
| 99 | |
} |
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
public void setDataObjectClass(Class<?> dataObjectClass) { |
| 105 | 0 | this.dataObjectClass = dataObjectClass; |
| 106 | 0 | } |
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
public String getName() { |
| 112 | 0 | return this.name; |
| 113 | |
} |
| 114 | |
|
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
public void setName(String name) { |
| 119 | 0 | this.name = name; |
| 120 | 0 | } |
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
public String getObjectLabel() { |
| 126 | 0 | return objectLabel; |
| 127 | |
} |
| 128 | |
|
| 129 | |
|
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
public void setObjectLabel(String objectLabel) { |
| 136 | 0 | this.objectLabel = objectLabel; |
| 137 | 0 | } |
| 138 | |
|
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
public String getObjectDescription() { |
| 143 | 0 | return objectDescription; |
| 144 | |
} |
| 145 | |
|
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
|
| 152 | |
public void setObjectDescription(String objectDescription) { |
| 153 | 0 | this.objectDescription = objectDescription; |
| 154 | 0 | } |
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
|
| 160 | |
|
| 161 | |
public HelpDefinition getHelpDefinition() { |
| 162 | 0 | return helpDefinition; |
| 163 | |
} |
| 164 | |
|
| 165 | |
|
| 166 | |
|
| 167 | |
|
| 168 | |
|
| 169 | |
|
| 170 | |
|
| 171 | |
|
| 172 | |
|
| 173 | |
|
| 174 | |
|
| 175 | |
|
| 176 | |
|
| 177 | |
public void setHelpDefinition(HelpDefinition helpDefinition) { |
| 178 | 0 | this.helpDefinition = helpDefinition; |
| 179 | 0 | } |
| 180 | |
|
| 181 | |
|
| 182 | |
|
| 183 | |
|
| 184 | |
@Override |
| 185 | |
public String toString() { |
| 186 | 0 | return "DataObjectEntry for " + getDataObjectClass(); |
| 187 | |
} |
| 188 | |
|
| 189 | |
|
| 190 | |
|
| 191 | |
|
| 192 | |
public List<MustOccurConstraint> getMustOccurConstraints() { |
| 193 | 0 | return this.mustOccurConstraints; |
| 194 | |
} |
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
public void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints) { |
| 200 | 0 | this.mustOccurConstraints = mustOccurConstraints; |
| 201 | 0 | } |
| 202 | |
|
| 203 | |
|
| 204 | |
|
| 205 | |
|
| 206 | |
public String getTitleAttribute() { |
| 207 | 0 | return this.titleAttribute; |
| 208 | |
} |
| 209 | |
|
| 210 | |
|
| 211 | |
|
| 212 | |
|
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
public void setTitleAttribute(String titleAttribute) { |
| 220 | 0 | this.titleAttribute = titleAttribute; |
| 221 | 0 | } |
| 222 | |
|
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
public List<String> getPrimaryKeys() { |
| 227 | 0 | return this.primaryKeys; |
| 228 | |
} |
| 229 | |
|
| 230 | |
|
| 231 | |
|
| 232 | |
|
| 233 | |
public void setPrimaryKeys(List<String> primaryKeys) { |
| 234 | 0 | this.primaryKeys = primaryKeys; |
| 235 | 0 | } |
| 236 | |
|
| 237 | |
public Class<? extends Exporter> getExporterClass() { |
| 238 | 0 | return this.exporterClass; |
| 239 | |
} |
| 240 | |
|
| 241 | |
public void setExporterClass(Class<? extends Exporter> exporterClass) { |
| 242 | 0 | this.exporterClass = exporterClass; |
| 243 | 0 | } |
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
public List<String> getGroupByAttributesForEffectiveDating() { |
| 252 | 0 | return this.groupByAttributesForEffectiveDating; |
| 253 | |
} |
| 254 | |
|
| 255 | |
|
| 256 | |
|
| 257 | |
|
| 258 | |
|
| 259 | |
|
| 260 | |
public void setGroupByAttributesForEffectiveDating(List<String> groupByAttributesForEffectiveDating) { |
| 261 | 0 | this.groupByAttributesForEffectiveDating = groupByAttributesForEffectiveDating; |
| 262 | 0 | } |
| 263 | |
|
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
|
| 274 | |
|
| 275 | |
|
| 276 | |
|
| 277 | |
public boolean isBoNotesEnabled() { |
| 278 | 0 | return boNotesEnabled; |
| 279 | |
} |
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | |
|
| 284 | |
public void setBoNotesEnabled(boolean boNotesEnabled) { |
| 285 | 0 | this.boNotesEnabled = boNotesEnabled; |
| 286 | 0 | } |
| 287 | |
|
| 288 | |
|
| 289 | |
|
| 290 | |
|
| 291 | |
|
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
public List<InactivationBlockingDefinition> getInactivationBlockingDefinitions() { |
| 298 | 0 | return this.inactivationBlockingDefinitions; |
| 299 | |
} |
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
public void setInactivationBlockingDefinitions( |
| 305 | |
List<InactivationBlockingDefinition> inactivationBlockingDefinitions) { |
| 306 | 0 | this.inactivationBlockingDefinitions = inactivationBlockingDefinitions; |
| 307 | 0 | } |
| 308 | |
} |