Did bc4j create row with sequence change from integer to long

When creating a new row through bc4j with database sequence for primary key, I followed the online examples and even checked the samples distributed with jdev production 9.0.2. They all show that the sequence is returned as Integer. I finally changed it to Long and got it to work. Has there been a change, or have I got something else fouled up?
This is the code that worked...
protected void create(AttributeList attributeList)
super.create(attributeList);
// get the next template ID from database sequence
SequenceImpl s = new SequenceImpl("XXPRC_TEMPLATE_ID_S", getDBTransaction() );
java.lang.Long next = (java.lang.Long) s.getData();
setTemplateId( new Number(next) );
}

When creating a new row through bc4j with database sequence for primary key, I followed the online examples and even checked the samples distributed with jdev production 9.0.2. They all show that the sequence is returned as Integer. I finally changed it to Long and got it to work. Has there been a change, or have I got something else fouled up?
This is the code that worked...
protected void create(AttributeList attributeList)
super.create(attributeList);
// get the next template ID from database sequence
SequenceImpl s = new SequenceImpl("XXPRC_TEMPLATE_ID_S", getDBTransaction() );
java.lang.Long next = (java.lang.Long) s.getData();
setTemplateId( new Number(next) );
} Yes some javadoc was corrected to reflect this change in 9.0.2. Could you post the "context" for the javadoc where you're seeing this example so we can verify if that's corrected too.
To get the correct Sequence value, you need to call getSequenceNumber() method and not getData which should have been (and is in 902) marked internal.

Similar Messages

  • I have to select a file – get Info – and change – open with and change from preview to another program and CHANGE ALL everytime I boot up

    Why do I have to select a file – get Info – select – open with – and change from Preview to another program and click CHANGE ALL with every file extention everytime I boot up.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Load distinct rows with sequence

    Hi All
    I have requirement at my client where we need to load distinct rows from the source TABLEA into TABLEB and add sequence in target TABLEB.
    As we know in Oracle we cant use sequence with distinct keyword, one of the solution is to use the sequence in target so ODI will capture
    distinct rows from source and use the sequence only in target table but if the source and target are on same schema then ODI doesn't create
    C$ table but it load data directly into target table and we get the error of invalid use of sequence.It wors fine if source and target table on different
    schema. I like to know if there is any way force ODI to create C$ table with distinct rows and load the sequence in target table only even source and
    target are on same schema. Otherwise I have create two interface to capture the distinct rows firct and then update the same table with sequence
    in second step. I really wanna avoid creating 2 interface for this simple job.Let me know if you have better solution.
    Thanks
    Kashif

    user634784 wrote:
    But is there any way to get the same outcome without using the subquery.In reality... No.
    You can hide the fact that you have to generate a row_number for the records by using a view... ;)
    SQL> ed
    Wrote file afiedt.buf
      1  create table t as select 1 as Empid, to_date('01-jan-2008','DD-MON-YYYY') as startdate, null as enddate, 'O1' as organisation from dual union all
      2                    select 2, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O1' from dual union all
      3                    select 3, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O1' from dual union all
      4                    select 4, to_date('5-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
      5                    select 5, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
      6                    select 6, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
      7                    select 7, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O3' from dual union all
      8*                   select 8, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O3' from dual
      9  /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  create view vw_x as
      2* select empid, startdate, enddate, organisation, row_number() over (partition by organisation order by empid) rn from t
    SQL> /
    View created.
    SQL> select * from vw_x where rn = 1;
         EMPID STARTDATE ENDDATE   OR         RN
             1 01-JAN-08           O1          1
             4 05-JAN-08 31-JUL-08 O2          1
             7 02-JAN-08 31-JUL-08 O3          1
    SQL>

  • Update group of rows with sequence

    Hi guys,
    I have no idea how to do an update of a table with a sequence value... but i don't want to increment the sequence for each row.
    create sequence seq_num;
    create table upd_group(
    id number,
    group_code varchar2(5),
    seq_num number
    insert into upd_group values(1,'a',null);
    insert into upd_group values(2,'c',null);
    insert into upd_group values(3,'a',null);
    insert into upd_group values(4,'b',null);
    insert into upd_group values(5,'a',null);
    insert into upd_group values(6,'b',null);
    commit;
    select * from upd_group;
    --doesn't work
    update upd_group set seq_num = seq_num.nextval
    where group_code in (select distinct group_code from upd_group)the expected result would be
    all rows with group_code = 'a' would have N
    all rows with group_code = 'b' would have N+1
    all rows with group_code = 'c' would have N+2
    and so on....
    any idea how to do this?

    Thanks for posting sample data!
    If this is a one time shot, then analytics and MERGE might come to the rescue:
    SQL> select * from upd_group order by group_code;
            ID GROUP    SEQ_NUM
             1 a
             3 a
             5 a
             4 b
             6 b
             2 c
    6 rows selected.
    SQL> --
    SQL> --doesn't work
    SQL> --update upd_group set seq_num = seq_num.nextval
    SQL> --where group_code in (select distinct group_code from upd_group);
    SQL> --
    SQL> merge into upd_group a
      2  using ( select id
      3          ,      dense_rank() over (order by group_code) new_seq_num
      4          from   upd_group
      5         ) b
      6  on  (a.id = b.id)
      7  when matched then update set a.seq_num = b.new_seq_num;       
    6 rows merged.
    SQL> --
    SQL> select * from upd_group order by group_code;
            ID GROUP    SEQ_NUM
             1 a              1
             3 a              1
             5 a              1
             4 b              2
             6 b              2
             2 c              3
    6 rows selected.How a sequence could be able to take care of this in a query....that's interesting.
    Depending on your database version you might opt for a virtual column....(11g stuff)

  • NAM 5.1 How to create Application with port range from cli?

    Hello,
    I can create new Applicaion with port range from GUI, but I can not do it from CLI
    If I do it by CLI as a:
    nam# application
    nam# name mkst-cur-A
    nam# match udp 16001-16009
    nam# exit
    then
    nam# show application app-tag 268435576
    custom:120 (268435576) mkst-cur-A
      udp 16001
    nam#
    But if I do it by GUI and than
    nam# show application app-tag 268435576
    custom:120 (268435576) mkst-cur-A
      udp 16001 - 16009
    nam#
    How to do it by CLI?

    Hi Alexey,
    Sure, the function you're looking for is in the ANALYSIS panel under the "CUrve Fitting" palette-- it's called "Linear Mapping".  You will need to create the desired X channel prior to calling this function, though, so you will probably need to use the ANALYIS function "Generate Numeric Channel" in the "Channel Functions" palette.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Problem while creating row with dependent select one choice in adf  table

    Iam having independent and dependent select one choice in a ROW in adf af:table
    unable to insert more than one row with dependent select one choice using create insert in adf table.
    Able to add more rows in UI af:table but ,ignoring previous rows (select one choice values) and only latest current row values is getting inserted to the database.
    Following is the code used to create row and for pointing to the current row
    public void addRowOnSecSettings(){
    SecurityGroupSettingsVOImpl SecGroupSetVO =(SecurityGroupSettingsVOImpl) this.getSecurityGroupSettingsVO1();
    try{
    int rowCount = SecGroupSetVO.getRowCount();
    SecurityGroupSettingsVORowImpl SecGroupSetRow =
    (SecurityGroupSettingsVORowImpl)SecGroupSetVO.createRow();
    SecGroupSetRow.setNewRowState(Row.STATUS_INITIALIZED);
    SecGroupSetVO.insertRowAtRangeIndex(rowCount, SecGroupSetRow);
    SecGroupSetVO.setCurrentRowAtRangeIndex(rowCount);
    SecGroupSetVO.setCurrentRow(SecGroupSetRow);
    } catch (Exception e) {
    e.printStackTrace();
    Regards,
    Bhagavan

    as it is dependent select one choice ,have already put auto submit="true".but no chance ,
    if i add two rows vo rowiterator showing count 2 but only current row select onechoice values are getting where as previous row select one choice values are null.

  • Error in creating table with sequence

    Good day,
    i tried creating a table in Object Browser - create table, selecting "Populated from a new sequence" when creating my primary key. The following error was encountered after i clicked on the "create" button towards the end.
    Creating table "temp2" failed.
    Failed Creating Table ORA-24344: success with compilation error ORA-00942: table or view does not exist ORA-06510: PL/SQL: unhandled user-defined exception
    Thank you for any assistance.

    Hi,
    "Action: Check each of the following:
    the spelling of the table or view name.
    that a view is not specified where a table is required.
    that an existing table or view name exists.
    Contact the database administrator if the table needs to be created or if user or application privileges are required to access the table.
    Also, if attempting to access a table or view in another schema, make certain the correct schema is referenced and that access to the object is granted. "
    There are reserved names. Change the names of the table and sequence.
    Konstantin

  • List out on the one row with all variables from db

    from DB
    namn
    namnID namn
    166 -----------------------
    167 pierre lemon
    170 Lena Jakobsson
    171 adas
    172 Lena M Jakobsson
    175 Per Olofsson
    Inmata
    id namnID startdate slutdate vc fargkod
    50 167 2006-04-20 2006-04-27 Uddevalla Re
    54 167 2006-05-20 2006-07-20 Vänersborg A
    58 167 2006-08-21 2006-09-01 Uddevalla O
    61 170 2006-04-24 2006-05-03 ----- P
    <cfquery name="row_stsl" datasource="at">
    SELECT DISTINCT count(namnID) as sum_namnID
    FROM inmata
    group by namnID
    </cfquery>
    <cfset sum_namnIDa = row_stsl.sum_namnID>
    <cfoutput query="row_stsl">
    <table border="1">
    <tr><td>#sum_namnID#</td></tr>
    </cfoutput>
    <cfscript>
    for (i=1; i lt sum_namnIDa; i=i+1)
    writeoutput ( "<td>" & startdate & slutdate
    & "</td>");
    </cfscript>
    <cfoutput>
    </table>
    </cfoutput>
    My idea is to count number of nameID and build one row using
    <td> within startdate and slutdate </td>
    if there is 3 namnID so create three startdate and slutdate
    but don't know exact how to code.
    Any suggestion?
    I tried to get out startdate and slutdate in ordinal on the
    one row.
    Name:
    eg.
    Pierre Lemon 1. 2006-04-24 2006-06-02 2. 2006-06-03
    2006-07-25 3. etc startdate and slutdate on the row.

    <cfquery name="row_stsl" datasource="at">
    SELECT Count(inmata.namnID) AS sum_namnID,
    First(inmata.startdate) AS Förstaförstartdate,
    Last(inmata.slutdate) AS Sistaförslutdate
    FROM inmata
    WHERE ((inmata.startdate) AND (inmata.slutdate))
    GROUP BY inmata.namnID;
    </cfquery>
    <cfloop query="row_stsl">
    <table border="1">
    <tr>
    <cfscript>
    for (i=1; i lte sum_namnID; i=i+1)
    writeoutput ("<td>" & #dateformat
    (Förstaförstartdate,"yyyy-mm-dd")# & " "
    & #dateformat (Sistaförslutdate,"yyyy-mm-dd")# &
    "</td>");
    </cfscript>
    </tr>
    </table>
    </cfloop>
    Resultat:
    2006-04-20 2006-09-01 2006-04-20 2006-09-01 2006-04-20
    2006-09-01
    2006-04-24 2006-05-03
    In DB
    id namnID startdate slutdate
    50 167 2006-04-20 2006-04-27
    54 167 2006-05-20 2006-07-20
    58 167 2006-08-21 2006-09-01
    61 170 2006-04-24 2006-05-03
    yes, startdate and slutdate is date as datatype
    Is it SQL statement or cfscript I will change on?
    Have tried with other sql question but it will not take
    effect to get out answer.
    SELECT inmata.namnID, Count(inmata.namnID) AS Antal,
    inmata.startdate AS start_datum, inmata.slutdate AS slut_datum
    FROM inmata
    GROUP BY inmata.namnID, inmata.startdate, inmata.slutdate
    HAVING (((inmata.startdate) Is Not Null) AND
    ((inmata.slutdate) Is Not Null));
    Because the result is :
    2006-04-20 2006-05-03
    2006-04-20 2006-04-27
    2006-05-20 2006-07-20
    2006-08-21 2006-09-01
    2006-04-24 2006-05-03
    2006-04-20 2006-04-27
    2006-08-21 2007-05-03
    Any idea?!

  • Create images with dynamic width from 3 images each (left/center/right-part)

    Hello,
    i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
    The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
    Has anyone done something similar already and could give me some useful hints on that issue ?
    I have come up to this until now:
    #target Photoshop
    // =========================== Opens a new document and asks for dimensions ============================
    var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
    var myName = prompt("How do you want to call the document?"); // askes for document name
    var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
    var height = prompt("Please insert height for the output here!", ""); //askes for desired height
    var docName = myName +".psd"
    var idMk = charIDToTypeID( "Mk  " );
        var desc3 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
            var desc4 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc4.putString( idNm, """Wunschname""" );
            var idMd = charIDToTypeID( "Md  " );
            var idRGBM = charIDToTypeID( "RGBM" );
            desc4.putClass( idMd, idRGBM );
            var idWdth = charIDToTypeID( "Wdth" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idWdth, idRlt, width );
            var idHght = charIDToTypeID( "Hght" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idHght, idRlt, height );
            var idRslt = charIDToTypeID( "Rslt" );
            var idRsl = charIDToTypeID( "#Rsl" );
            desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
            var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
            desc4.putDouble( idpixelScaleFactor, 1.000000 );
            var idFl = charIDToTypeID( "Fl  " );
            var idFl = charIDToTypeID( "Fl  " );
            var idTrns = charIDToTypeID( "Trns" );
            desc4.putEnumerated( idFl, idFl, idTrns );
            var idDpth = charIDToTypeID( "Dpth" );
            desc4.putInteger( idDpth, 8 );
            var idprofile = stringIDToTypeID( "profile" );
            desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
        var idDcmn = charIDToTypeID( "Dcmn" );
        desc3.putObject( idNw, idDcmn, desc4 );
    executeAction( idMk, desc3, DialogModes.NO );
    //==============================================save document================================================
    var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc5 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc5.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc4.putObject( idAs, idPhtthree, desc5 );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
        var idDocI = charIDToTypeID( "DocI" );
        desc4.putInteger( idDocI, 308 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc4, DialogModes.NO );
    //========================================================================================================
    for (var i = 0; i < myLayerset.length; i++) {
    if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
    // ======================================================= opens selected images as smart objects====================
    var idOpn = charIDToTypeID( "Opn " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
       desc1.putPath( idnull, myLayerset[i]);
        var idsmartObject = stringIDToTypeID( "smartObject" );
        desc1.putBoolean( idsmartObject, true );
    executeAction( idOpn, desc1, DialogModes.NO );
    //===================================duplicates opened layer into created document========================================
    var idDplc = charIDToTypeID( "Dplc" );
        var desc144 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref135 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref135.putEnumerated( idLyr, idOrdn, idTrgt );
        desc144.putReference( idnull, ref135 );
        var idT = charIDToTypeID( "T   " );
            var ref136 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref136.putName( idDcmn, docName); 
        desc144.putReference( idT, ref136 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc144.putInteger( idVrsn, 5 );
    executeAction( idDplc, desc144, DialogModes.NO );
    // ======================================================= close tab without saving ==========
    var idCls = charIDToTypeID( "Cls " );
        var desc156 = new ActionDescriptor();
        var idSvng = charIDToTypeID( "Svng" );
        var idYsN = charIDToTypeID( "YsN " );
        var idN = charIDToTypeID( "N   " );
        desc156.putEnumerated( idSvng, idYsN, idN );
    executeAction( idCls, desc156, DialogModes.NO );

    I adapted a Script somewhat, so you may give this a test.
    But it uses the open file so you would have to adapt it further.
    // arranges the selected jpg, tif, psd in line;
    // gutters may be irregular due to rounding effects;
    // thanks to michael l hale and muppet mark;
    // for mac and CS6;
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length == 0) {
              var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
    else {myDocument = app.activeDocument};
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var theArray = [0, 0, myDocument.width, myDocument.height];
    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
    // do the arrangement
    if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
    app.preferences.rulerUnits = originalRulerUnits;
    ////// function to place images in lines //////
    function placeInLines (myDocument, theFiles, theArray) {
    theFiles.sort();
    // fit on screen;
    var idslct = charIDToTypeID( "slct" );
    var desc64 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref44 = new ActionReference();
    var idMn = charIDToTypeID( "Mn  " );
    var idMnIt = charIDToTypeID( "MnIt" );
    var idFtOn = charIDToTypeID( "FtOn" );
    ref44.putEnumerated( idMn, idMnIt, idFtOn );
    desc64.putReference( idnull, ref44 );
    executeAction( idslct, desc64, DialogModes.NO );
    // change pref;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    setToAccelerated();
    app.togglePalettes();
    var check = turnOffRescale ();
    // create the arrangement;
    if (theFiles.length > 0 && theFiles.length == 3) {
    myDocument.activeLayer = myDocument.layers[0];
    // create masked group;
    var theGroup = myDocument.layerSets.add();
    theGroup.name = "arrangement";
    // determine the array’s values;
    var areaWidth = theArray[2] - theArray[0];
    var areaHeight = theArray[3] - theArray[1];
    var theDocResolution = myDocument.resolution;
    var areaRelation = areaHeight / areaWidth;
    // center of placed non-pdf images;
    var centerX = Number(myDocument.width / 2);
    var centerY = Number(myDocument.height / 2);
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    var pdfSinglePages = new Array;
    var nonPDFs = new Array;
    var theDimPDFs = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    var theDimensions = new Array;
    var theLengths = new Array;
    // array to collect both files and placed pdf-pages;
    var theseFiles = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    for (var o = 0; o < theFiles.length; o++) {
        var thisFile = theFiles[o];
              theseFiles.push(thisFile);
              var theDim = getDimensions(thisFile);
              theDimensions.push(theDim);
              theRelativeWidth = 100 / theDim[1] * theDim[0];
              theLength = theLength + theRelativeWidth;
    // reset dialogmodes;
    app.displayDialogs = DialogModes.ERROR;
    // if three files;
    if (theseFiles.length == 3) {
    // create the layers;
    var theNumber = 0;
    var theAdded = 0;
    var y = areaHeight / 2;
    // add placed image’s width;
    var thisLineWidth = 0 + theAdded;
    var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
    var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
    // place the files;
    for (var x = 0; x < 3; x++) {
    var theNumber = x;
    var thisFile = theseFiles[theNumber];
    var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
    var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
    var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
    var offsetY = y - centerY + theArray[1];
    var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
    myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
    thisLineWidth = thisLineWidth + theNewWidth;
    // duplicate the middle one;
    if (theNumber == 1) {
              while (thisLineWidth < myDocument.width - theLastWidth) {
                        theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                        thisLineWidth = thisLineWidth + theNewWidth;
    // reset;
    app.togglePalettes();
    turnOnRescale (check);
    app.preferences.rulerUnits = originalRulerUnits;
    ////// playback to accelerated //////
    function setToAccelerated () {
              var idsetd = charIDToTypeID( "setd" );
              var desc1 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                        var ref1 = new ActionReference();
                        var idPrpr = charIDToTypeID( "Prpr" );
                        var idPbkO = charIDToTypeID( "PbkO" );
                        ref1.putProperty( idPrpr, idPbkO );
                        var idcapp = charIDToTypeID( "capp" );
                        var idOrdn = charIDToTypeID( "Ordn" );
                        var idTrgt = charIDToTypeID( "Trgt" );
                        ref1.putEnumerated( idcapp, idOrdn, idTrgt );
              desc1.putReference( idnull, ref1 );
              var idT = charIDToTypeID( "T   " );
                        var desc2 = new ActionDescriptor();
                        var idperformance = stringIDToTypeID( "performance" );
                        var idperformance = stringIDToTypeID( "performance" );
                        var idaccelerated = stringIDToTypeID( "accelerated" );
                        desc2.putEnumerated( idperformance, idperformance, idaccelerated );
              var idPbkO = charIDToTypeID( "PbkO" );
              desc1.putObject( idT, idPbkO, desc2 );
              executeAction( idsetd, desc1, DialogModes.NO );
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return myDocument.activeLayer;
    ////// open pdf //////
    function openPDF (theImage, x) {
    // define pdfopenoptions;
    var pdfOpenOpts = new PDFOpenOptions;
    pdfOpenOpts.antiAlias = true;
    pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
    pdfOpenOpts.cropPage = CropToType.TRIMBOX;
    pdfOpenOpts.mode = OpenDocumentMode.CMYK;
    pdfOpenOpts.resolution = 10;
    pdfOpenOpts.suppressWarnings = true;
    pdfOpenOpts.usePageNumber  = true;
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    pdfOpenOpts.page = x;
    var thePdf = app.open(theImage, pdfOpenOpts);
    thePdf.close(SaveOptions.DONOTSAVECHANGES);
    // reset dialogmodes;
    app.displayDialogs = theDialogSettings;
    ////// turn off preference to scale placed image //////
    function turnOffRescale () {
    // determine if the resize prefernce is on;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var appDesc = executeActionGet(ref);
    var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
    var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
    // turn off resize image during place;
    if (theResizePref == true);{
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc12 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref4.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idcapp, idOrdn, idTrgt );
        desc12.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T   " );
            var desc13 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc13.putBoolean( idresizePastePlace, false );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc12.putObject( idT, idGnrP, desc13 );
    executeAction( idsetd, desc12, DialogModes.NO );
    return theResizePref
    ////// turn on preference to scale plced image //////
    function turnOnRescale (check) {
    if (check == true) {
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref5.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idcapp, idOrdn, idTrgt );
        desc14.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc15 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc15.putBoolean( idresizePastePlace, true );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc14.putObject( idT, idGnrP, desc15 );
    executeAction( idsetd, desc14, DialogModes.NO );
    ////// convert to so if not one aready //////
    function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
    app.activeDocument.activeLayer = theLayer;
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
        var desc9 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idLyr, idOrdn, idTrgt );
        desc9.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc9.putObject( idT, idOfst, desc10 );
    executeAction( idcopy, desc9, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// load pdf as smart object //////
    function transformLayer (layer, percentage, xOffset, yOffset) {
    app.activeDocument.activeLayer = layer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc4 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc5 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc4.putObject( idOfst, idOfst, desc5 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idWdth, idPrc, percentage );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idHght, idPrc, percentage );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc4.putBoolean( idLnkd, true );
        var idAntA = charIDToTypeID( "AntA" );
        desc4.putBoolean( idAntA, true );
    executeAction( idTrnf, desc4, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// function to get file’s dimensions, thanks to michael l hale //////
    function getDimensions( file ){
    function divideString (theString) {
              theString = String(theString);
        var a = Number(theString.slice(0, theString.indexOf("\/")));
        var b = Number(theString.slice(theString.indexOf("\/") + 1));
        return (a / b)
    // from a script by michael l hale;
    function loadXMPLibrary(){
         if ( !ExternalObject.AdobeXMPScript ){
              try{
                   ExternalObject.AdobeXMPScript = new ExternalObject
                                                                ('lib:AdobeXMPScript');
              }catch (e){
                   alert( ErrStrs.XMPLIB );
                   return false;
         return true;
    function unloadXMPLibrary(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
             alert( ErrStrs.XMPLIB );
    ////// based on a script by muppet mark //////
    function dimensionsShellScript (file) {
              try {
    // getMetaDataMDLS;
    if (File(file) instanceof File && File(file).exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += File(file).fsName;
    //          shellString += File(file).fullName;
              shellString += ' > ~/Documents/StdOut2.txt';
              app.system(shellString);
    // read the file;
    if (File('~/Documents/StdOut2.txt').exists == true) {
        var file = File('~/Documents/StdOut2.txt');
        file.open("r");
        file.encoding= 'BINARY';
        var theText = new String;
        for (var m = 0; m < file.length; m ++) {
                        theText = theText.concat(file.readch());
              file.close();
              theText = theText.split("\n");
    // get the dimensions;
              var dim = new Array;
              for (var m = 0; m < theText.length; m++) {
                        var theLine = theText[m];
                        if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
    // remove file and hand back;
              File('~/Documents/StdOut2.txt').remove();
    catch (e) {
              if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
              return dim
              try{
                        loadXMPLibrary();
                        var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                        var xmp = xmpf.getXMP();
                        xmpf.closeFile();
                        var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                        var resFactor = 1;
                        if (resolutionUnit == 2) {
                                  var resFactor = 1;
                        if (resolutionUnit == 3) {
                                  var resFactor = 2.54;
                        var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                        xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                        unloadXMPLibrary();
                        if(dim[0]=="undefined" || dim[1]=="undefined"){
                var dim = undefined;
                var res = undefined;
                var bt = new BridgeTalk;
                bt.target = "bridge";
                var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
                bt.body = myScript;
                bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
                bt.send(10);
                        function myReturnValue(str){
                                  res = str;
                                  dim = str.split(',');
                        function psRemote(file){
                                  var t= new Thumbnail(file);
                                  return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
        }catch(e){unloadXMPLibrary()};
              if (String(dim[2]).indexOf("\/") != -1) {
                        var a = divideString(dim[2]);
                        var b = divideString(dim[3]);
                        dim = [dim[0], dim[1], a, b]
    // if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var array = dimensionsShellScript(file);
                        dim = array;
    // if shell-string failed open doc to get measurements;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var thisDoc = app.open (File(file));
    // close ai without saving;
                        if (file.name.slice(-3).match(/\.(ai)$/i)) {
                                  thisDoc.trim(TrimType.TRANSPARENT);
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                        else {
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
    return dim;

  • ADF Toplink Create Row with foreign key

    Hello,
    I'd like to create a new row in a table that has a required one-to-one mapping relationship (foreign key). I've created an edit form by dragging the return node of a readQuery. The columns holding foreign key values aren't added to the page(because of 1-1 relationship) and when I commit the changes errors are raised.
    How do I pass the foreign key to the ADF Toplink framwork to include in the insert statement.

    TopLink's persistence model is based around relationships, which represent FKs. To have these FKs properly populated you need to create the corresponding object relationships.
    To do this you need to create a data action that will invoke a method on your class passing in the object you want to create the relationship with. There is currently an issue where ADF will not allow you to easily drop a set method onto an action. You will need to create a method on your bean that does not start with 'set'.
    In the demos I have done I have added a method like 'populateAddress(Address)' that internally calls the set method. This populate method will show up on the data control palette and you can then drop it on the action in your page flow.
    One additional tip: To access the object you want to pass in you will need to extend the default expression that reflects the current selected row in the iterator to have '.dataProvider' appended. This accesses the persistent object within row container.
    If you are still struggling please contact me through the email address in my forum profile.
    Doug

  • Issue with pictures changing from light to dark

    This is hard to explain,
    I finish editing my pictures, save as PSD and a 2nd as jpeg.
    i view the picture in windows live gallery (windows 7 64bit) and it has changed to a dark deep contrast.
    I open the jpeg or the PSD file and they both appear as i originally saved them until I select/ click on it. and i get the darker deep contrasted image.
    I have tried to have Photoshop elements 9, in preferences set to windows color and I tried it at Adobe no difference.
    Jpegs are saved as sRGB but it is affecting all images, fine while editing but when saved and reviewed it changes and when opened i get to different contrasting views of the same image when selected. This is really anoying me as you think your done and it looks completely different when you review it. HELP!!
    please keep your helpful comments to a basic understandable level.

    I always recommend sticking with sRGB from the point of shooting photos, through editing and printing. It’s pretty universal and if you keep your workflow settings as sRGB it will avoid profile conflicts.
    Start with the elements editor and check your workspace settings by clicking:
    Edit >> Color Settings
    Click image to enlarge.
    Then click on the Windows Start button and type Color Management and press return.
    Check all of your settings are consistent.
    Finally check your profiles when saving files in the Editor.
    If you keep everything consistent you should have no problems.

  • Bridge CS4 edit history problem with OS change from XP to 7

    I've changed my OS from XP to 7.  After reinstalling software, Bridge CS4 no longer keeps my editing steps in the "edit history" metadata.  The only steps recorded are that I've  saved a file.  I have the edit history box marked in preferences in both Bridge and PS, and have tried changing the metadata section in Preferences to session only, concise, and detailed.  None of those choices make a difference.  Any suggestions on how to get my edit history steps back in the metadata of Bridge?  I use the edit history frequently!  Thanks in advance!

    Work through all of the steps (ideas) listed at http://ppro.wikia.com/wiki/Troubleshooting
    If your problem isn't fixed after you follow all of the steps, report back with ALL OF THE DETAILS asked for in the FINALLY section, the questions at the end of the troubleshooting link... most especially the codec used... see Question 1
    Read Harm on drive setup http://forums.adobe.com/thread/662972?tstart=0
    - click the embedded picture in Harm's message to enlarge to reading size

  • Iphone 4S with GMAIL / Changing from address.

    Looking to see if it is possible to setup a GMAIL account with Iphone 4S and change the email address it sends from.  I can setup the account just fine but the IPhone automatically changes the email address to the @gmail.com account after it saves.  
    The reason I want to use the exchange email option is that it synchs much faster the using Other/IMAP.
    Any ideas would be apreciated.

    I just learned how at Apple store today.
    Set-up your gmail email account on iPhone as a Microsoft Exchange account type, NOT a Gmail.
    Do not use a domain
    When asked, after initial verify, enter the following for the server:  m.google.com
    I then deleted the other gmail email account I had set-up previously.
    Works great for me!

  • Locating row with invalid number from  table with few million rows

    We need to query the a table or a view of same to obtain a id of type VARCHAR with bind value being NUMBER. Any attempts in this regard I try seem to result ORA-01722: invalid number. Once case is below here
    SQL> select TEXT_ID FROM ATT_TABLE where to_number(TEXT_ID) = 9411956;
    select TEXT_ID FROM ATT_TABLE where to_number(TEXT_ID) = 9411956
    ERROR at line 1:
    ORA-12801: error signaled in parallel query server P010
    ORA-01722: invalid number
    1. TEXT_ID column is meant to have numeric values in VARCHAR type. It is possible that some record / row is not complying. How can I locate the non-complying records ?
    2. What would be a VIEW definition that would return only records with valid numeric data in TEXT_ID column.
    Edited by: bonjonbovi on Feb 13, 2009 3:58 PM

    Of course the regexp_like is really cpu expensive, but there's no other solution in your situation
    The only way to differ numberic value from character, is REGEXP_LIKE function
    But you can do it using PL/SQL
    BEGIN
       FOR c IN (SELECT TO_NUMBER (ID) ID
                   FROM test_number)
       LOOP
          DBMS_OUTPUT.put_line (c.ID);
       END LOOP;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;

  • Problems with values changed from timeout to event

    Hi all
    i've this question.
    I'm talking with an instrument (oscilloscope) asking it some values and i can see them into my labview panel (refreshing them every timeout loop).
    I can set different values into labview panel and the scope changes its settings so in the next loop my panel reads the new value from the scope.
    I obtain this with some events and all is working perfectly.
    My problem is this: when i click on an element (click generates an event) labview must finish timeout loop and only then executes the event, so the new value set by the user will be ignored.
    What can i do to execute the event "instantly" with new user values?
    tnx to all
    http://www.sd-studio.it - web design agency

    As per your description, the user input should be delayed, not ignored, because LV will execute the event at last.
    Anyway, to shorten the delay, you may simply set a 0 ms (or a very short, e.g. 10 ms) timeout for the event structure and manage a timeout "by hand". For example, you store in a shift register the last time you executed the refreshing code; when the timeout event executes, you subtract the last time value from the current time; if the difference is more than a given threshold, you actually execute the refreshing code.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

Maybe you are looking for