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: [email protected]
For additional commands, e-mail: [email protected]