[Carbon-commits] [Governance] svn commit r47654 - in trunk/solutions/governance/modules/samples/shutterbug/src: org.wso2.governance.samples.shutterbug.ui org.wso2.governance.samples.shutterbug.ui/src/main/java/org/wso2/governance/samples/shutterbug/ui org.wso2.governance.samples.shutterbug.ui/src/main/resources org.wso2.governance.samples.shutterbug.ui/src/main/resources/web/shutterbug org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services

senaka at wso2.com senaka at wso2.com
Wed Oct 21 05:41:00 PDT 2009


Author: senaka
Date: Wed Oct 21 05:41:00 2009
New Revision: 47654
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=47654

Log:
Some further fixes.


Added:
   trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/java/org/wso2/governance/samples/shutterbug/ui/ShutterbugAdminClient.java
   trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/ShutterbugAdminService.wsdl
   trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/web/shutterbug/imagefeed_rss.jsp
Modified:
   trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/pom.xml
   trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services/ShutterbugService.java

Modified: trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/pom.xml
URL: http://wso2.org/svn/browse/wso2/trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/pom.xml?rev=47654&r1=47653&r2=47654&view=diff
==============================================================================
--- trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/pom.xml	(original)
+++ trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/pom.xml	Wed Oct 21 05:41:00 2009
@@ -38,7 +38,50 @@
                     <target>1.5</target>
                 </configuration>
             </plugin>
-
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>source-code-generation</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+                                    <arg line="-uri src/main/resources/ShutterbugAdminService.wsdl -u -uw -o target/generated-code
+                                    -p org.wso2.governance.samples.shutterbug.ui
+                                    -ns2p http://services.shutterbug.samples.governance.wso2.org=org.wso2.governance.samples.shutterbug.ui.services,http://exceptions.core.registry.carbon.wso2.org/xsd=org.wso2.governance.samples.shutterbug.ui.exceptions.xsd"/>
+                                    <classpath refid="maven.dependency.classpath"/>
+                                    <classpath refid="maven.compile.classpath"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                </java>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>target/generated-code/src</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
@@ -49,7 +92,7 @@
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
                         <Private-Package>
-                            org.wso2.carbon.governance.samples.shutterbug.ui.*,
+                            org.wso2.governance.samples.shutterbug.ui.*,
                         </Private-Package>
                         <Import-Package>
                             *;resolution:=optional
@@ -61,4 +104,31 @@
 
         </plugins>
     </build>
