Hi ! And sorry for my bad english.
I just want to know how to do a smartExport of a package in JAVA. I already write some code but it's export all my project and not just my package.
final String folderPath = fonctionDiverses.pathFolder();
final String smartExportFileName = fonctionDiverses.xmlName();
// Set the encoding of XML file
final EncodingOptions expeo = new EncodingOptions ("1.0", "ISO8859_9", "ISO-8859-9");
Locale locale = new Locale ("en", "US");
Locale.setDefault (locale);
//
// From which Project will be exported the Integration Interfaces? Set below the Project code
final String srcOdiProjectCode = fonctionDiverses.projectName();
//
// Export the Integration Interfaces from the Project
final List<ISmartExportable> expIntegrationInterfaces = new LinkedList<ISmartExportable> ();
// Allocate an odisinstance of the name
final OdiInstance odiInstance = odiInstanceHandle.getOdiInstance();
try
{
TransactionTemplate tx = new TransactionTemplate(odiInstance.getTransactionManager());
tx.execute(new TransactionCallbackWithoutResult()
{
protected void doInTransactionWithoutResult(ITransactionStatus pStatus)
{
/*
*
* << ODI SDK Codes goes here >>
*
*/
// OdiProject project = ((IOdiProjectFinder) odiInstanceHandle.getOdiInstance ().getTransactionalEntityManager ().getFinder( OdiProject.class)).findByCode(srcOdiProjectCode); //$NON-NLS-1$
Collection<OdiInterface> odiInterfaces = ((IOdiInterfaceFinder)odiInstanceHandle.getOdiInstance ().getTransactionalEntityManager ().getFinder (OdiInterface.class)).findByName(fonctionDiverses.packageName(), srcOdiProjectCode, fonctionDiverses.folderName()); //$NON-NLS-1$
for (OdiInterface pop : odiInterfaces)
{
expIntegrationInterfaces.add( (ISmartExportable) pop);
System.out.println("pop : "+ pop.getName ());
}
ISmartExportService esvc = new SmartExportServiceImpl (odiInstanceHandle.getOdiInstance ());
try {
esvc.exportToXml (expIntegrationInterfaces, folderPath, smartExportFileName, true, false, expeo, false, null);
} catch (IOException e) {
e.printStackTrace ();
}
} });
}
finally
{
odiInstanceHandle.release();
}
}
}