Search in sources :

Example 1 with DocumentAttributeIndexingQueue

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());
}
Also used : DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue)

Example 2 with DocumentAttributeIndexingQueue

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();
}
Also used : ArrayList(java.util.ArrayList) BufferedReader(java.io.BufferedReader) DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue) FileReader(java.io.FileReader) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException)

Example 3 with DocumentAttributeIndexingQueue

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());
    }
}
Also used : PurapService(org.kuali.kfs.module.purap.document.service.PurapService) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) DocumentType(org.kuali.rice.kew.api.doctype.DocumentType) DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) DocumentTypeService(org.kuali.rice.kew.api.doctype.DocumentTypeService) Timestamp(java.sql.Timestamp)

Example 4 with DocumentAttributeIndexingQueue

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());
}
Also used : DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue)

Example 5 with DocumentAttributeIndexingQueue

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());
}
Also used : DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue)

Aggregations

DocumentAttributeIndexingQueue (org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue)5 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)1 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)1 DocumentType (org.kuali.rice.kew.api.doctype.DocumentType)1 DocumentTypeService (org.kuali.rice.kew.api.doctype.DocumentTypeService)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1