Forms Resizer Documentation: Full Version

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Forms Resizer Documentation

Full Version
Content
Presentation..........................................................................................3
Installation............................................................................................4
Forms module process............................................................................6
Adjusting object properties....................................................................10
Form properties.................................................................................11
Canvas properties..............................................................................12
Block properties................................................................................14
Item properties.................................................................................17
Visual Attribute properties..................................................................22
Alert properties.................................................................................24
Window properties.............................................................................25
Rebuild the Java project.........................................................................27
Warnings and recommandations.............................................................28
Presentation

Purpose

The Forms Resizer tool allows the Oracle Forms developer to give a new
size to the Forms modules, in order to adapt the application to a new
screen resolution/size.
It uses a JDAPI program that scans the Forms modules, then adjust the
size and location of any object that could be displayed.
That JDAPI program requires a description file that gives indication about
what to do at process time.
In that file, you give the current and target resolution, but you can also
change many properties on existing objects.

How it works

A Java program, packed in a JAR file, read the configuration information


from a XML file, then open the given Forms modules to scan its objects in
order to adjust both location ans size information to suit the new
resolution.
This program is based on the Oracle Forms JDAPI API, so it needs a valid
Oracle Developer Suite installed on the machine that will scan the Forms
modules.
The XML file contains all the required information in order to open the list
of concerned modules, then apply all the modification described.
Installation

Unzip the forms_resizer.zip file.

Check out the content:

• resizer.xml
• FormsResizer.jar
• FormsResizer.bat
• FormsResizer.pdf
• resizer_test.fmb

resizer.xml is the configuration file required to convert your


existing modules

FormsResizer.jar is the Java program that will process your


existing modules

FormsResizer.bat is a DOS batch file to start the process

resizer_test.fmb is a sample dialog to test (Forms 10.1.2).

FormsResizer.pdf this documentation.

ResizerSources.zip the JDeveloper sources to build the project.

• Copy the JAR file in your <DEVSUITE_HOME>/forms/java/ folder.

• Adapt the FormsResizer.bat file to suit your own installation.


• If uou intend to modify or rebild the JAR file, unzip the
ResizerSources.zip in a folder, then open it with Oracle Jdeveloper. It has
been created with Jdeveloper 10.1.3.1.
In the Jdeveloper project you have to add the frmall.jar and frmjdapi.jar
to the libraries folder.
Forms module process

A Java Program packed in a JAR file (FormsResizer.jar) is required to


scan your existing modules.
You can use the FormsResizer.bat DOS batch file to start it.

Modify this file to suit your own installation.

cmd /k "<JRE_HOME>/bin/java.exe" -classpath


<DEVSUITE_HOME>/forms/java/FormsResizer.jar;<DEVSUITE_HOME>/forms/java/frm
jdapi.jar; oracle.forms.fd.Resizer resizer.xml

Change the <JRE_HOME> to point to your folder where the JRE is


installed.
Change the <DEVSUITE_HOME> to point to your folder where Oracle
Forms is installed.

For instance, say that your JRE is located in the c:/Java/jre1.6, and Forms
is installed in the c:/devsuite folder, and the resizer.xml file is located in the
current folder, change the batch content to the following:

cmd /k "c:/java/jre1.6/bin/java.exe" -classpath


c:/devsuite/forms/java/FormsResizer.jar;<DEVSUITE_HOME>/forms/java/frmjdap
i.jar; oracle.forms.fd.Resizer resizer.xml

 If you are running a Forms 9i version, change frmjdapi.jar to


f90jdapi.jar.
Modify the resizer.xml file to suit your needs.

