See: Description
Interface | Description |
---|---|
DataExchangeConfigurationService |
Provides the methods to execute {addon.label} configuration import and export.
|
DataExchangeHelper |
Provides the methods to transform old specifications to new specifications.
|
DataExchangeHelperContext |
Provides the context to get the
DataExchangeSpec from the configuration declared in the {addon.label} dataset. |
DataExchangeService |
Provides a method for executing data import, export and transfer.
|
Class | Description |
---|---|
CSVExportDataExchangeHelperContext |
Provides the context to get the
DataExchangeSpec for exporting CSV from the configuration declared in the {addon.label} dataset. |
CSVImportDataExchangeHelperContext |
Provides the context to get the
DataExchangeSpec for importing CSV from the configuration declared in the {addon.label} dataset. |
DataExchangeExportTableSpec |
Represents a {addon.label} specification for the export table which stores
the (
DataExchangeSpec ) {addon.label}
specification and the optional records, or optional predicate of each table. |
DataExchangeExportTableSpecBuilder |
Provides the methods to build the {addon.label} specification for the export
table by using
ApplicationMappingHelper APIs to automatically
generate an application mapping. |
DataExchangeHelperFactory |
Creates instances of
DataExchangeHelper . |
DataExchangeServiceFactory |
Creates instances of
DataExchangeService . |
DataExchangeSpec |
Represents a {addon.label} specification which stores the (
ConfigurationSpec ) configuration specification and
the (ApplicationMapping ) mapping specification. |
SpreadsheetExportDataExchangeHelperContext |
Provides the context to get the
DataExchangeSpec for exporting Excel from the configuration declared in the {addon.label} dataset. |
SpreadsheetImportDataExchangeHelperContext |
Provides the context to get the
DataExchangeSpec for importing Excel from the configuration declared in the {addon.label} dataset. |
Classes and interfaces to call the {addon.label} import, export and transfer.
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(configurationSpec); DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
If you use the com.orchestranetworks.addon.dataexchange.DataExchangeSpec specification it must be converted as follows:
DataExchangeSpec newSpec = DataExchangeHelperFactory.getDataExchangeHelper() .transform(oldSpec);
The following example demonstrates how to execute the transfer data service
Define the application mapping:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EBX); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EBX); ApplicationMapping<EBXField, EBXField> applicationMapping = new ApplicationMapping<EBXField, EBXField>( sourceApplication, targetApplication);
Define the configuration specification:
TransferConfigurationSpec transferConfig = new TransferConfigurationSpec( sourceDataset, sourceEBXTables, targetDataset, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(transferConfig); DataExchangeResult.Transfer result = (Transfer) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the transfer data service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the transfer data service.The following example shows you how to execute the Import XML service.
Define the application mapping as follows:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.XML); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EBX); ApplicationMapping<XMLField, EBXField> applicationMapping = new ApplicationMapping<XMLField, EBXField>( sourceApplication, targetApplication);
Define the configuration specifications:
XMLImportConfigurationSpec importXMLConfigSpec = new XMLImportConfigurationSpec( currentTable, srcXMLTable, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(importXMLConfigSpec); DataExchangeResult.XMLImport result = (XMLImport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Import XML service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Import XML service.Define the application mapping as follows:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EBX); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.XML); ApplicationMapping<EBXField, XMLField> applicationMapping = new ApplicationMapping<EBXField, XMLField>( sourceApplication, targetApplication);
Define the configuration specifications:
XMLExportConfigurationSpec exportXMLConfigSpec = new XMLExportConfigurationSpec( currentTable, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(exportXMLConfigSpec); DataExchangeResult.XMLExport result = (XMLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Export XML service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Export XML service.The following describes how to execute the Import SQL service.
Define the application mapping as shown below:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.DEFAULT_SQL); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EBX); ApplicationMapping<SQLField, EBXField> applicationMapping = new ApplicationMapping<SQLField, EBXField>( sourceApplication, targetApplication);
Define the configuration specifications:
SQLImportConfigurationSpec importSQLConfigSpec = new SQLImportConfigurationSpec( currentTable, sqlDataSourceName, sqlTableOrView, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(importSQLConfigSpec); DataExchangeResult.SQLImport result = (SQLImport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Import SQL service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Import SQL service.The following shows how to execute the Export SQL service:
Define the application mapping as follows:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EBX); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.DEFAULT_SQL); ApplicationMapping<EBXField, SQLField> applicationMapping = new ApplicationMapping<EBXField, SQLField>( sourceApplication, targetApplication);
Define the configuration specifications:
SQLExportConfigurationSpec exportSQLConfigSpec = new SQLExportConfigurationSpec(currentTable,sqlDataSourceName,session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(exportSQLConfigSpec); DataExchangeResult.SQLExport result = (SQLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Export SQL service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Export SQL service.The following steps show how to execute the Import CSV service:
Define the application mapping as follows:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.CSV); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EBX); ApplicationMapping<CSVField, EBXField> applicationMapping = new ApplicationMapping<CSVField, EBXField>( sourceApplication, targetApplication);
Define the configuration specification:
CSVImportConfigurationSpec importCSVSpec = new CSVImportConfigurationSpec(currentTable, csvTable, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(importCSVSpec); DataExchangeResult.CSVImport result = (CSVImport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Import CSV service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Import CSV service.The following steps show how to execute the Export CSV service:
Define the application mapping:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EBX); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.CSV); ApplicationMapping<EBXField, CSVField> applicationMapping = new ApplicationMapping<EBXField, CSVField>( sourceApplication, targetApplication);
Define the configuration specifications:
CSVExportConfigurationSpec exportCSVSpec = new CSVExportConfigurationSpec( currentTable, tableFilter, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(exportCSVSpec); DataExchangeResult.CSVExport result = (CSVExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Export CSV service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Export CSV service.The following steps show how to execute the Import Excel service:
Define the application mapping as follows:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EXCEL); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EBX); ApplicationMapping<SpreadsheetField, EBXField> applicationMapping = new ApplicationMapping<SpreadsheetField, EBXField>( sourceApplication, targetApplication);
Define the configuration specifications:
When importing a single table:
SpreadsheetImportConfigurationSpec importSpreadsheetConfig = new SpreadsheetImportConfigurationSpec( currentTable, spreadsheetTable, session);
When importing multiple tables:
SpreadsheetImportConfigurationSpec importSpreadsheetConfig = new SpreadsheetImportConfigurationSpec( currentDataset, spreadsheetTables, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(importSpreadsheetConfig); DataExchangeResult.SpreadsheetImport result = (SpreadsheetImport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Import Excel service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Import Excel service.The following steps show how to execute the Export Excel service:
Define the application mapping:
CommonApplication sourceApplication = new CommonApplication( sourceLogicalName, ApplicationType.EBX); CommonApplication targetApplication = new CommonApplication( targetLogicalName, ApplicationType.EXCEL); ApplicationMapping<EBXField, SpreadsheetField> applicationMapping = new ApplicationMapping<EBXField, SpreadsheetField>( sourceApplication, targetApplication);
Define the configuration specifications:
Exporting a single table:
SpreadsheetExportConfigurationSpec exportSpreadsheetConfigurationSpec = new SpreadsheetExportConfigurationSpec( ebxTable, tableFilter, session);
Exporting multiple tables:
SpreadsheetExportConfigurationSpec exportSpreadsheetConfigurationSpec = new SpreadsheetExportConfigurationSpec( dataset, ebxTables, tableFilters, session);
Define the {addon.label} specification:
DataExchangeSpec dataExchangeSpec = new DataExchangeSpec(); dataExchangeSpec.setApplicationMapping(applicationMapping); dataExchangeSpec.setConfigurationSpec(exportSpreadsheetConfigurationSpec); DataExchangeResult.SpreadsheetExport result = (SpreadsheetExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Please refer to:
com.orchestranetworks.addon.dex.configuration
package for examples of creating a configuration specification for the Export Excel service.com.orchestranetworks.addon.dex.mapping
package for examples of creating an application mapping for the Export Excel service.The following example shows how to import a {addon.label} configuration from an XML file.
Session session; String importedFilePath; ImportMode importMode; ImportDataExchangeConfigurationSpec configurationSpec = new ImportDataExchangeConfigurationSpec(); File importedFile = new File(importedFilePath); configurationSpec.setImportedFile(importedFile); configurationSpec.setSession(session); configurationSpec.setImportMode(importMode); DataExchangeResult.XMLImport importResult = DataExchangeServiceFactory.getDataExchangeConfigurationService().doImport(configurationSpec);
To import {addon.label} add-on configuration from an XML file, please set the specified preference owner and import scope as outlined below:
// Sets the import scope configurationSpec.setImportScopes(importScopes); // Sets the preference owner configurationSpec.setProfile(profile);
The following example shows how to export a {addon.label} configuration to an XML file.
Session session; String exportedFilePath; ExportDataExchangeConfigurationSpec configurationSpec = new ExportDataExchangeConfigurationSpec(); configurationSpec.setSession(session); File exportedFile=new File(exportedFilePath); configurationSpec.setExportedFile(exportedFile); configurationSpec.setXMLIndented(false); configurationSpec.setXMLCommentOmitted(true); DataExchangeResult.XMLExport exportResult = DataExchangeServiceFactory.getDataExchangeConfigurationService().doExport(configurationSpec);
To export {addon.label} configuration data to an XML file, please set a PrimaryKey
collection that identifies records in the Application interface preference table in the {addon.label} dataset as shown below:
Set<PrimaryKey> preferenceRecords; configurationSpec.setPreferenceRecords(preferenceRecords);
The following example shows how to execute the Export Excel service with an automatically generated application mapping:
Adaptation dataset; Session session; Adaptation oneRecord; List<Adaptation> listOfRecords; AdaptationTable adaptationTable; AdaptationTable adaptationTableWithFilter; TableFilter tableFilter; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.EXCEL, session) .setTableContent(oneRecord) .setTableContent(listOfRecords) .setTableContent(adaptationTable) .setTableContent(adaptationTableWithFilter, tableFilter) .build(); DataExchangeResult.SpreadsheetExport exportResult = (SpreadsheetExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
The following example shows how to execute the Export CSV service with an automatically generated application mapping:
Exporting a single record:
Adaptation dataset; Session session; Adaptation oneRecord; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.CSV, session) .setTableContent(oneRecord) .build(); DataExchangeResult.CSVExport exportResult = (CSVExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a list of records:
Adaptation dataset; Session session; List<Adaptation> listOfRecords; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.CSV, session) .setTableContent(listOfRecords) .build(); DataExchangeResult.CSVExport exportResult = (CSVExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a table:
Adaptation dataset; Session session; AdaptationTable adaptationTable; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.CSV, session) .setTableContent(adaptationTable) .build(); DataExchangeResult.CSVExport exportResult = (CSVExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a table with filter:
Adaptation dataset; Session session; AdaptationTable adaptationTableWithFilter; TableFilter tableFilter; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.CSV, session) .setTableContent(adaptationTableWithFilter, tableFilter) .build(); DataExchangeResult.CSVExport exportResult = (CSVExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
The following example shows how to execute the Export XML service with an automatically generated application mapping:
Exporting a single record:
Adaptation dataset; Session session; Adaptation oneRecord; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.XML, session) .setTableContent(oneRecord) .build(); DataExchangeResult.XMLExport exportResult = (XMLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a list of records:
Adaptation dataset; Session session; List<Adaptation> listOfRecords; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.XML, session) .setTableContent(listOfRecords) .build(); DataExchangeResult.XMLExport exportResult = (XMLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a table:
Adaptation dataset; Session session; AdaptationTable adaptationTable; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.XML, session) .setTableContent(adaptationTable) .build(); DataExchangeResult.XMLExport exportResult = (XMLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
Exporting a table with filter:
Adaptation dataset; Session session; AdaptationTable adaptationTableWithFilter; TableFilter tableFilter; DataExchangeExportTableSpec dataExchangeSpec = new DataExchangeExportTableSpecBuilder(dataset, ApplicationType.XML, session) .setTableContent(adaptationTableWithFilter, tableFilter) .build(); DataExchangeResult.XMLExport exportResult = (XMLExport) DataExchangeServiceFactory.getDataExchangeService().execute(dataExchangeSpec);
com.orchestranetworks.addon.dex.DataExchangeSpec
based on the configuration declared in the {addon.label} dataset.The following example shows how to create a com.orchestranetworks.addon.dex.DataExchangeSpec
based on the configuration declared in the {addon.label} dataset for Excel/CSV export and import:
Create a com.orchestranetworks.addon.dex.DataExchangeSpec
by using the specified name declared in the Application interface preference table in the {addon.label} dataset for Excel export:
When exporting a single table:
AdaptationTable table; String preferenceName; Session session; SpreadsheetExportDataExchangeHelperContext context = new SpreadsheetExportDataExchangeHelperContext( preferenceName, table, session); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.SpreadsheetExport dataExchangeResult = (SpreadsheetExport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);
When exporting multiple tables:
Adaptation dataset; String preferenceName; Session session; SpreadsheetExportDataExchangeHelperContext context = new SpreadsheetExportDataExchangeHelperContext( preferenceName, dataset, session); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.SpreadsheetExport dataExchangeResult = (SpreadsheetExport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);
To create a com.orchestranetworks.addon.dex.DataExchangeSpec
by using the specified name declared in the Application interface preference table in the {addon.label} dataset for Excel import:
When importing a single table:
String preferenceName; AdaptationTable table; Session session; File importedFile; SpreadsheetImportDataExchangeHelperContext context = new SpreadsheetImportDataExchangeHelperContext( preferenceName, table, session); context.setImportedFile(importedFile); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.SpreadsheetImport dataExchangeResult = (SpreadsheetImport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);
When importing multiple tables:
String preferenceName; Adaptation dataset; Session session; File importedFile; SpreadsheetImportDataExchangeHelperContext context = new SpreadsheetImportDataExchangeHelperContext( preferenceName, dataset, session); context.setImportedFile(importedFile); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.SpreadsheetImport dataExchangeResult = (SpreadsheetImport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);
To create a com.orchestranetworks.addon.dex.DataExchangeSpec
by using the specified name declared in the Application interface preference table in the {addon.label} dataset for CSV export:
AdaptationTable table; String preferenceName; Session session; CSVExportDataExchangeHelperContext context = new CSVExportDataExchangeHelperContext( preferenceName, table, session); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.CSVExport dataExchangeResult = (CSVExport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);
To create a com.orchestranetworks.addon.dex.DataExchangeSpec
by using the specified name declared in the Application interface preference table in the {addon.label} dataset for CSV import:
String preferenceName; AdaptationTable table; Session session; File importedFile; CSVImportDataExchangeHelperContext context = new CSVImportDataExchangeHelperContext( preferenceName, table, session); context.setImportedFile(importedFile); DataExchangeSpec dataExchangeSpec = DataExchangeHelperFactory.getDataExchangeHelper().getDataExchangeSpec(context); DataExchangeResult.CSVImport dataExchangeResult = (CSVImport) DataExchangeServiceFactory .getDataExchangeService().execute(dataExchangeSpec);