Thursday, November 30, 2006

How to get the portal passwords

Create a script named: OIDPWD.bat

@echo offREM ####################################################################REM # OIDPWD for IAS 9.0.2REM ####################################################################
if not "%1" == "" goto step0
:usageREM ####################################################################REM # Usage Description REM ####################################################################
set IAS_PASSWORD=welcome1set OIDHOST=hostname.domain.comset OIDPORT=389
echo Usageecho -----echo oidpwd [-w IAS_PASSWORD] [-h OID_HOST] -p [OID_PORT]echo .echo -w IAS_PASSWORD The OID password of "cn=orcladmin"echo Default = %IAS_PASSWORD%echo -h OID_HOST The oid host name echo Default = %OIDHOST%echo -p OID_PORT The port used by OIDecho Default = %OIDPORT%
:step0echo .setlocal
if not "%ORACLE_HOME%" == "" goto step1set ORACLE_HOME=d:\ias902echo You should set ORACLE_HOME in your environment to run this script.echo Using default = %ORACLE_HOME%
:step1
if "%1" == "" goto step2
:arg1if not "%1" == "-w" goto arg2shiftset IAS_PASSWORD=%1shiftgoto step1
:arg2if not "%1" == "-h" goto arg3shiftset OIDHOST=%1shiftgoto step1
:arg3if not "%1" == "-p" goto arg4shiftset OIDPORT=%1shiftgoto step1
:arg4echo "***Error - Unknow option used %1"goto :end
:step2
echo Looking up passwords inside OIDecho ..IAS_PASSWORD = %IAS_PASSWORD%echo ..OIDHOST = %OIDHOST%echo ..OIDPORT = %OIDPORT%echo .echo --- portal ---%ORACLE_HOME%\bin\ldapsearch -h %OIDHOST% -p %OIDPORT% -D cn=orcladmin -w %IAS_PASSWORD% -b "cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext" -s sub "orclResourceName=portal" orclpasswordattributeecho .echo --- orasso ---%ORACLE_HOME%\bin\ldapsearch -h %OIDHOST% -p %OIDPORT% -D cn=orcladmin -w %IAS_PASSWORD% -b "cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext" -s sub "orclResourceName=orasso" orclpasswordattributeecho .echo --- orasso_pa ---%ORACLE_HOME%\bin\ldapsearch -h %OIDHOST% -p %OIDPORT% -D cn=orcladmin -w %IAS_PASSWORD% -b "cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext" -s sub "orclResourceName=orasso_pa" orclpasswordattributeecho .echo --- orasso_ps ---%ORACLE_HOME%\bin\ldapsearch -h %OIDHOST% -p %OIDPORT% -D cn=orcladmin -w %IAS_PASSWORD% -b "cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext" -s sub "orclResourceName=orasso_ps" orclpasswordattributeecho .echo OIDPWD Completed.goto end
:oh_not_setecho ***ERROR: You must set ORACLE_HOME in your environment to run this script.goto end
:endendlocalpause:exit

Change the defaults in the script:

...

set IAS_PASSWORD=welcome1

set OIDHOST=hostname.domain.com

set OIDPORT=389

...

set ORACLE_HOME=d:\ias902...

Where:


IAS_PASSWORD is the main password of iAS and the password of cn=orcladmin user in OID

OIDHOST is the host of OID
OIDPORT is the port of OID
ORACLE_HOME is the home where the program will use LDAPSEARCH

Run the bat file


Tuesday, November 28, 2006

Demo Script (Win) - Migrating & compiling forms application

@ECHO OFF
REM WINDOWS Migrate FORMS
Echo migrating Forms....

del E:\Logs\*.log

Echo *************************** start ******************************************

set forms_path=D:\oracle\OraMT\forms;E:\apps\forms;E:\apps\lib;E:\apps\menu;E:\apps\pll;E:\apps\template

del E:\apps\pll\*.plx
del E:\apps\pll\*.err

e:

cd E:\apps\pll