<file>
<!-- --------------------------------- -->
<!-- general configuration information -->
<!-- --------------------------------- -->
<configuration>
<backup_directory>./</backup_directory>
<target_directory>./</target_directory>
<module_list>
<name>resizer_test.fmb</name>
</module_list>
<log_file_name>resizer.log</log_file_name>
<backup_ext>_bak</backup_ext>
<new_ext>_new</new_ext>
<log_detail>true</log_detail>
<connection_string>user/pwd@XE</connection_string>
<compile_module>false</compile_module>
<comment>module modified by FormsResizer on :SYSDATE</comment>
<libraries_case>to_lower_case</libraries_case>
<source_resolution>800,600</source_resolution>
<target_resolution>1024,800</target_resolution>
<replace_Set_Item_Property>true</replace_Set_Item_Property>
</configuration>
<!-- ---------------------- -->
<!-- properties for modules -->
<!-- ---------------------- -->
<properties>
<form>
<set><property>setComment</property><value>new comment</value></set>
<set><property>setTitle</property><value>Resizer title</value></set>
</form>
<blocks>
<set><property>setComment</property><value>new block comment</value></set>
</blocks>
<items>
<set><type>PushButton</type><property>setFontName</property><value>Courier</value></set>
<set><property>setForegroundColor</property><value>r250g250b250</value></set>
<set><property>setBackColor</property><value>r10g10b10</value></set>
</items>
</properties>
</file>
<backup_directory>
Name of the directory used to backup a copy of the source file.
If left empty, the backup copy is created in the current directory.
Default value : none

<target_directory>
Name of the directory used to create the converted source file.
If left empty, the new file is created in the current directory.
Default value : none

<module_list>
Full filename to the Forms source file (.fmb) to convert.
This can also be a directory, so that all files inside that has the .fmb extension
will be converted.

<log_file_name>
full filename to the log file created by the last conversion process.
default is : magnifier.log

<backup_ext>
extension add to the backup copy.
Default value : _bak

<new_ext>
extension add to the converted source file.
If left blank, the source file is replaced by the new one.
Default value : none

<connection_string>
The full connexion used to compile the modules

<compile_module> true | false


boolean that describes if the converted module has to be compiled.
Default value : false
<comment>
Text put into the form-level Comments property
Default value : none

<trace> true | false


Indicates if the runtime information have to be consigned in a log file.
Set this property to true at first time you convert the module, if you see
incorrect behavior at runtime.
Set it to false when the result is correct, and you deliver the converted modules
to production.
Default value : false

<trace_file>
Full name of the trace file created if the <trace> property is set to true.
Default value : magnifier.trc

<libraries_case> to_lower_case | to_upper_case


Indicates if the attached library names have to be converted to lower or upper
case

<source_resolution>
Resolution, given in pixel (width,height), of the current Forms module.

<target_resolution>
Final resolution, given in pixel (width,height), of the new Forms module.

<font_factor>
Value, in percentage, to scale the font size of Text Items and List Items.
Default value : 1.0
If you want to increase the Forms application size, but also allow the user to
see more characters in the Text and List Items, put a value less than 1. For
instance, 0.5 will divide the Font size by 2.

<replace_Set_Item_Property>
If set to true, the PL/SQL code located in the Forms module is scanned, trying
to adjust the value of any Set_Item_Property() built-in that deals with location
or size. If the position or size is given with a hard-coded value, the conversion
is immediately done to adjust them, otherwise (the value is passed via a
variable), a message is raised on the console and log file, to tell that the built-in
has to be adjusted manually.
Adjusting object properties

Some properties can be adjusted during the process, via the XML file
tags.

A first tag indicates the Object type, for instance <items>. It can include
as many <set> tags required to do the adjustment. You need one <set>
tag for every different property.

<items>
<set>
<type>PushButton</type>
<property>setFontName</property>
<value>Courier</value>
</set>
<set>
<property>setForegroundColor</property>
<value>r250g250b250</value>
</set>
<set>
<property>setBackColor</property>
<value>r10g10b10</value>
</set>
</items>

The Boolean properties accept only two value: true or false


Some of the Integer properties require some Forms constants. You can
find the complete constant list by following this link.

Here is the list of the objects you can modify the properties:

• Form
• Canvas
• Block
• Item
• Visual Attribute
• Alert
• Window
Form properties

XML file syntax:

<form>
<set><property>property_name</property><value>value</value></set>
<set>...</set>
</form>

