abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r616036 - in /incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver: CustomProvider.java SimpleAdapter.java
Date Mon, 28 Jan 2008 20:48:10 GMT
Author: jmsnell
Date: Mon Jan 28 12:48:09 2008
New Revision: 616036

URL: http://svn.apache.org/viewvc?rev=616036&view=rev
Log:
Update the example to match the test

Modified:
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/CustomProvider.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleAdapter.java

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/CustomProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/CustomProvider.java?rev=616036&r1=616035&r2=616036&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/CustomProvider.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/CustomProvider.java
Mon Jan 28 12:48:09 2008
@@ -26,14 +26,13 @@
 import org.apache.abdera.protocol.server.context.RequestContextWrapper;
 import org.apache.abdera.protocol.server.impl.AbstractWorkspaceProvider;
 import org.apache.abdera.protocol.server.impl.RegexTargetResolver;
-import org.apache.abdera.protocol.server.impl.SimpleCollectionInfo;
 import org.apache.abdera.protocol.server.impl.SimpleWorkspaceInfo;
 import org.apache.abdera.protocol.server.impl.TemplateTargetBuilder;
 
 public class CustomProvider 
   extends AbstractWorkspaceProvider {
 
-  private final CollectionAdapter adapter;
+  private final SimpleAdapter adapter;
   
   public CustomProvider() {
     // Create the adapter that will handle all of the requests processed by this provider
@@ -61,13 +60,7 @@
     // Add a Workspace descriptor so the provider can generate an atompub service document
     SimpleWorkspaceInfo workspace = new SimpleWorkspaceInfo();
     workspace.setTitle("A Simple Workspace");
-    workspace.addCollection(
-      new SimpleCollectionInfo(
-        "feed",
-        "A simple feed",
-        "/atom/feed",
-        "application/atom+xml;type=entry"
-      ));
+    workspace.addCollection(adapter);
     addWorkspace(workspace);
     
     // Add one of more Filters to be invoked prior to invoking the Provider

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleAdapter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleAdapter.java?rev=616036&r1=616035&r2=616036&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleAdapter.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleAdapter.java
Mon Jan 28 12:48:09 2008
@@ -55,7 +55,9 @@
   }
 
   public String getHref(RequestContext request) {
-    return "atom/feed";
+    Map<String,Object> params = new HashMap<String,Object>();
+    params.put("collection","feed");
+    return request.urlFor(TargetType.TYPE_COLLECTION, params);
   }
 
   public String getTitle(RequestContext request) {



Mime
View raw message