use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class SubDirectoryWalker method handleDirectoryStart.
/**
* @see DirectoryWalker#handleDirectoryStart(File, int, java.util.Collection)
*/
@Override
protected void handleDirectoryStart(File directory, int depth, Collection results) throws IOException {
super.handleDirectoryStart(directory, depth, results);
ConcreteKeyValue entry = new ConcreteKeyValue();
entry.setKey(BatchFileUtils.pathRelativeToRootDirectory(directory.getAbsolutePath()));
// use the unicode literal for space....KFSMI-7392 fix
entry.setValue(StringUtils.repeat("\u00A0", 4 * this.recursiveDepth) + directory.getName());
keyValues.add(entry);
this.recursiveDepth++;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class FavoriteAccountValuesFinder method getKeyValues.
public List<KeyValue> getKeyValues() {
List<KeyValue> keyValues = new ArrayList<KeyValue>();
List<FavoriteAccount> favoriteAccounts = getUserFavoriteAccounts();
keyValues.add(new ConcreteKeyValue("", ""));
if (CollectionUtils.isNotEmpty(favoriteAccounts)) {
Collections.sort(favoriteAccounts, new Comparator() {
public int compare(Object o1, Object o2) {
FavoriteAccount accountFirst = (FavoriteAccount) o1;
FavoriteAccount accountSecond = (FavoriteAccount) o2;
if (accountFirst.getPrimaryInd() && !accountSecond.getPrimaryInd()) {
return -1;
} else if (!accountFirst.getPrimaryInd() && accountSecond.getPrimaryInd()) {
return 1;
}
if (StringUtils.equals(accountFirst.getDescription(), accountSecond.getDescription())) {
return accountFirst.getAccountNumber().compareTo(accountSecond.getAccountNumber());
} else if (StringUtils.isBlank(accountFirst.getDescription())) {
// Be aware case comparison.
return -1;
} else if (StringUtils.isBlank(accountSecond.getDescription())) {
return 1;
} else {
return accountFirst.getDescription().compareTo(accountSecond.getDescription());
}
}
});
for (FavoriteAccount account : favoriteAccounts) {
keyValues.add(new ConcreteKeyValue(account.getAccountLineIdentifier().toString(), getAccountingLineDescription(account)));
}
}
return keyValues;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class AutoDisEncumberType method getKeyValues.
/**
* Creates a list of {@link Chart}s using their code as their key, and their code as the display value
*
* @see org.kuali.kfs.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List<KeyValue> getKeyValues() {
List<KeyValue> chartKeyLabels = new ArrayList<KeyValue>();
chartKeyLabels.add(new ConcreteKeyValue("", ""));
chartKeyLabels.add(new ConcreteKeyValue(CUKFSConstants.PreEncumbranceDocumentConstants.BIWEEKLY, "Bi-Weekly"));
chartKeyLabels.add(new ConcreteKeyValue(CUKFSConstants.PreEncumbranceDocumentConstants.MONTHLY, "Monthly"));
chartKeyLabels.add(new ConcreteKeyValue(CUKFSConstants.PreEncumbranceDocumentConstants.SEMIMONTHLY, "Semi-Monthly"));
chartKeyLabels.add(new ConcreteKeyValue(CUKFSConstants.PreEncumbranceDocumentConstants.CUSTOM, "One Time"));
return chartKeyLabels;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class CuCurrencyTypeValuesFinder method getKeyValues.
/*
* @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List getKeyValues() {
List keyValues = new ArrayList();
keyValues.add(new ConcreteKeyValue(CuFPConstants.CURRENCY_CODE_U, CuFPConstants.CURRENCY_US_DOLLAR));
keyValues.add(new ConcreteKeyValue(CuFPConstants.CURRENCY_CODE_C, CuFPConstants.CURRENCY_US_DOLLAR_TO_FOREIGN));
keyValues.add(new ConcreteKeyValue(CuFPConstants.CURRENCY_CODE_F, CuFPConstants.CURRENCY_FOREIGN));
return keyValues;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class IWantDocumentAction method setCollegeAndDepartmentBasedOnPrimaryDepartment.
/**
* Sets the College and Department based on the initiator primary department.
*
* @param documentForm
*/
private void setCollegeAndDepartmentBasedOnPrimaryDepartment(IWantDocumentForm documentForm) {
IWantDocumentService iWantDocumentService = SpringContext.getBean(IWantDocumentService.class);
String primaryDeptOrg = null;
IWantDocument iWantDocument = null;
if (documentForm != null && documentForm.getDocument() != null) {
iWantDocument = (IWantDocument) documentForm.getDocument();
}
if (iWantDocument != null && StringUtils.isEmpty(iWantDocument.getCollegeLevelOrganization())) {
Person currentUser = GlobalVariables.getUserSession().getPerson();
Entity entityInfo = KimApiServiceLocator.getIdentityService().getEntityByPrincipalId(currentUser.getPrincipalId());
if (ObjectUtils.isNotNull(entityInfo)) {
if (ObjectUtils.isNotNull(entityInfo.getEmploymentInformation()) && entityInfo.getEmploymentInformation().size() > 0) {
EntityEmployment employmentInformation = entityInfo.getEmploymentInformation().get(0);
String primaryDepartment = employmentInformation.getPrimaryDepartmentCode();
primaryDeptOrg = primaryDepartment.substring(primaryDepartment.lastIndexOf('-') + 1, primaryDepartment.length());
String cLevelOrg = iWantDocumentService.getCLevelOrganizationForDLevelOrg(primaryDepartment);
((IWantDocument) documentForm.getDocument()).setCollegeLevelOrganization(cLevelOrg);
}
}
}
if (iWantDocument != null && StringUtils.isNotEmpty(iWantDocument.getCollegeLevelOrganization())) {
String cLevelOrg = iWantDocument.getCollegeLevelOrganization();
documentForm.getDeptOrgKeyLabels().clear();
documentForm.getDeptOrgKeyLabels().add(new ConcreteKeyValue("", "Please Select"));
List<LevelOrganization> dLevelOrgs = iWantDocumentService.getDLevelOrganizations(cLevelOrg);
for (LevelOrganization levelOrganization : dLevelOrgs) {
documentForm.getDeptOrgKeyLabels().add(new ConcreteKeyValue(levelOrganization.getCode(), levelOrganization.getCodeAndDescription()));
}
if (primaryDeptOrg != null) {
iWantDocument.setDepartmentLevelOrganization(primaryDeptOrg);
}
}
}
Aggregations