Author: scottbw
Date: Fri Jun  8 14:38:06 2012
New Revision: 1348092

URL: http://svn.apache.org/viewvc?rev=1348092&view=rev
Log:
Harmonized the Author, Description, License APIs in the server with those in 
the parser. See WOOKIE-345.

Modified:
    
incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java
    incubator/wookie/trunk/src/org/apache/wookie/beans/IAuthor.java
    incubator/wookie/trunk/src/org/apache/wookie/beans/IDescription.java
    incubator/wookie/trunk/src/org/apache/wookie/beans/ILicense.java
    incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/AuthorImpl.java
    
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/DescriptionImpl.java
    incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java
    
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java
    
incubator/wookie/trunk/src/org/apache/wookie/beans/util/PersistenceManagerFactory.java
    incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetAdvertHelper.java
    incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetFactory.java
    incubator/wookie/trunk/src/org/apache/wookie/util/WidgetFormattingUtils.java

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java 
(original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java 
Fri Jun  8 14:38:06 2012
@@ -88,7 +88,7 @@ public class WidgetAPIImpl implements IW
         String email = "";
         String href = "";
                if (widget.getAuthor() != null){
-            if (widget.getAuthor().getAuthor() != null) author = 
WidgetFormattingUtils.getEncoded(widget.getAuthor().getDir(), 
widget.getAuthor().getAuthor());
+            if (widget.getAuthor().getAuthorName() != null) author = 
WidgetFormattingUtils.getEncoded(widget.getAuthor().getDir(), 
widget.getAuthor().getAuthorName());
                if (widget.getAuthor().getEmail() != null) email = 
widget.getAuthor().getEmail();
                if (widget.getAuthor().getHref() != null) href = 
widget.getAuthor().getHref();
                }
@@ -101,7 +101,7 @@ public class WidgetAPIImpl implements IW
                
                String description = "";
                IDescription idescription = 
(IDescription)LocalizationUtils.getLocalizedElement(widget.getDescriptions().toArray(new
 IDescription[widget.getDescriptions().size()]), locales, 
widget.getDefaultLocale());
-               if (idescription != null && idescription.getContent() != null) 
description = WidgetFormattingUtils.getEncoded(idescription.getDir(), 
idescription.getContent());
+               if (idescription != null && idescription.getDescription() != 
null) description = WidgetFormattingUtils.getEncoded(idescription.getDir(), 
idescription.getDescription());
                
                String version = "";
                if (widget.getVersion() != null) version = 
WidgetFormattingUtils.getEncoded(widget.getDir(), widget.getVersion());

Modified: incubator/wookie/trunk/src/org/apache/wookie/beans/IAuthor.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/IAuthor.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/beans/IAuthor.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/beans/IAuthor.java Fri Jun  8 
14:38:06 2012
@@ -22,7 +22,7 @@ public interface IAuthor extends ILocali
         * Get the details of the author, e.g. name or names of people and/or 
organisations
         * @return the author details, or null if there are no author details
         */
-       public String getAuthor();
+       public String getAuthorName();
        
        /**
         * Get the email address of the author
@@ -40,7 +40,7 @@ public interface IAuthor extends ILocali
         * Set the author details
         * @param author tha author details to set
         */
-       public void setAuthor(String author);
+       public void setAuthorName(String author);
        
        /**
         * Set the author's email

Modified: incubator/wookie/trunk/src/org/apache/wookie/beans/IDescription.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/IDescription.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/beans/IDescription.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/beans/IDescription.java Fri 
Jun  8 14:38:06 2012
@@ -28,12 +28,12 @@ public interface IDescription extends IL
      * 
      * @return content
      */
-    String getContent();
+    String getDescription();
     
     /**
      * Set widget description content.
      * 
      * @param text content
      */
-    void setContent(String text);
+    void setDescription(String text);
 }

Modified: incubator/wookie/trunk/src/org/apache/wookie/beans/ILicense.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/ILicense.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/beans/ILicense.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/beans/ILicense.java Fri Jun  8 
14:38:06 2012
@@ -28,14 +28,14 @@ public interface ILicense extends ILocal
      * 
      * @return license text
      */
-    String getText();
+    String getLicenseText();
     
     /**
      * Set widget license text.
      * 
      * @param text license text
      */
