public LayoutResource(String category) { this.category = category; service = Framework.getService(LayoutStore.class); registeredLayoutNames = service.getLayoutDefinitionNames(category); // sort so that order is deterministic Collections.sort(registeredLayoutNames); }
@Override public List<String> getLayoutDefinitionNames() { return getLayoutStore().getLayoutDefinitionNames(getDefaultStoreCategory()); }
@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)); }