Overblog
Suivre ce blog Administration + Créer mon blog
21 mai 2007 1 21 /05 /mai /2007 22:17

Purpose

Here is a Java Bean from Casey Bowden to get the status of a long report and to cancel it if needed.

Report Monitor

 

ReportMonitor detail

I. Problem One: Report Status


When running Oracle Forms and Reports in client/server, users knew the status of the report they were running. After converting to the web version of Oracle Forms and Reports users are get a locked screen and do not know the status of the report. This is usually an issue with longer running reports.

Solution: I created a ReportMonitor JavaBean that launches a separate applet, from the current forms session, to update the user on the status of the report. The applet will close when the report is finished or encounters an error.

  

II. Problem Two: Cancel Report

When running Oracle Forms and Reports in client/server, users could cancel a report. After converting to the web version of Oracle Forms and Reports users are get a locked screen. If the user wants to run another report without waiting for the current report to finish, I have found that users close the browser and start another session.

Solution: I created a ReportMonitor JavaBean that launches a separate applet, from the current forms session, that has a "Cancel Report" button so users can cancel the report and continue with what they were doing.

Download the  ReportMonitor Demo, overview, source and installation instructions


The zip file contains all the necessary documentation to install and configure this bean.
Read carrefully the Installation.rtf file that explains step by step how to configure the tool that needs external JAR files to run.
For any question concerning this bean, send a mail to Casey at
cbowden@dsdmail.net

Partager cet article
Repost0
19 mai 2007 6 19 /05 /mai /2007 15:15

Purpose

Here is a Java bean to dynamically handle menu options at runtime.

Dynamic Menu


Dynamic Menu

You can dynamically add, remove, enable, disable, show and hide menus and menu options.


The Java code

     DynamicMenu.java



The implementation class of the Bean Item

     oracle.forms.fd.DynamicMenu


The methods you can set



Set the menu and menu option graphical properties

Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'props' ) ;

props is : menu_type, font_name, weight,size[,foreground_color[,background_color]]

menu_type can be MenuBar or MenuOption


e.g. :
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuBar,Tahoma,B,14,r255g255b255,r255g0b0' ) ;
   


Read the current menu

It is used to get the starting Forms current menu to set the given graphical properties.

Set_Custom_Property('BL.BEAN', 1, 'GET_MENU', '' ) ;

 

Add a popup menu

Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU', 'menu_name,menu_label' ) ;

Adds a new popup menu at the end of the menu bar


e.g. :
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU', 'Main.Menu1,Menu1' ) ;
   

 

Add a menu option to an existing popup menu

Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'props' ) ;

 

props is : internal_menu_name, label, command [, tooltip [,image] ]


internal_menu_name is the name given to the menu option -> e.g: Menu1.Option1


- If you want to provide image name, but no tooltip, put '-' instead of tooltip text


note: Image size for menu option is generally 16x16 pixels.


If the given parent's popup menu does not exists, the method does nothing.

e.g. :

-- Tooltip and no icon --
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.Opt1,Option 1,Exit-Form','Option to exit the current form' ) ;

-- no tooltip but icon --
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu2.Opt3,Option 3,instruction3,-,C:/dev/gif/icon-16.gif' ) ;

 

  

 

Add an option menu's separator

Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'internal_option_name,SEPARATOR' ) ;

internal_option_name is the name given to the menu option -> e.g: Menu1.Sep1

e.g. :

Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.sep1,SEPARATOR' )


 

 

 

Show/Hide a popup menu

Set_Custom_Property('BL.BEAN', 1, 'VISIBLE_MENU', 'Menu1,true|false' ) ;

 

Enable/Disable a popup menu

Set_Custom_Property('BL.BEAN', 1, 'STATUS_MENU', 'Menu1,true|false' ) ;

 

Remove a menu option

Set_Custom_Property('BL.BEAN', 1, 'REMOVE_MENU_OPTION', 'Menu1.Opt10' ) ;

 

Show/Hide a menu option

Set_Custom_Property('BL.BEAN', 1, 'VISIBLE_MENU_OPTION', 'Menu1.Opt4, true|false' ) ;

 

Enabled/Disable a menu option

