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 Bug Fix
    • Status: Closed Closed
    • Priority: Major 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
    • 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.

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

        Issue Links

          Activity

          Hide
          Jeff Ruch added a comment -

          BO Attachment sample

          Show
          Jeff Ruch added a comment - BO Attachment sample
          Hide
          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
          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
          Jeff Ruch added a comment -

          BO Attachments Sample

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

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

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

          Converted all fileForm to multiPartFiles.

          Show
          Jeff Ruch added a comment - Converted all fileForm to multiPartFiles.
          Hide
          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
          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
          Jeff Ruch added a comment -

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

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

          This is a good example of the functionality in KNS

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

            People

            • Assignee:
              Jeff Ruch
              Reporter:
              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

                  Agile

                    Structure Helper Panel