/** * @return the attachmentLink */ public String getAttachmentLink() { //getAttachment() is always return null. Attachment attachment = KRADServiceLocator.getAttachmentService().getAttachmentByNoteId(Note.this.getNoteIdentifier()); if(attachment == null) { return ""; } else{ Properties params = new Properties(); params.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOWNLOAD_BO_ATTACHMENT_METHOD); params.put(KRADConstants.DOC_FORM_KEY, "88888888"); params.put(KRADConstants.NOTE_IDENTIFIER, this.getNoteIdentifier().toString()); return UrlFactory.parameterizeUrl(KRADConstants.INQUIRY_ACTION, params); } }
public InputStream getAttachmentContents() throws IOException { return KRADServiceLocator.getAttachmentService().retrieveAttachmentContents(this); } }
attachmentType = newAttachment.getAttachmentTypeCode(); attachment = getAttachmentService().createAttachment(document.getNoteTarget(), attachmentFile.getFileName(), attachmentFile.getContentType(), attachmentFile.getFileSize(), attachmentFile.getInputStream(), attachmentType);
attachment.refreshNonUpdateableReferences(); getAttachmentService().deleteAttachmentContents(attachment);