Object obj=evt.getSource();
if(ur.equalsIgnoreCase("http://localhost:8080/mondrian/xmla"))
{
if(obj==bDS)
{
ServerMetadata smd = new ServerMetadata(ur);
DataSourceTreeElement ds[] = smd.discoverDataSources();
cmbDS.removeAllItems();
for (int i = 0; ds != null && i < ds.length; i++)
{
cmbDS.addItem((ds[i].toString()).trim());
}
cmbDS.repaint();
}
if(obj==bCat)
{
ServerMetadata smd = new ServerMetadata(ur);
XMLADiscoverRestrictions restrictions = XMLAObjectsFactory.newXMLADiscoverRestrictions();
XMLADiscoverProperties properties = XMLAObjectsFactory.newXMLADiscoverProperties();
properties.setDataSourceInfo((String)cmbDS.getSelectedItem());
CatalogElement ds[]=(CatalogElement[])smd.getCatalogList(restrictions,properties);
cmbCat.removeAllItems();
for (int i = 0; i < ds.length; i++)
{
cmbCat.addItem((ds[i].toString()).trim());
}
cmbCat.repaint();
}
if(obj==bCube)
{
ServerMetadata smd = new ServerMetadata(ur);
XMLADiscoverRestrictions restrictions = XMLAObjectsFactory.newXMLADiscoverRestrictions();
XMLADiscoverProperties properties = XMLAObjectsFactory.newXMLADiscoverProperties();
properties.setDataSourceInfo((String)cmbDS.getSelectedItem());
properties.setCatalog((String)cmbCat.getSelectedItem());
DataSourceTreeElement ds[]=smd.getCubeList(restrictions,properties);
cmbCube.removeAllItems();
for (int i = 0; i < ds.length; i++)
{ System.out.println(ds[i].toString());
cmbCube.addItem((ds[i].toString()));
}