use of org.kuali.kfs.kew.api.document.attribute.DocumentAttributeString in project cu-kfs by CU-CommunityApps.
the class FinancialSystemSearchableAttribute method addSearchableAttributesForGLPE.
/**
* Pulls the default searchable attribute - financialSystemTypeCode - from a given accounting line and populates
* the searchable attribute values in the given list
*
* @param searchAttrValues a List of SearchableAttributeValue objects to populate
* @param glpe a GeneralLedgerPendingEntry to get values from
*/
protected void addSearchableAttributesForGLPE(List<DocumentAttribute> searchAttrValues, GeneralLedgerPendingEntry glpe) {
if (glpe != null && StringUtils.isNotBlank(glpe.getFinancialDocumentTypeCode())) {
DocumentAttributeString searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE, glpe.getFinancialDocumentTypeCode());
searchAttrValues.add(searchableAttributeValue);
}
}
use of org.kuali.kfs.kew.api.document.attribute.DocumentAttributeString in project cu-kfs by CU-CommunityApps.
the class FinancialSystemSearchableAttribute method addSearchableAttributesForAccountingLine.
/**
* Pulls the default searchable attributes - chart code, account number, and account organization code - from a
* given accounting line and populates the searchable attribute values in the given list
*
* @param searchAttrValues a List of SearchableAttributeValue objects to populate
* @param accountingLine an AccountingLine to get values from
*/
protected void addSearchableAttributesForAccountingLine(List<DocumentAttribute> searchAttrValues, AccountingLine accountingLine) {
DocumentAttributeString searchableAttributeValue;
if (!ObjectUtils.isNull(accountingLine)) {
if (StringUtils.isNotBlank(accountingLine.getChartOfAccountsCode())) {
searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, accountingLine.getChartOfAccountsCode());
searchAttrValues.add(searchableAttributeValue);
}
if (StringUtils.isNotBlank(accountingLine.getAccountNumber())) {
searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.ACCOUNT_NUMBER, accountingLine.getAccountNumber());
searchAttrValues.add(searchableAttributeValue);
}
if (!ObjectUtils.isNull(accountingLine.getAccount()) && StringUtils.isNotBlank(accountingLine.getAccount().getOrganizationCode())) {
searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.ORGANIZATION_CODE, accountingLine.getAccount().getOrganizationCode());
searchAttrValues.add(searchableAttributeValue);
}
}
}
use of org.kuali.kfs.kew.api.document.attribute.DocumentAttributeString in project cu-kfs by CU-CommunityApps.
the class FinancialSystemSearchableAttribute method extractDocumentAttributes.
@Override
public List<DocumentAttribute> extractDocumentAttributes(RuleAttribute ruleAttribute, DocumentRouteHeaderValue document) {
if (LOG.isDebugEnabled()) {
LOG.debug("extractDocumentAttributes( " + ruleAttribute + ", " + document + " )");
}
List<DocumentAttribute> searchAttrValues = super.extractDocumentAttributes(ruleAttribute, document);
String docId = document.getDocumentId();
DocumentService docService = SpringContext.getBean(DocumentService.class);
Document doc = null;
try {
doc = docService.getByDocumentHeaderId(docId);
} catch (WorkflowException we) {
// ignore
}
if (doc != null) {
if (doc instanceof AmountTotaling && ((AmountTotaling) doc).getTotalDollarAmount() != null) {
DocumentAttributeDecimal searchableAttributeValue = new DocumentAttributeDecimal(KFSPropertyConstants.FINANCIAL_DOCUMENT_TOTAL_AMOUNT, ((AmountTotaling) doc).getTotalDollarAmount().bigDecimalValue());
searchAttrValues.add(searchableAttributeValue);
}
if (doc instanceof AccountingDocument) {
AccountingDocument accountingDoc = (AccountingDocument) doc;
searchAttrValues.addAll(harvestAccountingDocumentSearchableAttributes(accountingDoc));
}
boolean indexedLedgerDoc = false;
if (doc instanceof LaborLedgerPostingDocumentForSearching) {
LaborLedgerPostingDocumentForSearching LLPostingDoc = (LaborLedgerPostingDocumentForSearching) doc;
searchAttrValues.addAll(harvestLLPDocumentSearchableAttributes(LLPostingDoc));
indexedLedgerDoc = true;
}
if (doc instanceof GeneralLedgerPostingDocument && !indexedLedgerDoc) {
GeneralLedgerPostingDocument GLPostingDoc = (GeneralLedgerPostingDocument) doc;
searchAttrValues.addAll(harvestGLPDocumentSearchableAttributes(GLPostingDoc));
}
DocumentHeader docHeader = doc.getDocumentHeader();
if (ObjectUtils.isNotNull(docHeader) && ObjectUtils.isNotNull(docHeader.getWorkflowDocument()) && CUKFSConstants.GACC_DOCUMENT_TYPE.equalsIgnoreCase(docHeader.getWorkflowDocument().getDocumentTypeName())) {
for (AccountGlobalDetail detail : ((AccountGlobal) ((AccountGlobalMaintainableImpl) ((FinancialSystemMaintenanceDocument) doc).getNewMaintainableObject()).getBusinessObject()).getAccountGlobalDetails()) {
if (!StringUtils.isBlank(detail.getAccountNumber())) {
DocumentAttributeString searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.ACCOUNT_NUMBER, detail.getAccountNumber());
searchAttrValues.add(searchableAttributeValue);
}
}
}
}
return searchAttrValues;
}
use of org.kuali.kfs.kew.api.document.attribute.DocumentAttributeString in project cu-kfs by CU-CommunityApps.
the class FinancialSystemSearchableAttribute method addSearchableAttributesForLLPE.
/**
* Pulls the default searchable attribute - financialSystemTypeCode from a given accounting line and populates
* the searchable attribute values in the given list
*
* @param searchAttrValues a List of SearchableAttributeValue objects to populate
* @param llpe a LaborLedgerPendingEntry to get values from
*/
protected void addSearchableAttributesForLLPE(List<DocumentAttribute> searchAttrValues, LaborLedgerPendingEntryForSearching llpe) {
if (llpe != null && StringUtils.isNotBlank(llpe.getFinancialDocumentTypeCode())) {
DocumentAttributeString searchableAttributeValue = new DocumentAttributeString(KFSPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE, llpe.getFinancialDocumentTypeCode());
searchAttrValues.add(searchableAttributeValue);
}
}
Aggregations