Set_Custom_Property('BL.BEAN', 1, 'STATUS_MENU_OPTION', 'Menu1.Opt4, true|false' ) ;

 

Move the "Window" system menu at end of the menu bar

Set_Custom_Property('BL.BEAN', 1, 'MOVE_WIN_MENU_OPTION', '' ) ;

Use this method when you have added all your popup menu to move the Window system popup menu at the end of the menu bar.

 

Here is an exemple of what could be a When-New-Form-Instance trigger:

-- Set menu properties --
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuBar,Tahoma,B,14,r255g255b255,r255g0b0' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuOption,Tahoma,B,14,r128g128b255,r255g255b255' ) ;
-- Get the current menu --
Set_Custom_Property('BL.BEAN', 1, 'GET_MENU', '' ) ;
-- Add a few menu options --
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU', 'Menu1' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.Opt1,Option 1,instruction1' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.Opt2,Option 2,instruction2' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.sep1,SEPARATOR' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.Exit,Exit,Exit-Form' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU', 'Menu1.SubMenu1,SubMenu1' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.SubMenu1.Exit,Exit,Exit-Form' ) ;
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU', 'Menu1.SubMenu1.SubSubMenu1,SubSubMenu1' ) ;  
Set_Custom_Property('BL.BEAN', 1, 'ADD_MENU_OPTION', 'Menu1.SubMenu1.SubSubMenu1.Exit,Exit,Exit-Form' ) ;
-- Move Window system menu at end --
Set_Custom_Property('BL.BEAN', 1, 'MOVE_WIN_MENU_OPTION', '' ) ;


 

 


The event received from the Bean

MENU_MSG


This event tells Forms that a menu option has been clicked.

The command associated to the menu option is read from the MENU_OPTION parameter.

You can get it in a WHEN-CUSTOM-ITEM-EVENT event:

DECLARE
    eventName      Varchar2(30) := :system.custom_item_event;
    eventValues    ParamList;
    eventValueType Number;
    LC$Option      varchar2(100);   
BEGIN
   
   IF (eventName='MENU_MSG') THEN
      -- get the menu message --
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'MENU_OPTION',eventValueType, LC$Option);
      clear_message;
      Message(LC$Option, no_acknowledge) ;
      Synchronize ;
      ---------------------------------
      --  Handle the raised options  --
      ---------------------------------
      If LC$Option = 'Exit-Form' Then
           Exit_Form ;
      End if ;           
   END IF;
   
END;

 


The sample dialog

     . Download the dynamicmenu.zip file
     . Unzip the file
     . copy the dynamicmenu.jar files in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file
     . Open the dynamicmenu.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module


Partager cet article
Repost0
14 mai 2007 1 14 /05 /mai /2007 19:33

Purpose

Here is a Java Bean from Casey Bowden to get back print features lost in Oracle Reports  converting to web environment.

Direct Print

I. Problem One:

Point Of Sale (POS) clients is slow to print.

 

After converting reports from client/server to the web environment, OraRRP utility was used to print reports directly to client’s default printer, without being prompted with a print dialog. Even though OraRRP works as advertised, it does not meet the speed required for a POS terminal.

 

Solution:

In my experience with DirectPrint JavaBean, the time to print a receipt reduced from 12 – 14 seconds to 2 - 3 seconds. Also, DirectPrint JavaBean is downloaded and cached to the client machine when client accessed form that calls for DirectPrint JavaBean.

 

II. Problem Two:

OraRRP utility does not allow printing to named client printer.

 

Because of architectural change from client/server to web, knowledge of the client printers was lost since Report Server resides on the middle tier where knowledge of printers is loaded.

 

Solution:

With DirectPrint JavaBean, programmers can send PDF report output to named client printer. This feature can also be used to send a single report to multiple client printers that are either local or on the network. The exact printer name is required.

 

Conclusion:

DirectPrint JavaBean can be used to restore some print features lost when converting reports from a client/server to web environment.

 

Download the DirectPrint Demo, overview, source and installation instructions


The zip file contains all the necessary documentation to install and configure this bean.
All debug messages are output on the Java console. Set the debug property to ON to display them.
For any question concerning this bean, send a mail to Casey at
cbowden@dsdmail.net

