Skip to Main Content

Integration

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.

CQL cache query

dmitryz1Dec 2 2012 — edited Dec 5 2012
Hello all,
I have an event and cache that suppose to add this event on each occurrence.
I have to build CQL query with following logic:
The same event happened three times during defined period of time (let's say last 7 days) .
Any help would be appreciated .

Regards,
Dmitry

Comments

If the file is in a JAR then you must include a reference to the JAR in your configuration.
ARCHIVE=frmall.jar,audio.jar
A URL cannot read into the contents of a JAR file. Using this configuration, your code would now look like this:
PLAY_AUDIO('po.mp3');;)
Alternatively, you can store the file on the server and access it using a URL. I do not recommend this method as Java may throw security warnings when trying to access it. However, if you wanted to try this save the mp3 file in the desired, virtually mapped directory then change your code to something like this:
PLAY_AUDIO('http://srv-fm1:7777/forms/icons/po.mp3');;)

buggleboy007

Hello Michael,
I have really not understood this concept. If my DBA creates a jar file and then gives me the link saying : I have uploaded to srv-fm1 and also attached the file here. The file is accessible from /apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar
The file that I gave him was 'po.mp3' but when he did the audio jar, he told me that the name was no po.mp3, but audio.jar.
How do I access it using PLAY_AUDIO in WHEN-NEW-FORM-INSTANCE trigger?

Also you mentioned :
If the file is in a JAR then you must include a reference to the JAR in your configuration.
ARCHIVE=frmall.jar,audio.jar
Who should be doing this and where should this be done? Me as a developer in Oracle forms or DBA in formsweb.cfg file? Please let me know.

Answer

In order to avoid hard coding server locations in your source code, the best approach is to add the mp3 file to a JAR, which is what you claimed to have done. A "JAR" is exactly the same thing as a ZIP file. So within this JAR is your mp3 file.
Do the following:
ADMIN
1. Add po.mp3 to the root directory of a JAR file
2. Ensure that audio.jar has been signed with a trusted digital signature certificate (ask your DBA or Admin).
3. Copy audio.jar to $ORACLE_HOME/forms/java (ask your DBA or Admin)
4. In Fusion Middleware Control, add audio.jar to the ARCHIVE parameter in formsweb.cfg for the config you are using. (ask your DBA or Admin) . Be sure to Save and Activate the changes.
image.png4. Stop and restart WLS_FORMS.
DEVELOPER
1. Use this syntax in code: PLAY_AUDIO('po.mp3');;)

Marked as Answer by buggleboy007 · Nov 19 2020
buggleboy007

Hello Michael,
Thanks for your assistance. My DBA told me that he has done all the above steps and when I launch the form nothing really happens:
I then placed the following code components (one did not work, so tried another) in WHEN-NEW-FORM-INSTANCE. None worked.
PLAY_AUDIO('po.mp3');
play_audio('audio.jar');
I am using forms :Forms [64 Bit] Version 12.2.1.0.0 (Production). Using the same form, if I call a music file from the internet it plays but not an mp3 file created locally.

The hint is in the Java Console. Look carefully at the path shown in the console. It's telling you where Forms is looking for your file. In my example above, it is looking in the CODEBASE, which is /forms/java. If you put your JAR in the /forms/java directory then the file will be found. If the file was found you will also see in the Console that audio.jar was found and downloaded. If you do not see that audio.jar was downloaded then you can understand why things aren't working.
image.pngThe correct syntax for using a JAR is as I mentioned. All the other examples you shared would never work.
Also, open the JAR file in WinZip, 7Zip, WinRaR, or any other Zip tool with a UI so you can visually see the structure. Carefully note if your file is in the root directory or in a subdirectory. Here is an example of three files in the root directory of a Zip file named demoMedia.jar
image.png

buggleboy007

