Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-9795

Convert the PersistableAttachment framework for KRAD

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-7234Convert KRAD Manual to DocBook
      KULRICE-9507Convert internal Rice modules to use JPA and the new krad-data framework
      KULRICE-9420Convert Administration > Miscellaneous Screens to KRAD
      KULRICE-9127Convert Address Type to KRAD
      KULRICE-9128Convert Affiliation Type to KRAD
      KULRICE-9130Convert Citizenship Status to KRAD
      KULRICE-9131Convert Email Type to KRAD
      KULRICE-9132Convert Entity Type to KRAD
      KULRICE-9134Convert Name Type to KRAD
      KULRICE-9135Convert Phone Type to KRAD
    • Rice Module:
      KNS, KRAD
    • KRAD Feature Area:
      Document
    • Sprint:
      2.4.0-m4 Dev Sprint 4 (Real), 2.4.0-rc1 Sprint 1, Core 2.5.0-m6 Sprint 2
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      5

      Description

      As a user of the maintenance document framework, I would like to be able to upload and download attachments on to business objects so that they are persisted along with the rest of the business object.

        Activity

        Hide
        Eric Westfall added a comment -

        Assigning this one to you Kurt. It sounds like what happened is that PersistableAttachment perhaps didn't get handled properly in the JPA migration of KRAD. It will probably be worth chatting quickly with Jonathan about it first so he can point you in the right direction.

        Show
        Eric Westfall added a comment - Assigning this one to you Kurt. It sounds like what happened is that PersistableAttachment perhaps didn't get handled properly in the JPA migration of KRAD. It will probably be worth chatting quickly with Jonathan about it first so he can point you in the right direction.
        Hide
        Eric Westfall added a comment -

        Unassigning from Kurt since he's not working the current sprint.

        Show
        Eric Westfall added a comment - Unassigning from Kurt since he's not working the current sprint.
        Hide
        Eric Westfall added a comment -

        We looked at this one and it looks to me like in KRAD code is commented out related to this. I think for this jira we need to figure out if PersistableAttachments are actually working properly in KRAD or not, and then if not figure out how to fix them (or if they even still make sense to have in KRAD?)

        For example, see org.kuali.rice.krad.maintenance.MaintenanceDocumentBase.populateDocumentAttachment. It's all commented out with a TODO that says "TODO: need to convert this from using struts form file". So I assume it most being something missed in KNS -> KRAD.

        Show
        Eric Westfall added a comment - We looked at this one and it looks to me like in KRAD code is commented out related to this. I think for this jira we need to figure out if PersistableAttachments are actually working properly in KRAD or not, and then if not figure out how to fix them (or if they even still make sense to have in KRAD?) For example, see org.kuali.rice.krad.maintenance.MaintenanceDocumentBase.populateDocumentAttachment. It's all commented out with a TODO that says "TODO: need to convert this from using struts form file". So I assume it most being something missed in KNS -> KRAD.
        Hide
        Eric Westfall added a comment -

        Moving to 2.5 from 2.4 and removing epic link.

        Show
        Eric Westfall added a comment - Moving to 2.5 from 2.4 and removing epic link.
        Hide
        Kristina Taylor (Inactive) added a comment -

        See additional comments on KULRICE-12964.

        Show
        Kristina Taylor (Inactive) added a comment - See additional comments on KULRICE-12964 .
        Hide
        Shannon Hess added a comment - - edited

        The PersistableAttachment framework works differently in KRAD but it is working as expected.

        Links to Examples:

        CI Tests - https://ci.kuali.org/view/rice/view/2.5/view/list/job/rice-2.5-test-functional-env14-jenkins-krad-sampleapp/lastCompletedBuild/testReport/org.kuali.rice.krad.labs.maintenance/LabsMaintenanceBOAttachmentAft/

        There is a write up in the KNS2KRAD conversion guide : http://site.kuali.org/rice/latest/reference/html/KNS2KRAD_ConvGuide.html#MA

        I removed the TODO code in org.kuali.rice.krad.maintenance.MaintenanceDocumentBase and replaced it with the following:

            /**
             * The following populateAttachment methods are no longer needed for KRAD but are still used and overridden in
             * org.kuali.rice.kns.document.MaintenanceDocumentBase.  Once the KNS version of MaintenanceDocumentBase is gone
             * these methods can be removed along with any calling code.
             */
            public void populateAttachmentForBO() { }
        
            public void populateDocumentAttachment() { }
        
            public void populateAttachmentListForBO() { }
        
            public void populateAttachmentBeforeSave() { }
        
            public void populateDocumentAttachmentList() { }
        
            public void populateBoAttachmentListBeforeSave() { }
        
            /**
             * The following deleteDocumentAttachment methods are no longer needed for KRAD but are still used for KNS
             * documents. For KRAD documents, attachment is null and attachments is empty so the code is not executed.
             */
            public void deleteDocumentAttachment() {
                if ( attachment != null ) {
                    KRADServiceLocatorWeb.getLegacyDataAdapter().delete(attachment);
                    attachment = null;
                }
            }
        
            public void deleteDocumentAttachmentList() {
                if (CollectionUtils.isNotEmpty(attachments)) {
                    for (MultiDocumentAttachment attachment : attachments) {
                        KRADServiceLocatorWeb.getLegacyDataAdapter().delete(attachment);
                    }
                    attachments = null;
                }
            }
        
        Show
        Shannon Hess added a comment - - edited The PersistableAttachment framework works differently in KRAD but it is working as expected. Links to Examples: Demo Page - http://env14.rice.kuali.org/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR4C2 Single attachment - http://env14.rice.kuali.org/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.labs.LabsTravelAttachment Collection of attachments - http://env14.rice.kuali.org/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.labs.LabsTravelAttachmentGroup CI Tests - https://ci.kuali.org/view/rice/view/2.5/view/list/job/rice-2.5-test-functional-env14-jenkins-krad-sampleapp/lastCompletedBuild/testReport/org.kuali.rice.krad.labs.maintenance/LabsMaintenanceBOAttachmentAft/ There is a write up in the KNS2KRAD conversion guide : http://site.kuali.org/rice/latest/reference/html/KNS2KRAD_ConvGuide.html#MA I removed the TODO code in org.kuali.rice.krad.maintenance.MaintenanceDocumentBase and replaced it with the following: /** * The following populateAttachment methods are no longer needed for KRAD but are still used and overridden in * org.kuali.rice.kns.document.MaintenanceDocumentBase. Once the KNS version of MaintenanceDocumentBase is gone * these methods can be removed along with any calling code. */ public void populateAttachmentForBO() { } public void populateDocumentAttachment() { } public void populateAttachmentListForBO() { } public void populateAttachmentBeforeSave() { } public void populateDocumentAttachmentList() { } public void populateBoAttachmentListBeforeSave() { } /** * The following deleteDocumentAttachment methods are no longer needed for KRAD but are still used for KNS * documents. For KRAD documents, attachment is null and attachments is empty so the code is not executed. */ public void deleteDocumentAttachment() { if ( attachment != null ) { KRADServiceLocatorWeb.getLegacyDataAdapter().delete(attachment); attachment = null ; } } public void deleteDocumentAttachmentList() { if (CollectionUtils.isNotEmpty(attachments)) { for (MultiDocumentAttachment attachment : attachments) { KRADServiceLocatorWeb.getLegacyDataAdapter().delete(attachment); } attachments = null ; } }
        Hide
        Shannon Hess added a comment -

        I accidentally committed a change to LabsMaintenanceBOAttachmentAft.java without meaning to as part of KULRICE-13015 so it appears in that list of source changes as well.

        Show
        Shannon Hess added a comment - I accidentally committed a change to LabsMaintenanceBOAttachmentAft.java without meaning to as part of KULRICE-13015 so it appears in that list of source changes as well.
        Hide
        Kristina Taylor (Inactive) added a comment -

        The method we are using to document the methods that are no longer used is to deprecate them. You can also remove the comments you put in since the deprecation annotation is sufficient.

        Show
        Kristina Taylor (Inactive) added a comment - The method we are using to document the methods that are no longer used is to deprecate them. You can also remove the comments you put in since the deprecation annotation is sufficient.
        Hide
        Shannon Hess added a comment -

        I've updated methods to be deprecated. I also included refreshAttachment and refreshAttachmentList as methods that are deprecated.

        Show
        Shannon Hess added a comment - I've updated methods to be deprecated. I also included refreshAttachment and refreshAttachmentList as methods that are deprecated.

          People

          • Assignee:
            Shannon Hess
            Reporter:
            Jonathan Keller
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 30 minutes
              1h 30m

                Agile

                  Structure Helper Panel