Search in sources :

Example 46 with Note

use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.

the class VendorBatchServiceImpl method addNote.

/*
     * create a note and add it to vendor document
     */
private void addNote(Document document, String noteText) {
    Note note = new Note();
    note.setNoteText(noteText);
    note.setRemoteObjectIdentifier(document.getObjectId());
    note.setAuthorUniversalIdentifier(getSystemUser().getPrincipalId());
    note.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
    note.setNotePostedTimestampToCurrent();
    document.addNote(note);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) VendorBatchAdditionalNote(edu.cornell.kfs.vnd.businessobject.VendorBatchAdditionalNote)

Example 47 with Note

use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.

the class VendorInactivateConvertBatchServiceImpl method activateVendor.

private void activateVendor(VendorDetail vnd, String note, String reasonCd) {
    vnd.setActiveIndicator(true);
    vnd.setVendorInactiveReasonCode(null);
    vnd.setVendorInactiveReason(null);
    Note newNote = new Note();
    newNote.setNoteText("Vendor has been activated via the activate batch job for the following reason: " + note);
    newNote.setNotePostedTimestampToCurrent();
    LOG.info("activating " + vnd.getVendorNumber());
    Note tmpNote = noteService.createNote(newNote, vnd, GlobalVariables.getUserSession().getPrincipalId());
    LOG.info("save note");
    SpringContext.getBean(NoteService.class).save(tmpNote);
    businessObjectService.save(vnd);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NoteService(org.kuali.kfs.krad.service.NoteService)

Example 48 with Note

use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.

the class VendorInactivateConvertBatchServiceImpl method convertVendor.

private void convertVendor(VendorHeader vHead, VendorDetail vnd, String note, String vndTypeCd) {
    vHead.setVendorTypeCode(vndTypeCd);
    Note newNote = new Note();
    newNote.setNoteText("Vendor Type has been converted to " + vndTypeCd + " via the convert vendor batch job for the following reason: " + note);
    newNote.setNotePostedTimestampToCurrent();
    LOG.info("Converting " + vnd.getVendorNumber());
    Note tmpNote = noteService.createNote(newNote, vnd, GlobalVariables.getUserSession().getPrincipalId());
    LOG.info("save note");
    SpringContext.getBean(NoteService.class).save(tmpNote);
    businessObjectService.save(vHead);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NoteService(org.kuali.kfs.krad.service.NoteService)

Example 49 with Note

use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.

the class AbstractRelatedView method getNotes.

public List<Note> getNotes() {
    List<Note> notes = new ArrayList<Note>();
    // reverse the order of notes only when anything exists in it..
    NoteService noteService = SpringContext.getBean(NoteService.class);
    // ==== CU Customization: Use the note target property, rather than always assuming that the doc header is the target. ====
    List<Note> tmpNotes = noteService.getByRemoteObjectId(findDocument(this.documentNumber).getNoteTarget().getObjectId());
    notes.clear();
    // reverse the order of notes retrieved so that newest note is in the front
    for (int i = tmpNotes.size() - 1; i >= 0; i--) {
        Note note = tmpNotes.get(i);
        notes.add(note);
    }
    return notes;
}
Also used : Note(org.kuali.kfs.krad.bo.Note) ArrayList(java.util.ArrayList) NoteService(org.kuali.kfs.krad.service.NoteService)

Example 50 with Note

use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.

the class CuDisbursementVoucherAction method insertBONote.

/**
 * Overridden to treat "Confidential" add-attachment authorization failures as validation errors, rather than throwing an authorization exception.
 *
 * @see org.kuali.kfs.kns.web.struts.action.KualiDocumentActionBase#insertBONote()
 */
@SuppressWarnings("deprecation")
@Override
public ActionForward insertBONote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    CuDisbursementVoucherForm dvForm = (CuDisbursementVoucherForm) form;
    Note newNote = dvForm.getNewNote();
    // If trying to add a conf attachment without authorization or not properly flagging a potentially-conf attachment, then treat as a validation failure.
    if (!ConfidentialAttachmentUtil.attachmentIsNonConfidentialOrCanAddConfAttachment(newNote, dvForm.getDocument(), dvForm.getAttachmentFile(), getDocumentHelperService().getDocumentAuthorizer(dvForm.getDocument()))) {
        // Just return without adding the note/attachment. The ConfidentialAttachmentUtil method will handle updating the message map accordingly.
        return mapping.findForward(RiceConstants.MAPPING_BASIC);
    }
    // If not "Confidential" or if authorized to add such attachments, then proceed with the superclass processing.
    return super.insertBONote(mapping, form, request, response);
}
Also used : Note(org.kuali.kfs.krad.bo.Note)

Aggregations

Note (org.kuali.kfs.krad.bo.Note)76 Attachment (org.kuali.kfs.krad.bo.Attachment)14 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)12 IOException (java.io.IOException)9 FileNotFoundException (java.io.FileNotFoundException)7 ArrayList (java.util.ArrayList)7 NoteService (org.kuali.kfs.krad.service.NoteService)7 FileInputStream (java.io.FileInputStream)6 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)6 NonTransactional (org.kuali.kfs.sys.service.NonTransactional)6 File (java.io.File)5 Iterator (java.util.Iterator)5 DocumentService (org.kuali.kfs.krad.service.DocumentService)5 Person (org.kuali.rice.kim.api.identity.Person)5 NoteExtendedAttribute (edu.cornell.kfs.sys.businessobject.NoteExtendedAttribute)4 SimpleDateFormat (java.text.SimpleDateFormat)4 Document (org.kuali.kfs.krad.document.Document)4 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)4 HashMap (java.util.HashMap)3 List (java.util.List)3