/** * 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) + ")"; }
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(); }
/** * 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) + ")"; }
/** * 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; }
/** * This method creates a human-readable string of the class' primary key field names, as designated by the * DataDictionary. * * @param boClass * @return */ protected String getHumanReadablePrimaryKeyFieldNames(Class<?> boClass) { String delim = ""; StringBuffer pkFieldNames = new StringBuffer(); // get a list of all the primary key field names, walk through them List<String> pkFields = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(boClass); for (Iterator<String> iter = pkFields.iterator(); iter.hasNext(); ) { String pkFieldName = (String) iter.next(); // TODO should this be getting labels from the view dictionary // use the DataDictionary service to translate field name into human-readable label String humanReadableFieldName = ddService.getAttributeLabel(boClass, pkFieldName); // append the next field pkFieldNames.append(delim + humanReadableFieldName); // separate names with commas after the first one if (delim.equalsIgnoreCase("")) { delim = ", "; } } return pkFieldNames.toString(); }
/** * Returns a comma delimited list of primary key field labels, to be used on the UI to tell the user which fields were used to search * * These labels are generated from the DD definitions for the lookup fields * * @return a comma separated list of field attribute names. If no fields found, returns "N/A" * @see LookupableHelperService#isSearchUsingOnlyPrimaryKeyValues() * @see LookupableHelperService#getPrimaryKeyFieldLabels() */ @Override public String getPrimaryKeyFieldLabels() { StringBuilder buf = new StringBuilder(); List<String> primaryKeyFieldNames = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(getBusinessObjectClass()); Iterator<String> pkIter = primaryKeyFieldNames.iterator(); while (pkIter.hasNext()) { String pkFieldName = (String) pkIter.next(); buf.append(getDataDictionaryService().getAttributeLabel(getBusinessObjectClass(), pkFieldName)); if (pkIter.hasNext()) { buf.append(", "); } } return buf.length() == 0 ? KRADConstants.NOT_AVAILABLE_STRING : buf.toString(); }
String fieldNameReadable = ddService.getAttributeLabel(newBo.getClass(), fieldName);
final String attributeDisplayLabel; if (StringUtils.isNotBlank(attr.getKimAttribute().getComponentName())) { attributeDisplayLabel = getDataDictionaryService().getAttributeLabel(attr.getKimAttribute().getComponentName(), attributeToHighlightOnFail); } else { attributeDisplayLabel = attr.getKimAttribute().getAttributeLabel();
/** * This method uses the evaluationSucceeds method to evaluate the * constrainedValue. If evaluation does not succeed, it adds an error to * GlobalVariables.getErrorMap(). The businessObjectOrDocumentClass, * nameOfConstrainedProperty and userEditablePropertyName are used to * retrieve the appropriate labels from the DataDictionary. * * @param businessObjectOrDocumentClass * @return boolean indicating whether evaluation succeeded (see * evaluationSucceeds) */ public boolean evaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass, String constrainedPropertyName, String userEditablePropertyName) { if (!evaluationSucceeds()) { GlobalVariables.getMessageMap().putError( userEditablePropertyName, constraintIsAllow() ? RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_ALLOWED_VALUES_PARAMETER : RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_DENIED_VALUES_PARAMETER, new String[] { getDataDictionaryService().getAttributeLabel( businessObjectOrDocumentClass, constrainedPropertyName), constrainedValue, toStringForMessage(), getParameterValuesForMessage(), getDataDictionaryService().getAttributeLabel( businessObjectOrDocumentClass, userEditablePropertyName) } ); return false; } return true; }
if (fieldValues.containsKey(attributeName)) { String attributeLabel = getDataDictionaryService().getAttributeLabel(getBusinessObjectClass(), attributeName);
return; String attributeLabel = getDataDictionaryService().getAttributeLabel(getBusinessObjectClass(), attributeName); if (getBusinessObjectDictionaryService().isLookupFieldTreatWildcardsAndOperatorsAsLiteral(businessObjectClass, attributeName)) { BusinessObject example = null;
@Override public List<RemotableAttributeError> validateUnmodifiableAttributes(String kimTypeId, Map<String, String> originalAttributes, Map<String, String> newAttributes){ if (StringUtils.isBlank(kimTypeId)) { throw new RiceIllegalArgumentException("kimTypeId was null or blank"); } if (newAttributes == null) { throw new RiceIllegalArgumentException("newAttributes was null or blank"); } if (originalAttributes == null) { throw new RiceIllegalArgumentException("oldAttributes was null or blank"); } List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>(); KimType kimType = getTypeInfoService().getKimType(kimTypeId); List<String> uniqueAttributes = getUniqueAttributes(kimTypeId); for(String attributeNameKey: uniqueAttributes){ KimTypeAttribute attr = kimType.getAttributeDefinitionByName(attributeNameKey); String mainAttributeValue = getAttributeValue(originalAttributes, attributeNameKey); String delegationAttributeValue = getAttributeValue(newAttributes, attributeNameKey); if(!StringUtils.equals(mainAttributeValue, delegationAttributeValue)){ validationErrors.add(RemotableAttributeError.Builder.create(attributeNameKey, DataDictionaryTypeServiceHelper .createErrorString(RiceKeyConstants.ERROR_CANT_BE_MODIFIED, dataDictionaryService.getAttributeLabel(attr.getKimAttribute().getComponentName(), attributeNameKey))).build()); } } return validationErrors; }
field.setFieldLabel(getDataDictionaryService().getAttributeLabel(businessObjectClass, 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; }
Column column = new Column(); column.setPropertyName(attributeName); String columnTitle = getDataDictionaryService().getAttributeLabel(getBusinessObjectClass(), attributeName); Boolean useShortLabel = getBusinessObjectDictionaryService().getLookupResultFieldUseShortLabel(businessObjectClass, attributeName); if (useShortLabel != null && useShortLabel) {