Michael - I did download and unzip the contents of JAR file and here's how it looks. It appears that the po.mp3 is in root directory of 'audio' folder.
image.png
Coming to the path of the file in Java Console, it looks like you need to copy the audio.jar file to Java folder, right? Based on what my DBA has said the path is: apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar
Does this mean that he has not copied the JAR file to the JAVA folder? (I asked him this question but haven't heard yet).

Yes. He put the file in the wrong place. As I mentioned, it must go in Oracle_Home/forms/java
After copying there, WLS_FORMS must be stopped and restarted.

buggleboy007

Hello Michael,
One good news – The audio works. I tested it on a form that I prototyped on my home computer (which has Oracle forms : Version 12.2.1.4.0) and was able to reproduce the exact sound/voice of PO.MP3 file. 
At work we are using (for exploring new features only) Version: 12.2.1.1.0. I do not know if the version is the root cause. Anyway here are the steps that I went through:
• Copied the JAR file in ‘middleware/forms/java’ directory  (this is the same JAR file that my DBA used)
• Then made a change in formsweb.cfg file i.e. added audio.jar file entry in the following locations where I found formsweb.cfg
(E:\Middleware\user_projects\domains\base_domain\pending\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config)
(E:\Middleware\user_projects\domains\base_domain\servers\WLS_FORMS\tmp\_WL_user\formsapp_12.2.1\wblalg\config)
• Then shut down OHS, WLS_FORMS, Weblogic Admin Server and Node manager too.
• Restarted my home computer
• Then restarted Node Manager, Weblogic Admin Server, WLS_FORMS and finally OHS.
• After everything settled down, I launched the form (that I had made the change).
image.png
• When I pressed START button, I was to hear contents of the audio file. This proves your steps are working but not sure why in the office it is not.
image.pngThanks for all your assistance in this.

Happy you were able to get it working. One comment about your steps, you mentioned that you edited formsweb.cfg found in two different directories. It is very important that you not do this. This file (referred to as Web Configuration) is managed by Fusion Middleware Control (FMC). Changes made in the file system and not from FMC may eventually be reverted back to their previous state. It is very important that you edit managed files from with FMC. This is explained in the Working with Forms guide.
So if you find that for some unexplained reason your audio test form stops working, likely it's because the configuration changes you made were undone. Reenter them through FMC. Also, if you enter the changes in FMC you will not need to restart servers.
Here is the URL to the 12.2.1.4 doc:
Working With Oracle Forms (0 Bytes)And here is the text I mentioned:
image.png

buggleboy007

I tried reentering it through FMC UI itself to begin with. However after spending 30 minutes I gave up that option because I could not find a way for the same. Therefore went through backdoor method. I will go through the links that you have suggested to understand the way it needs to be changed from front-end itself. I completely agree not to change the entries from back-door method.

@michael-ferrante-oracle : By any chance do you feel that lower version of Forms 12c is the root cause of the audio file not playing back? At home I have : 12.2.1.4.0. At work we have: 12.2.1.1.0

Here is how you get to the Forms configuration (assuming a single instance).
'1. Go to http://server:7001/em (or whichever port you chose for Fusion Middleware Control) and login.
'2. On the top left side, click on the hamburger button to expand the side panel. The tool tip will say "Target Navigation"
'3. Expand the "Forms" node by clicking on the arrow to the left of "Forms".
'4. Click on "forms1"
'5. Then click on Web Configuration
image.pngThis is all explained in the Forms Deployment Guide (referred to as Working with Oracle Forms in v12.2.1.4)

buggleboy007

Thanks a lot once again Michael. I did follow the above steps and was able to view the UI of FMC. I did see the audio.jar entry in the archive text box.

buggleboy007

@michael-ferrante-oracle : A quick question regarding Audio:
A) Let's say that my application consists of 300 Forms. Of those 300 Forms, I wish to have Audio play back capability in about 75 Forms. This means I will have to record 75 Audio files of .MP3 format.
B) Then ensure that in those Forms I have to add the code: PLAY_AUDIO(<<NAME OF THE MP3 FILE>>);
I guess my question is, can the names of those Audio Files be made dynamic or may be retrieved from a table rather than hard coding each audio file? Based on what I have noticed in the white paper + our conversation in this thread it appears to me that the name of the audio file(PLAY_AUDIO('1.MP3');) has to be mentioned in the Form(s) that needs the audio. It cannot be done dynamically.
Is my understanding correct?