Char properties:
• setComment
• setConsoleWindow
• setFirstNavigationBlockName
• setHelpBookTitle
• setHorizontalToolbarCanvas
• setInitializeMenu
• setMenuModule
• setMenuRole
• setName
• setRecordVisualAttributeGroupName
• setTitle
• setVerticalToolbarCanvas

Boolean properties:
• setUse3dControls

Integer properties:
• setInteractionMode
• setIsolationMode
• setLanguageDirection
• setMaximumQueryTime
• setMaximumRecordsFetched
• setMouseNavigationLimit
• setNewdeferReqEnf
• setRuntimeComp
• setValidationUnit
Canvas properties

XML file syntax:

<canvases>
<set>
<name>canvas_name</name> (not mandatory)
<property>property_name</property>
<value>value</value>
</set>
<set>...</set>
</canvases>

Char properties:
• setBackColor
• setComment
• setFillPattern
• setFontName
• setForegroundColor
• setHelpBookTopic
• setName
• setParentFilename
• setParentFilepath
• setParentModule
• setParentName
• setPopupMenuName
• setVisualAttributeName
• setWindowName

Boolean properties:
• setRaiseOnEnter
• setShowHorizontalScrollbar
• setShowVerticalScrollbar
• setSubclassObjectGroup
• setVisible

Integer properties:
• setBevel
• setCanvasType
• setFontSize
• setFontSpacing
• setFontStyle
• setFontWeight
• setHeight
• setLanguageDirection
• setParentModuleType
• setParentType
• setTabActionStyle
• setTabAttachmentEdge
• setTabStyle
• setTabWidthStyle
• setViewportHeight
• setViewportWidth
• setViewportXPosition
• setViewportXPositionOnCanvas
• setViewportYPosition
• setViewportYPositionOnCanvas
• setWidth
Block properties

XML file syntax:

<blocks>
<set>
<name>block_name</name> (not mandatory)
<property>property_name</property>
<value>value</value>
</set>
<set>...</set>
</blocks>

Char properties:
• setAlias
• setBackColor
• setComment
• setDeleteProcedureName
• setDMLDataName
• setFillPattern
• setForegroundColor
• setInsertProcedureName
• setLockProcedureName
• setName
• setNextNavigationBlockName
• setOptionHint
• setOrderByClause
• setParentFilename
• setParentFilepath
• setParentModule
• setParentName
• setPreviousNavigationBlockName
• setQueryDataSourceName
• setRecordVisualAttributeGroupName
• setScrollbarCanvasName
• setScrollbarTabPageName
• setUpdateProcedureName
• setVisualAttributeName
• setWhereClause
Boolean properties:
• setDatabaseBlock
• setDeleteAllowed
• setDMLReturnValue
• setEnforcedColumnSecurity
• setEnforcedPrimaryKey
• setIncludeRefitem
• setInsertAllowed
• setPrecompSummary
• setQueryAllowed
• setQueryAllRecords
• setReverseDirection
• setSingleRecord
• setSubclassObjectGroup
• setUpdateAllowed
• setUpdateChangedColumns

Integer properties:
• setDMLDataType
• setKeyMode
• setLanguageDirection
• setLockMode
• setMaximumQueryTime
• setMaximumRecordsFetched
• setNavigationStyle
• setParentModuleType
• setParentType
• setQueryDataSourceType
• setRecordOrientation
• setRecordsBufferedCount
• setRecordsDisplayCount
• setRecordsFetchedCount
• setScrollbarLength
• setScrollbarOrientation
• setScrollbarWidth
• setScrollbarXPosition
• setScrollbarYPosition
Item properties

XML file syntax:

<items>
<set>
<type>item_type</type> (not mandatory)
<name>item_name</name> (not mandatory)
<property>property_name</property>
<value>value</value></set>
<set>...</set>
</items>

The <type> tag (that is not mandatory) can be provided to filter the type of Items you
want to change the property.
It can be one of the following:

• all
• BeanArea
• Chart
• CheckBox
• DisplayItem
• Tree
• Image
• List
• PushButton
• RadioButton
• TextItem