-    void setText(String text);
+    void setLicenseText(String text);
     
     /**
      * Get widget license href URL.

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/AuthorImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/AuthorImpl.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/AuthorImpl.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/AuthorImpl.java 
Fri Jun  8 14:38:06 2012
@@ -67,7 +67,7 @@ public class AuthorImpl extends Localize
        /* (non-Javadoc)
         * @see org.apache.wookie.beans.IAuthor#getAuthor()
         */
-       public String getAuthor() {
+       public String getAuthorName() {
                return this.author;
        }
 
@@ -88,7 +88,7 @@ public class AuthorImpl extends Localize
        /* (non-Javadoc)
         * @see org.apache.wookie.beans.IAuthor#setAuthor(java.lang.String)
         */
-       public void setAuthor(String author) {
+       public void setAuthorName(String author) {
                this.author = author;
        }
 

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/DescriptionImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/DescriptionImpl.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/DescriptionImpl.java
 (original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/DescriptionImpl.java
 Fri Jun  8 14:38:06 2012
@@ -70,7 +70,7 @@ public class DescriptionImpl extends Loc
     /* (non-Javadoc)
      * @see org.apache.wookie.beans.IDescription#getContent()
      */
-    public String getContent()
+    public String getDescription()
     {
         return content;
     }
@@ -78,7 +78,7 @@ public class DescriptionImpl extends Loc
     /* (non-Javadoc)
      * @see org.apache.wookie.beans.IDescription#setContent(java.lang.String)
      */
-    public void setContent(String text)
+    public void setDescription(String text)
     {
         this.content = text;
     }

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java 
(original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java 
Fri Jun  8 14:38:06 2012
@@ -90,7 +90,7 @@ public class LicenseImpl extends Localiz
     /* (non-Javadoc)
      * @see org.apache.wookie.beans.ILicense#getText()
      */
-    public String getText()
+    public String getLicenseText()
     {
         return text;
     }
@@ -98,7 +98,7 @@ public class LicenseImpl extends Localiz
     /* (non-Javadoc)
      * @see org.apache.wookie.beans.ILicense#setText(java.lang.String)
      */
-    public void setText(String text)
+    public void setLicenseText(String text)
     {
         this.text = text;
     }

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java
 (original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java
 Fri Jun  8 14:38:06 2012
@@ -29,7 +29,7 @@ import org.apache.wookie.beans.ILocalize
 @MappedSuperclass
 public abstract class LocalizedBeanImpl implements ILocalizedBean
 { 
-       @Basic
+       @Basic 
     @Column(name="dir")
     private String dir;
 

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/beans/util/PersistenceManagerFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/util/PersistenceManagerFactory.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/beans/util/PersistenceManagerFactory.java
 (original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/beans/util/PersistenceManagerFactory.java
 Fri Jun  8 14:38:06 2012
@@ -92,7 +92,7 @@ public class PersistenceManagerFactory
                     widget.setGuid("http://notsupported";);
                     
                     IAuthor author = 
persistenceManager.newInstance(IAuthor.class);
-                    author.setAuthor("Paul Sharples");
+                    author.setAuthorName("Paul Sharples");
                     author.setEmail("[email protected]");
                     author.setHref("http://iec.bolton.ac.uk";);
                     widget.setAuthor(author);
@@ -102,7 +102,7 @@ public class PersistenceManagerFactory
                     widgetName.setShortName("Unsupported");
                     widget.getNames().add(widgetName);
                     IDescription widgetDescription = 
persistenceManager.newInstance(IDescription.class);
-                    widgetDescription.setContent("This widget is a placeholder 
for when no corresponding widget is found for a given type");
+                    widgetDescription.setDescription("This widget is a 
placeholder for when no corresponding widget is found for a given type");
                     widget.getDescriptions().add(widgetDescription);
                     IStartFile widgetStartFile = 
persistenceManager.newInstance(IStartFile.class);
                     
widgetStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + 
"/wservices/notsupported/index.htm");

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetAdvertHelper.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetAdvertHelper.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetAdvertHelper.java 
(original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetAdvertHelper.java 
Fri Jun  8 14:38:06 2012
@@ -110,7 +110,7 @@ public class WidgetAdvertHelper {
            if (widget.getAuthor().getEmail() != null) out+= " 
email=\""+widget.getAuthor().getEmail()+"\"";
            if (widget.getAuthor().getHref() != null) out+= " 
href=\""+widget.getAuthor().getHref()+"\"";
            out += ">";
-           if (widget.getAuthor().getAuthor()!=null) out += 
StringEscapeUtils.escapeXml(widget.getAuthor().getAuthor());           
+           if (widget.getAuthor().getAuthorName()!=null) out += 
StringEscapeUtils.escapeXml(widget.getAuthor().getAuthorName());           
            out += "</author>\n";
            return out;
          } else {
@@ -127,7 +127,7 @@ public class WidgetAdvertHelper {
                        if (license.getLang()!=null) out+=" 
xml:lang=\""+license.getLang()+"\"";
                        if (license.getHref()!=null) out+=" 
href=\""+license.getHref()+"\"";
                        if (license.getDir()!=null) out+=" 
dir=\""+license.getDir()+"\"";
-                       
out+=">"+StringEscapeUtils.escapeXml(license.getText())+"</license>\n";
+                       
out+=">"+StringEscapeUtils.escapeXml(license.getLicenseText())+"</license>\n";
                }
                return out;
        }
@@ -164,7 +164,7 @@ public class WidgetAdvertHelper {
                String out = "\t\t<description";
                if (desc!= null && desc.getDir()!=null) out+=" 
dir=\""+desc.getDir()+"\"";
                out += ">";
-               if (desc != null) out += 
StringEscapeUtils.escapeXml(desc.getContent());
+               if (desc != null) out += 
StringEscapeUtils.escapeXml(desc.getDescription());
                out += "</description>\n";
                return out;
        }

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetFactory.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetFactory.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/helpers/WidgetFactory.java Fri 
Jun  8 14:38:06 2012
@@ -120,7 +120,7 @@ public class WidgetFactory {
        private static void createAuthor(IPersistenceManager 
persistenceManager, W3CWidget model, IWidget widget){
           if (model.getAuthor() != null){
              IAuthor author = persistenceManager.newInstance(IAuthor.class);
-             author.setAuthor(model.getAuthor().getAuthorName());
+             author.setAuthorName(model.getAuthor().getAuthorName());
              author.setEmail(model.getAuthor().getEmail());
              author.setHref(model.getAuthor().getHref());
              author.setDir(model.getAuthor().getDir());
@@ -153,11 +153,11 @@ public class WidgetFactory {
        private static void createDescriptions(IPersistenceManager 
persistenceManager, W3CWidget model, IWidget widget){
                for (IDescriptionEntity desc:model.getDescriptions()){
                        IDescription widgetDesc = 
persistenceManager.newInstance(IDescription.class);
-                       widgetDesc.setContent(desc.getDescription());
+                       widgetDesc.setDescription(desc.getDescription());
                        widgetDesc.setLang(desc.getLang());
                        widgetDesc.setDir(desc.getDir());
             widget.getDescriptions().add(widgetDesc);
-               }
+               } 
        }
 
        private static void createIcons(IPersistenceManager persistenceManager, 
W3CWidget model, IWidget widget){
@@ -174,7 +174,7 @@ public class WidgetFactory {
        private static void createLicenses(IPersistenceManager 
persistenceManager, W3CWidget model, IWidget widget){
                for(ILicenseEntity licenseModel: model.getLicensesList()){
             ILicense license = persistenceManager.newInstance(ILicense.class);
-            license.setText(licenseModel.getLicenseText());
+            license.setLicenseText(licenseModel.getLicenseText());
             license.setHref(licenseModel.getHref());
             license.setLang(licenseModel.getLang());
             license.setDir(licenseModel.getDir());

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/util/WidgetFormattingUtils.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/util/WidgetFormattingUtils.java?rev=1348092&r1=1348091&r2=1348092&view=diff
==============================================================================
--- 
incubator/wookie/trunk/src/org/apache/wookie/util/WidgetFormattingUtils.java 
(original)
+++ 
incubator/wookie/trunk/src/org/apache/wookie/util/WidgetFormattingUtils.java 
Fri Jun  8 14:38:06 2012
@@ -59,7 +59,7 @@ public class WidgetFormattingUtils exten
         * @return a CSS-formatted i18n string
         */
        public static String getFormattedWidgetDescription(IDescription 
description){
-               return getFormatted(description.getDir(), 
description.getContent());
+               return getFormatted(description.getDir(), 
description.getDescription());
        }
        /**
         * Returns the CSS formatted i18n string for the widget license
@@ -67,7 +67,7 @@ public class WidgetFormattingUtils exten
         * @return a CSS-formatted i18n string
         */
        public static String getFormattedWidgetLicense(ILicense license){
-               return getFormatted(license.getDir(), license.getText());
+               return getFormatted(license.getDir(), license.getLicenseText());
        }
 
 


Reply via email to