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 2014/02/05 19:54:13 UTC

svn commit: r1564879 - /wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java

Author: scottbw
Date: Wed Feb  5 18:54:12 2014
New Revision: 1564879

URL: http://svn.apache.org/r1564879
Log:
Removed all dependencies from IWidget to packages outside the scope of the beans package. This is so we can start refactoring the current JPA code out of the server and into wookie-jpa.

Modified:
    wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java

Modified: wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java
URL: http://svn.apache.org/viewvc/wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java?rev=1564879&r1=1564878&r2=1564879&view=diff
==============================================================================
--- wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java (original)
+++ wookie/trunk/wookie-server/src/main/java/org/apache/wookie/beans/IWidget.java Wed Feb  5 18:54:12 2014
@@ -16,9 +16,9 @@ package org.apache.wookie.beans;
 
 import java.util.Collection;
 
-import org.apache.wookie.helpers.WidgetRuntimeHelper;
-import org.apache.wookie.util.WidgetFormattingUtils;
+//import org.apache.wookie.helpers.WidgetRuntimeHelper;
 import org.apache.wookie.w3c.IW3CXMLConfiguration;
+import org.apache.wookie.w3c.util.FormattingUtils;
 import org.apache.wookie.w3c.util.LocalizationUtils;
 import org.apache.wookie.w3c.*;
 
@@ -156,7 +156,7 @@ public interface IWidget extends W3CWidg
         {
         	IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
             IName name = (IName)LocalizationUtils.getLocalizedElement(names, new String[]{locale}, widget.getDefaultLocale());
-            return ((name != null) ? WidgetFormattingUtils.getFormattedWidgetName(name) : IW3CXMLConfiguration.UNKNOWN);
+            return ((name != null) ? FormattingUtils.getFormatted(name.getDir(),name.getName()) : IW3CXMLConfiguration.UNKNOWN);
         }
         
         /**
@@ -174,7 +174,7 @@ public interface IWidget extends W3CWidg
         {
         	IDescription[] descriptions = widget.getDescriptions().toArray(new IDescription[widget.getDescriptions().size()]);
             IDescription description = (IDescription)LocalizationUtils.getLocalizedElement(descriptions, new String[]{locale}, widget.getDefaultLocale());
-            return ((description != null) ? WidgetFormattingUtils.getFormattedWidgetDescription(description) : null);
+            return ((description != null) ? FormattingUtils.getFormatted(description.getDir(), description.getDescription()) : null);
         }
 
         /**
@@ -192,7 +192,7 @@ public interface IWidget extends W3CWidg
         {
         	IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
             IName name = (IName)LocalizationUtils.getLocalizedElement(names, new String[]{locale}, widget.getDefaultLocale());
-            return ((name != null) ? WidgetFormattingUtils.getFormattedWidgetShortName(name) : IW3CXMLConfiguration.UNKNOWN);
+            return ((name != null) ? FormattingUtils.getFormatted(name.getDir(), name.getShort()) : IW3CXMLConfiguration.UNKNOWN);
         }
 
         /**
@@ -221,7 +221,12 @@ public interface IWidget extends W3CWidg
         {
         	IIcon[] icons = widget.getIcons().toArray(new IIcon[widget.getIcons().size()]);
             IIcon icon = (IIcon)LocalizationUtils.getLocalizedElement(icons, new String[]{locale}, widget.getDefaultLocale());
-            return ((icon != null) ? icon.getSrc() : WidgetRuntimeHelper.DEFAULT_ICON_PATH);
+            return ((icon != null) ? icon.getSrc() : "/wookie/shared/images/cog.gif");
+            //
+            // TODO This should be looked up dynamically within wookie-server when refactoring is completed
+            // The code below was only removed to make wookie-jpa not depend on wookie-server
+            //
+            //return ((icon != null) ? icon.getSrc() : WidgetRuntimeHelper.DEFAULT_ICON_PATH);
         }
     }
 }