use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class PaymentWorksDataProcessingIntoKfsServiceImpl method buildVendorMaintenanceDocumentBase.
private MaintenanceDocument buildVendorMaintenanceDocumentBase(VendorDetail newVendorDetail, VendorDetail oldVendorDetail, String documentAction, boolean isNewVendor, List<Note> notesToPersist) throws WorkflowException {
MaintenanceDocument vendorMaintDoc = (MaintenanceDocument) getDocumentService().getNewDocument(CUVendorConstants.VENDOR_DOCUMENT_TYPE_NAME);
vendorMaintDoc.getNewMaintainableObject().setBusinessObject(newVendorDetail);
vendorMaintDoc.getOldMaintainableObject().setBusinessObject(oldVendorDetail);
vendorMaintDoc.getDocumentHeader().setDocumentDescription(buildVendorMainenanceDocumentDescription(newVendorDetail, isNewVendor));
vendorMaintDoc.getNewMaintainableObject().setMaintenanceAction(documentAction);
for (Note note : notesToPersist) {
note.setRemoteObjectIdentifier(vendorMaintDoc.getObjectId());
vendorMaintDoc.addNote(note);
}
return vendorMaintDoc;
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuAttachmentServiceImplTest method setupMockNote.
private Note setupMockNote(String objectId) {
Note mockNote = EasyMock.createMock(Note.class);
EasyMock.expect(mockNote.getRemoteObjectIdentifier()).andStubReturn(objectId);
EasyMock.replay(mockNote);
return mockNote;
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuAttachmentServiceImplTest method setUp.
@Before
public void setUp() throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
attachmentService = new CuAttachmentServiceImpl();
attachmentService.setKualiConfigurationService(new MockConfigurationService());
attachmentService.setAttachmentDao(new MockAttachmentDao());
attachmentService.setNoteService(new MockNoteService());
attachmentService.setAntiVirusService(new MockAntivirusService());
attachment = new Attachment();
attachment.setObjectId(String.valueOf(new Guid()));
attachment.setAttachmentIdentifier(attachment.getObjectId());
Note noteGood = setupMockNote();
attachment.setNote(noteGood);
createAttachmentFile(noteGood, GOOD_FILE_NAME);
noteVirus = setupMockNote();
createAttachmentFile(noteVirus, VIRUS_FILE_NAME);
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuAttachmentServiceImplTest method setupMockNote.
private Note setupMockNote() {
Note mockNote = EasyMock.createMock(Note.class);
EasyMock.expect(mockNote.getRemoteObjectIdentifier()).andStubReturn(String.valueOf(new Guid()));
EasyMock.replay(mockNote);
return mockNote;
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class AccountReversionTrickleDownInactivationServiceImpl method addMaintenanceLockedNotes.
/**
* Adds notes about any maintence locks on Account Reversions.
*
* @param documentNumber
* @param lockedAccountReversions
* @param messageKey
* @param noteParent
* @param noteTemplate
*/
protected void addMaintenanceLockedNotes(String documentNumber, Map<AccountReversion, String> lockedAccountReversions, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
for (Map.Entry<AccountReversion, String> entry : lockedAccountReversions.entrySet()) {
try {
AccountReversion accountReversion = entry.getKey();
String accountReversionString = accountReversion.getUniversityFiscalYear() + " - " + accountReversion.getChartOfAccountsCode() + " - " + accountReversion.getAccountNumber();
if (StringUtils.isNotBlank(accountReversionString)) {
String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
String noteText = MessageFormat.format(noteTextTemplate, accountReversionString, entry.getValue());
Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
note.setNoteText(noteText);
noteService.save(note);
}
} catch (Exception e) {
LOG.error("Unable to create/save notes for document " + documentNumber, e);
throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
}
}
}
Aggregations