public static String getTitleText(String prependText, Class<?> dataObjectClass, Map<String, String> keyValueMap) { StringBuffer titleText = new StringBuffer(prependText); for (String key : keyValueMap.keySet()) { String fieldVal = keyValueMap.get(key).toString(); if (StringUtils.isNotBlank(fieldVal)) { titleText.append(KRADServiceLocatorWeb.getDataDictionaryService() .getAttributeLabel(dataObjectClass, key) + "=" + fieldVal.toString() + " "); } } return titleText.toString(); }
/** * Removes fields identified in the data dictionary as hidden from the lookup field values. * (This will remove Universal User ID and Person name from search requests when a user ID is entered.) * * @param fieldValues */ public static void removeHiddenCriteriaFields(Class businessObjectClass, Map fieldValues) { List<String> lookupFieldAttributeList = getBusinessObjectMetaDataService().getLookupableFieldNames(businessObjectClass); if (lookupFieldAttributeList != null) { for (Iterator iter = lookupFieldAttributeList.iterator(); iter.hasNext(); ) { String attributeName = (String) iter.next(); if (fieldValues.containsKey(attributeName)) { ControlDefinition controlDef = getDataDictionaryService() .getAttributeControlDefinition(businessObjectClass, attributeName); if (controlDef != null && controlDef.isHidden()) { fieldValues.remove(attributeName); } } } } }
String propertyName = (String) propsIter.next(); Boolean caseInsensitive = Boolean.TRUE; if ( KRADServiceLocatorWeb.getDataDictionaryService().isAttributeDefined( example.getClass(), propertyName )) { caseInsensitive = !KRADServiceLocatorWeb.getDataDictionaryService().getAttributeForceUppercase( example.getClass(), propertyName );
/** * This method translates the passed in field name into a human-readable attribute label. * * It assumes the existing newBO's class as the class to examine the fieldName for. * * @param boClass The class to use in combination with the fieldName. * @param fieldName The fieldName you want a human-readable label for. * @return A human-readable label, pulled from the DataDictionary. */ protected String getFieldLabel(Class boClass, String fieldName) { return ddService.getAttributeLabel(boClass, fieldName) + "(" + ddService.getAttributeShortLabel(boClass, fieldName) + ")"; }
field.setFieldLabel(getDataDictionaryService().getAttributeLabel(businessObjectClass, attributeName)); Integer maxLength = getDataDictionaryService().getAttributeMaxLength(businessObjectClass, attributeName); if (maxLength != null) { field.setMaxLength(maxLength.intValue()); upperCase = getDataDictionaryService().getAttributeForceUppercase(businessObjectClass, attributeName); field.setFieldHelpSummary(getDataDictionaryService().getAttributeSummary(businessObjectClass, attributeName));
Column column = new Column(); column.setPropertyName(attributeName); String columnTitle = getDataDictionaryService().getAttributeLabel(getBusinessObjectClass(), attributeName); Boolean useShortLabel = getBusinessObjectDictionaryService().getLookupResultFieldUseShortLabel(businessObjectClass, attributeName); if (useShortLabel != null && useShortLabel) { columnTitle = getDataDictionaryService().getAttributeShortLabel(getBusinessObjectClass(), attributeName); columnTitle = getDataDictionaryService().getCollectionLabel(getBusinessObjectClass(), attributeName);
private String getDisplayLabel(Node node) { String displayLabel = ""; if(node.getParentNode() != null && node.getPathElement() != null) { if(!node.isCollectionNode()) { displayLabel = dataDictionaryService.getAttributeLabel(node.getParentNode().getType(), node.getPathElement().toString()); } else { displayLabel = dataDictionaryService.getCollectionLabel(node.getParentNode().getType(), node.getPathElement().toString()); } if(displayLabel != null) { displayLabel = displayLabel.toUpperCase(); } else { //this method will never return null displayLabel = ""; } } return displayLabel; }
List<RelationshipDefinition> relationships = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(entry.getKey()).getRelationships(); if (relationships == null) { relationships = getDataDictionaryService().getDataDictionary().getDataObjectEntry(entry.getKey()).getRelationships(); if (relationships == null) { continue; final String attributeDisplayLabel; if (StringUtils.isNotBlank(attr.getKimAttribute().getComponentName())) { attributeDisplayLabel = getDataDictionaryService().getAttributeLabel(attr.getKimAttribute().getComponentName(), attributeToHighlightOnFail); } else { attributeDisplayLabel = attr.getKimAttribute().getAttributeLabel();
String collectionLabel = getDataDictionaryService().getCollectionLabel(o.getClass(), collectionDefinition.getName()); collectionElementLabel = getDataDictionaryService().getCollectionElementLabel(o.getClass().getName(), collectionDefinition.getName(),collectionDefinition.getBusinessObjectClass());
private static void addMaintenanceDocumentCollectionPathToSecurityMappings(Map<String, AttributeSecurity> mappings, String propertyPathPrefix, MaintainableCollectionDefinition collectionDefinition) { propertyPathPrefix = propertyPathPrefix + collectionDefinition.getName() + "."; String boClassName = collectionDefinition.getBusinessObjectClass().getName(); for (MaintainableFieldDefinition field : collectionDefinition.getMaintainableFields()) { AttributeSecurity attributeSecurity = getDataDictionaryService().getAttributeSecurity(boClassName, field.getName()); if (attributeSecurity != null) { mappings.put(propertyPathPrefix + field.getName(), attributeSecurity); } } for (MaintainableCollectionDefinition nestedCollection : collectionDefinition.getMaintainableCollections()) { addMaintenanceDocumentCollectionPathToSecurityMappings(mappings, propertyPathPrefix, nestedCollection); } }
if (getDataDictionaryService().getAttributeDefinition(businessObjectClass.getName(), fieldNm) == null) { String errorMessage = "The field " + fieldNm + " could not be found in the data dictionary for class " + businessObjectClass.getName() + ", and thus it could not be determined whether it is a secure field.";
boolean upperCase = false; try { upperCase = getDataDictionaryService().getAttributeForceUppercase(businessObjectClass, propertyName);
KRADServiceLocatorWeb.getDataDictionaryService().getAttributeFormatter(boClass, boPropertyName); if (formatterClass == null) { try {
/** * Determines whether this document has been inactivation blocked * * @param maintenanceDocument * @return true iff there is NOTHING that blocks this record */ protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument) { if (isDocumentInactivatingBusinessObject(maintenanceDocument)) { Class boClass = maintenanceDocument.getNewMaintainableObject().getDataObjectClass(); Set<InactivationBlockingMetadata> inactivationBlockingMetadatas = ddService.getAllInactivationBlockingDefinitions(boClass); if (inactivationBlockingMetadatas != null) { for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) { // for the purposes of maint doc validation, we only need to look for the first blocking record // we found a blocking record, so we return false if (!processInactivationBlockChecking(maintenanceDocument, inactivationBlockingMetadata)) { return false; } } } } return true; }
/** * This method translates the passed in field name into a human-readable attribute label. * * It assumes the existing newBO's class as the class to examine the fieldName for. * * @param fieldName The fieldName you want a human-readable label for. * @return A human-readable label, pulled from the DataDictionary. */ protected String getFieldLabel(String fieldName) { return ddService.getAttributeLabel(newBo.getClass(), fieldName) + "(" + ddService.getAttributeShortLabel(newBo.getClass(), fieldName) + ")"; }
String collectionLabel = getDataDictionaryService().getCollectionLabel(o.getClass(), collectionDefinition.getName()); collectionElementLabel = getDataDictionaryService().getCollectionElementLabel(o.getClass().getName(), collectionDefinition.getName(), collectionDefinition.getBusinessObjectClass()); String subCollectionLabel = getDataDictionaryService().getCollectionLabel(o.getClass(), subCollection.getName()); subCollectionElementLabel = getDataDictionaryService().getCollectionElementLabel(o.getClass().getName(), subCollection.getName(), subCollection.getBusinessObjectClass());
public static Map<String, AttributeSecurity> retrievePropertyPathToAttributeSecurityMappings(String docTypeName) { Map<String, AttributeSecurity> results = new HashMap<String, AttributeSecurity>(); MaintenanceDocumentEntry entry = getMaintenanceDocumentDictionaryService().getMaintenanceDocumentEntry(docTypeName); String className = entry.getDataObjectClass().getName(); for (MaintainableSectionDefinition section : entry.getMaintainableSections()) { for (MaintainableItemDefinition item : section.getMaintainableItems()) { if (item instanceof MaintainableFieldDefinition) { MaintainableFieldDefinition field = (MaintainableFieldDefinition) item; AttributeSecurity attributeSecurity = getDataDictionaryService().getAttributeSecurity(className, field.getName()); if (attributeSecurity != null) { results.put(field.getName(), attributeSecurity); } } else if (item instanceof MaintainableCollectionDefinition) { addMaintenanceDocumentCollectionPathToSecurityMappings(results, "", (MaintainableCollectionDefinition) item); } } } return results; }
if (getDataDictionaryService().getAttributeDefinition(businessObjectClass.getName(), fieldNm) == null) { String errorMessage = "The field " + fieldNm + " could not be found in the data dictionary for class " + businessObjectClass.getName() + ", and thus it could not be determined whether it is a secure field.";
boolean upperCase = false; try { upperCase = getDataDictionaryService().getAttributeForceUppercase(businessObjectClass, fieldName);
/** * This method turns a list of field property names, into a delimited string of the human-readable names. * * @param fieldNames - List of fieldNames * @return A filled StringBuffer ready to go in an error message */ protected StringBuffer consolidateFieldNames(List fieldNames, String delimiter) { StringBuffer sb = new StringBuffer(); // setup some vars boolean firstPass = true; String delim = ""; // walk through the list for (Iterator iter = fieldNames.iterator(); iter.hasNext(); ) { String fieldName = (String) iter.next(); // get the human-readable name // add the new one, with the appropriate delimiter sb.append(delim + ddService.getAttributeLabel(newBo.getClass(), fieldName)); // after the first item, start using a delimiter if (firstPass) { delim = delimiter; firstPass = false; } } return sb; }