Your understanding is incorrect.
Nearly any value in Forms code can be created dynamically.
In your case though, I do have a question. 75 audio files? Really? Although I'm very happy that you are finding this new feature useful, I am wondering what you might be doing with it...
So to your question. Yes, you can store the audio file names in a table. To get them you might do something like this (exact code may need to be adapted - this is just an example):

Declare
  v_audioName varchar2(100);
Begin
  Select filename Into v_audioName From someTable Where <some condition>;
  If v_audioName Is Not Null Then
    Play_Audio (v_audioName);
  Else
    Message ('Audio file not found.');
  End if;
End;

There are other ways to do it, but again, this was just an example. You can also access the audio files from a URL.

buggleboy007

75 was just an example/hypothetical question. More than one for sure but do not know yet how many we require. I believe this is to make complex Forms (like Purchase Order, Material Allocation) have an audio playback so that the user knows the need/nature of the Form.
Your example code was something on my mind too. It's good to know that it can be done dynamically.
So concluding there are three ways to make it work:
a) using the file name in PLAY_AUDIO built in
b) passing a URL link in PLAY_AUDIO built in
c) and then your example above
Any other way that you think I have missed?

buggleboy007

Michael,
My DBA at work put the 'audio.jar' file in FORMS/JAVA folder and applied the necessary changes. Yet when I launch the required Form which has PLAY_AUDIO('po.mp3') code, I still do not hear any audio playback.
Is there a reason why? (i can get it to work on my home computer, Windows based using the same JAR file but not on office environment Linux based ).
Here's how the office environment is set up:
a) I log in to the office network remotely (via VPN due to work from home policy).
b) Open the required Form and then add the necessary code and compile it successfully on Linux environment.
c) Then open the executable but cannot hear any audio playback when I press 'Start' on the Form.
Following screenshots should give you an idea if they are set up correctly or incorrectly.
image.pngimage.png
image.png
image.pngPlease do let me know your thoughts on the above.
Regards

As I mentioned several times, the Java Console output will answer many of your troubleshooting questions. At minimum, the Console will give you a good hint as to why it's failing.
If you are running with Java Web Start, it's failing because archive entries must be entered in "extensions.jnlp" and not the ARCHIVE parameter. Editing this file breaks the rules. To edit it, stop WLS_FORMS and open the file in a text editor. In the file you will see an example entry (commented out) for "jacob.jar". Create a new entry below that example using the same syntax (but without the comments). Replace jacob.jar with your jar name.
Once the file has been updated, restart the managed server.
If you are not using Web Start and are seeing this problem, I recommend reviewing the Java Console. It may be necessary to increase the logging level to Level 2. To do this, start the form then open the Java Console (or change the settings to make it open automatically). Once open, use the mouse and click in the Console text area to move focus to it. Then press the number "2" on the keyboard (above the letter Q). Do not use the number pad, as this will not work. If you did it correctly, you should see something like this:
image.pngNow push the button or whatever it is you have to play the audio. Then note the output in the console.

buggleboy007

We are using Java Web Start. So based on what you have mentioned I will have to ask the DBA now to make changes in extensions.jnlp(ensuring that the audio.jar file is mentioned in extensions.jnlp and not in archive parameter).
Unfortunately the Java Console does not give any error or hint (at the very least) for me to troubleshoot it independently.
Anyways I will try what you have mentioned and then see the outcome.

buggleboy007

Finally Michael, based on what you mentioned(as we use JWS), my DBA implemented those steps and I was able to get the AUDIO to work. I was able to hear the contents of the audio file on our office environment.
Thanks a lot for your assistance and guiding me all the way.
I will let you and others know separately the new features of Forms 12c that we have implemented.
Merci beaucoup!

1 - 19
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 1 2013
Added on Dec 2 2012
4 comments
2,229 views