For example, if you want to change the text color of PushButtons only, set the tags like
the following:
<set>
<type>PushButton</type>
<property>setForegroundColor</property>
<value>r200g25b25</value></set>
<set>...</set>

The <name> tag (that is not mandatory) can be provided to filter the exact Item you
want to change the property.
Char properties:
• setAccessKey
• setBackColor
• setCanvasName
• setCheckedValue
• setColumnName
• setComment
• setCopyValueFromItem
• setDataSourceBlock
• setEditName
• setFilename
• setFillPattern
• setFontName
• setForegroundColor
• setFormatMask
• setFormula
• setHelpBookTopic
• setHighestAllowedValue
• setHint
• setIconFilename
• setImplementationClass
• setInitializeValue
• setLabel
• setLovName
• setLowestAllowedValue
• setName
• setNextNavigationItemName
• setOtherValues
• setPopupMenuName
• setPreviousNavigationItemName
• setPrompt
• setPromptBackColor
• setPromptFillPattern
• setPromptFontName
• setPromptForegroundColor
• setPromptVisualAttributeName
• setRecordGroupName
• setRecordVisualAttributeGroupName
• setSummaryBlockName
• setSummaryItemName
• setSynchronizedItemName
• setTabPageName
• setTooltip
• setTooltipVisualAttributeGroup
• setTreeDataQuery
• setUncheckedValue
• setVisualAttributeName

Boolean properties:
• setAutoHint
• setAutoSkip
• setCaseInsensitiveQuery
• setConcealData
• setDatabaseItem
• setDefaultButton
• setDirtyInfo
• setEnabled
• setFixedLength
• setIconic
• setInsertAllowed
• setKeepCursorPosition
• setKeyboardNavigable
• setLockRecord
• setMouseNavigate
• setMultiLine
• setPrimaryKey
• setQueryAllowed
• setQueryOnly
• setRendered
• setRequired
• setShowFastForward
• setShowHorizontalScrollbar
• setShowPlay
• setShowRecord
• setShowRewind
• setShowSlider
• setShowTime
• setShowVerticalScrollbar
• setShowVolume
• setTreeAllowEmpBranch
• setTreeMultiSelect
• setTreeShowLines
• setTreeShowSymbol
• setUpdateAllowed
• setUpdateCommit
• setUpdateIfNull
• setUpdateQuery
• setValidateFromList
• setVisible

Integer properties:
• setBevel
• setCalculateMode
• setCaseRestriction
• setCheckBoxOtherValues
• setCommMode
• setCompress
• setCompressionQuality
• setDataLengthSemantics
• setDataType
• setDisplayQuality
• setDistanceBetweenRecords
• setEditXPosition
• setEditYPosition
• setExecuteMode
• setFontSize
• setFontSpacing
• setFontStyle
• setFontWeight
• setHeight
• setImageDepth
• setImageFormat
• setInitializeKeyboardDirection
• setItemsDisplay
• setItemType
• setJustification
• setKeyboardState
• setLanguageDirection
• setListStyle
• setLovXPosition
• setLovYPosition
• setMaximumLength
• setPromptAlign
• setPromptAlignOffset
• setPromptAttachmentEdge
• setPromptAttachmentOffset
• setPromptDisplayStyle
• setPromptFontSize
• setPromptFontSpacing
• setPromptFontStyle
• setPromptFontWeight
• setPromptJustification
• setPromptReadingOrder
• setQueryLength
• setReadingOrder
• setSizingStyle
• setSoundFormat
• setSoundQuality
• setSummaryFunction
• setWidth
• setWrapStyle
• setXPosition
• setYPosition
Visual Attribute properties

XML file syntax:

<visual_attributes>
<set>
<name>visual_attribute_name</name> (not mandatory)
<property>property_name</property>
<value>value</value>
</set>
<set>...</set>
</visual_attributes>

