|  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.exception.AttributeValidationException;  | 
  |  21 |     | 
   import org.kuali.rice.krad.datadictionary.validation.capability.MustOccurConstrainable;  | 
  |  22 |     | 
   import org.kuali.rice.krad.datadictionary.validation.constraint.MustOccurConstraint;  | 
  |  23 |     | 
     | 
  |  24 |     | 
   import java.util.List;  | 
  |  25 |     | 
     | 
  |  26 |     | 
     | 
  |  27 |     | 
     | 
  |  28 |     | 
     | 
  |  29 |     | 
     | 
  |  30 |     | 
     | 
  |  31 |     | 
     | 
  |  32 |    33 |    public class DataObjectEntry extends DataDictionaryEntryBase implements MustOccurConstrainable { | 
  |  33 |     | 
     | 
  |  34 |     | 
       protected String name;  | 
  |  35 |     | 
       protected Class<?> dataObjectClass;  | 
  |  36 |     | 
     | 
  |  37 |     | 
       protected String titleAttribute;  | 
  |  38 |     | 
       protected String objectLabel;  | 
  |  39 |     | 
       protected String objectDescription;  | 
  |  40 |     | 
     | 
  |  41 |     | 
       protected List<String> primaryKeys;  | 
  |  42 |     | 
       protected Class<? extends Exporter> exporterClass;  | 
  |  43 |     | 
     | 
  |  44 |     | 
       protected List<MustOccurConstraint> mustOccurConstraints;  | 
  |  45 |     | 
     | 
  |  46 |     | 
       protected List<String> groupByAttributesForEffectiveDating;  | 
  |  47 |     | 
     | 
  |  48 |     | 
       protected HelpDefinition helpDefinition;  | 
  |  49 |     | 
     | 
  |  50 |     | 
       @Override  | 
  |  51 |     | 
       public void completeValidation() { | 
  |  52 |     | 
             | 
  |  53 |    0 |            if (StringUtils.isBlank(getObjectLabel())) { | 
  |  54 |    0 |                throw new AttributeValidationException("Object label cannot be blank for class " + dataObjectClass.getName()); | 
  |  55 |     | 
           }  | 
  |  56 |     | 
     | 
  |  57 |    0 |            super.completeValidation();  | 
  |  58 |    0 |        }  | 
  |  59 |     | 
     | 
  |  60 |     | 
         | 
  |  61 |     | 
     | 
  |  62 |     | 
     | 
  |  63 |     | 
       @Override  | 
  |  64 |     | 
       public String getJstlKey() { | 
  |  65 |    0 |            if (dataObjectClass == null) { | 
  |  66 |    0 |                throw new IllegalStateException("cannot generate JSTL key: dataObjectClass is null"); | 
  |  67 |     | 
           }  | 
  |  68 |     | 
     | 
  |  69 |    0 |            return (dataObjectClass != null) ? dataObjectClass.getSimpleName() : dataObjectClass.getSimpleName();  | 
  |  70 |     | 
       }  | 
  |  71 |     | 
     | 
  |  72 |     | 
         | 
  |  73 |     | 
     | 
  |  74 |     | 
     | 
  |  75 |     | 
       @Override  | 
  |  76 |     | 
       public String getFullClassName() { | 
  |  77 |    0 |            return dataObjectClass.getName();  | 
  |  78 |     | 
       }  | 
  |  79 |     | 
     | 
  |  80 |     | 
         | 
  |  81 |     | 
     | 
  |  82 |     | 
     | 
  |  83 |     | 
       @Override  | 
  |  84 |     | 
       public Class<?> getEntryClass() { | 
  |  85 |    0 |            return dataObjectClass;  | 
  |  86 |     | 
       }  | 
  |  87 |     | 
     | 
  |  88 |     | 
         | 
  |  89 |     | 
     | 
  |  90 |     | 
     | 
  |  91 |     | 
       public Class<?> getDataObjectClass() { | 
  |  92 |    0 |            return this.dataObjectClass;  | 
  |  93 |     | 
       }  | 
  |  94 |     | 
     | 
  |  95 |     | 
         | 
  |  96 |     | 
     | 
  |  97 |     | 
     | 
  |  98 |     | 
       public void setDataObjectClass(Class<?> dataObjectClass) { | 
  |  99 |    0 |            this.dataObjectClass = dataObjectClass;  | 
  |  100 |    0 |        }  | 
  |  101 |     | 
     | 
  |  102 |     | 
         | 
  |  103 |     | 
     | 
  |  104 |     | 
     | 
  |  105 |     | 
       public String getName() { | 
  |  106 |    0 |            return this.name;  | 
  |  107 |     | 
       }  | 
  |  108 |     | 
     | 
  |  109 |     | 
         | 
  |  110 |     | 
     | 
  |  111 |     | 
     | 
  |  112 |     | 
       public void setName(String name) { | 
  |  113 |    0 |            this.name = name;  | 
  |  114 |    0 |        }  | 
  |  115 |     | 
     | 
  |  116 |     | 
         | 
  |  117 |     | 
     | 
  |  118 |     | 
     | 
  |  119 |     | 
       public String getObjectLabel() { | 
  |  120 |    0 |            return objectLabel;  | 
  |  121 |     | 
       }  | 
  |  122 |     | 
     | 
  |  123 |     | 
         | 
  |  124 |     | 
     | 
  |  125 |     | 
     | 
  |  126 |     | 
     | 
  |  127 |     | 
     | 
  |  128 |     | 
     | 
  |  129 |     | 
       public void setObjectLabel(String objectLabel) { | 
  |  130 |    0 |            this.objectLabel = objectLabel;  | 
  |  131 |    0 |        }  | 
  |  132 |     | 
     | 
  |  133 |     | 
         | 
  |  134 |     | 
     | 
  |  135 |     | 
     | 
  |  136 |     | 
       public String getObjectDescription() { | 
  |  137 |    0 |            return objectDescription;  | 
  |  138 |     | 
       }  | 
  |  139 |     | 
     | 
  |  140 |     | 
         | 
  |  141 |     | 
     | 
  |  142 |     | 
     | 
  |  143 |     | 
     | 
  |  144 |     | 
     | 
  |  145 |     | 
     | 
  |  146 |     | 
       public void setObjectDescription(String objectDescription) { | 
  |  147 |    0 |            this.objectDescription = objectDescription;  | 
  |  148 |    0 |        }  | 
  |  149 |     | 
     | 
  |  150 |     | 
         | 
  |  151 |     | 
     | 
  |  152 |     | 
     | 
  |  153 |     | 
     | 
  |  154 |     | 
     | 
  |  155 |     | 
       public HelpDefinition getHelpDefinition() { | 
  |  156 |    0 |            return helpDefinition;  | 
  |  157 |     | 
       }  | 
  |  158 |     | 
     | 
  |  159 |     | 
         | 
  |  160 |     | 
     | 
  |  161 |     | 
     | 
  |  162 |     | 
     | 
  |  163 |     | 
     | 
  |  164 |     | 
     | 
  |  165 |     | 
     | 
  |  166 |     | 
     | 
  |  167 |     | 
     | 
  |  168 |     | 
     | 
  |  169 |     | 
     | 
  |  170 |     | 
     | 
  |  171 |     | 
       public void setHelpDefinition(HelpDefinition helpDefinition) { | 
  |  172 |    0 |            this.helpDefinition = helpDefinition;  | 
  |  173 |    0 |        }  | 
  |  174 |     | 
     | 
  |  175 |     | 
         | 
  |  176 |     | 
     | 
  |  177 |     | 
     | 
  |  178 |     | 
       @Override  | 
  |  179 |     | 
       public String toString() { | 
  |  180 |    0 |            return "DataObjectEntry for " + getDataObjectClass();  | 
  |  181 |     | 
       }  | 
  |  182 |     | 
     | 
  |  183 |     | 
         | 
  |  184 |     | 
     | 
  |  185 |     | 
     | 
  |  186 |     | 
       public List<MustOccurConstraint> getMustOccurConstraints() { | 
  |  187 |    0 |            return this.mustOccurConstraints;  | 
  |  188 |     | 
       }  | 
  |  189 |     | 
     | 
  |  190 |     | 
         | 
  |  191 |     | 
     | 
  |  192 |     | 
     | 
  |  193 |     | 
       public void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints) { | 
  |  194 |    5 |            this.mustOccurConstraints = mustOccurConstraints;  | 
  |  195 |    5 |        }  | 
  |  196 |     | 
     | 
  |  197 |     | 
         | 
  |  198 |     | 
     | 
  |  199 |     | 
     | 
  |  200 |     | 
       public String getTitleAttribute() { | 
  |  201 |    0 |            return this.titleAttribute;  | 
  |  202 |     | 
       }  | 
  |  203 |     | 
     | 
  |  204 |     | 
         | 
  |  205 |     | 
     | 
  |  206 |     | 
     | 
  |  207 |     | 
     | 
  |  208 |     | 
     | 
  |  209 |     | 
     | 
  |  210 |     | 
     | 
  |  211 |     | 
     | 
  |  212 |     | 
     | 
  |  213 |     | 
       public void setTitleAttribute(String titleAttribute) { | 
  |  214 |    0 |            this.titleAttribute = titleAttribute;  | 
  |  215 |    0 |        }  | 
  |  216 |     | 
     | 
  |  217 |     | 
         | 
  |  218 |     | 
     | 
  |  219 |     | 
     | 
  |  220 |     | 
       public List<String> getPrimaryKeys() { | 
  |  221 |    0 |            return this.primaryKeys;  | 
  |  222 |     | 
       }  | 
  |  223 |     | 
     | 
  |  224 |     | 
         | 
  |  225 |     | 
     | 
  |  226 |     | 
     | 
  |  227 |     | 
       public void setPrimaryKeys(List<String> primaryKeys) { | 
  |  228 |    0 |            this.primaryKeys = primaryKeys;  | 
  |  229 |    0 |        }  | 
  |  230 |     | 
     | 
  |  231 |     | 
       public Class<? extends Exporter> getExporterClass() { | 
  |  232 |    0 |            return this.exporterClass;  | 
  |  233 |     | 
       }  | 
  |  234 |     | 
     | 
  |  235 |     | 
       public void setExporterClass(Class<? extends Exporter> exporterClass) { | 
  |  236 |    0 |            this.exporterClass = exporterClass;  | 
  |  237 |    0 |        }  | 
  |  238 |     | 
     | 
  |  239 |     | 
         | 
  |  240 |     | 
     | 
  |  241 |     | 
     | 
  |  242 |     | 
     | 
  |  243 |     | 
     | 
  |  244 |     | 
     | 
  |  245 |     | 
       public List<String> getGroupByAttributesForEffectiveDating() { | 
  |  246 |    0 |            return this.groupByAttributesForEffectiveDating;  | 
  |  247 |     | 
       }  | 
  |  248 |     | 
     | 
  |  249 |     | 
         | 
  |  250 |     | 
     | 
  |  251 |     | 
     | 
  |  252 |     | 
     | 
  |  253 |     | 
     | 
  |  254 |     | 
       public void setGroupByAttributesForEffectiveDating(List<String> groupByAttributesForEffectiveDating) { | 
  |  255 |    0 |            this.groupByAttributesForEffectiveDating = groupByAttributesForEffectiveDating;  | 
  |  256 |    0 |        }  | 
  |  257 |     | 
   }  |