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);
}
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);
}
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);
}
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;
}
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);
}
Aggregations