+    <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
+            <artifactId>axiom</artifactId>
+            <version>1.2.9.wso2v1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+            <version>1.6.0.wso2v1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.ui</artifactId>
+            <version>${carbon.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.common.ui</artifactId>
+            <version>${carbon.version}</version>
+        </dependency>
+    </dependencies>
 </project>

Added: trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/java/org/wso2/governance/samples/shutterbug/ui/ShutterbugAdminClient.java
URL: http://wso2.org/svn/browse/wso2/trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/java/org/wso2/governance/samples/shutterbug/ui/ShutterbugAdminClient.java?pathrev=47654
==============================================================================
--- (empty file)
+++ trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/java/org/wso2/governance/samples/shutterbug/ui/ShutterbugAdminClient.java	Wed Oct 21 05:41:00 2009
@@ -0,0 +1,116 @@
+/*
+ *  Copyright (c) 2005-2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. licenses this file to you under the Apache License,
+ *  Version 2.0 (the "License"); you may not use this file except
+ *  in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.wso2.governance.samples.shutterbug.ui;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+import org.wso2.carbon.CarbonConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.ServletConfig;
+
+public class ShutterbugAdminClient {
+
+    private static final Log log = LogFactory.getLog(ShutterbugAdminClient.class);
+
+    private ShutterbugAdminServiceStub stub;
+    private String epr;
+
+    public ShutterbugAdminClient(ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "PropertiesAdminService";
+
+        try {
+            stub = new ShutterbugAdminServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public boolean vote(HttpServletRequest request) {
+        String imagePath = request.getParameter("imagePath");
+        if (request.getParameter("vote") == null) {
+            return false;
+        }
+        try {
+            return stub.vote(imagePath);
+        } catch (Exception e) {
+            String msg = "Failed to vote. " + e.getMessage();
+            log.error(msg, e);
+        }
+        return false;
+    }
+
+    public boolean withdrawVote(HttpServletRequest request) {
+        String imagePath = request.getParameter("imagePath");
+        if (request.getParameter("withdrawVote") == null) {
+            return false;
+        }
+        try {
+            return stub.withdrawVote(imagePath);
+        } catch (Exception e) {
+            String msg = "Failed to withdraw vote. " + e.getMessage();
+            log.error(msg, e);
+        }
+        return false;
+    }
+
+    public String getImageFeed(HttpServletRequest request) {
+        try {
+            return stub.getImageFeed();
+        } catch (Exception e) {
+            String msg = "Failed to get image feed. " + e.getMessage();
+            log.error(msg, e);
+        }
+        return null;
+    }
+
+    public String getMyImageFeed(HttpServletRequest request) {
+        try {
+            return stub.getMyImageFeed();
+        } catch (Exception e) {
+            String msg = "Failed to get image feed. " + e.getMessage();
+            log.error(msg, e);
+        }
+        return null;
+    }
+}

Added: trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/ShutterbugAdminService.wsdl
URL: http://wso2.org/svn/browse/wso2/trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/ShutterbugAdminService.wsdl?pathrev=47654
==============================================================================
--- (empty file)
+++ trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/ShutterbugAdminService.wsdl	Wed Oct 21 05:41:00 2009
@@ -0,0 +1,215 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ns="http://services.shutterbug.samples.governance.wso2.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://services.shutterbug.samples.governance.wso2.org">
+    <wsdl:documentation>ShutterbugAdminService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.shutterbug.samples.governance.wso2.org">
+            <xs:element name="withdrawVote">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="imagePath" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="withdrawVoteResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="vote">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="imagePath" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="voteResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getMyImageFeedResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getImageFeedResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="voteRequest">
+        <wsdl:part name="parameters" element="ns:vote" />
+    </wsdl:message>
+    <wsdl:message name="voteResponse">
+        <wsdl:part name="parameters" element="ns:voteResponse" />
+    </wsdl:message>
+    <wsdl:message name="getImageFeedRequest" />
+    <wsdl:message name="getImageFeedResponse">
+        <wsdl:part name="parameters" element="ns:getImageFeedResponse" />
+    </wsdl:message>
+    <wsdl:message name="withdrawVoteRequest">
+        <wsdl:part name="parameters" element="ns:withdrawVote" />
+    </wsdl:message>
+    <wsdl:message name="withdrawVoteResponse">
+        <wsdl:part name="parameters" element="ns:withdrawVoteResponse" />
+    </wsdl:message>
+    <wsdl:message name="getMyImageFeedRequest" />
+    <wsdl:message name="getMyImageFeedResponse">
+        <wsdl:part name="parameters" element="ns:getMyImageFeedResponse" />
+    </wsdl:message>
+    <wsdl:portType name="ShutterbugAdminServicePortType">
+        <wsdl:operation name="vote">
+            <wsdl:input message="ns:voteRequest" wsaw:Action="urn:vote" />
+            <wsdl:output message="ns:voteResponse" wsaw:Action="urn:voteResponse" />
+        </wsdl:operation>
+        <wsdl:operation name="getImageFeed">
+            <wsdl:input message="ns:getImageFeedRequest" wsaw:Action="urn:getImageFeed" />
+            <wsdl:output message="ns:getImageFeedResponse" wsaw:Action="urn:getImageFeedResponse" />
+        </wsdl:operation>
+        <wsdl:operation name="withdrawVote">
+            <wsdl:input message="ns:withdrawVoteRequest" wsaw:Action="urn:withdrawVote" />
+            <wsdl:output message="ns:withdrawVoteResponse" wsaw:Action="urn:withdrawVoteResponse" />
+        </wsdl:operation>
+        <wsdl:operation name="getMyImageFeed">
+            <wsdl:input message="ns:getMyImageFeedRequest" wsaw:Action="urn:getMyImageFeed" />
+            <wsdl:output message="ns:getMyImageFeedResponse" wsaw:Action="urn:getMyImageFeedResponse" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="ShutterbugAdminServiceSoap11Binding" type="ns:ShutterbugAdminServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="vote">
+            <soap:operation soapAction="urn:vote" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="withdrawVote">
+            <soap:operation soapAction="urn:withdrawVote" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getImageFeed">
+            <soap:operation soapAction="urn:getImageFeed" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMyImageFeed">
+            <soap:operation soapAction="urn:getMyImageFeed" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ShutterbugAdminServiceSoap12Binding" type="ns:ShutterbugAdminServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="vote">
+            <soap12:operation soapAction="urn:vote" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="withdrawVote">
+            <soap12:operation soapAction="urn:withdrawVote" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getImageFeed">
+            <soap12:operation soapAction="urn:getImageFeed" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMyImageFeed">
+            <soap12:operation soapAction="urn:getMyImageFeed" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ShutterbugAdminServiceHttpBinding" type="ns:ShutterbugAdminServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="vote">
+            <http:operation location="vote" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="vote" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="vote" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="withdrawVote">
+            <http:operation location="withdrawVote" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="withdrawVote" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="withdrawVote" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getImageFeed">
+            <http:operation location="getImageFeed" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="getImageFeed" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="getImageFeed" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMyImageFeed">
+            <http:operation location="getMyImageFeed" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="getMyImageFeed" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="getMyImageFeed" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="ShutterbugAdminService">
+        <wsdl:port name="ShutterbugAdminServiceHttpsSoap11Endpoint" binding="ns:ShutterbugAdminServiceSoap11Binding">
+            <soap:address location="https://10.100.1.151:9443/services/ShutterbugAdminService.ShutterbugAdminServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ShutterbugAdminServiceHttpsSoap12Endpoint" binding="ns:ShutterbugAdminServiceSoap12Binding">
+            <soap12:address location="https://10.100.1.151:9443/services/ShutterbugAdminService.ShutterbugAdminServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ShutterbugAdminServiceHttpsEndpoint" binding="ns:ShutterbugAdminServiceHttpBinding">
+            <http:address location="https://10.100.1.151:9443/services/ShutterbugAdminService.ShutterbugAdminServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/web/shutterbug/imagefeed_rss.jsp
URL: http://wso2.org/svn/browse/wso2/trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/web/shutterbug/imagefeed_rss.jsp?pathrev=47654
==============================================================================
--- (empty file)
+++ trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug.ui/src/main/resources/web/shutterbug/imagefeed_rss.jsp	Wed Oct 21 05:41:00 2009
@@ -0,0 +1,14 @@
+<%@ page import="org.wso2.governance.samples.shutterbug.ui.ShutterbugAdminClient" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %><%
+    String errorMessage = null;
+    try {
+        ShutterbugAdminClient client = new ShutterbugAdminClient(config, session);
+        String output = client.getImageFeed(request);
+        output = output.replace("${startData}", "<![CDATA[{").replace("${endData}", "}]]>")
+                .replace("${registryURL}", CarbonUIUtil.getServerURL(config.getServletContext(),
+                session).replace("/services", "/registry"));
+        %><%=output%><%
+    } catch (Exception e) {
+        response.setStatus(500);
+    }
+%>
\ No newline at end of file

Modified: trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services/ShutterbugService.java
URL: http://wso2.org/svn/browse/wso2/trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services/ShutterbugService.java?rev=47654&r1=47653&r2=47654&view=diff
==============================================================================
--- trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services/ShutterbugService.java	(original)
+++ trunk/solutions/governance/modules/samples/shutterbug/src/org.wso2.governance.samples.shutterbug/src/main/java/org/wso2/governance/samples/shutterbug/services/ShutterbugService.java	Wed Oct 21 05:41:00 2009
@@ -60,20 +60,36 @@
         return false;
     }
 
-    public OMElement getImageFeed() {
-        return Utils.buildImageFeed(getUserList());
+    public String getImageFeed() {
+        try {
+            return Utils.buildImageFeed(getUserList()).toStringWithConsume();
+        } catch (Exception e) {
+            log.error("Failed to serialize payload", e);
+            return null;
+        }
     }
 
-    public OMElement getMyImageFeed() {
+    public String getMyImageFeed() {
         List<ShutterbugUser> userList = getUserList();
         for (ShutterbugUser user : userList) {
             if (user.getId().equals(getCurrentUserId())) {
                 List<ShutterbugUser> currentUser = new LinkedList<ShutterbugUser>();
                 currentUser.add(user);
-                return Utils.buildImageFeed(currentUser);
+                try {
+                    return Utils.buildImageFeed(currentUser).toStringWithConsume();
+                } catch (Exception e) {
+                    log.error("Failed to serialize payload", e);
+                    return null;
+                }
+
             }
         }
-        return Utils.buildImageFeed(new LinkedList<ShutterbugUser>());
+        try {
+            return Utils.buildImageFeed(new LinkedList<ShutterbugUser>()).toStringWithConsume();
+        } catch (Exception e) {
+            log.error("Failed to serialize payload", e);
+            return null;
+        }
     }
 
     private String getCurrentUserId() {



More information about the Carbon-commits mailing list