*/
public InvCatalog expand()
{
CatalogGenConfig tmpCgc = null;
List cgcList = null;
DatasetSource dss = null;
// Find and loop through each CatGenConfigMetadata object.
List mdataList = findCatGenConfigMdata( this.catalog.getDatasets());
for ( int i = 0; i < mdataList.size(); i++)
{
InvMetadata curMdata = (InvMetadata) mdataList.get( i);
InvDatasetImpl curParentDataset = ( (InvDatasetImpl) curMdata.getParentDataset());
// Loop through the CatalogGenConfig objects in current InvMetadata.
cgcList = (List) curMdata.getContentObject();
for ( int j = 0; j < cgcList.size(); j++)
{
tmpCgc = (CatalogGenConfig) cgcList.get( j);
log.debug( "expand(): mdata # " + i + " and catGenConfig # " + j + "." );
dss = tmpCgc.getDatasetSource();
InvCatalog generatedCat = null;
try
{
generatedCat = dss.fullExpand();
}
catch ( IOException e )
{
String tmpMsg = "Error: IOException on fullExpand() of DatasetSource <" + dss.getName() + ">: " + e.getMessage();
log.error( "expand(): " + tmpMsg);
curParentDataset.addDataset( new InvDatasetImpl( curParentDataset, tmpMsg));
break;
}
catalogRefInfoList.addAll( dss.getCatalogRefInfoList());
// Always a single top-level dataset in catalog returned by DatasetSource.fullExpand()
InvDataset genTopDs = (InvDataset) generatedCat.getDatasets().get( 0);
// Add all services in the generated catalog to the parent catalog.