@GET public Object doGet(@Context UriInfo uriInfo) { LayoutStore service = Framework.getService(LayoutStore.class); // XXX: use hard coded "jsf" category for now int nbWidgetTypes = service.getWidgetTypeDefinitions("jsf").size(); int nbLayoutTypes = service.getLayoutTypeDefinitions("jsf").size(); int nbLayouts = service.getLayoutDefinitionNames("jsf").size(); return getTemplate("index.ftl", uriInfo).arg("nbWidgetTypes", Integer.valueOf(nbWidgetTypes)).arg("nbLayouts", Integer.valueOf(nbLayouts)).arg("nbLayoutTypes", Integer.valueOf(nbLayoutTypes)); }
@Override public List<WidgetTypeDefinition> getWidgetTypeDefinitions() { return getLayoutStore().getWidgetTypeDefinitions(getDefaultStoreCategory()); }
public WidgetTypeResource(String category) { this.category = category; service = Framework.getService(LayoutStore.class); widgetTypes = service.getWidgetTypeDefinitions(category); // sort so that order is deterministic Collections.sort(widgetTypes, new WidgetTypeDefinitionComparator(true)); widgetTypesByCat = getWidgetTypesByCategory(); }