juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1467691 - /juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
Date Sat, 13 Apr 2013 20:09:16 GMT
Author: kstam
Date: Sat Apr 13 20:09:16 2013
New Revision: 1467691

URL: http://svn.apache.org/r1467691
Log:
JUDDI-588, we missed discoveryURL for the token replacement.

Modified:
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java?rev=1467691&r1=1467690&r2=1467691&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java Sat
Apr 13 20:09:16 2013
@@ -373,7 +373,19 @@ public class MappingModelToApi {
 		for (org.apache.juddi.model.DiscoveryUrl modelDiscUrl : modelDiscUrlList) {
 			org.uddi.api_v3.DiscoveryURL apiDiscUrl = new org.uddi.api_v3.DiscoveryURL();
 			apiDiscUrl.setUseType(modelDiscUrl.getUseType());
-			apiDiscUrl.setValue(modelDiscUrl.getUrl());
+			String discoveryURL = modelDiscUrl.getUrl();
+			try {
+				String baseUrl = AppConfig.getConfiguration().getString("juddi.server.baseurl");
+				if (baseUrl==null) {
+					logger.warn("Token 'juddi.server.baseurl' not found in the juddiv3.properties, defaulting
to '" 
+							+ Property.DEFAULT_BASE_URL + "'");
+					baseUrl = Property.DEFAULT_BASE_URL;
+				}
+				discoveryURL = discoveryURL.replaceAll("\\$\\{juddi.server.baseurl\\}", baseUrl);
+			} catch (ConfigurationException e) {
+				logger.error(e.getMessage(),e);
+			}
+			apiDiscUrl.setValue(discoveryURL);
 			apiDiscUrlList.add(apiDiscUrl);
 		}
 		apiBusinessEntity.setDiscoveryURLs(apiDiscUrls);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message