Coverage Report - org.kuali.rice.krad.service.DataDictionaryService
 
Classes in this File Line Coverage Branch Coverage Complexity
DataDictionaryService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.krad.service;
 17  
 
 18  
 import org.kuali.rice.core.web.format.Formatter;
 19  
 import org.kuali.rice.krad.bo.BusinessObject;
 20  
 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
 21  
 import org.kuali.rice.krad.datadictionary.AttributeSecurity;
 22  
 import org.kuali.rice.krad.datadictionary.DataDictionary;
 23  
 import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata;
 24  
 import org.kuali.rice.krad.datadictionary.control.ControlDefinition;
 25  
 import org.kuali.rice.krad.datadictionary.exception.UnknownDocumentTypeException;
 26  
 import org.kuali.rice.krad.document.Document;
 27  
 import org.kuali.rice.krad.keyvalues.KeyValuesFinder;
 28  
 import org.kuali.rice.krad.uif.container.View;
 29  
 
 30  
 import java.io.IOException;
 31  
 import java.util.List;
 32  
 import java.util.Map;
 33  
 import java.util.Set;
 34  
 import java.util.regex.Pattern;
 35  
 
 36  
 /**
 37  
  * Defines the API for interacting with the data dictionary
 38  
  *
 39  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 40  
  */
 41  
 public interface DataDictionaryService {
 42  
 
 43  
     /**
 44  
      * Sequentially adds each package named (as a String) in the given List as a source of unique entries to the DataDictionary
 45  
      * being constructed. Duplicate entries among any of the XML files in any of these packages will result in exceptions being
 46  
      * thrown, hence service-initialization failure.
 47  
      *
 48  
      * @param baselinePackages
 49  
      * @throws SourceException if any of the given packages can't be located
 50  
      */
 51  
     public void setBaselinePackages(List baselinePackages) throws IOException;
 52  
 
 53  
     /**
 54  
      * @return current DataDictionary
 55  
      */
 56  
     public DataDictionary getDataDictionary();
 57  
 
 58  
     public void addDataDictionaryLocations(List<String> locations) throws IOException;
 59  
 
 60  
 //    /**
 61  
 //     * Hook to allow the dataDictionary service to perform any post-build initialization tasks needed before the dataDictionary
 62  
 //     * itself will be publicly available.
 63  
 //     */
 64  
 //    public void completeInitialization();
 65  
 
 66  
     /**
 67  
      * the html control type used to render the field
 68  
      */
 69  
     public ControlDefinition getAttributeControlDefinition(Class dataObjectClass, String attributeName);
 70  
 
 71  
     /**
 72  
      * the display size of the field if text control
 73  
      */
 74  
     public Integer getAttributeSize(Class dataObjectClass, String attributeName);
 75  
 
 76  
     /**
 77  
      * the max length defined for the given attribute name.
 78  
      */
 79  
     public Integer getAttributeMaxLength(Class dataObjectClass, String attributeName);
 80  
 
 81  
     /**
 82  
      * the regular expression defined to validate the given attribute name.
 83  
      */
 84  
     public Pattern getAttributeValidatingExpression(Class dataObjectClass, String attributeName);
 85  
 
 86  
     /**
 87  
      * the label to be used for displaying the attribute.
 88  
      */
 89  
     public String getAttributeLabel(Class dataObjectClass, String attributeName);
 90  
 
 91  
     /**
 92  
      * the short label to be used for displaying the attribute.
 93  
      */
 94  
     public String getAttributeShortLabel(Class dataObjectClass, String attributeName);
 95  
 
 96  
     /**
 97  
      * the "label (short label)" used for displaying error messages
 98  
      */
 99  
     public String getAttributeErrorLabel(Class dataObjectClass, String attributeName);
 100  
 
 101  
     /**
 102  
      * the formatter class used to format the attribute value
 103  
      */
 104  
     public Class<? extends Formatter> getAttributeFormatter(Class dataObjectClass, String attributeName);
 105  
 
 106  
     /**
 107  
      * indicates whether or not to force input text into uppercase
 108  
      */
 109  
     public Boolean getAttributeForceUppercase(Class dataObjectClass, String attributeName);
 110  
 
 111  
     /**
 112  
      * short help text for attribute
 113  
      */
 114  
     public String getAttributeSummary(Class dataObjectClass, String attributeName);
 115  
 
 116  
     /**
 117  
      * detailed help text for attribute
 118  
      */
 119  
     public String getAttributeDescription(Class dataObjectClass, String attributeName);
 120  
 
 121  
     /**
 122  
      * indicates whether or not the named attribute is required
 123  
      */
 124  
     public Boolean isAttributeRequired(Class dataObjectClass, String attributeName);
 125  
 
 126  
     /**
 127  
      * indicates whether or not the named attribute is defined in the business object xml
 128  
      */
 129  
     public Boolean isAttributeDefined(Class dataObjectClass, String attributeName);
 130  
 
 131  
     /**
 132  
      * the Class that returns a values list for this attribute
 133  
      */
 134  
     public Class<? extends KeyValuesFinder> getAttributeValuesFinderClass(Class dataObjectClass, String attributeName);
 135  
 
 136  
     /**
 137  
      * the label to be used for displaying the collection.
 138  
      */
 139  
     public String getCollectionLabel(Class dataObjectClass, String collectionName);
 140  
 
 141  
     /**
 142  
      * the short label to be used for displaying the collection.
 143  
      */
 144  
     public String getCollectionShortLabel(Class dataObjectClass, String collectionName);
 145  
 
 146  
     /**
 147  
      * short help text for collection
 148  
      */
 149  
     public String getCollectionSummary(Class dataObjectClass, String collectionName);
 150  
 
 151  
     /**
 152  
      * detailed help text for collection
 153  
      */
 154  
     public String getCollectionDescription(Class dataObjectClass, String collectionName);
 155  
 
 156  
     /**
 157  
      * the html control type used to render the field
 158  
      */
 159  
     public ControlDefinition getAttributeControlDefinition(String entryName, String attributeName);
 160  
 
 161  
     /**
 162  
      * the display size of the field if text control
 163  
      */
 164  
     public Integer getAttributeSize(String entryName, String attributeName);
 165  
 
 166  
     /**
 167  
      * the min length defined for the given attribute name.
 168  
      */
 169  
     public Integer getAttributeMinLength(String entryName, String attributeName);
 170  
 
 171  
     /**
 172  
      * the max length defined for the given attribute name.
 173  
      */
 174  
     public Integer getAttributeMaxLength(String entryName, String attributeName);
 175  
 
 176  
     /**
 177  
      * @param entryName
 178  
      * @param attributeName
 179  
      * @return the exclusive minimum for the specified attribute, or <code>null</code> if none.
 180  
      */
 181  
     public /*BigDecimal*/ String getAttributeExclusiveMin(String entryName, String attributeName);
 182  
 
 183  
     /**
 184  
      * @param entryName
 185  
      * @param attributeName
 186  
      * @return the inclusive maximum for the specified attribute, or <code>null</code> if none.
 187  
      */
 188  
     public /*BigDecimal*/ String getAttributeInclusiveMax(String entryName, String attributeName);
 189  
 
 190  
     /**
 191  
      * the regular expression defined to validate the given attribute name.
 192  
      */
 193  
     public Pattern getAttributeValidatingExpression(String entryName, String attributeName);
 194  
 
 195  
     /**
 196  
      * the label to be used for displaying the attribute.
 197  
      */
 198  
     public String getAttributeLabel(String entryName, String attributeName);
 199  
 
 200  
     /**
 201  
      * the short label to be used for displaying the attribute.
 202  
      */
 203  
     public String getAttributeShortLabel(String entryName, String attributeName);
 204  
 
 205  
     /**
 206  
      * the "label (short label)" used for displaying error messages
 207  
      */
 208  
     public String getAttributeErrorLabel(String entryName, String attributeName);
 209  
 
 210  
     /**
 211  
      * the formatter class used to format the attribute value
 212  
      */
 213  
     public Class<? extends Formatter> getAttributeFormatter(String entryName, String attributeName);
 214  
 
 215  
     /**
 216  
      * indicates whether or not to force input text into uppercase
 217  
      */
 218  
     public Boolean getAttributeForceUppercase(String entryName, String attributeName);
 219  
 
 220  
     /**
 221  
      * the AttributeSecurity object defined for the attribute's data value
 222  
      */
 223  
     public AttributeSecurity getAttributeSecurity(String entryName, String attributeName);
 224  
 
 225  
     /**
 226  
      * short help text for attribute
 227  
      */
 228  
     public String getAttributeSummary(String entryName, String attributeName);
 229  
 
 230  
     /**
 231  
      * detailed help text for attribute
 232  
      */
 233  
     public String getAttributeDescription(String entryName, String attributeName);
 234  
 
 235  
     public String getAttributeValidatingErrorMessageKey(String entryName, String attributeName);
 236  
 
 237  
     public String[] getAttributeValidatingErrorMessageParameters(String entryName, String attributeName);
 238  
 
 239  
     /**
 240  
      * indicates whether or not the named attribute is required
 241  
      */
 242  
     public Boolean isAttributeRequired(String entryName, String attributeName);
 243  
 
 244  
     /**
 245  
      * indicates whether or not the named attribute is defined in the business object xml
 246  
      */
 247  
     public Boolean isAttributeDefined(String entryName, String attributeName);
 248  
 
 249  
     /**
 250  
      * the Class that returns a values list for this attribute
 251  
      */
 252  
     public Class<? extends KeyValuesFinder> getAttributeValuesFinderClass(String entryName, String attributeName);
 253  
 
 254  
     /**
 255  
      * AttributeDefinition associated with the given attributeName within the given entry
 256  
      */
 257  
     public AttributeDefinition getAttributeDefinition(String entryName, String attributeName);
 258  
 
 259  
     /**
 260  
      * the label to be used for displaying the collection.
 261  
      */
 262  
     public String getCollectionLabel(String entryName, String collectionName);
 263  
 
 264  
     /**
 265  
      * the short label to be used for displaying the collection.
 266  
      */
 267  
     public String getCollectionShortLabel(String entryName, String collectionName);
 268  
 
 269  
     /**
 270  
      * the element label to be used for displaying the collection.
 271  
      */
 272  
     public String getCollectionElementLabel(String entryName, String collectionName, Class dataObjectClass);
 273  
 
 274  
     /**
 275  
      * short help text for collection
 276  
      */
 277  
     public String getCollectionSummary(String entryName, String collectionName);
 278  
 
 279  
     /**
 280  
      * detailed help text for collection
 281  
      */
 282  
     public String getCollectionDescription(String entryName, String collectionName);
 283  
 
 284  
     /**
 285  
      * @param entryName
 286  
      * @param relationshipName
 287  
      * @return source Class for the given relationship, or null if there is no relationship with that name
 288  
      */
 289  
     public Class<? extends BusinessObject> getRelationshipSourceClass(String entryName, String relationshipName);
 290  
 
 291  
     /**
 292  
      * @param entryName
 293  
      * @param relationshipName
 294  
      * @return target Class for the given relationship, or null if there is no relationship with that name
 295  
      */
 296  
     public Class<? extends BusinessObject> getRelationshipTargetClass(String entryName, String relationshipName);
 297  
 
 298  
     /**
 299  
      * @param entryName
 300  
      * @param relationshipName
 301  
      * @return List<String> of source attributeNames for the given relationship, or null if there is no relationship with that name
 302  
      */
 303  
     public List<String> getRelationshipSourceAttributes(String entryName, String relationshipName);
 304  
 
 305  
     /**
 306  
      * @param entryName
 307  
      * @param relationshipName
 308  
      * @return List<String> of target attributeNames for the given relationship, or null if there is no relationship with that name
 309  
      */
 310  
     public List<String> getRelationshipTargetAttributes(String entryName, String relationshipName);
 311  
 
 312  
     /**
 313  
      * returns a Map that specifies the attributes of the relationship
 314  
      *
 315  
      * @param entryName - Name of the Business Object entry
 316  
      * @param relationshipName - Name of the relationship
 317  
      * @return Map - Target field as key, source field as value
 318  
      */
 319  
     public Map<String, String> getRelationshipAttributeMap(String entryName, String relationshipName);
 320  
 
 321  
     /**
 322  
      * returns a list of names for all entries whose source parameter matches the parameter
 323  
      *
 324  
      * @param entryName Name of the Business Object entry
 325  
      * @param sourceAttributeName name of the source attribute
 326  
      * @return the names of all entries that use the sourceAttributeName as a primitive attribute
 327  
      */
 328  
     public List<String> getRelationshipEntriesForSourceAttribute(String entryName, String sourceAttributeName);
 329  
 
 330  
     /**
 331  
      * returns a list of names for all entries whose source parameter matches the parameter
 332  
      *
 333  
      * @param entryName Name of the Business Object entry
 334  
      * @param targetAttributeName name of the target attribute
 335  
      * @return the names of all entries that use the targetAttributeName as a primitive attribute
 336  
      */
 337  
     public List<String> getRelationshipEntriesForTargetAttribute(String entryName, String targetAttributeName);
 338  
 
 339  
     /**
 340  
      * Determines whether there is a relationship defined for the given entry with the given name
 341  
      *
 342  
      * @param entryName name of the BO entry
 343  
      * @param relationshipName name of the relationship for the entry
 344  
      * @return true iff there is a relationship with the given name defined for the BO entry in the DD
 345  
      */
 346  
     public boolean hasRelationship(String entryName, String relationshipName);
 347  
 
 348  
     /**
 349  
      * Returns all of the relationships defined for a BO in the DD
 350  
      *
 351  
      * @param name of the BO entry
 352  
      * @return a list of all DD defined mappings
 353  
      */
 354  
     public List<String> getRelationshipNames(String entryName);
 355  
 
 356  
 //    /**
 357  
 //     * Returns the list of document class names
 358  
 //     * 
 359  
 //     * @return
 360  
 //     */
 361  
 //    public List getDocumentObjectClassnames();
 362  
 
 363  
     /**
 364  
      * This method returns the user friendly label based on the workflow doc type name
 365  
      *
 366  
      * @param documentTypeName
 367  
      * @return label
 368  
      */
 369  
     public String getDocumentLabelByTypeName(String documentTypeName);
 370  
 
 371  
     /**
 372  
      * This method returns the user friendly label based on the document or business object class
 373  
      *
 374  
      * @param documentTypeName
 375  
      * @return label
 376  
      */
 377  
     public String getDocumentLabelByClass(Class documentOrBusinessObjectClass);
 378  
 
 379  
     /**
 380  
      * Returns the document type name declared in the dd for the given document
 381  
      * class. If no valid document type is found 'null' is returned.
 382  
      *
 383  
      * @param documentClass
 384  
      * @return documentTypeName
 385  
      */
 386  
     public String getDocumentTypeNameByClass(Class documentClass);
 387  
 
 388  
     /**
 389  
      * Returns the document type name declared in the dd for the given document
 390  
      * class. If no valid document type is found an
 391  
      * {@link UnknownDocumentTypeException} is thrown.
 392  
      *
 393  
      * @param documentClass
 394  
      * @return documentTypeName
 395  
      */
 396  
     public String getValidDocumentTypeNameByClass(Class documentClass);
 397  
 
 398  
     /**
 399  
      * Returns the document class declared in the dd for the given document type
 400  
      * name. If no document entry is found with given document type name, 'null'
 401  
      * will be returned.
 402  
      *
 403  
      * @param documentTypeName
 404  
      * @return document Class
 405  
      */
 406  
     public Class<? extends Document> getDocumentClassByTypeName(String documentTypeName);
 407  
 
 408  
     /**
 409  
      * Returns the document class declared in the dd for the given document type
 410  
      * name. If no document entry is found with given document type name, and
 411  
      * {@link UnknownDocumentTypeException} will be thrown.
 412  
      *
 413  
      * @param documentTypeName
 414  
      * @return document Class
 415  
      */
 416  
     public Class<? extends Document> getValidDocumentClassByTypeName(String documentTypeName);
 417  
 
 418  
     /**
 419  
      * Returns the list of attributes that should be used for grouping when determining the current
 420  
      * status of a business object that implements InactivateableFromTo
 421  
      *
 422  
      * @param businessObjectClass - business object class to get configured list for
 423  
      * @return List of string attribute names that gives the group by list
 424  
      */
 425  
     public List<String> getGroupByAttributesForEffectiveDating(Class businessObjectClass);
 426  
 
 427  
     /**
 428  
      * Returns all of the inactivation blocks registered for a particular business object
 429  
      *
 430  
      * @param inactivationBlockedBusinessObjectClass
 431  
      * @return a set of all registered inactivation blocks for a particular business object
 432  
      */
 433  
     public Set<InactivationBlockingMetadata> getAllInactivationBlockingDefinitions(
 434  
             Class inactivationBlockedBusinessObjectClass);
 435  
 
 436  
     /**
 437  
      * Returns the View entry identified by the given id
 438  
      *
 439  
      * @param viewId - unique id for view
 440  
      * @return View instance associated with the id
 441  
      */
 442  
     public View getViewById(String viewId);
 443  
 
 444  
     /**
 445  
      * Returns View instance identified by the view type name and index
 446  
      *
 447  
      * @param viewTypeName - type name for the view
 448  
      * @param indexKey - Map of index key parameters, these are the parameters the
 449  
      * indexer used to index the view initially and needs to identify
 450  
      * an unique view instance
 451  
      * @return View instance that matches the given index
 452  
      */
 453  
     public View getViewByTypeIndex(String viewTypeName, Map<String, String> indexKey);
 454  
 }