/** * Update activity status code to the value used in DB. The reason is the value from user input * will be 'Y' or 'N'. However, these two status code are now replaced by 'N','E' and 'P'. * * @param fieldValues */ protected void updateStatusCodeCriteria(Map<String, String> fieldValues) { String activityStatusCode = null; if (fieldValues.containsKey(CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE)) { activityStatusCode = (String) fieldValues.get(CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE); } if (KFSConstants.NON_ACTIVE_INDICATOR.equalsIgnoreCase(activityStatusCode)) { // not processed in CAMs: 'N' fieldValues.put( CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE, CabConstants.ActivityStatusCode.NEW); } else if (KFSConstants.ACTIVE_INDICATOR.equalsIgnoreCase(activityStatusCode)) { // processed in CAMs: 'E' or 'P' fieldValues.put( CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE, CabConstants.ActivityStatusCode.PROCESSED_IN_CAMS + SearchOperator.OR.op() + CabConstants.ActivityStatusCode.ENROUTE); } }
@SuppressWarnings({"rawtypes", "unchecked"}) protected void transformWildCardableFields( Class<? extends HrBusinessObjectContract> hrBOClass, Map formProps) { Iterator propsIter = formProps.keySet().iterator(); while (propsIter.hasNext()) { String propertyName = (String) propsIter.next(); String propertyValue = (String) formProps.get(propertyName); if (StringUtils.isNotBlank(propertyValue)) { // transform this value into an "OR" with the wildcard symbols boolean canContainWildcard = false; if (KRADServiceLocatorWeb.getDataDictionaryService() .isAttributeDefined(hrBOClass, propertyName)) { AttributeDefinition attributeDefinition = KRADServiceLocatorWeb.getDataDictionaryService() .getAttributeDefinition(hrBOClass.getName(), propertyName); // check if this property is wildcarded if (attributeDefinition instanceof WildcardableAttributeDefinition) { canContainWildcard = ((WildcardableAttributeDefinition) attributeDefinition).getContainsWildcardData(); } if (canContainWildcard) { // get the wildcard symbols and attach them with an "OR" seperator i.e. "|" List<String> wildcardStrings = ((WildcardableAttributeDefinition) attributeDefinition).getAllowedWildcardStrings(); if (wildcardStrings != null) { for (String wildcardString : wildcardStrings) { if (StringUtils.equals("*", wildcardString) || StringUtils.equals("%", wildcardString)) { wildcardString = "\\" + wildcardString; } propertyValue = propertyValue + SearchOperator.OR.op() + wildcardString; } formProps.put(propertyName, propertyValue); } } } } } }