Partager cet article
Repost0
12 mai 2007 6 12 /05 /mai /2007 21:13

Purpose

Here is a Java bean that allows decorating the Forms application containers.

Personalize

It becomes very easy to change all the fonts of a Forms application at runtime.

You can set the Font Family, weight and size, foreground and background color on the
following elements:

  • . Menu bar
  • . Menu options
  • . Window title (font only)
  • . Items
  • . Status bar




The Java code

    Personalize.java



The implementation class of the Bean Item

     oracle.forms.fd.Personalize


The methods you can set



Set the element properties
  

Set_Custom_Property( 'BL.BEAN', 1, 'SET_PROPERTIES', 'properties' );

properties is : Element_type, Font name, Font weight, Font size[, Foreground color, Background color]

Element_type can be:

  • . TextField
  • . TextArea
  • . Button
  • . CheckBox
  • . RadioB
  • . Tree
  • . ComboBox
  • . PopList
  • . TList
  • . Tree
  • . MenuBar
  • . MenuOption
  • . Status
  • . Window

 

e.g. :

Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'TextField,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Button,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'CheckBox,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'RadioB,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Tree,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'ComboBox,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Tree,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuBar,Tahoma,B,14,r255g128b0,r200g255b150' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuOption,Tahoma,B,14,r0g185b90,r255g255b150' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Status,Tahoma,B,12,r255g255b255,r0g185b90' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Window,Tahoma,B,14' )
   
 

Start the decoration

Set_Custom_Property( 'BL.BEAN', 1, 'BEANINFO', '' );

 


The sample dialog

     . Download the personalize.zip file
     . Unzip the file
     . copy the personalize.jar files in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file
     . Open the personalize.fmb module (Oracle Forms 10.1 .2)
     . Compile all and run the module


Partager cet article
Repost0
10 mai 2007 4 10 /05 /mai /2007 17:08

Purpose

Here is a PJC that allows doing some basic operations on a Text Item.
You can apply styles on the selected sub-text and also view the HTML result in a browser window.
It is a "light" component that does not render the HTML result itself, but has the benefit to stay a simple PJC (no Java Bean).

     Basic embeded text

A popup menu is attached to both single and multi-line Text Items.
Select a part of the text, then right-click to display the popup menu.



The Java code

     EmbededTextField.java     EmbededTextArea.java


The implementation class of the
PJCs

     oracle.forms.fd.EmbedeTextField  for a single-line Text Item

     oracle.forms.fd.EmbedeTextArea  for a multi-line Text Item


The methods you can set

  • . Set the case

Set_Custom_Property( 'BL.BEAN', 1, 'CASE', 'case' ) ;

Where case can b:

  •  
    • - UPPER
    • - LOWER
 

 

  • . Set the style

Set_Custom_Property( 'BL.BEAN', 1, 'STYLE', 'style' ) ;

Where style can b:

  •  
    • - BOLD
    • - ITALIC
    • - UNDERLINE

 


The methods you can call


 

  • Get the cursor location in the Text Item

char := Get_Custom_Property( 'BL.BEAN', 1, 'GET_CARET_POSITION' ) ;

The first position is zero (0).

 

  • Get the selection range

char := Get_Custom_Property( 'BL.BEAN', 1, 'GET_RANGE_SELECTION' ) ;

that returns a comma delimited string : start_position,end_position

The first position is zero (0).



The sample dialog

     . Download the embededtext.zip file

     . Unzip the file
     . copy the embededtext.jar file in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add this jar file
     . Open the embedtext.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

Partager cet article
Repost0
1 mai 2007 2 01 /05 /mai /2007 19:40

Purpose

Here is a Java bean that allows querying a POP3 server

POP3 reader

It uses the commons-net-1.4.1.jar JAR file from the Jakarta project.
http://jakarta.apache.org/site/downloads/downloads_commons-net.cgi .

This bean does not use all the functionnalities of the org.apache.commons.net.pop3 classes.
See the documentation provided on the original site to get all availables methods.


The Java code

     POP3Reader.java



The implementation class of the Bean Item

     oracle.forms.fd.POP3Reader


The methods you can call



Set the login information and get the messages
  
 
Set_Custom_Property( 'BL.BEAN', 1, 'SET_LOGIN_INFO', 'login_info' );

