Search in sources :

Example 1 with MaskFormatter

use of org.kuali.kfs.krad.datadictionary.mask.MaskFormatter in project cu-kfs by CU-CommunityApps.

the class WebUtils method getPartiallyMaskedValue.

public static String getPartiallyMaskedValue(String className, String fieldName, Object formObject, String propertyName) {
    String displayMaskValue = null;
    Object propertyValue = ObjectUtils.getPropertyValue(formObject, propertyName);
    DataDictionaryEntryBase entry = (DataDictionaryEntryBase) KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getDictionaryObjectEntry(className);
    AttributeDefinition a = entry.getAttributeDefinition(fieldName);
    AttributeSecurity attributeSecurity = a.getAttributeSecurity();
    if (attributeSecurity != null && attributeSecurity.isPartialMask()) {
        MaskFormatter partialMaskFormatter = attributeSecurity.getPartialMaskFormatter();
        displayMaskValue = partialMaskFormatter.maskValue(propertyValue);
    }
    return displayMaskValue;
}
Also used : DataDictionaryEntryBase(org.kuali.kfs.krad.datadictionary.DataDictionaryEntryBase) AttributeDefinition(org.kuali.kfs.krad.datadictionary.AttributeDefinition) MaskFormatter(org.kuali.kfs.krad.datadictionary.mask.MaskFormatter) AttributeSecurity(org.kuali.kfs.krad.datadictionary.AttributeSecurity)

Example 2 with MaskFormatter

use of org.kuali.kfs.krad.datadictionary.mask.MaskFormatter in project cu-kfs by CU-CommunityApps.

the class WebUtils method getFullyMaskedValue.

public static String getFullyMaskedValue(String className, String fieldName, Object formObject, String propertyName) {
    String displayMaskValue = null;
    Object propertyValue = ObjectUtils.getPropertyValue(formObject, propertyName);
    DataDictionaryEntryBase entry = (DataDictionaryEntryBase) KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getDictionaryObjectEntry(className);
    AttributeDefinition a = entry.getAttributeDefinition(fieldName);
    AttributeSecurity attributeSecurity = a.getAttributeSecurity();
    if (attributeSecurity != null && attributeSecurity.isMask()) {
        MaskFormatter maskFormatter = attributeSecurity.getMaskFormatter();
        displayMaskValue = maskFormatter.maskValue(propertyValue);
    }
    return displayMaskValue;
}
Also used : DataDictionaryEntryBase(org.kuali.kfs.krad.datadictionary.DataDictionaryEntryBase) AttributeDefinition(org.kuali.kfs.krad.datadictionary.AttributeDefinition) MaskFormatter(org.kuali.kfs.krad.datadictionary.mask.MaskFormatter) AttributeSecurity(org.kuali.kfs.krad.datadictionary.AttributeSecurity)

Aggregations

AttributeDefinition (org.kuali.kfs.krad.datadictionary.AttributeDefinition)2 AttributeSecurity (org.kuali.kfs.krad.datadictionary.AttributeSecurity)2 DataDictionaryEntryBase (org.kuali.kfs.krad.datadictionary.DataDictionaryEntryBase)2 MaskFormatter (org.kuali.kfs.krad.datadictionary.mask.MaskFormatter)2