Char properties:
• setBackColor
• setComment
• setFillPattern
• setFontName
• setForegroundColor
• setFrameTitleBackColor
• setFrameTitleFillPattern
• setFrameTitleFontName
• setFrameTitleForegroundColor
• setName
• setPromptBackColor
• setPromptFillPattern
• setPromptFontName
• setPromptForegroundColor
• setFontSize
• setFontSpacing
• setFontStyle
• setFontWeight
• setFrameTitleFontSize
• setFrameTitleFontSpacing
• setFrameTitleFontStyle
• setFrameTitleFontWeight
• setPromptFontSize
• setPromptFontSpacing
• setPromptFontStyle
• setPromptFontWeight
• setVisualAttributeType
Alert properties

XML file syntax:

<alerts>
<set>
<name>alert_name</name> (not mandatory)
<property>property_name</property>
<value>value</value>
</set>
<set>...</set>
</alerts>

Char properties:
• setAlertMessage
• setBackColor
• setButton1Label
• setButton2Label
• setButton3Label
• setComment
• setFillPattern
• setFontName
• setForegroundColor
• setName
• setTitle
• setVisualAttributeName

Boolean properties:
• setSubclassObjectGroup

Integer properties:
• setAlertStyle
• setDefaultAlertButton
• setFontSize
• setFontSpacing
• setFontStyle
• setFontWeight
• setLanguageDirection
Window properties

XML file syntax:

<windows>
<set>
<name>window_name</name> (not mandatory)
<property>property_name</property>
<value>value</value>
</set>
<set>...</set>
</windows>

Char properties:
• setBackColor
• setComment
• setFillPattern
• setFontName
• setForegroundColor
• setHelpBookTopic
• setHorizontalToolbar
• setIconFilename
• setMinimizeTitle
• setName
• setParentFilename
• setParentFilepath
• setParentModule
• setParentName
• setPrimaryCanvas
• setTitle
• setVerticalToolbarCanvasName
• setVisualAttributeName

Boolean properties:
• setClearAllowed
• setHideOnExit
• setInheritMenu
• setMaximizeAllowed
• setMinimizeAllowed
• setModal
• setMoveAllowed
• setResizeAllowed
• setShowHorizontalScrollbar
• setShowVerticalScrollbar
• setSubclassObjectGroup

Integer properties:
• setBevel
• setFontSize
• setFontSpacing
• setFontStyle
• setFontWeight
• setHeight
• setLanguageDirection
• setParentModuleType
• setParentType
• setWidth
• setWindowStyle
• setXPosition
• setYPosition
Rebuild the Java project

The ResizerSources.zip contains the JDeveloper sources to build the


project.
Unzip that file in a directory, then open it with the Oracle Jdeveloper tool.
To compile, you need to add the frmall.jar and frmjdapi.jar files to the
project → Properties → Libraries section.

Here is the list of the Java classes:

• AlertObject.java (to handle alerts)


• BlockObject.java (to handle blocks)
• CanvasObject.java (to handle canvases)
• EditorObject.java (to handle editors)
• ErrorException.java
• FormObject.java (to handle forms modules)
• GraphicObject.java (to handle graphics)
• ItemObject.java (to handle items)
• LovColumnObject.java (to handle LOV columns)
• LovObject.java (to handle LOVs)
• RecordGroupColumnObject.java (to handle Record Group columns)
• RecordGroupObject.java (to handle Record Groups)
• Resizer.java (Main class)
• TriggerObject.java (to handle triggers)
• VisualAttributeObject.java (to handle Visual Attributes)
• WindowObject.java (to handle Windows)

The conversion is done via the methods of the main class: Resizer.java
Warnings and recommandations

The Forms Resizer is free to use, modify and use in any development
and production applications.
There is no licence at all attached to that tool. I give it to the community
without any restriction.

Just keep in mind that I won't give any maintenance version of the tool and
will never continue to support that product in any way. So do not send me any
request concerning the questions or bugs you will find. It is, now, your
responsibility to play and work with it :)
Forms Resizer - 2011
Created and maintained by Francois Degrelle

Forms Resizer Web site


email : [email protected]

You might also like