package <%= controllers_base_package %>; <% if action_map.values.member? :get_all -%> import java.util.List; <% end -%> import javax.ws.rs.*; import org.fusesource.restygwt.client.*; <% if name -%> import <%= models_base_package %>.*; <% end -%> @Path("/<%= table_name %><%= options[:singleton] ? '.json' : '' %>") public interface <%= controller_class_name %>Controller extends RestService { <% actions.each do |action| case action_map[action] when :get_all -%> @GET @Path('.json') void <%= action %>(MethodCallback>> callback); // @GET @Path('.json') // void <%= action %>(MethodCallback>> callback, @QueryParam("limit") int limit, @QueryParam("offset") int offset); // <% when :get_single -%> @GET<% unless options[:singleton] -%> @Path("/{id}.json")<% end %> void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") int id, <% end -%>MethodCallback<<%= class_name %>> callback); <% when :post -%> @POST @Path('.json') void <%= action %>(<%= class_name %> value, MethodCallback<<%= class_name %>> callback); <% when :put -%> @PUT<% unless options[:singleton] -%> @Path("/{id}.json")<% end %> void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") @Attribute("id") <% end -%><%= class_name %> value, MethodCallback<<%= class_name %>> callback); <% when :delete -%> @DELETE @Path("/{id}.json") void <%= action %>(@PathParam("id") @Attribute("id") <%= class_name %> value, MethodCallback callback); <% else -%> @GET @Path("/<%= action %>.json") void <%= action %>(MethodCallback callback); <% end end -%> }