Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CreateDataSources (
|
Object sourceObject_i,
|
LibSOPImpExp_ImportExportBase owner_i,
|
Boolean isIncludeGlobal_i
|
) #extension
|
{
|
TextBody:
|
[*
|
mpsync := sourceObject_i.astype( MPSync );
|
|
// Create all interface group
|
group_all := LibSOPImpExp_DataSource::FindCreate( owner_i, Translations::LibSOPImpExp_DataSource_All_Interfaces(), Translations::LibSOPImpExp_DataSource_All_Interfaces() );
|
|
// Create data source groups (based on import profile group)
|
// Reason, we need hierarchical structure to display for web import/export dialog
|
traverse( mpsync, DefaultImportProfile.ImportObjectGroupInDefaultProfile.ImportObjectGroup, iog, isIncludeGlobal_i or iog.IsGlobal() = isIncludeGlobal_i )
|
{
|
// Ensure we call ImportObjectGroup methods to use translation text
|
group := LibSOPImpExp_DataSource::FindCreate( owner_i, group_all, iog.GetDisplayCategory(), iog.GetDisplayCategory() );
|
|
// Data source under the data group
|
datasource := LibSOPImpExp_DataSource::FindCreate( owner_i, group, iog.GetDisplayName(), iog.GetDescription() );
|
datasource.LibSOPImpExp_DataSourceFile( relflush );
|
|
// Files associated with each ImportObjectGroup
|
traverse( iog.GetMPFileNames(), Elements, filename )
|
{
|
brokerName := ImportObjectGroup::GetDirectImportBrokerByFile( mpsync, filename );
|
mpsync_brokername := ImportObjectGroup::GetMPSyncImportBrokerByFile( mpsync, filename );
|
LibSOPImpExp_DataSourceFile::Create( datasource, filename, brokerName, mpsync_brokername );
|
}
|
}
|
*]
|
}
|