/** * Downloads the selected attachment to the user's browser * * @param mapping * @param form * @param request * @param response * @return ActionForward * @throws Exception */ public ActionForward downloadBOAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Long noteIdentifier = Long.valueOf(request.getParameter(KRADConstants.NOTE_IDENTIFIER)); Note note = this.getNoteService().getNoteByNoteId(noteIdentifier); if(note != null){ Attachment attachment = note.getAttachment(); if(attachment != null){ //make sure attachment is setup with backwards reference to note (rather then doing this we could also just call the attachment service (with a new method that took in the note) attachment.setNote(note); WebUtils.saveMimeInputStreamAsFile(response, attachment.getAttachmentMimeTypeCode(), attachment.getAttachmentContents(), attachment.getAttachmentFileName(), attachment.getAttachmentFileSize().intValue()); } return null; } return mapping.findForward(RiceConstants.MAPPING_BASIC); }
throw new IllegalStateException("Current UserSession has a null Person."); Note tmpNote = getNoteService().createNote(newNote, document.getNoteTarget(), kualiUser.getPrincipalId()); && !(document instanceof MaintenanceDocument && NoteType.BUSINESS_OBJECT.getCode().equals(tmpNote.getNoteTypeCode())) ) { tmpNote = getNoteService().save(tmpNote); && !(document instanceof MaintenanceDocument && NoteType.BUSINESS_OBJECT.getCode().equals(tmpNote.getNoteTypeCode())) ) { tmpNote = getNoteService().save(tmpNote);
noteText += visitor.getCollectionMessages(); KRADServiceLocator.getNoteService().save(createNote(noteText, noteTarget, currentPosition.getUserPrincipalId()));
getNoteService().deleteNote(note);