How to make a smart export a package with JAVA?

Hello! And sorry for my bad English.

I just want to know how to make a smartExport of a package in JAVA. I already write code, but it has exported all my project and not only 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();
                        }
    }

}

I got my answer that I post here to help someone else.

package truc;

    import java.io.IOException;

    import java.util.Collection;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Locale;

    import oracle.odi.core.OdiInstance;
    import oracle.odi.core.persistence.transaction.ITransactionStatus;
    import oracle.odi.core.persistence.transaction.support.TransactionCallbackWithoutResult;
    import oracle.odi.core.persistence.transaction.support.TransactionTemplate;
    import oracle.odi.domain.project.OdiInterface;
    import oracle.odi.domain.project.OdiPackage;
    import oracle.odi.domain.project.OdiProject;
    import oracle.odi.domain.project.finder.IOdiInterfaceFinder;
    import oracle.odi.domain.project.finder.IOdiPackageFinder;
    import oracle.odi.domain.project.finder.IOdiProjectFinder;
    import oracle.odi.impexp.EncodingOptions;
    import oracle.odi.impexp.smartie.ISmartExportService;
    import oracle.odi.impexp.smartie.ISmartExportable;
    import oracle.odi.impexp.smartie.impl.SmartExportServiceImpl;
    import oracle.odi.publicapi.samples.SimpleOdiInstanceHandle;

    public class ClassName {

        public static void main(String args[]){

            final FonctionParamExport fonctionDiverses = new FonctionParamExport();

            //Paramètre de connexion à ODI et au repo

            final SimpleOdiInstanceHandle odiInstanceHandle = SimpleOdiInstanceHandle.create
                    ("jdbc:oracle:thin:@localhost:1521:EXEMPLE",
                    "oracle.jdbc.OracleDriver",
                    "Repo_User",
                    "Repo_Password",
                    "WORKREP",
                    "ODI_user",
                    "ODI_password");

            //
            // Set the location, and name of the Smart Export .xml file (the file which will be created during the Smart Export operation, and which will hold the exported objects)
            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 expIntegrationInterfaces = new LinkedList ();        

            // 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)
                     {

                         OdiProject project =  ((IOdiProjectFinder) odiInstanceHandle.getOdiInstance ().getTransactionalEntityManager ().getFinder( OdiProject.class)).findByCode(srcOdiProjectCode); //$NON-NLS-1$

                            Collection odiPackages = ((IOdiPackageFinder)odiInstanceHandle.getOdiInstance ().getTransactionalEntityManager ().getFinder (OdiPackage.class)).findByName(fonctionDiverses.packageName(), srcOdiProjectCode, fonctionDiverses.folderName()); //$NON-NLS-1$

                            for (OdiPackage pop : odiPackages)
                            {
                                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();
                    }
        }
    }

Tags: Business Intelligence

Similar Questions

  • How to make a smart playlist

    How to make a smart playlist with songs not played as often?

    It depends on what you mean by "not play also" often  You can select songs based on the number times that they have played, or how recently they've been played or a combination of both.  This example:

    with, select all the songs in your library who have not played in the last six months, or who have played less than three times in total.

    1. This button allows you to create a group of rules with variables AND / OR combinations
    2. everything here indicates that the rule will select the songs corresponding to one or more of the rules listed in this group (in the case of GOLD).  Changing at all means that only songs corresponding to each rule in the group will be selected.

    Best thing to do is probably to start with this example and play with the different options offered by iTunes to get something that fits your needs.

  • Hello, I would like to know how to make horizontal sites and it moves with scrolling

    Hello, I would like to know how to make horizontal sites and it moves with scrolling

    The scrolling would work with the scrolling of the mouse.

    Site that you mentioned also uses the same movement of scrolling with the horizontal length long.

    This video could give the exact idea:

    https://www.YouTube.com/watch?v=x5YMbB1jMdY

    Thank you

    Sanjit

  • How to make a PDF export to HTML

    Hi all!

    I am currently trying to export a PDF to epub.

    EPUB is what I understand sort of html. So if you get a good export in format html you are sorted.

    I use XI Acrobat pro, but if you have another suggestion I'm all ears.

    After handled html or PDF I use calibre to export to epub.

    There are a lot of problems and if you know the answer to the only one I would be very grateful!

    My pdf have tables, images with text (not embedded in the image) and boxes with another background with text in them. but above all, it is a two-column document.

    Issues related to the:

    1. the images in the PDF are made up of elements of text and photo. Is there a way to convert text and image into a png image so that they don't get screwed up in the conversion?         I can select all, but I do not know if I need to export all, and then put everything back that would be a hassle because the pdf has a lot of pages.

    2. the tables do not play nice. I have in my pdf document of the pictures that end up as a vertical line when I export the document in html and txt or try to directly convert pdf to epub form. is it possible to edit tables in acrobat so that they are exported as a table when you export as html?

    3. sometimes the my document does not export to a txt properly. is there a way to tell acrobat in what order the text must be exported?

    4. it is a little close to the previous question: re-flow, is possible to re-flow a pdf to go in two columns to one and tell acrobat in what order should be made. This is where the photos should go and tables and so forth.

    5 to get a round formatting issues is there a way to export only the text and the images and tables.

    6 fonts: my pdf consists of several fonts. Is there a way to select all the text in a document based on the color of font or fonts then I would be able to change this text in the font that I want.

    7. I have a table of contents at the beginning of the file with links to the different sections of the pdf file, but I don't know how to make these useful. I would like that they as bookmarks. is there a good process for this.

    Thanks for your help!

    People have made this mistake for almost 20 years, since Acrobat 1.0. The error is: I want to convert 'X' to 'Y '. I can convert PDF and PDF 'X' on 'Y' - job done! As you've found, it's a terrible way to work. The fact is that most just PDF files do not contain the required information. For example, most PDF files have tables. They have some text here, a text here - a few lines. We see a table, Acrobat (and other software) struggles. We see columns, Acrobat can see just text and lines. Similarly, we know that is an image, it's his legend, which is a title and is a page number. And so on.

    Everything you did the PDF from - go back to that. If you have any earlier version, then convert the PDF into Word or InDesign - something that makes epub - and begin the long process of creating the structure and flow you need.

  • How to make a video exported always matches what is shown in the window of the program?

    I try to export several videos HD 1080 p for YouTube, nothing will do, often get weird proportions and still get black bars on the sides or the bottom and top (sometimes with the same rendering settings) in the final exported video.  The problem that I am facing has a very clear expected result with the following:

    • Export EXACTLY what is shown in the window of the program
    • Have the appropriate settings for the video good exported any standard modern computer screen (although this resolution can be)
    • Have the right settings for any project to export a 1080 p video that FILLS the screen in full screen
    • Have the exported video not stretch, scale or decreases in quality
    • Be able to use this project as a "Preset" for all of my future videos

    Whatever my current settings, what I need to do to make sure an exported video remains at its highest quality while also never showing black bars?  I'm ready to start a new project from scratch if I need to.

    Additional information:

    • I'm new to this software, using the free 30 day trial of Adobe first Pro CC 2014
    • I use images from sources that are larger than what is shown in the project window.  For example, I stepped up a rectangular background image so I could animate the rotation without revealing the empty corners in the video.

    I suppose that when a video is rendered, it flush with all source material that is not in the frame.  If this is the case, why are the exported videos different from what is shown in the window of the program and make preview?  Thanks in advance for your help.

    The sequence settings say:

    Preview file format: I-Frame only MPEG

    Codec: MPEG I-Frame (out parameters)

    Width: 1920

    Height: 1080

    However, it seems that doing a new project and everything again after setting parameters of the sequence to what I had before some fixed my problems.  Now, the program window corresponds to the export preview and export correctly.  However, this does not identify what caused the problem.

    As far as I can tell, it's a glitch in Adobe Premiere caused by importing a source file, exporting in the wrong resolution (32: 21), then trying to change the resolution and export again in the same sequence.  For anyone else facing this problem in the future, make a new project, set up the correct resolution (16:9) in sequence settings and THEN export.

    Thank you all for your help!

  • How to make the printer deskjet 3940 compatible with Windows 7 Home Basic, 32-bit?

    I have the HP Deskjet 3940 printer. I recently bought a Lenovo (C320, 57-302429) desktop computer that has Windows 7 home basic, 32-bit operating system. The said printer does not work with the computer above. Please guide how to make this printer compatible with the operating system above.

    1. click on the Start button, select Control Panel and double-click devices and printers.

    2. click on Add a printer.

    3. Select Add a local printer.

    4. Select an existing Local USBx port, click Next.

    5. click on the Windows Update button.

    6. once the update is complete, locate the 3940 driver.

    7. click on Next,Next,Next,Next,Finish

  • How to make a mirror of an image with windows image 7

    How to make a mirror of an image image using windows 7?

    Refer to this,

    http://Windows.Microsoft.com/en-us/Windows7/using-paint

    Right-click on the image and click Open with,

    Click on the painting,

    Click rotate on the upper left and Horizontal.

    This will give you a mirror image,

    Click on the blue button on the file and click on save as,

    Click on a file type and name it, save.

  • How to make the output of Sql Plus with an error Code

    Dear members,

    How can I define sql more exit with an error code.

    We have a simultaneous host program. The executable is a shell script for this program. This sql script Shell script request which in turn gives call to a custom database package that I built.

    The flow rate is:


    -> SQL-> CUSTOM PACKAGE SCRIPT SHELL SCRIPT

    Custom package has two PARAMETERS of the error indicator and the error message. If something fails in the package these two PARAMETERS is returned with a value.

    So my sql script code looks like this:

    WHENEVER SQLERROR EXIT 251
    WHEN the OSERROR EXIT 251
    Set serveroutput size 1000000
    set linesize 32767
    set verify off
    set the position
    Set feedback off

    DECLARE
    x_error_message VARCHAR2 (1000);
    x_sql_message VARCHAR2 (1000);
    x_exception EXCEPTION;
    e_value NUMBER;

    BEGIN
    dbms_output.put_line ('Inside sql file');


    XXpackage.xxproc (x_error_message, x_sql_message);


    IF (x_error_message IS NOT NULL) AND (x_sql_message IS NOT NULL) THEN
    RAISE x_exception;
    END IF;


    EXCEPTION
    WHEN X_EXCEPTION THEN
    e_value: = 1;
    DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
    DBMS_OUTPUT. Put_line ('X_EXCEPTION: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
    DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
    DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
    DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);
    WHILE OTHERS THEN
    e_value: = 252;
    DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
    DBMS_OUTPUT. Put_line (' OTHER: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
    DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
    DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
    DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);


    END;
    */*
    output
    */*


    As you can see from above, if the two PARAMETERS have value, then it goes to an exception.

    My problem is that if it goes with the exception of X_EXCEPTION, the sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.


    How can do us more sql dating a sqlerror so that the host program must fail.


    Thank you
    Sandeep

    Published by: user340 on July 28, 2009 12:51

    Published by: user340 on July 28, 2009 12:57

    the plu sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.

    This is because there is no error. You handled the exception.

    You can try adding a STIMULUS; at the end of your exception section. This re-triggers the exception so sql liked to see it.

  • How to make an ultimate download Windows 7 with a product key.

    We bought a copy of windows 7 Ultimate edition, but never had the time to install it.  Our computer just died and our new laptop doesn't have cd player.  Download a copy?

    You can go to a working computer and create a. ISO image that you can use to create a bootable from DVD copy if you have a copy:

    http://notebooks.com/2011/07/08/how-to-backup-your-software/

    If you want to download a copy, see:

    How to: What are my options for Windows 7 reinstall media?

  • How to make the animated lips that move with the text?

    Hello

    I would like to make the animated lips (as below) say some text. So I would like to move with the text that is said.

    What would be the best way to do it in an Adobe program? Thanks in advance!

    lips photo.jpg

    The best way to do it would be to learn now to use Adobe character animation. Simply design a work in layers so that the different sounds are on different layers.

    There are also manual techniques that require a familiarity with the distortion and masking tools in AE and a knowledge of the time remapping effect. You can also use audio levels to trigger the movement. Using this technique you can divide the image in the upper lip, lower lip and then use expressions to drive to position distortion tools. The good technique depends on the look you are after. If you just want to use those lips she's going to be quite difficult to get a "oh" sound or a 'b' as in "oh Boy" which seems natural.

    Are you new to AE? What you are wanting to do will require some basic skills in AE and probably Photoshop or Illustrator.

  • How to make a backup of the database with RMAN Oracle Single Instance

    People,

    Hello. I use the server of Oracle 11 GR 1 material with operating system Oracle Linux 5.10 database.

    I understand how to back up the database instance in SQL Server with Windows. But do not really understand how to back up the database instance in Oracle on Linux.
    I did it cold and hot backup for the database HRCS90 instance, but both receive the same error message.


    Cold backup is below:

    SQL > startup
    ORACLE instance started.

    Total System Global Area 538677248 bytes
    Bytes of size 2146024 fixed
    528482584 variable size bytes
    4194304 buffers of data bytes
    Redo buffers 3854336 bytes
    Mounted database.
    Open database.


    SQL > shutdown immediate
    The database is closed.
    The database is dismounted.
    ORACLE instance stops.


    RMAN > backup database;

    From backup 25 November 13
    using the control file of the target instead of recovery catalog database
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03002: failure of the backup command to the 25/11/2013 14:26:52
    RMAN-06171: not connected to the target database


    RMAN > backup HRCS90

    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-00558: error occurred during parsing of order entry
    RMAN-01009: syntax error: found 'distinctive sign': expected an of: ' archivelog, auxiliary, as, backup backupset, blocks, channel, check, copy, copies, controlfilecopy, cumulative, current, basic data, datafile, datafilecopy, device, diskratio, db_recovery_file_dest, db_file_name_convert, duration, filesperset, for, format, from, full, strength, file, incremental, keep, (, maxsetsize nochecksum, noexclude, nokeep, not, proxy, pool, re-use, recovery, section, skip). ', spfile, skip readonly, setsize, tablespace, tag to validate.
    RMAN-01008: the identifier of the AfDB was: HRCS90
    RMAN-01007: line 1 column 8 file: entry standard


    RMAN > backup database HRCS90

    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-00558: error occurred during parsing of order entry
    RMAN-01009: syntax error: found 'distinctive sign': expected an of: ' archivelog, auxiliary, backupset channel, copy, controlfilecopy, backup, common, base data, data file, datafilecopy, remove, diskratio, db_recovery_file_dest, filesperset, format, force, file, include, keep, (, maxsetsize, noexclude, nokeep, not, pool, more reuse, recovery, section, skip, spfile, pass readonly, setsize, tablespace, tag, to).
    RMAN-01008: the identifier of the AfDB was: HRCS90
    RMAN-01007: line 1 column 17 file: entry standard

    While the instance of database HRCS90 is starting, I do hot backup by using the same commands and get the same error message with above cold backup.

    My question is:

    Can any folk tell me specific steps (order by order) to back up a single instance of the database in Oracle with RMAN?


    Thank you.

    Yes, you can restore and recover the backup, but not at the moment. You will only be able to restore and recover at the time of your backup.

    For example.

    If you take backup (mount point with no mode of journal archive) at 06:00 and your grave database crashes at 21:00, you will be able to restore and recover until 06:00. You will find all the changes made to the database between 06:00 and 21:00.

    If you want your database to recover until 9 PM or until a point in time, then you must put your database in log mode archive, and then save the archives.

  • How can make a file into several files with any number of files with any file size.

    Hello

    I do multiple files download JDeveloper 11.1.1.7 utility. I want to choose any number of files with any size but adf have a total files size or single file size restriction.

    How to remove this restriction. I do not use portal UCM or webcenter. Its core ADF application that inserts data Blob in DB.

    Looks warms

    Maroof Ahmed

    This is possible by using 11.1.1.7.0. The inputFile allows unlimited file (set the property maxFiles-1 and the uploadType "autoMultiple" or "manualMultiple"). The size of the files to download can be configured in the Web.XML ( post treatment file) then it should be possible. However, you should think about the consequences if you allow unlimited download of files. To insist on the server until the break (disk space or memory).

    Timo

  • How to make a list of question field with the data type DATE?

    I have a column with the DATE data type. Using forms 6i I want to generate a poplist field of list item with this column while the value of the items in the list of names of days like SATURDAY, SUNDAY, MONDAY. If we change the date to a char data type, it won't work properly, but now with the data type DATE behind him, it gives the following error message

    "FRM-32082: invalid value for given the type of element."
    List WEEKREST
    Article: WEEKREST
    Block: EMPRESTS
    Form: module 3
    FRM-30085: unable to adapt to the shape for the release. »


    Using forms 6i how a list item field type DATE data which may contain names of days?

    Set your date as a hidden field (not shown) column. Create your item list with the names of day of varchar2. Create the list item as a base table field that accepts the values of text in the names of the days. On this area, create a when-validate-item trigger that translated the text into an actual date that it then uses to set the value of the real object of the base table.

  • How to make the column in the table with the formula

    Hi all..
    This is my class
    public class MyNumber{
         private int num;
    
         public int getNum(){
              return num;
         }
    
         public void setNum( int num){
              this.num = num;
         }
    }
    Consider that designing a table with FXML Editor (Builder scene in this case)
    and here are some of my codes
    private TableView tab;
    private TableColumn<MyNumber, Integer> tabColInput;
    private TableColumn tabColOutput;
    
    tab.setEditable(true);
    tabColInput.setEditable(true);
    
    tabColInput.setCellValueFactory( new PropertyValueFactory<Person,Integer>("num") );
    tabColInput.setCellFactory(TextFieldTableCell.forTableColumn());
    tabColInput.setOnEditCommit(
        new EventHandler<CellEditEvent<MyNumber, Integer>>() {
            @Override
            public void handle(CellEditEvent<MyNumber, Integer> t) {
                ((MyNumber) t.getTableView().getItems().get(
                    t.getTablePosition().getRow())
                    ).setNum(t.getNewValue());
            }
        }
    );
    Problem:
    I want to tabColOutput to always show the result for tabColInput multiplied by 2

    for example:
    When I change a line in tabColInput 10, tabColOutput shows 20
    When I change a line in tabColInput to 3, tabColOutput show 6

    Could someone advice me how do?

    PS: I'm not native English, so I'm sorry if I tell it fake ^^

    You're up-to-date data are probably not ObservableValues as properties, so the TableView cannot update dynamically as modification of data items.

  • How to make my online design view upward with my live view?

    I use CS6 and my mode of creation is very different from my way live view. How can I change this?

    www.kurtesposito.com

    Thank you.

    Unfortunately, you can't. Design mode is only an "orientation" POV. Test on the browser or use Live View to see how it will really look like.

Maybe you are looking for