for %%f IN (*.pll) do frmcmp Module_type=LIBRARY Module=%%f userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
ECHO FINISHED Migrating PLL

del E:\apps\template\*.fmx
del E:\apps\template\*.err

e:
cd E:\apps\template

for %%f IN (*.fmb) do call frmplsqlconv mode=batch module=%%f userid=username/password@database log=e:\logs\%%f.log

for %%f IN (*.fmb) do frmcmp Module_type=form Module=%%f userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
ECHO FINISHED Migrating Temaplate

del E:\apps\menu\*.mmx
del E:\apps\menu\*.err

e:
cd E:\apps\menu

for %%f IN (*.mmb) do call frmplsqlconv mode=batch module=%%f userid=username/password@database log=e:\logs\%%f.log

for %%f IN (*.mmb) do frmcmp Module_type=menu Module=%%f userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes strip_source=NO
ECHO FINISHED Migrating Menus

del E:\apps\forms\*.fmx
del E:\apps\forms\*.err

e:
cd E:\apps\forms

for %%f IN (*.fmb) do call frmplsqlconv mode=batch module=%%f userid=username/password@database log=e:\logs\%%f.log

for %%f IN (*.fmb) do frmcmp Module_type=form Module=%%f userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes strip_source=NO
ECHO FINISHED Migrating Forms

Echo *************************** end *****************************************

Demo script (Linux) - Compiling forms application

setenv FORMS_PATH=$ORACLE_HOME/forms;/apps/forms;/apps/lib;/apps/menu;/apps/pll;/apps/template
export FORMS_PATH

rm /apps/pll/*.plx
rm /apps/pll/*.err

cd /apps/pll

for file in *.pll do frmcmp_batch.sh Module_type=LIBRARY Module=$ff userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
done

rm /apps/template/*.fmx
rm /apps/template/*.err

cd /apps/template

for file in *.fmb do frmcmp_batch.sh Module_type=form Module=$ff userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
done

rm /apps/menu\*.mmx
rm /apps/menu/*.err

cd /apps/menu

for file in *.mmb do frmcmp_batch.sh Module_type=menu Module=$ff userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
done

rm /apps/forms/*.fmx
rm /apps/forms/*.err

cd /apps/forms

for file in *.fmb do frmcmp_batch.sh Module_type=form Module=$ff userid=username/password@database upgrade=yes batch=yes window_state=minimize compile_all=yes
done

Tuesday, November 07, 2006

Fonts in Web Forms

How to control fonts in web form?:

There are 2 relevent config files:
1. \forms\java\oracle\forms\registry\Registry.dat
server side file - no deployment problems
2. C:\Program Files\Oracle\JInitiator 1.3.1.22\lib\font.properties
client side file - instaled with the JInitiator and we will need to distribute the new file to the clients

The first file map font names from the forms application to java forn name:
default.fontMap.appFontnames=Courier New,Courier,courier,System......
default.fontMap.javaFontnames=MonoSpaced,MonoSpaced,Dialog,Serif.....

so that courier new will become monospace in the web application
and Courier =MonoSpaced
courier = Dialog
System = Serif
and so on.

If there is a font in the form that we want to change to another font then we need to add the font name and the java font name to the list.

Default Java fonts (case sensitive):
Monospaced (fixed length fonts)
Dialog
Serif
SansSerif

Now the second file: font.properties OR font.properties. (depends on the client's "regional setings")

In this file the first part maps jave font names to local font names.

For each java font there is maping to a local font with all different situations he might face (bold, Italic..).

e.g.
dialog.plain.0=Arial,DEFAULT_CHARSET
Dialog Java font will become Arial at the local machine.

monospaced.plain.0=Courier New,DEFAULT_CHARSET
MonoSpaced Java font will become Courier New at the local machine.


Later in this file we need to define where to find those fonts on the client:
filename.Arial=ARIAL.TTF
filename.Courier_New=COUR.TTF

Now the only problem is how to distribute this files to all client (hint - we use the JInitiator installation for it).
This will be coverd in a different post.

Cheers