Thursday, March 13, 2008

checkout hidden oarameters

SELECT
x.ksppinm name,
y.ksppstvl VALUE,
decode(ksppity,
1, 'BOOLEAN',
2, 'STRING',
3, 'INTEGER',
4, 'PARAMETER FILE',
5, 'RESERVED',
6, 'BIG INTEGER',
'UNKNOWN') typ,
decode(ksppstdf,
'TRUE', 'DEFAULT VALUE',
'FALSE', 'INIT.ORA') isdefault,
decode(bitand(ksppiflg / 256, 1),
1, 'IS_SESS_MOD(TRUE)',
'FALSE') isses_modifiable,
decode(bitand(ksppiflg / 65536, 3),
1, 'MODSYS(NONDEFERED)',
2, 'MODSYS(DEFERED)',
3, 'MODSYS(*NONDEFERED*)',
'FALSE') issys_modifiable,
decode(bitand(ksppstvf, 7),
1, 'MODIFIED_BY(SESSION)',
4, 'MODIFIED_BY(SYSTEM)',
'FALSE') is_modified,
decode(bitand(ksppstvf, 2),
2, 'ORA_STARTUP_MOD(TRUE)',
'FALSE') is_adjusted,
ksppdesc description,
ksppstcmnt update_comment
FROM x$ksppi x,
x$ksppcv y
WHERE x.inst_id = userenv('Instance')
AND y.inst_id = userenv('Instance')
AND x.indx = y.indx
AND x.ksppinm LIKE '%optim%';

Tuesday, March 04, 2008

Keyboard state - hebrew

1) Compile the java code to generate the class files.


++ Since the sample code uses forms classes also, it is necessary to include the frmall.jar(10.1.2)/f90all.jar(9.0.4) in CLASSPATH before compilation.


set CLASSPATH=%ORACLE_HOME%\forms\java\frmall.jar;%CLASSPATH% (in 10.1.2 windows)

%ORACLE_HOME%\jdk\bin\javac ChangeInputMethodOnFocus.java 

%ORACLE_HOME%\jdk\bin\javac VTextFieldHeb.java

%ORACLE_HOME%\jdk\bin\javac VTextFieldEng.java

2) Generate the jar file with the 'jar' command to package the class files in step 1.


%ORACLE_HOME%\jdk\bin\jar -cvf InputMethod.jar VTextFieldEng.class VTextFieldHeb.class ChangeInputMethodOnFocus.class

3) Place the jar file in the codebase directory of Forms which is ORACLE_HOME/forms90/java(9.0.4 version) or ORACLE_HOME/forms/java(10.1.2 version) directory by default.


4) Include the jar file in the archive parameter in formsweb.cfg to enable the jar file to be downloaded and cached on the client machine.


archive=frmall.jar,InputMethod.jar

5) Set the 'Implementation Class' property in the form to 'VTextFieldHeb' for the Hebrew text items and 'VTextFieldEng' for english text items where this functionality is required.



Sample Code

-------------------ChangeInputMethodOnFocus.java--------------------


import java.awt.Component; 
import java.awt.event.FocusAdapter; 

import java.awt.event.FocusEvent; 
import java.awt.im.InputContext; 
import java.util.Locale; 

public class ChangeInputMethodOnFocus extends FocusAdapter 

Locale _locale;
class="km">Locale defLocale;
public ChangeInputMethodOnFocus(Locale locale) 

_locale = locale; 


public void focusGained(FocusEvent fe) 

Component c = fe.getComponent(); 

InputContext inputContext = c.getInputContext();
defLocale = inputContext.getLocale();
inputContext.selectInputMethod(_locale); 

}
 public void focusLost(FocusEvent fe) {
      Component c = fe.getComponent(); 

      InputContext inputContext = c.getInputContext(); 
      inputContext.selectInputMethod(defLocale); 
    } 
}

 ----------------VTextFieldHeb.java ------------------


import java.util.Locale;
import oracle.forms.handler.IHandler;

import oracle.forms.ui.VTextField;
public class VTextFieldHeb extends VTextField
{
public void init(IHandler ih)

{
super.init(ih);
ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("iw","IL"));
this.addFocusListener(focusAdapter);
}
}


----------------VTextFieldEng.java ------------------


import java.util.Locale;
import oracle.forms.handler.IHandler;

import oracle.forms.ui.VTextField;
public class VTextFieldEng extends VTextField
{
public void init(IHandler ih)

{
super.init(ih);
ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("en","US"));

this.addFocusListener(focusAdapter);
}
}



Sample Code Output

When you navigate to text items which implement the 'VTextFieldHeb' class, the input locale automatically changes to 'HE' (Hebrew)
and you can begin to enter Hebrew characters. Then when you navigate to text items which implement the 'VTextFieldEng' class, the input locale automatically changes to 'EN' (English) and you can enter English characters.


Additional information


This solution is also applicable for arabic language after performing the following:
1)-On the client machine ,set "Arabic
(Egypt)" as an input keyboard language.

2)-In the above code,change:
ChangeInputMethodOnFocus (new Locale("iw","IL"));


To be:

ChangeInputMethodOnFocus (new Locale("ar","EG"));