Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-10455

Support for retrieving attachments which have been linked to properties on the business object itself

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • 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.

        Attachments

        1. AttachmentSample1.patch
          19 kB
          Jeff Ruch
        2. KULRICE-10455.patch
          13 kB
          Kristina Taylor

          Issue Links

            Activity

            Hide
            jruch Jeff Ruch added a comment -

            This is a good example of the functionality in KNS

            Show
            jruch Jeff Ruch added a comment - This is a good example of the functionality in KNS
            Hide
            jruch Jeff Ruch added a comment -

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

            Show
            jruch Jeff Ruch added a comment - Note there are two types of attachments (PersistableAttachment and PersistableAttachmentList).
            Hide
            kbtaylor Kristina Taylor (Inactive) added a comment -

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

            Show
            kbtaylor Kristina Taylor (Inactive) added a comment - I was working on attachments for another issue and adapted this example for an attachment maintenance document. The patch should help jumpstart this issue.
            Hide
            jruch Jeff Ruch added a comment -

            Converted all fileForm to multiPartFiles.

            Show
            jruch Jeff Ruch added a comment - Converted all fileForm to multiPartFiles.
            Hide
            jruch Jeff Ruch added a comment -

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

            Show
            jruch Jeff Ruch added a comment - JPA breaks existing implementation (including KNS). Need to remove refreshAttachment and refreshAttachmentList from MaintenanceDocumentBase to resolve.
            Hide
            jruch Jeff Ruch added a comment -

            BO Attachments Sample

            Show
            jruch Jeff Ruch added a comment - BO Attachments Sample
            Hide
            jruch Jeff Ruch added a comment -

            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.

            Show
            jruch Jeff Ruch added a comment - 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.
            Hide
            jruch Jeff Ruch added a comment -

            BO Attachment sample

            Show
            jruch Jeff Ruch added a comment - BO Attachment sample

              People

              • Assignee:
                jruch Jeff Ruch
                Reporter:
                jruch Jeff Ruch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 days
                  4d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days
                  4d