login_info is : POP3 server name, username, password
  


e.g. :
LC$Log := 'pop3.free.fr,me@free.fr,my_password' ;
Set_Custom_Property( 'BL.BEAN', 1, 'SET_LOGIN_INFO', LC$Log ) ;
   
 

Clear the message list

Set_Custom_Property( 'BL.BEAN', 1, 'CLEAR_LIST', '' );

Set the maximum length of the message body retrieved

Set_Custom_Property( 'BL.BEAN', 1, 'SET_MAX_LENGTH', 'max_length' );

login_info is : POP3 server name, username, password


e.g. :
Set_Custom_Property( 'BL.BEAN', 1, 'SET_MAX_LENGTH', '32000' ) ;
   
 


Set the message number to get

Set_Custom_Property( 'BL.BEAN', 1, 'SET_MESSAGE', 'num_message' );

In order to get the message content (header and body), you have to set the message number.

e.g. :
Set_Custom_Property( 'BL.BEAN', 1, 'SET_MESSAGE', '3' ) ;
   
 



The properties you can get



Get the total amount of messages available

char := Get_Custom_Property( 'BL.BEAN', 1, 'GET_MESSAGE_COUNT' )  ;

 

  
 
 

 

 

Get the header of the preselected message

LC$Line := Get_Custom_Property( 'BL.BEAN', 1, 'GET_HEADER' )  ;

the string returned contains the subject, from and date information.
The separator is the ^ character.
the sample form contain a function (Split) that is similar to the StringTokenizer Java function

e.g. :
LC$Line := Get_Custom_Property( 'BL.BEAN', 1, 'GET_HEADER' )  ;  
:ENTRIES.SUBJECT := Split( LC$Line, 1, '^' ) ;
:ENTRIES.MFROM := Split( LC$Line, 2, '^' ) ;
:ENTRIES.MDATE := Split( LC$Line, 3, '^' ) ;
   
 

Get the text of the preselected message

char := Get_Custom_Property( 'BL.BEAN', 1, 'GET_MESSAGE' )  ;


e.g. :
message := Get_Custom_Property( 'BL.BEAN', 1, 'GET_MESSAGE' )
   
 

The event received from the Bean

SENDMSG

 

This event tells Forms that a message is sent by the Java Bean.
You can get it in a WHEN-CUSTOM-ITEM-EVENT event:

Declare
 LC$Text        Varchar2(200);
 LC$Rec         Varchar2(10) ;
 LC$Count       Varchar2(10) ; 
 LC$Line        Varchar2(1024);
 eventValues    ParamList;
 eventValueType Number;
Begin
  -- get the message info --
  eventValues := get_parameter_list(:system.custom_item_event_parameters);
  get_parameter_attr(eventValues,'MSGINFO',eventValueType, LC$Text);
  get_parameter_attr(eventValues,'MSGNUM',eventValueType, LC$Rec);
  get_parameter_attr(eventValues,'MSGCOUNT',eventValueType, LC$Count);
  clear_message;
  Message(LC$Text, no_acknowledge) ;

  Set_Custom_Property( 'BL.BEAN', 1, 'SET_MESSAGE', LC$Rec );
 LC$Line := Get_Custom_Property( 'BL.BEAN', 1, 'GET_HEADER' )  ; 
 Go_Block('ENTRIES');
  If To_Number(LC$Rec) > 1 Then Create_Record ; End if ;
 :ENTRIES.NUM := LC$Rec ;
 :ENTRIES.SUBJECT := Split( LC$Line, 1, '^' ) ;
 :ENTRIES.MFROM := Split( LC$Line, 2, '^' ) ;
 :ENTRIES.MDATE := Split( LC$Line, 3, '^' ) ;  
 :ENTRIES.TEXT  := Substr(
                   Get_Custom_Property( 'BL.BEAN', 1, 'GET_MESSAGE' )
                   ,1, 32000 ) ;
 
  Synchronize ;
  If LC$Rec = LC$Count Then
    First_Record ;
    Set_Block_Property('ENTRIES', INSERT_ALLOWED, PROPERTY_FALSE ) ;
    Set_Block_Property('ENTRIES', UPDATE_ALLOWED, PROPERTY_FALSE ) ;    
  End if ;
