javamoney
  1. javamoney
  2. JAVAMONEY-58

Currency data source URL for IsoCurrencyOnlineProvider needs updating

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Labels:
      None

      Description

      The URL which specifies the location of the currency source in net.java.javamoney.ri.ext.provider.iso.IsoCurrencyOnlineProvider#loadCurrencies method is no longer valid. The current source is:

      http://www.currency-iso.org/dam/isocy/downloads/dl_iso_table_a1.xml
      

      which results in an Http 404.

      I believe the replacement should be:

      http://www.currency-iso.org/dam/downloads/table_a1.xml
      

        Activity

        paulkmoore created issue -
        keilw made changes -
        Field Original Value New Value
        Assignee keilw [ keilw ]
        keilw made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        keilw added a comment - - edited

        As a first step I'm fixing the URL to the new version. Where CI server (Jenkins) would also allow us to run Integration Tests there should be some for external services such as this to flag whenever this or another URL changes in future.
        Will externalize it into a properties file for easier maintenance, but ultimate customization should be possible similar to Java 7+ Currency class:
        >Users can supersede the Java runtime currency data by creating a properties file named <JAVA_HOME>/lib/currency.properties. The contents of the properties file are key/value pairs of the ISO 3166 country codes and the ISO 4217 currency data >respectively. The value part consists of three ISO 4217 values of a currency, i.e., an alphabetic code, a numeric code, and a minor unit. Those three
        >ISO 4217 values are separated by commas. The lines which start with '#'s are considered comment lines. For example,...

        either we'd use this file or introduce another one or two additional files (not too many, otherwise it gets confusing and we'd have a Spring-like maze of properties

        Show
        keilw added a comment - - edited As a first step I'm fixing the URL to the new version. Where CI server (Jenkins) would also allow us to run Integration Tests there should be some for external services such as this to flag whenever this or another URL changes in future. Will externalize it into a properties file for easier maintenance, but ultimate customization should be possible similar to Java 7+ Currency class: >Users can supersede the Java runtime currency data by creating a properties file named <JAVA_HOME>/lib/currency.properties. The contents of the properties file are key/value pairs of the ISO 3166 country codes and the ISO 4217 currency data >respectively. The value part consists of three ISO 4217 values of a currency, i.e., an alphabetic code, a numeric code, and a minor unit. Those three >ISO 4217 values are separated by commas. The lines which start with '#'s are considered comment lines. For example,... either we'd use this file or introduce another one or two additional files (not too many, otherwise it gets confusing and we'd have a Spring-like maze of properties
        Hide
        keilw added a comment -

        Changed, those URLs are now loaded from a properties file, but neither of the URLs looks like it gets results from parsing
        I suppose the 404 error was mainly a browser-based observation, so there may be something left to do.

        Debug information (if log level is changed appropriately or System.out/IDE-debugging used) tells currencies is empty, while the list of countries contains 249 of them.

        Show
        keilw added a comment - Changed, those URLs are now loaded from a properties file, but neither of the URLs looks like it gets results from parsing I suppose the 404 error was mainly a browser-based observation, so there may be something left to do. Debug information (if log level is changed appropriately or System.out/IDE-debugging used) tells currencies is empty, while the list of countries contains 249 of them.
        Hide
        paulkmoore added a comment - - edited

        Werner, the mapping also appears to have changed - I guess they did this as part of the "move"...

        From the comments in code the previous feed appears to be structured as follows:

        // <ISO_CCY_CODES>
        // <ISO_CURRENCY>
        // <ENTITY>AFGHANISTAN</ENTITY>
        // <CURRENCY>Afghani</CURRENCY>
        // <ALPHABETIC_CODE>AFN</ALPHABETIC_CODE>
        // <NUMERIC_CODE>971</NUMERIC_CODE>
        // <MINOR_UNIT>2</MINOR_UNIT>
        // </ISO_CURRENCY>
        // ...
        // </ISO_CCY_CODES>
        

        Whereas the new feed is as follows:

        <ISO_4217 Pblshd="">
        	<CcyTbl>
        		<CcyNtry>
        			<CtryNm>AFGHANISTAN</CtryNm>
        			<CcyNm>Afghani</CcyNm>
        			<Ccy>AFN</Ccy>
        			<CcyNbr>971</CcyNbr>
        			<CcyMnrUnts>2</CcyMnrUnts>
        		</CcyNtry>
        		<!--snip-->
        	</CcyTbl>
        </ISO_4217>
        
        Show
        paulkmoore added a comment - - edited Werner, the mapping also appears to have changed - I guess they did this as part of the "move"... From the comments in code the previous feed appears to be structured as follows: // <ISO_CCY_CODES> // <ISO_CURRENCY> // <ENTITY>AFGHANISTAN</ENTITY> // <CURRENCY>Afghani</CURRENCY> // <ALPHABETIC_CODE>AFN</ALPHABETIC_CODE> // <NUMERIC_CODE>971</NUMERIC_CODE> // <MINOR_UNIT>2</MINOR_UNIT> // </ISO_CURRENCY> // ... // </ISO_CCY_CODES> Whereas the new feed is as follows: <ISO_4217 Pblshd=""> <CcyTbl> <CcyNtry> <CtryNm> AFGHANISTAN </CtryNm> <CcyNm> Afghani </CcyNm> <Ccy> AFN </Ccy> <CcyNbr> 971 </CcyNbr> <CcyMnrUnts> 2 </CcyMnrUnts> </CcyNtry> <!--snip--> </CcyTbl> </ISO_4217>
        keilw made changes -
        Fix Version/s 0.8 [ 16791 ]
        keilw made changes -
        Component/s API: Core Artifacts [ 14820 ]
        Component/s API: Provided Extensions [ 14823 ]
        atsticks made changes -
        Component/s Impl: RI [ 14824 ]
        Component/s API [ 14820 ]
        keilw made changes -
        Assignee keilw [ keilw ] atsticks [ atsticks ]
        Hide
        keilw added a comment -

        This has been open for a while, does it work now?

        Show
        keilw added a comment - This has been open for a while, does it work now?
        keilw made changes -
        Fix Version/s 0.9 [ 16866 ]
        Fix Version/s 0.8 [ 16791 ]
        keilw made changes -
        Fix Version/s 1.0 [ 16867 ]
        Fix Version/s 0.9 [ 16866 ]
        atsticks made changes -
        Component/s Library: JavaMoney Extensions [ 15468 ]
        Component/s Impl: RI [ 14824 ]

          People

          • Assignee:
            atsticks
            Reporter:
            paulkmoore
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: