You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2011/06/07 19:19:47 UTC
svn commit: r1133102 - in /incubator/wookie/trunk/src/org/apache/wookie:
controller/WidgetInstancesController.java util/gadgets/GadgetAdapter.java
util/opensocial/OpenSocialUtils.java
Author: scottbw
Date: Tue Jun 7 17:19:46 2011
New Revision: 1133102
URL: http://svn.apache.org/viewvc?rev=1133102&view=rev
Log:
Updated calls to localizationUtils to use defaultLocale attribute. See WOOKIE-211.
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
incubator/wookie/trunk/src/org/apache/wookie/util/gadgets/GadgetAdapter.java
incubator/wookie/trunk/src/org/apache/wookie/util/opensocial/OpenSocialUtils.java
Modified: incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java?rev=1133102&r1=1133101&r2=1133102&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java Tue Jun 7 17:19:46 2011
@@ -298,9 +298,9 @@ public class WidgetInstancesController e
String url = "";
IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
- IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()});
+ IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
// Try default locale if no appropriate localization found
- if (sf == null) sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, null);
+ if (sf == null) sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, null, instance.getWidget().getDefaultLocale());
// No start file found, so throw an exception
if (sf == null) throw new IOException("No start file located for widget "+instance.getWidget().getGuid());
Modified: incubator/wookie/trunk/src/org/apache/wookie/util/gadgets/GadgetAdapter.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/util/gadgets/GadgetAdapter.java?rev=1133102&r1=1133101&r2=1133102&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/util/gadgets/GadgetAdapter.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/util/gadgets/GadgetAdapter.java Tue Jun 7 17:19:46 2011
@@ -199,7 +199,7 @@ public class GadgetAdapter implements W3
}
public String getLocalName(String locale) {
- INameEntity name = (INameEntity)LocalizationUtils.getLocalizedElement(fNamesList.toArray(new INameEntity[fNamesList.size()]), new String[]{locale});
+ INameEntity name = (INameEntity)LocalizationUtils.getLocalizedElement(fNamesList.toArray(new INameEntity[fNamesList.size()]), new String[]{locale}, null);
if (name != null) return name.getName();
return IW3CXMLConfiguration.UNKNOWN;
}
Modified: incubator/wookie/trunk/src/org/apache/wookie/util/opensocial/OpenSocialUtils.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/util/opensocial/OpenSocialUtils.java?rev=1133102&r1=1133101&r2=1133102&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/util/opensocial/OpenSocialUtils.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/util/opensocial/OpenSocialUtils.java Tue Jun 7 17:19:46 2011
@@ -125,7 +125,7 @@ public class OpenSocialUtils {
private static String getUrl(IWidgetInstance instance){
IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
- IStartFile start = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{"en"});
+ IStartFile start = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{"en"}, instance.getWidget().getDefaultLocale());
return start.getUrl();
}