diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a221ac1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target/ +.vscode/ diff --git a/samples/ExternalLibGeoSample/adsGeoLibrary/pom.xml b/samples/ExternalLibGeoSample/adsGeoLibrary/pom.xml index 34fa665..e484f44 100644 --- a/samples/ExternalLibGeoSample/adsGeoLibrary/pom.xml +++ b/samples/ExternalLibGeoSample/adsGeoLibrary/pom.xml @@ -9,7 +9,6 @@ 2401.0.4 - ads.samples adsGeoLibrary External library providing geo localization facilities @@ -25,18 +24,6 @@ - - com.ibm.decision - build-maven-plugin - ${ads-mojo.version} - - - - adsGeoLibrary - - - - com.ibm.decision build-maven-plugin @@ -70,17 +57,18 @@ en_US - true - - + reference diff --git a/samples/ExternalLibGeoSample/adsGeoLibrary/reference/bom/model_en_US.voc b/samples/ExternalLibGeoSample/adsGeoLibrary/reference/bom/model_en_US.voc index 8853d09..a83e735 100644 --- a/samples/ExternalLibGeoSample/adsGeoLibrary/reference/bom/model_en_US.voc +++ b/samples/ExternalLibGeoSample/adsGeoLibrary/reference/bom/model_en_US.voc @@ -1,17 +1,17 @@ -ads.samples.geoLibrary.Location#concept.documentation = a city described with a name, a longitude and a latitude -ads.samples.geoLibrary.Country#concept.documentation = a country described with a name and its capital +ads.samples.geolibrary.Location#concept.documentation = a city described with a name, a longitude and a latitude +ads.samples.geolibrary.Country#concept.documentation = a country described with a name and its capital -# ads.samples.geoLibrary.Location -ads.samples.geoLibrary.Location.getDistance(ads.samples.geoLibrary.Location)#phrase.navigation = the distance between {this} and {0} +# ads.samples.geolibrary.Location +ads.samples.geolibrary.Location.getDistance(ads.samples.geolibrary.Location)#phrase.navigation = the distance between {this} and {0} -# ads.samples.geoLibrary.LocationsUtilities -ads.samples.geoLibrary.LocationsUtilities.getDistance(java.lang.String,java.lang.String)#phrase.navigation = the distance between {0} and {1} -ads.samples.geoLibrary.LocationsUtilities.knownCity(java.lang.String)#phrase.navigation = {0} is a known city -ads.samples.geoLibrary.LocationsUtilities.unknownCity(java.lang.String)#phrase.navigation = {0} is not a known city -ads.samples.geoLibrary.LocationsUtilities.knownCountry(java.lang.String)#phrase.navigation = {0} is a known country -ads.samples.geoLibrary.LocationsUtilities.unknownCountry(java.lang.String)#phrase.navigation = {0} is not a known country -ads.samples.geoLibrary.LocationsUtilities.getCountry(java.lang.String)#phrase.navigation = {country} named {0} -ads.samples.geoLibrary.LocationsUtilities.getCountry(java.lang.String)#phrase.navigation.documentation = Finds the country with the given name -ads.samples.geoLibrary.LocationsUtilities.getLocation(java.lang.String)#phrase.navigation = {location} named {0} -ads.samples.geoLibrary.LocationsUtilities.getLocation(java.lang.String)#phrase.navigation.documentation = Finds the city with the given name +# ads.samples.geolibrary.LocationsUtilities +ads.samples.geolibrary.LocationsUtilities.getDistance(java.lang.String,java.lang.String)#phrase.navigation = the distance between {0} and {1} +ads.samples.geolibrary.LocationsUtilities.knownCity(java.lang.String)#phrase.navigation = {0} is a known city +ads.samples.geolibrary.LocationsUtilities.unknownCity(java.lang.String)#phrase.navigation = {0} is not a known city +ads.samples.geolibrary.LocationsUtilities.knownCountry(java.lang.String)#phrase.navigation = {0} is a known country +ads.samples.geolibrary.LocationsUtilities.unknownCountry(java.lang.String)#phrase.navigation = {0} is not a known country +ads.samples.geolibrary.LocationsUtilities.getCountry(java.lang.String)#phrase.navigation = {country} named {0} +ads.samples.geolibrary.LocationsUtilities.getCountry(java.lang.String)#phrase.navigation.documentation = Finds the country with the given name +ads.samples.geolibrary.LocationsUtilities.getLocation(java.lang.String)#phrase.navigation = {location} named {0} +ads.samples.geolibrary.LocationsUtilities.getLocation(java.lang.String)#phrase.navigation.documentation = Finds the city with the given name diff --git a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Country.java b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Country.java index f02027d..cb9523e 100644 --- a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Country.java +++ b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Country.java @@ -6,7 +6,7 @@ * Use, duplication or disclosure restricted by GSA ADP Schedule * Contract with IBM Corp. */ -package ads.samples.geoLibrary; +package ads.samples.geolibrary; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,11 +15,13 @@ public class Country { private String name; - private ads.samples.geoLibrary.Location capital; + private ads.samples.geolibrary.Location capital; + + public Country(){} @BeanConstructor @JsonCreator - public Country(@JsonProperty("name")String name, @JsonProperty("capital")ads.samples.geoLibrary.Location capital) { + public Country(@JsonProperty("name")String name, @JsonProperty("capital")ads.samples.geolibrary.Location capital) { this.name = name; this.capital = capital; capital.setCountry(this); @@ -37,7 +39,7 @@ public void setName(String name) { this.name = name; } - public void setCapital(ads.samples.geoLibrary.Location capital) { + public void setCapital(ads.samples.geolibrary.Location capital) { this.capital = capital; } diff --git a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Location.java b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Location.java index 3294d78..e5bb9e2 100644 --- a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Location.java +++ b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Location.java @@ -7,7 +7,7 @@ * Contract with IBM Corp. */ -package ads.samples.geoLibrary; +package ads.samples.geolibrary; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -27,6 +27,8 @@ public class Location { private double longitude; private double latitude; + public Location(){} + @BeanConstructor @JsonCreator public Location(@JsonProperty("name") String name, @JsonProperty("longitude") double longitude, diff --git a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Locations.java b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Locations.java index 63f4935..0fe6bfa 100644 --- a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Locations.java +++ b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/Locations.java @@ -7,7 +7,7 @@ * Contract with IBM Corp. */ -package ads.samples.geoLibrary; +package ads.samples.geolibrary; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/LocationsUtilities.java b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/LocationsUtilities.java index 18d0b55..139f12c 100644 --- a/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/LocationsUtilities.java +++ b/samples/ExternalLibGeoSample/geoLibrary/src/main/java/ads/samples/geoLibrary/LocationsUtilities.java @@ -7,7 +7,7 @@ * Contract with IBM Corp. */ -package ads.samples.geoLibrary; +package ads.samples.geolibrary; import com.ibm.rules.engine.annotations.PureFunction; import ilog.rules.bom.annotations.NotBusiness; diff --git a/samples/ExternalLibGeoSample/geoLibrary/src/test/java/ads/samples/geoLibrary/LocationTest.java b/samples/ExternalLibGeoSample/geoLibrary/src/test/java/ads/samples/geoLibrary/LocationTest.java index 04cd01d..89c1b09 100644 --- a/samples/ExternalLibGeoSample/geoLibrary/src/test/java/ads/samples/geoLibrary/LocationTest.java +++ b/samples/ExternalLibGeoSample/geoLibrary/src/test/java/ads/samples/geoLibrary/LocationTest.java @@ -7,8 +7,11 @@ * Contract with IBM Corp. */ -package ads.samples.geoLibrary; +package ads.samples.geolibrary; +import ads.samples.geolibrary.Country; +import ads.samples.geolibrary.Locations; +import ads.samples.geolibrary.LocationsUtilities; import junit.framework.TestCase; public class LocationTest extends TestCase { @@ -19,19 +22,19 @@ public class LocationTest extends TestCase { private static final float WASHINGTON_PARIS = (float)6164.81; public void testDistanceParisNice() { - ads.samples.geoLibrary.Location paris = new ads.samples.geoLibrary.Location("Paris", PARIS_LONGITUDE, PARIS_LATITUDE); - ads.samples.geoLibrary.Location nice = new ads.samples.geoLibrary.Location("Nice", 7.2661, 43.7031); - ads.samples.geoLibrary.Location washington = new ads.samples.geoLibrary.Location("Washington", WASHINGTON_LONGITUDE, WASHINGTON_LATITUDE); + ads.samples.geolibrary.Location paris = new ads.samples.geolibrary.Location("Paris", PARIS_LONGITUDE, PARIS_LATITUDE); + ads.samples.geolibrary.Location nice = new ads.samples.geolibrary.Location("Nice", 7.2661, 43.7031); + ads.samples.geolibrary.Location washington = new ads.samples.geolibrary.Location("Washington", WASHINGTON_LONGITUDE, WASHINGTON_LATITUDE); assertEquals((float)685.953, paris.getDistance(nice)); assertEquals(WASHINGTON_PARIS, paris.getDistance(washington)); } public void testReadCsv() { Locations locations = new Locations("cities.csv"); - ads.samples.geoLibrary.Location paris = locations.getLocation("Paris"); + ads.samples.geolibrary.Location paris = locations.getLocation("Paris"); assertEquals(paris.getLatitude(), PARIS_LATITUDE); assertEquals(paris.getLongitude(), PARIS_LONGITUDE); - ads.samples.geoLibrary.Location washington = locations.getLocation("Washington"); + ads.samples.geolibrary.Location washington = locations.getLocation("Washington"); assertEquals(washington.getLatitude(), WASHINGTON_LATITUDE); assertEquals(washington.getLongitude(), WASHINGTON_LONGITUDE); } diff --git a/samples/ExternalLibGeoSample/pom.xml b/samples/ExternalLibGeoSample/pom.xml index c3805b7..b224795 100644 --- a/samples/ExternalLibGeoSample/pom.xml +++ b/samples/ExternalLibGeoSample/pom.xml @@ -10,6 +10,7 @@ 2.0.13 2401.0.4 2.15.2 + UTF-8 ads.samples diff --git a/samples/ExternalLibGeoSample/settings.xml b/samples/ExternalLibGeoSample/settings.xml index 77410fa..42f5a66 100644 --- a/samples/ExternalLibGeoSample/settings.xml +++ b/samples/ExternalLibGeoSample/settings.xml @@ -9,12 +9,6 @@ Maven release mirror %MAVEN_RELEASES-REPOSITORY_TO_BE_SET% - - ads-maven - ads-maven - ADS Maven repository mirror - %ADS_MAVEN_REPOSITORY_TO_BE_SET% - @@ -47,16 +41,5 @@ USER TO BE SET PASSWORD TO BE SET - - ads-maven - - - - Authorization - ZenApiKey %YOUR_API_KEY_TO_BE_SET% - - - -