use of org.pentaho.platform.util.web.SimpleUrlFactory in project data-access by pentaho.
the class DSWDatasourceServiceImpl method listDatasourceNames.
public List<String> listDatasourceNames() throws IOException {
synchronized (CsvDatasourceServiceImpl.lock) {
// $NON-NLS-1$
IPentahoUrlFactory urlFactory = new SimpleUrlFactory("");
PMDUIComponent component = new PMDUIComponent(urlFactory, new ArrayList());
component.validate(PentahoSessionHolder.getSession(), null);
component.setAction(PMDUIComponent.ACTION_LIST_MODELS);
Document document = component.getXmlContent();
// $NON-NLS-1$
List<DefaultElement> modelElements = document.selectNodes("//model_name");
ArrayList<String> datasourceNames = new ArrayList<String>();
for (DefaultElement element : modelElements) {
datasourceNames.add(element.getText());
}
return datasourceNames;
}
}
Aggregations