001package org.nuxeo.ecm.webengine.samples; 002 003import javax.ws.rs.GET; 004import javax.ws.rs.Produces; 005 006import org.nuxeo.ecm.webengine.model.WebAdapter; 007import org.nuxeo.ecm.webengine.model.impl.DefaultAdapter; 008 009/** 010 * UserBuddies object. You can see the @WebAdapter annotation that is defining a WebAdapter of type "UserBuddies" that 011 * applies to any User WebObject. The name used to access this adapter is the adapter name prefixed with a '@' 012 * character: {@code @buddies} 013 * 014 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 015 */ 016@WebAdapter(name = "buddies", type = "UserBuddies", targetType = "User") 017@Produces("text/html;charset=UTF-8") 018public class UserBuddiesObject extends DefaultAdapter { 019 020 /** 021 * Get the index view. The view file name is computed as follows: index[-media_type_id].ftl First the 022 * skin/views/UserBuddies is searched for that file then the current directory. (The type of a module is the same as 023 * its name) 024 */ 025 @GET 026 public Object doGet() { 027 return getView("index"); 028 } 029 030}