use of com.adobe.granite.ui.components.ds.DataSource in project APM by Cognifide.
the class ScriptsDatasourceServlet method doGet.
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) {
String path = request.getRequestPathInfo().getSuffix();
List<Resource> scripts = new ArrayList<>();
Resource resource = request.getResourceResolver().getResource(path);
for (Resource child : resource.getChildren()) {
if (ScriptsRowModel.isFolder(child) || ScriptModel.isScript(child)) {
scripts.add(new ResourceTypeWrapper(child));
}
}
DataSource dataSource = new SimpleDataSource(scripts.iterator());
request.setAttribute(DataSource.class.getName(), dataSource);
}
Aggregations