Browse files

Tiny attempt for speed-up-CTV

  • Loading branch information...
1 parent 579ed02 commit 17f9eede005f6257e9bb95dbca8c5a08b47fbbe3 @polx polx committed Jan 24, 2012
View
5 ...c/main/java/org/curriki/xwiki/servlet/restlet/resource/users/UserCollectionsResource.java
@@ -1,5 +1,6 @@
package org.curriki.xwiki.servlet.restlet.resource.users;
+import org.curriki.xwiki.plugin.asset.composite.CompositeAsset;
import org.restlet.resource.Representation;
import org.restlet.resource.Variant;
import org.restlet.resource.ResourceException;
@@ -43,10 +44,12 @@ public UserCollectionsResource(Context context, Request request, Response respon
for(String collFullName: resultList) {
JSONObject collInfo = new JSONObject();
collInfo.put("collectionPage", collFullName);
- Asset asset = plugin.fetchAsset(collFullName);
+ CompositeAsset asset =
+ plugin.fetchAsset(collFullName).as(CompositeAsset.class);
collInfo.put("revision", asset.getVersion());
collInfo.put("collectionType", "collection") ; // ???
collInfo.put("displayTitle", asset.getTitle());
+ collInfo.put("children", asset.getSubassetList());
json.add(collInfo);
}
//results = plugin.fetchUserCollectionsInfo(forUser);

0 comments on commit 17f9eed

Please sign in to comment.