use of org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderAction method reIndexDocument.
/**
* This method is being added to handle calls to perform re-indexing of documents following change events performed on the documents. This is necessary to correct problems
* with searches not returning accurate results due to changes being made to documents, but those changes not be indexed.
*
* @param document - The document to be re-indexed.
*/
private void reIndexDocument(PurchaseOrderDocument document) {
// force reindexing
// DocumentRouteHeaderValue routeHeader = KEWServiceLocator.getRouteHeaderService().getRouteHeader(document.getDocumentNumber());
// SearchableAttributeProcessingService searchableAttributeService = MessageServiceNames.getSearchableAttributeService(routeHeader);
// searchableAttributeService.indexDocument(Long.valueOf(document.getDocumentNumber()));
// RICE20 replaced searchableAttributeProcessingService.indexDocument with DocumentAttributeIndexingQueue.indexDocument
final DocumentAttributeIndexingQueue documentAttributeIndexingQueue = KewApiServiceLocator.getDocumentAttributeIndexingQueue();
documentAttributeIndexingQueue.indexDocument(document.getDocumentNumber());
}
use of org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue in project cu-kfs by CU-CommunityApps.
the class DocumentReindexStep method execute.
/* (non-Javadoc)
* @see org.kuali.kfs.kns.bo.Step#execute(java.lang.String, java.util.Date)
*/
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
final DocumentAttributeIndexingQueue queue = KewApiServiceLocator.getDocumentAttributeIndexingQueue();
File f = new File(stagingDirectory + File.separator + fileName);
ArrayList<String> docIds = new ArrayList<String>();
try {
BufferedReader reader = new BufferedReader(new FileReader(f));
String line = null;
while ((line = reader.readLine()) != null) {
docIds.add(line);
}
} catch (IOException ioe) {
ioe.printStackTrace();
return false;
}
for (Iterator<String> it = docIds.iterator(); it.hasNext(); ) {
Long id = new Long(it.next());
try {
queue.indexDocument(id.toString());
} catch (Exception e) {
/*move to the next doc*/
}
}
addTimeStampToFileName(f, fileName, stagingDirectory);
return true;
// return SpringContext.getBean(DocumentMaintenanceService.class).requeueDocuments();
}
use of org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue in project cu-kfs by CU-CommunityApps.
the class CuPdpExtractServiceImpl method updatePaymentRequest.
@Override
protected void updatePaymentRequest(PaymentRequestDocument paymentRequestDocument, Person puser, Date processRunDate) {
try {
PaymentRequestDocument doc = (PaymentRequestDocument) documentService.getByDocumentHeaderId(paymentRequestDocument.getDocumentNumber());
doc.setExtractedTimestamp(new Timestamp(processRunDate.getTime()));
SpringContext.getBean(PurapService.class).saveDocumentNoValidation(doc);
// RICE20 replaced searchableAttributeProcessingService.indexDocument with DocumentAttributeIndexingQueue.indexDocument
DocumentTypeService documentTypeService = SpringContext.getBean(DocumentTypeService.class);
DocumentType documentType = documentTypeService.getDocumentTypeByName(doc.getFinancialDocumentTypeCode());
DocumentAttributeIndexingQueue queue = KewApiServiceLocator.getDocumentAttributeIndexingQueue(documentType.getApplicationId());
queue.indexDocument(doc.getDocumentNumber());
} catch (WorkflowException e) {
throw new IllegalArgumentException("Unable to retrieve payment request: " + paymentRequestDocument.getDocumentNumber());
}
}
use of org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue in project cu-kfs by CU-CommunityApps.
the class CuCreditMemoServiceImpl method reIndexDocument.
/**
* KFSUPGRADE-508 : this is happened in multi-node env. also see KFSUPGRADE_347
* This method is being added to handle calls to perform re-indexing of documents following change events performed on the documents. This is necessary to correct problems
* with searches not returning accurate results due to changes being made to documents, but those changes not be indexed.
*
* @param document - The document to be re-indexed.
*/
private void reIndexDocument(AccountsPayableDocument document) {
// force reindexing
final DocumentAttributeIndexingQueue documentAttributeIndexingQueue = KewApiServiceLocator.getDocumentAttributeIndexingQueue();
documentAttributeIndexingQueue.indexDocument(document.getDocumentNumber());
}
use of org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImpl method reIndexDocument.
/**
* KFSUPGRADE-508 : this is happened in multi-node env. also see KFSUPGRADE_347
* This method is being added to handle calls to perform re-indexing of documents following change events performed on the documents. This is necessary to correct problems
* with searches not returning accurate results due to changes being made to documents, but those changes not be indexed.
*
* @param document - The document to be re-indexed.
*/
private void reIndexDocument(AccountsPayableDocument document) {
// force reindexing
final DocumentAttributeIndexingQueue documentAttributeIndexingQueue = KewApiServiceLocator.getDocumentAttributeIndexingQueue();
documentAttributeIndexingQueue.indexDocument(document.getDocumentNumber());
}
Aggregations