Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Sprint:
      2.4.0-m4 KRAD Sprint 1, 2.4.0-m4 KRAD Sprint 2, Core 2.5.0-m4 Sprint 1, Core 2.5.0-m4 Sprint 2
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required

      Description

      Demo for M94 - List data object attributes which should be reference checked for existence. These will be checked that they exist in the database and are active. You can (must?) also indicate which field you want the framework to highlight if the validation fails.

      1) Build a KRAD sample linked from the KRAD sample app / labs / maintenance page, and
      2) identify a KNS example.
      Add links to these in the corresponding row the Maintenance Gap Analysis wiki page (https://wiki.kuali.org/display/KULRICE/Gap+Analysis+-+Maintenance+Document) to these examples.

        Attachments

          Issue Links

            Activity

            Hide
            eghm-kuali-m Erik Meade added a comment -

            ./rice-framework/krad-it/src/test/resources/org/kuali/rice/krad/test/document/AccountMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/core-service/web/src/main/resources/org/kuali/rice/coreservice/web/component/ComponentMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/core-service/web/src/main/resources/org/kuali/rice/coreservice/web/parameter/ParameterMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/it/kim/src/test/resources/org/kuali/rice/kim/bo/datadictionary/test/SampleBO.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/kew/impl/src/main/resources/org/kuali/rice/kew/impl/datadictionary/PeopleFlowBo.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/kim/kim-impl/src/main/resources/org/kuali/rice/kim/impl/responsibility/IdentityManagementReviewResponsibilityMaintenanceDocument.xml: <!--<property name="defaultExistenceChecks">
            ./rice-middleware/krms/impl/src/main/resources/org/kuali/rice/krms/datadictionary/ContextMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/county/CountyMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/postalcode/PostalCodeMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/state/StateMaintenanceDocument.xml: <property name="defaultExistenceChecks">

            Show
            eghm-kuali-m Erik Meade added a comment - ./rice-framework/krad-it/src/test/resources/org/kuali/rice/krad/test/document/AccountMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/core-service/web/src/main/resources/org/kuali/rice/coreservice/web/component/ComponentMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/core-service/web/src/main/resources/org/kuali/rice/coreservice/web/parameter/ParameterMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/it/kim/src/test/resources/org/kuali/rice/kim/bo/datadictionary/test/SampleBO.xml: <property name="defaultExistenceChecks"> ./rice-middleware/kew/impl/src/main/resources/org/kuali/rice/kew/impl/datadictionary/PeopleFlowBo.xml: <property name="defaultExistenceChecks"> ./rice-middleware/kim/kim-impl/src/main/resources/org/kuali/rice/kim/impl/responsibility/IdentityManagementReviewResponsibilityMaintenanceDocument.xml: <!--<property name="defaultExistenceChecks"> ./rice-middleware/krms/impl/src/main/resources/org/kuali/rice/krms/datadictionary/ContextMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/county/CountyMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/postalcode/PostalCodeMaintenanceDocument.xml: <property name="defaultExistenceChecks"> ./rice-middleware/location/web/src/main/resources/org/kuali/rice/location/web/state/StateMaintenanceDocument.xml: <property name="defaultExistenceChecks">
            Hide
            eghm-kuali-m Erik Meade added a comment -

            M94Kns.png screen shot of defaultExistenceChecks exists in action for Country and State code. County code is also a defaultExistenceChecks, but throws a NPE, see discovered Jira KULRICE-11547

            Show
            eghm-kuali-m Erik Meade added a comment - M94Kns.png screen shot of defaultExistenceChecks exists in action for Country and State code. County code is also a defaultExistenceChecks, but throws a NPE, see discovered Jira KULRICE-11547
            Hide
            eghm-kuali-m Erik Meade added a comment - - edited

            KULRICE-7666 implements defaultExistenceChecks. See rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/rules/MaintenanceDocumentRuleBase.java dataDictionaryValidate

            Show
            eghm-kuali-m Erik Meade added a comment - - edited KULRICE-7666 implements defaultExistenceChecks. See rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/rules/MaintenanceDocumentRuleBase.java dataDictionaryValidate
            Hide
            eghm-kuali-m Erik Meade added a comment -

            Once KULRICE-7666 is resolved a candidate for KRAD Labs demo isTravelerDetailMaintenance.xml:
            In TravelerDetailMaintenanceDocument:

                <property name="defaultExistenceChecks">
                  <bean parent="ReferenceDefinition" p:attributeName="principalId" p:attributeToHighlightOnFail="principalId"/>
                </property>
            

            and add to TravelerDetail-MaintenanceView:

                          <bean parent="Uif-InputField" p:propertyName="principalId" />
            
            Show
            eghm-kuali-m Erik Meade added a comment - Once KULRICE-7666 is resolved a candidate for KRAD Labs demo isTravelerDetailMaintenance.xml: In TravelerDetailMaintenanceDocument: <property name= "defaultExistenceChecks" > <bean parent= "ReferenceDefinition" p:attributeName= "principalId" p:attributeToHighlightOnFail= "principalId" /> </property> and add to TravelerDetail-MaintenanceView: <bean parent= "Uif-InputField" p:propertyName= "principalId" />
            Hide
            shahess Shannon Hess added a comment - - edited

            Links to test locally:

            Labs - Maintenance Views: http://localhost:8080/krad-dev/kr-krad/labs?viewId=LabsMenuMaintenanceView
            Existence Demo: http://localhost:8080/krad-dev/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1

            I wasn't able to use the recommended attribute or TravelerDetail data object due to how the person attribute is set up on TravelerDetail. I also verified the problem using the fiscalOfficer attribute in org.kuali.rice.krad.demo.travel.dataobject.TravelAccount.

            Here is the existing defaultExistenceChecks for PostalCodeMaintenanceDocument.xml

                <property name="defaultExistenceChecks">
                  <list>
                  	<bean parent="ReferenceDefinition" p:attributeName="country" p:attributeToHighlightOnFail="countryCode"/>
                    <bean parent="ReferenceDefinition" p:attributeName="state" p:attributeToHighlightOnFail="stateCode"/>
                    <bean parent="ReferenceDefinition" p:attributeName="county" p:attributeToHighlightOnFail="countyCode"/>
                  </list>
                </property>
            

            Based on how this was set up I set a similar defaultExistenceChecks for TravelAccount in bean id TestDocumentEntry. Both of these had some issues so while the demo page is built, there are two bugs. I'm going to detail the issues below and then create JIRAs for both bugs.

              <bean id="TestDocumentEntry" parent="uifMaintenanceDocumentEntry">
                <property name="dataObjectClass" value="org.kuali.rice.krad.demo.travel.dataobject.TravelAccount" />
                <property name="businessRulesClass" value="org.kuali.rice.krad.labs.ruleevent.BusinessRuleImpl" />
                <property name="documentTypeName" value="TravelAccountMaintenanceDocument" />
                <property name="defaultExistenceChecks">
                  <list>
                    <bean parent="ReferenceDefinition" p:attributeName="accountType" p:attributeToHighlightOnFail="accountTypeCode"/>
                    <bean parent="ReferenceDefinition" p:attributeName="fiscalOfficer" p:attributeToHighlightOnFail="foId"/>
                  </list>
                </property>
              </bean>
            



            Issue Number 1 - Able to create a TravelAccount with a fiscal officer that does not exist, even if a defaultExistenceChecks exists for it.

            The fiscalOfficer on the travel account is defaulted to a PersonImpl object, so when validateReferenceExists is called the referenceDataObject that is returned is a PersonImpl object that has all the fields set to empty strings or null. true is returned from validateReferenceExists since the object itself is not null. Another issue may be that when getReferenceIfExists is called, DataObjectWrapperBase.fetchRelationship does nothing since org.kuali.rice.kim.api.identity.Person is a related type that is not supported by DataObjectService.

            Code in DictionaryValidationServiceImpl (comments are a bit confusing in this method):

            public boolean validateReferenceExists(Object dataObject, String referenceName) {
                 // attempt to retrieve the specified object from the db
                 Object referenceDataObject = getLegacyDataAdapter().getReferenceIfExists(dataObject, referenceName);
            
                 // if it isn't there, then it doesn't exist, return false
                 if (KRADUtils.isNotNull(referenceDataObject)) {
                     return true;
                 }
            
                 // otherwise, it is there, return true
                 return false;
            }
            


            Issue Number 2 - Highlighting for existing accountType is wonky. (Will attach screenshots)

            IMPORTANT NOTE – This is only the case for highlighting the accountType field. For example, If I indicate that the Subsidized Percent should be highlighted if the account type is not found, it is correctly highlighted. It has to do with the field having two parts (input and lookup)

            • After you hit submit once, the popup error message appears if you roll over the account type. ("after hitting submit once" screenshot)
            • After you hit submit twice, the popup error message is still there and high level message appear. ("after hitting submit twice" screenshot)
            • If you change the html so the uif-hasError class is on the input-group div rather than the field div, the field has the red border that is expected. ("Manually moving uif-hasError to input-group" screenshot)

            The code that controls where the uif-hasError class is added is in krad.validate.js in the writeMessagesAtField function

            else {
               field.addClass(kradVariables.HAS_ERROR_CLASS);
               if (showImage) {
                  jQuery(messagesDiv).before(errorImage);
               }
            }
            
            Show
            shahess Shannon Hess added a comment - - edited Links to test locally: Labs - Maintenance Views: http://localhost:8080/krad-dev/kr-krad/labs?viewId=LabsMenuMaintenanceView Existence Demo: http://localhost:8080/krad-dev/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1 I wasn't able to use the recommended attribute or TravelerDetail data object due to how the person attribute is set up on TravelerDetail. I also verified the problem using the fiscalOfficer attribute in org.kuali.rice.krad.demo.travel.dataobject.TravelAccount. Here is the existing defaultExistenceChecks for PostalCodeMaintenanceDocument.xml <property name= "defaultExistenceChecks" > <list> <bean parent= "ReferenceDefinition" p:attributeName= "country" p:attributeToHighlightOnFail= "countryCode" /> <bean parent= "ReferenceDefinition" p:attributeName= "state" p:attributeToHighlightOnFail= "stateCode" /> <bean parent= "ReferenceDefinition" p:attributeName= "county" p:attributeToHighlightOnFail= "countyCode" /> </list> </property> Based on how this was set up I set a similar defaultExistenceChecks for TravelAccount in bean id TestDocumentEntry. Both of these had some issues so while the demo page is built, there are two bugs. I'm going to detail the issues below and then create JIRAs for both bugs. <bean id= "TestDocumentEntry" parent= "uifMaintenanceDocumentEntry" > <property name= "dataObjectClass" value= "org.kuali.rice.krad.demo.travel.dataobject.TravelAccount" /> <property name= "businessRulesClass" value= "org.kuali.rice.krad.labs.ruleevent.BusinessRuleImpl" /> <property name= "documentTypeName" value= "TravelAccountMaintenanceDocument" /> <property name= "defaultExistenceChecks" > <list> <bean parent= "ReferenceDefinition" p:attributeName= "accountType" p:attributeToHighlightOnFail= "accountTypeCode" /> <bean parent= "ReferenceDefinition" p:attributeName= "fiscalOfficer" p:attributeToHighlightOnFail= "foId" /> </list> </property> </bean> Issue Number 1 - Able to create a TravelAccount with a fiscal officer that does not exist, even if a defaultExistenceChecks exists for it. The fiscalOfficer on the travel account is defaulted to a PersonImpl object, so when validateReferenceExists is called the referenceDataObject that is returned is a PersonImpl object that has all the fields set to empty strings or null. true is returned from validateReferenceExists since the object itself is not null. Another issue may be that when getReferenceIfExists is called, DataObjectWrapperBase.fetchRelationship does nothing since org.kuali.rice.kim.api.identity.Person is a related type that is not supported by DataObjectService. Code in DictionaryValidationServiceImpl (comments are a bit confusing in this method): public boolean validateReferenceExists( Object dataObject, String referenceName) { // attempt to retrieve the specified object from the db Object referenceDataObject = getLegacyDataAdapter().getReferenceIfExists(dataObject, referenceName); // if it isn't there, then it doesn't exist, return false if (KRADUtils.isNotNull(referenceDataObject)) { return true ; } // otherwise, it is there, return true return false ; } Issue Number 2 - Highlighting for existing accountType is wonky. (Will attach screenshots) IMPORTANT NOTE – This is only the case for highlighting the accountType field. For example, If I indicate that the Subsidized Percent should be highlighted if the account type is not found, it is correctly highlighted. It has to do with the field having two parts (input and lookup) After you hit submit once, the popup error message appears if you roll over the account type. ("after hitting submit once" screenshot) After you hit submit twice, the popup error message is still there and high level message appear. ("after hitting submit twice" screenshot) If you change the html so the uif-hasError class is on the input-group div rather than the field div, the field has the red border that is expected. ("Manually moving uif-hasError to input-group" screenshot) The code that controls where the uif-hasError class is added is in krad.validate.js in the writeMessagesAtField function else { field.addClass(kradVariables.HAS_ERROR_CLASS); if (showImage) { jQuery(messagesDiv).before(errorImage); } }
            Hide
            shahess Shannon Hess added a comment -

            Adding screenshots for Issue Number 2 (highlighting issue)

            Show
            shahess Shannon Hess added a comment - Adding screenshots for Issue Number 2 (highlighting issue)
            Show
            shahess Shannon Hess added a comment - Link for env14 : Labs - Maintenance Views: http://env14.rice.kuali.org/kr-krad/labs?viewId=LabsMenuMaintenanceView Existence Demo: http://env14.rice.kuali.org/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1
            Hide
            shahess Shannon Hess added a comment -

            Updated Maintenance Gap Analysis wiki page (https://wiki.kuali.org/display/KULRICE/Gap+Analysis+-+Maintenance+Document) so it now contains the link to the KRAD demo page as well as links to the remaining bugs.

            Show
            shahess Shannon Hess added a comment - Updated Maintenance Gap Analysis wiki page ( https://wiki.kuali.org/display/KULRICE/Gap+Analysis+-+Maintenance+Document ) so it now contains the link to the KRAD demo page as well as links to the remaining bugs.
            Hide
            shahess Shannon Hess added a comment -

            I created an LabsMaintenanceExistenceCheckAft but marked both tests as Ignore until the two bugs are fixed.

            Show
            shahess Shannon Hess added a comment - I created an LabsMaintenanceExistenceCheckAft but marked both tests as Ignore until the two bugs are fixed.

              People

              • Assignee:
                shahess Shannon Hess
                Reporter:
                gilesp Peter Giles (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days, 2 hours Original Estimate - 2 days, 2 hours
                  2d 2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 3 hours
                  2d 3h