You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by do...@apache.org on 2008/04/30 14:12:19 UTC

svn commit: r652355 - in /incubator/shindig/trunk/java: server/src/main/webapp/WEB-INF/web.xml social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java

Author: doll
Date: Wed Apr 30 05:12:18 2008
New Revision: 652355

URL: http://svn.apache.org/viewvc?rev=652355&view=rev
Log:
Change the rest server url to be "social/rest" so that the url is the same when running from /server and /social-api.

Added a dummy gadgetToken to the peopleServiceAdapter for now so that it doesn't npe. 



Modified:
    incubator/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml
    incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java

Modified: incubator/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml?rev=652355&r1=652354&r2=652355&view=diff
==============================================================================
--- incubator/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml Wed Apr 30 05:12:18 2008
@@ -80,7 +80,7 @@
     <init-param>
       <param-name>org.apache.abdera.protocol.server.Provider</param-name>
       <param-value>org.apache.shindig.social.SocialApiProvider</param-value>
-    </init-param> 
+    </init-param>
   </servlet>
 
 
@@ -111,6 +111,6 @@
 
   <servlet-mapping>
     <servlet-name>restapiServlet</servlet-name>
-    <url-pattern>/rest/*</url-pattern>
+    <url-pattern>/social/rest/*</url-pattern>
   </servlet-mapping>
 </web-app>

Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java?rev=652355&r1=652354&r2=652355&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/PeopleServiceAdapter.java Wed Apr 30 05:12:18 2008
@@ -19,6 +19,7 @@
 
 import org.apache.shindig.social.opensocial.PeopleService;
 import org.apache.shindig.social.opensocial.model.Person;
+import org.apache.shindig.gadgets.GadgetToken;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -63,13 +64,45 @@
     String[] paramNames = request.getTarget().getParameterNames();
     String uid = request.getTarget().getParameter(paramNames[0]);
     // TODO(doll): Fix the service apis to add a concept of arbitrary friends
-    // Consider whether @all really makes sense... 
+    // Consider whether @all really makes sense...
     List<Person> listOfObj = null;
     return returnFeed(request, TITLE, AUTHOR, (List)listOfObj);
   }
 
   @Override
   public ResponseContext getEntry(RequestContext request) {
+
+      // TODO: Replace this with the real thing
+    GadgetToken dummyToken = new GadgetToken() {
+      public String toSerialForm() {
+        return "";
+      }
+
+      public String getOwnerId() {
+        return "";
+      }
+
+      public String getViewerId() {
+        return "";
+      }
+
+      public String getAppId() {
+        return "";
+      }
+
+      public String getDomain() {
+        return "";
+      }
+
+      public String getAppUrl() {
+        return "";
+      }
+
+      public long getModuleId() {
+        return 0;
+      }
+    };
+
     // get the params from the request
     String[] paramNames = request.getTarget().getParameterNames();
 
@@ -80,8 +113,7 @@
     switch (paramNames.length) {
       case 1:
         String uid = request.getTarget().getParameter(paramNames[0]);
-        // TODO: Pass in the gadget token
-        person = handler.getPerson(uid, null).getResponse();
+        person = handler.getPerson(uid, dummyToken).getResponse();
         break;
       case 2:
         uid = request.getTarget().getParameter(paramNames[0]);
@@ -89,7 +121,7 @@
         // TODO: pass in the gadget token with the uid parameter set. We don't
         // have different views of people from an aribtrary ids point of view.
         // Rather, the token is how permissions are done.
-        person = handler.getPerson(pid, null).getResponse();
+        person = handler.getPerson(pid, dummyToken).getResponse();
         break;
       default:
         return ProviderHelper.notsupported(request, "more than 2 params?");