use of org.pentaho.platform.uifoundation.component.xml.PMDUIComponent in project pentaho-platform by pentaho.
the class MetadataIT method __testLookup.
public void __testLookup() {
startTest();
// $NON-NLS-1$
IPentahoUrlFactory urlFactory = new SimpleUrlFactory("");
PMDUIComponent component = new PMDUIComponent(urlFactory, new ArrayList());
StandaloneSession session = // $NON-NLS-1$
new StandaloneSession(Messages.getInstance().getString("BaseTest.DEBUG_JUNIT_SESSION"));
component.validate(session, null);
component.setAction(PMDUIComponent.ACTION_LOOKUP);
// $NON-NLS-1$
component.setDomainName("test");
// $NON-NLS-1$
component.setModelId("Orders");
// $NON-NLS-1$
component.setColumnId("BC_CUSTOMERS_CUSTOMERNAME");
Document doc = component.getXmlContent();
System.out.println(doc.asXML());
try {
// $NON-NLS-1$//$NON-NLS-2$
OutputStream outputStream = getOutputStream("MetadataTest.testLoadView", ".xml");
outputStream.write(doc.asXML().getBytes());
} catch (IOException e) {
// ignore
}
finishTest();
}
use of org.pentaho.platform.uifoundation.component.xml.PMDUIComponent in project pentaho-platform by pentaho.
the class MetadataIT method testViewList.
public void testViewList() {
startTest();
// $NON-NLS-1$
IPentahoUrlFactory urlFactory = new SimpleUrlFactory("");
PMDUIComponent component = new PMDUIComponent(urlFactory, new ArrayList());
StandaloneSession session = // $NON-NLS-1$
new StandaloneSession(Messages.getInstance().getString("BaseTest.DEBUG_JUNIT_SESSION"));
component.validate(session, null);
component.setAction(PMDUIComponent.ACTION_LIST_MODELS);
Document doc = component.getXmlContent();
System.out.println(doc.asXML());
try {
// $NON-NLS-1$//$NON-NLS-2$
OutputStream outputStream = getOutputStream("MetadataTest.testViewList", ".xml");
outputStream.write(doc.asXML().getBytes());
} catch (IOException e) {
// ignore
}
finishTest();
}
use of org.pentaho.platform.uifoundation.component.xml.PMDUIComponent in project pentaho-platform by pentaho.
the class MetadataIT method __testLoadView.
public void __testLoadView() {
startTest();
// $NON-NLS-1$
IPentahoUrlFactory urlFactory = new SimpleUrlFactory("");
PMDUIComponent component = new PMDUIComponent(urlFactory, new ArrayList());
StandaloneSession session = // $NON-NLS-1$
new StandaloneSession(Messages.getInstance().getString("BaseTest.DEBUG_JUNIT_SESSION"));
component.validate(session, null);
component.setAction(PMDUIComponent.ACTION_LOAD_MODEL);
// $NON-NLS-1$
component.setDomainName("test");
// $NON-NLS-1$
component.setModelId("Orders");
Document doc = component.getXmlContent();
System.out.println(doc.asXML());
try {
// $NON-NLS-1$//$NON-NLS-2$
OutputStream outputStream = getOutputStream("MetadataTest.testLoadView", ".xml");
outputStream.write(doc.asXML().getBytes());
} catch (IOException e) {
// ignore
}
finishTest();
}
use of org.pentaho.platform.uifoundation.component.xml.PMDUIComponent 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