[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: Text File AttachmentSample1.patch     Text 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
Similar issues:
KULRICE-13808Create smoke test for retrieving attachments which have been linked to properties on the business object itself
KULRICE-11379sample for M29
KULRICE-9526Document which classes have been deprecated and why they have been deprecated
KULRICE-3911Business Object copy needs to be flexible
KULRICE-3716Create a "Business Object Observer" framework
KULRICE-8034Business object validation is validating reference objects when it should not
KULRICE-9287KualiLookupableTest fails in CI with Lookup not defined for business object class org.kuali.rice.krad.test.document.bo.Account
KULRICE-8467JS error in IE8 " Object doesn't support this property or method "
KULRICE-2279Add support to retrieve the user authentication Id directly from the workflowUser object
KULRICE-4736Support for dynamic business objects
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 Fri Jun 05 07:19:42 CDT 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.