portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r888350 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services: beans/ rest/
Date Tue, 08 Dec 2009 11:57:19 GMT
Author: woonsan
Date: Tue Dec  8 11:57:19 2009
New Revision: 888350

URL: http://svn.apache.org/viewvc?rev=888350&view=rev
Log:
JS2-1087: To keep consitency between xml and json marshalings

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/BeanCollection.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletApplicationBeanCollection.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletDefinitionBeanCollection.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/BeanCollection.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/BeanCollection.java?rev=888350&r1=888349&r2=888350&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/BeanCollection.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/BeanCollection.java
Tue Dec  8 11:57:19 2009
@@ -17,11 +17,7 @@
 package org.apache.jetspeed.services.beans;
 
 import java.io.Serializable;
-import java.util.Collection;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
@@ -29,13 +25,11 @@
  * 
  * @version $Id$
  */
-@XmlRootElement(name="collection")
-public class BeanCollection<T> implements Serializable
+@XmlRootElement(name="data")
+public class BeanCollection implements Serializable
 {
     private static final long serialVersionUID = 1L;
     
-    private Collection<T> collection;
-    
     private int totalSize = -1;
     
     private int beginIndex = -1;
@@ -45,28 +39,6 @@
         
     }
     
-    protected Collection<T> getCollection()
-    {
-        return collection;
-    }
-    
-    protected void setCollection(Collection<T> collection)
-    {
-        this.collection = collection;
-    }
-    
-    @XmlAttribute(name="size")
-    public int getSize()
-    {
-        return (collection != null ? collection.size() : 0);
-    }
-    
-    public void setSize()
-    {
-        
-    }
-    
-    @XmlAttribute(name="totalSize")
     public int getTotalSize()
     {
         return totalSize;
@@ -77,7 +49,6 @@
         this.totalSize = totalSize;
     }
     
-    @XmlAttribute(name="beginIndex")
     public int getBeginIndex()
     {
         return beginIndex;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletApplicationBeanCollection.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletApplicationBeanCollection.java?rev=888350&r1=888349&r2=888350&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletApplicationBeanCollection.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletApplicationBeanCollection.java
Tue Dec  8 11:57:19 2009
@@ -19,6 +19,7 @@
 import java.util.Collection;
 
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlElements;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -27,25 +28,27 @@
  * 
  * @version $Id$
  */
-@XmlRootElement(name="applications")
-public class PortletApplicationBeanCollection extends BeanCollection<PortletApplicationBean>
+@XmlRootElement(name="data")
+public class PortletApplicationBeanCollection extends BeanCollection
 {
     private static final long serialVersionUID = 1L;
     
+    private Collection<PortletApplicationBean> applicationBeans;
+
     public PortletApplicationBeanCollection()
     {
         super();
     }
     
-    @Override
+    @XmlElementWrapper(name="applications")
     @XmlElements(@XmlElement(name="application"))
-    public Collection<PortletApplicationBean> getCollection()
+    public Collection<PortletApplicationBean> getApplications()
     {
-        return super.getCollection();
+        return applicationBeans;
     }
     
-    public void setPortletApplicationBeans(Collection<PortletApplicationBean> collection)
+    public void setApplications(Collection<PortletApplicationBean> applicationBeans)
     {
-        super.setCollection(collection);
+        this.applicationBeans = applicationBeans;
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletDefinitionBeanCollection.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletDefinitionBeanCollection.java?rev=888350&r1=888349&r2=888350&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletDefinitionBeanCollection.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/beans/PortletDefinitionBeanCollection.java
Tue Dec  8 11:57:19 2009
@@ -19,6 +19,7 @@
 import java.util.Collection;
 
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlElements;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -27,26 +28,28 @@
  * 
  * @version $Id$
  */
-@XmlRootElement(name="definitions")
-public class PortletDefinitionBeanCollection extends BeanCollection<PortletDefinitionBean>
+@XmlRootElement(name="data")
+public class PortletDefinitionBeanCollection extends BeanCollection
 {
     private static final long serialVersionUID = 1L;
     
+    private Collection<PortletDefinitionBean> definitionBeans;
+
     public PortletDefinitionBeanCollection()
     {
         super();
     }
     
-    @Override
+    @XmlElementWrapper(name="definitions")
     @XmlElements(@XmlElement(name="definition"))
-    public Collection<PortletDefinitionBean> getCollection()
+    public Collection<PortletDefinitionBean> getDefinitions()
     {
-        return super.getCollection();
+        return definitionBeans;
     }
     
-    public void setPortletApplicationBeans(Collection<PortletDefinitionBean> collection)
+    public void setDefinitions(Collection<PortletDefinitionBean> definitionBeans)
     {
-        super.setCollection(collection);
+        this.definitionBeans = definitionBeans;
     }
     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java?rev=888350&r1=888349&r2=888350&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
Tue Dec  8 11:57:19 2009
@@ -155,7 +155,7 @@
             }
         }
         
-        paBeans.setPortletApplicationBeans(paBeanList);
+        paBeans.setApplications(paBeanList);
         
         return paBeans;
     }
@@ -270,7 +270,7 @@
             }
         }
         
-        pdBeans.setPortletApplicationBeans(pdBeanList);
+        pdBeans.setDefinitions(pdBeanList);
         
         return pdBeans;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message