Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to do a smart export of a package with JAVA ?

2842107Jan 19 2015 — edited Feb 23 2015

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();

                        }

    }

}

This post has been answered by 2842107 on Jan 20 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2015
Added on Jan 19 2015
2 comments
1,357 views