End;

Java security policy

You need to add the following line to your .../Java/jre1.5.0_11/lib/security/java.policy file:

   permission java.security.AllPermission;

 


The sample dialog

     . Download the pop3reader.zip file
     . Unzip the file
     . copy both commons-net-1.4.1.jar and POP3Reader.jar files in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file
     . Open the pop3reader.fmb module (Oracle Forms 10.1 .2)
     . Compile all and run the module


Partager cet article
Repost0
7 avril 2007 6 07 /04 /avril /2007 08:11
This tool allows the look of your Forms application to be separated from the functional design.
All the decoration elements are read from an external CSS file, as currently done with HTML pages and so both HTML and Forms applications can share a common look and feel.

Oracle Forms Look and Feel

You can download a full description of the tool from OTN


Participe to the project


You can also participate to this project by providing code improvement, CSS tag sections, bug report or simple comments.


If you feel interested in participate to the project, click on the following link:


     Want to participate to the Look and Feel project
Partager cet article
Repost0
23 février 2007 5 23 /02 /février /2007 14:15

 Purpose

Here is a Java bean that allows the Drag 'n Drop within a Swing JTree item.

This bean is proposed by Minas Lyrakis from Greece.


Swing JTree

This bean uses itself the DispatchingBean of Tom Cleymans. (so it needs the sun Java plugin 1.4 at least)

You can Drag 'n Drop nodes within the same tree but also from one tree to another as well.

When dragging a node, p
ress the Ctrl keybord key if you want to keep the original object (COPY).




The implementation class of the Bean Item

     pack1.SWTree

The bean has to be initialized at startup of the form:

When-New-Form-Instance trigger:

fbean.register_Bean('BLOCK.BEAN',1,'pack1.SWTree');

The public methods

Initialize the JTree

FBean.Invoke('BLOCK.BEAN', 1, 'InitAddNode', '1,1,Node1');




Associate a bean with its forms item

FBean.invoke('BLOCK.BEAN', 1, 'setFormItemName', 'TEST.SWTREE1');

When you put more than one Swing JTree bean area, this command allows to etablish the correspondance between each Java bean and its forms item.



Add a node at runtime:

FBean.Invoke(
              'BLOCK.BEAN',
              1,
              'RunAddNode',
              to_char(gv.NodeNumber) || ', Node' | |to_char(gv.NodeNumber) );




Remove the current node at runtime:

FBean.Invoke('BLOCK.BEAN', 1, 'RunRemoveNode', '' );



The sample dialog

     . Download the SWTree.zip file

     . Unzip the file
     . run the SWTree.sql SQL script file to create the required database objects
     . copy the SWTree1.jar file in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add this jar file
     . Open the test_SWTree2.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module
     . This bean needs the Sun Java plugin 1.4 at least

Partager cet article
Repost0
13 février 2007 2 13 /02 /février /2007 19:39

This Bean contains a functionality to change Font information on Form Items.
The current Font properties of the Item choosen in the ComboBox will also be reflected in the Beans.
Available Functions: Bold, Italic, Strikethrough (only on TextItems), Underline (only on TextItems), Size, Change Font.
Additional you can Save and Open the formatting of a Form & do an automatic Open of this file at Form startup.


Formatting


This bean is proposed by Tom Cleymans from Belgium.

Read the article

Partager cet article
Repost0
7 février 2007 3 07 /02 /février /2007 14:14

Purpose

Here is a package that allows the dispatching of events from Java Beans to Forms on Beans that extend VBean, beans that use the FBean package and also PJCs !
No, you are not dreaming and there is no mist on your glasses, a PJC that dispatch event to the form module !

            Dispatching events


You know that a Bean that extends VButton or VTextField for example cannot use the dispatchCustomEvent() method to send message to Forms, so how could this be possible ?

Tom Cleymans from Belgium brings here the solution.

He decided to attach a class that extends VBean to each PJC, so that it can use the included dispatchCustomEvent() method to send messages to the corresponding Forms' module Bean Area.

As brilliant as simple !

Read the Tom's article then do what you are searching for years.

Partager cet article
Repost0