[KULRICE-10455] Support for retrieving attachments which have been linked to properties on the business object itself Created: 11/Sep/13  Updated: 21/Apr/14  Resolved: 19/Oct/13

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: 2.3
Fix Version/s: 2.4
Security Level: Public (Public: Anyone can view)

Type: Bug Fix Priority: Major
Reporter: Jeff Ruch Assignee: Jeff Ruch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 4 days
Original Estimate: 4 days

Attachments: File AttachmentSample1.patch     File KULRICE-10455.patch    
Issue Links:
Relate
relates to KULRICE-5130 Sample Maintenance Document for testi... Closed
is related to KULRICE-13808 Create smoke test for retrieving atta... Closed
Rely
is relied upon by KULRICE-5363 Inquiry - Support for displaying bo a... Closed
Rice Module:
KRAD
Sprint: 2.4.0-m2 KRAD Sprint 4, 2.4.0-m3 KRAD Sprint 1
KAI Review Status: Not Required
KTI Review Status: Not Required
Code Review Status: Not Required
Include in Release Notes?:
Yes

 Description   

Convert KNS functionality to retrieve attachments that are linked to a BO property. You probably just need to convert struts file form to spring for populateDocumentAttachment() in MaintenanceDocumentBase. A sample of the KNS functionality is at https://jira.kuali.org/browse/KULRICE-5130.



 Comments   
Comment by Jeff Ruch [ 11/Sep/13 ]

This is a good example of the functionality in KNS

Comment by Jeff Ruch [ 11/Sep/13 ]

Note there are two types of attachments (PersistableAttachment and PersistableAttachmentList).

Comment by Kristina Taylor (Inactive) [ 01/Oct/13 ]

I was working on attachments for another issue and adapted this example for an attachment maintenance document. The patch should help jumpstart this issue.

Comment by Jeff Ruch [ 15/Oct/13 ]

Converted all fileForm to multiPartFiles.

Comment by Jeff Ruch [ 15/Oct/13 ]

JPA breaks existing implementation (including KNS). Need to remove refreshAttachment and refreshAttachmentList from MaintenanceDocumentBase to resolve.

Comment by Jeff Ruch [ 19/Oct/13 ]

BO Attachments Sample

Comment by Jeff Ruch [ 19/Oct/13 ]

Sample attached. Notice that the main issue with attachments is that the multiPartFile needs to be converted into file name, content type, and byte[]. The easiest way to do this is in the BO (as you can see in the sample). Once a multiPartFile attachmentFile is set, the BO sets the relevant fields so that it can be saved in the data.

For downloads, the old KNS action used a downloadAttachment method. This method was flawed because it could not support documents with both attachments and bo attachments. In order to fix that, I overrode the downloadBOAttachment method on the maintenance document controller.

Comment by Jeff Ruch [ 19/Oct/13 ]

BO Attachment sample

Generated at Tue Jan 26 05:36:21 CST 2021 using JIRA 7.0.11#70121-sha1:19d24976997c1d95f06f3e327e087be0b71f28d4.