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

Research how Message Resources are loaded now and clean them up

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1.1
    • Component/s: Development
    • Labels:
      None
    • Similar issues:
      KULRICE-5657Clean up configurers
      KULRICE-2593Review various Spring override points in the codebase and clean them up
      KULRICE-12814Clean up datasource configuration
      KULRICE-628Figure out how we are going to resource load are plugins better and build it
      KULRICE-2579Clean up xml bootstrap files
      KULRICE-11545Update EdocLiteXmlIngesterBase to load files as resources from jar
      KULRICE-6198Document Resource Loading Setup
      KULRICE-1214Allow ingestion of non-file-based resources
      KULRICE-6047Implement feedback on cleaning up install documentation
      KULRICE-1213ConcurrentModificationException in client-side resource loading layer

      Description

      See the notes from the following KTI meeting:

      https://test.kuali.org/confluence/x/BoEkDg

      In particular the section labeled: "Multiple ways to configure message bundles rice.struts.message.resources & configurationServiceData.xml - KC". I have pasted the specific notes below so that we have them available on the jira:

      Multiple ways to configure message bundles rice.struts.message.resources & configurationServiceData.xml - KC

      • Eric - I thought that configurationServiceData.xml was retired but it looks like it's still there, but it looks like it's still there
      • Travis - shouldn't there be one way to load message bundles
      • Travis - we're really not using the I18N features of message bundles right now
        • some of the properties in these property files are things like urls
      • Travis - imagine it would be as simple as having a config property specifying where resource bundles are, custom message resource factory for struts-config
      • Jonathan - we've already dealt with this in KFS with a custom KFSMessageResourcesFactory
      • Eric - next steps
        • assign someone on rice team to look into cleaning up the resource bundle mess
        • can we get rid of configurationServiceData.xml?
        • look at KFS as an example
        • what changes need to be made to AbstractStaticConfigurationServiceImpl to support this
        • end goals:
          1. message resources files should be for externalized strings for internationalization
          2. should only have a single way to load message resources, currently have two!

        Activity

        Hide
        Eric Westfall added a comment -

        Jeremy, we can talk more about this when you get to it if you want, I just wanted to make sure I got it into jira before I forgot so the notes above may be a bit rough.

        Show
        Eric Westfall added a comment - Jeremy, we can talk more about this when you get to it if you want, I just wanted to make sure I got it into jira before I forgot so the notes above may be a bit rough.
        Hide
        Jeremy Hanson added a comment - - edited

        Just a few notes:

        • ConfigurationServiceData.xml isn't retired, but it isn't used in the struts-config anymore.
        • We have updated our struts config files to use a message resource factory nearly identical to KFS's (KualiPropertyMessageResourcesFactory). All of our struts-config.xml files should now point to this.
        Show
        Jeremy Hanson added a comment - - edited Just a few notes: ConfigurationServiceData.xml isn't retired, but it isn't used in the struts-config anymore. We have updated our struts config files to use a message resource factory nearly identical to KFS's (KualiPropertyMessageResourcesFactory). All of our struts-config.xml files should now point to this.
        Hide
        Jeremy Hanson added a comment -

        Essentially what I did was this:
        Earlier I created KualiPropertyMessageResourcesFactory with an embedded class of KualiPropertyMessageResources (this works much like KFS's message factory)

        What I've changed is pulling out KualiPropertyMessageResources into it's own file so it can be used elsewhere, and adding a method to load and return the messages that are loaded based on the struts properties files.

        Then instead of using the KualiPropertiesFactory in AbstractStaticConfigurationServiceImpl, I create a KualiPropertyMessageResourcesFactory, create the resources, and load the files, then insert the properties into the property holder. Pretty straightforward.

        From there, nothing references the configurationServiceData anymore, so they can be removed as nothing references them anymore.

        KualiPropertiesFactory was no longer used anywhere in the codebase, so it was removed.

        Show
        Jeremy Hanson added a comment - Essentially what I did was this: Earlier I created KualiPropertyMessageResourcesFactory with an embedded class of KualiPropertyMessageResources (this works much like KFS's message factory) What I've changed is pulling out KualiPropertyMessageResources into it's own file so it can be used elsewhere, and adding a method to load and return the messages that are loaded based on the struts properties files. Then instead of using the KualiPropertiesFactory in AbstractStaticConfigurationServiceImpl, I create a KualiPropertyMessageResourcesFactory, create the resources, and load the files, then insert the properties into the property holder. Pretty straightforward. From there, nothing references the configurationServiceData anymore, so they can be removed as nothing references them anymore. KualiPropertiesFactory was no longer used anywhere in the codebase, so it was removed.
        Hide
        Jeremy Hanson added a comment -

        committed a bit more code to a couple struts-config.xml files because I missed them before. They were not bringing in the defaults message resources.

        Show
        Jeremy Hanson added a comment - committed a bit more code to a couple struts-config.xml files because I missed them before. They were not bringing in the defaults message resources.
        Hide
        Chad Hagstrom added a comment -

        Jeremy, just so you know, I committed a change to the KR struts-config.xml file on the 1.1 branch, where I swapped the positions of the <message-resources> and <plug-in> tags. This was needed because otherwise the parser (during Rice startup) complains about that file not conforming to the given DTD, since the DTD apparently expects the <message-resources> tag to appear before the <plug-in> tag.

        Show
        Chad Hagstrom added a comment - Jeremy, just so you know, I committed a change to the KR struts-config.xml file on the 1.1 branch, where I swapped the positions of the <message-resources> and <plug-in> tags. This was needed because otherwise the parser (during Rice startup) complains about that file not conforming to the given DTD, since the DTD apparently expects the <message-resources> tag to appear before the <plug-in> tag.
        Hide
        Travis Schneeberger added a comment -

        I also fixed this issue on the 1.0.kc branch.

        Show
        Travis Schneeberger added a comment - I also fixed this issue on the 1.0.kc branch.
        Hide
        Eric Westfall added a comment -

        Chad, did you mean the 1.1 branch or the 1.0.1.1 branch?

        Show
        Eric Westfall added a comment - Chad, did you mean the 1.1 branch or the 1.0.1.1 branch?
        Hide
        Chad Hagstrom added a comment -

        I made the fix on the 1.1.0 branch, although it looks like James also fixed it on the 1.0.1.1 branch.

        Show
        Chad Hagstrom added a comment - I made the fix on the 1.1.0 branch, although it looks like James also fixed it on the 1.0.1.1 branch.

          People

          • Assignee:
            Jeremy Hanson
            Reporter:
            Eric Westfall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel