Skip to Main Content

Oracle Forms

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Playing Audio - Forms 12c new features

buggleboy007Nov 16 2020 — edited Nov 16 2020

Hello Michael,
We wish to play an audio that has been recorded when a specific form is launched. This is what we have done:
a) recorded a file and named it as po.mp3
b) gave the file to middleware who then signed it into a jar file (as mentioned in the new features document). These were his words "The file is accessible from /apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar"
c) based on the above, I called the file in WHEN-NEW-FORM-INSTANCE as :
PLAY_AUDIO('po.mp3'); This resulted in no luck.
so tried: PLAY_AUDIO('http://srv-fm1:7777/forms/icons/audio.jar/po.mp3');;) Even this resulted in no luck.
Is there anything else that needs to be done that is missing? Please advice.
Thanks in advance!
PS: For a known issue mentioned by Oracle for Forms: 12.2.1.1.0 (which is what we are using)
2.3.9 Oracle Forms does not play Audio Files using URL served by WebLogic Server
Oracle Forms audio functionality does not works if the URL, to obtain an audio files, is served by Oracle WebLogic Server. The audio file will fail to load.
The URL for the audio files must be served by the Oracle HTTP Server. Audio files delivered in JAR file can use URL served by either Oracle WebLogic Server or Oracle HTTP Server.
I checked with my DBA if the above is causing an issue and here was his reply:
We are using weblogic. We run Oracle HTTP Server on top of the WLS_FORMS / WLS_REPORTS managed servers.

This post has been answered by Michael Ferrante-Oracle on Nov 17 2020
Jump to Answer

Comments

Hi Kent,

No, it's not possible to tune FK discovery wizard in that extent. You can try the following script:

Philip

var settings = model.getAppView().getSettings();

//function to get column by matching name from position

//and data type - similar data types can be allowed in preferences - DM 4.1 EA2+

//position is 0 based

function getColumn(table,refCol,position){

    partName = refCol.getName().substring(position);

    cols = table.getElementsCollection().toArray();

    for(var i = 0;i<cols.length;i++){

        col = cols[i];

        if(!col.equals(refCol)){

        cpartName = col.getName().substring(position);

        if(partName.equals(cpartName)){

            if(!settings.isAllowSimilarTypesFK() && col.hasEqulaDataType(refCol)

                ||settings.isAllowSimilarTypesFK() && col.hasSimilarDataType(refCol) ) {

                    return col;  

                }

        }

        }

    }

    return null;

}

tables = model.getTableSet().toArray();

for (var t = 0; t<tables.length;t++){

table = tables[t];

pk = table.getPK();

if(pk!=null){

    for (var p = 0; p<tables.length;p++){

      ctab = tables[p];

      list = new java.util.ArrayList();

      pk_cols = pk.getColumns();

      for(var k=0;k<pk_cols.length;k++){  

      //position is 0 based so 4th character is at position 3    

        col = getColumn(ctab,pk_cols[k],3);

        if(col!=null){

            list.add(col);

        }

      }

      //create FK if the number of columns is the same

      if(list.size()==pk_cols.length){

          ctab.addForeignKey(pk,list);

      }

    }

}

}

Kent Graziano

Thanks. Will give this a try. What do you mean - "similar data types can be allowed in preferences - DM 4.1 EA2+ "?

similar data types for FK columns - number(7) and Number(10) are similar types they are not exact as it's required for PK-FK columns matching in previous releases. It appears it's not included in 4.1 EA2. Sorry, I'll change the script tomorrow to not use

here is the new script that will work in 4.1.873

var settings = model.getAppView().getSettings();

//function to get column by matching name from position

//position is 0 based

function getColumn(table,refCol,position){

    partName = refCol.getName().substring(position);

    cols = table.getElementsCollection().toArray();

    for(var i = 0;i<cols.length;i++){

        col = cols[i];

        if(!col.equals(refCol)){

         cpartName = col.getName().substring(position);

         if(partName.equals(cpartName) && col.hasEqulaDataType(refCol) ){

             return col;

         }

        }

    }

    return null;

}

tables = model.getTableSet().toArray();

for (var t = 0; t<tables.length;t++){

table = tables[t];

pk = table.getPK();

if(pk!=null){

     for (var p = 0; p<tables.length;p++){

      ctab = tables[p];

      list = new java.util.ArrayList(); 

      pk_cols = pk.getColumns();

      for(var k=0;k<pk_cols.length;k++){         

         col = getColumn(ctab,pk_cols[k],3);

         if(col!=null){

             list.add(col);

         }

      }

      //create FK if the number of columns is the same

      if(list.size()==pk_cols.length){

          ctab.addForeignKey(pk,list);

      }

     }

}

}

Kent Graziano

It worked, mostly.

Got an error on these lines:

if(!settings.isAllowSimilarTypesFK() && col.hasEqulaDataType(refCol) 

                    ||settings.isAllowSimilarTypesFK() && col.hasSimilarDataType(refCol) )

It said isAllowSimilarTypesFK was not a valid function (no such function).

The other issue, if the FK is already there, I don't want another. I had already built a few by hand so the script created dups. So an FK from Tab1 to Tab2 is already there, that should be skipped.

Thanks.

Philip Stoyanov-Oracle
Answer

It said isAllowSimilarTypesFK was not a valid function (no such function).

My fault, it's not included in 4.1.873

The other issue, if the FK is already there, I don't want another. I had already built a few by hand so the script created dups.

I added a check that column is not already used in FK definition.Here is the new script:

var settings = model.getAppView().getSettings();

//function to get column by matching name from position

//position is 0 based

function getColumn(table,refCol,position){

    partName = refCol.getName().substring(position);

    cols = table.getElementsCollection().toArray();

    for(var i = 0;i<cols.length;i++){

        col = cols[i];

        if(!col.equals(refCol)){

         cpartName = col.getName().substring(position);

         if(!col.isFKColumn() && partName.equals(cpartName) && col.hasEqulaDataType(refCol) ){

             return col;

         }

        }

    }

    return null;

}

tables = model.getTableSet().toArray();

for (var t = 0; t<tables.length;t++){

table = tables[t];

pk = table.getPK();

if(pk!=null){

     for (var p = 0; p<tables.length;p++){

      ctab = tables[p];

      list = new java.util.ArrayList(); 

      pk_cols = pk.getColumns();

      for(var k=0;k<pk_cols.length;k++){         

         col = getColumn(ctab,pk_cols[k],3);

         if(col!=null){

             list.add(col);

         }

      }

      //create FK if the number of columns is the same

      if(list.size()==pk_cols.length){

          ctab.addForeignKey(pk,list);

      }

     }

}

}

Marked as Answer by Kent Graziano · Sep 27 2020
Philip Stoyanov-Oracle

Hi Kent,

in DM 4.1.1.888 you don't need script to get the similar result.

Cases covered:

1) prefix is in table abbreviation, then FK column template should be

{table abbr}SUBSTR(4,30,FRONT,{ref column})

2) first 3 (or another number) characters from table name are used as prefix for columns then template is:

SUBSTR(1,3,FRONT,{table})SUBSTR(4,30,FRONT,{ref column})

I say similar result because the script and wizard work in different ways:

- the wizard generates the name based on template and search for column with such name (and data type)

- the script is doing partial matching of parent and child columns

Philip

Kent Graziano

Cool! Thanks for the update and the template code.

1 - 7

Post Details

Added on Nov 16 2020
19 comments
979 views