You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by re...@apache.org on 2012/04/05 15:04:04 UTC
svn commit: r1309829 - in
/incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders:
FacetedResource.java RootResource.java
Author: reto
Date: Thu Apr 5 13:04:03 2012
New Revision: 1309829
URL: http://svn.apache.org/viewvc?rev=1309829&view=rev
Log:
getting first level categories from featuredSearch
Modified:
incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/FacetedResource.java
incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/RootResource.java
Modified: incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/FacetedResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/FacetedResource.java?rev=1309829&r1=1309828&r2=1309829&view=diff
==============================================================================
--- incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/FacetedResource.java (original)
+++ incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/FacetedResource.java Thu Apr 5 13:04:03 2012
@@ -25,6 +25,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
+import org.apache.solr.client.solrj.response.FacetField.Count;
import org.apache.stanbol.contenthub.servicesapi.search.featured.FacetResult;
import org.apache.stanbol.webdav.resources.AbstractCollectionResource;
@@ -38,25 +39,25 @@ import com.bradmcevoy.http.Request.Metho
import com.bradmcevoy.http.Resource;
import com.bradmcevoy.http.exceptions.BadRequestException;
import com.bradmcevoy.http.exceptions.NotAuthorizedException;
-import com.bradmcevoy.http.exceptions.NotFoundException;
public class FacetedResource extends AbstractCollectionResource implements PropFindableResource, GetableResource, CollectionResource {
- private String name = "scratchpad.txt";
private static final String MESSAGE = "Hello world";
+ private FacetResult fr;
- public FacetedResource(String name) {
- this.name = name;
+
+ public FacetedResource(FacetResult fr) {
+ this.fr = fr;
}
-
+
public String getUniqueId() {
- return name;
+ return fr.getFacetField().getName();
}
public String getName() {
- return name;
+ return fr.getFacetField().getName();
}
public Object authenticate(String user, String password) {
@@ -109,9 +110,10 @@ public class FacetedResource extends Abs
throws NotAuthorizedException, BadRequestException {
// TODO Auto-generated method stub
List<Resource> resources = new ArrayList<Resource>();
- resources.add(new FacetedResource("bar1"));
+ List<Count> values = fr.getFacetField().getValues();
+ /* resources.add(new FacetedResource("bar1"));
resources.add(new FacetedResource("bar2"));
- resources.add(new FacetedResource("bar3") {});
+ resources.add(new FacetedResource("bar3") {});*/
return resources;
}
Modified: incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/RootResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/RootResource.java?rev=1309829&r1=1309828&r2=1309829&view=diff
==============================================================================
--- incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/RootResource.java (original)
+++ incubator/stanbol/branches/ontonet-showcase/featured-vfolders/src/main/java/org/apache/stanbol/contenthub/vfolders/RootResource.java Thu Apr 5 13:04:03 2012
@@ -80,11 +80,8 @@ public class RootResource extends Abstra
for (FacetResult fr : facetResults) {
final String name = fr.getFacetField().getName();
System.out.println("name: "+name);
- resources.add(new FacetedResource(name) {});
+ resources.add(new FacetedResource(fr));
}
- resources.add(new FacetedResource("foo"));
- resources.add(new FacetedResource("foo2"));
- resources.add(new FacetedResource("foo3") {});
//resources.add(new SlingResource());
System.out.println("returning: "+resources);
return resources;