In Oracle Application Framework (OAF), you can use the getXSID() method of the OAFwkUtil class to get the current XSID (cross-session ID). The XSID is a unique identifier that is generated for each user session in OAF.
Here is an example of how you might use the getXSID() method in an OAF application:
Sql for this : select XSID from icx_sessions
Simple , You can use this (import this before any work WebAppsContext)
String xsid = webAppsContext.getEnvStore().setEnv("ICX_SESSION_COOKIE_VALUE");
Explanation:If you are trying to retrieve the value of the ICX_SESSION_COOKIE_VALUE environment variable and store it in a variable called xsid, you can use the getEnvStore().setEnv() method of the webAppsContext object in your code. This method will retrieve the value of the specified environment variable and store it in the xsid variable.
It is important to note that the getEnvStore().setEnv() method will only work if the ICX_SESSION_COOKIE_VALUE environment variable has been set in the environment where your code is running. If the variable has not been set, the setEnv() method will return null.
I hope this helps clarify how to retrieve the value of an environment variable using the getEnvStore().setEnv() method.
Oracle Tutorial, We have covered all Oracle articles which includes Oracle Database, Application, Framework, Oracle HRM, ADF Training and Financial Training. Further more we have queries and scripts for Oracle EBS Modules.
Showing posts with label ADF. Show all posts
Showing posts with label ADF. Show all posts
Thursday, 5 January 2023
Wednesday, 29 April 2020
OAF Current Row Values
Add Current Row Values in Event Parameters.
Parameters: Open dialog and add parameters by choosing your own Parameter name and its value from current row.
${oa.FileSetupVO1.SrlFileSetupId}
FileSetupVO1 is my view name
Tuesday, 12 November 2019
Alert Using JavaScript in OAF
if(pageContext.getParameter("SubmitButton")!=null)
{
StringBuffer l_buffer = new StringBuffer();
l_buffer.append("javascript:alert('hello')");
pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
}
Here SubmitButton is the id name of submitbutton
l_buffer is the variable name of StringBuffer
{
StringBuffer l_buffer = new StringBuffer();
l_buffer.append("javascript:alert('hello')");
pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
}
Here SubmitButton is the id name of submitbutton
l_buffer is the variable name of StringBuffer
Tuesday, 5 November 2019
Retrieving Script Engines in Java
A script engine registers alias names with the scripting framework.
For example, the built-in Rhino scripting registers the following names with the scripting framework:
- js
- rhino
- JavaScript
- javascript
- ECMAScript
- ecmascript
import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; public class GetEngineByName { public static void main(String[] args) { ScriptEngineManager manager = new ScriptEngineManager(); /* Retrieve a ScriptEngine registered with the rhino name */ ScriptEngine jsEngine = manager.getEngineByName("rhino"); if (!(jsEngine == null)) { System.out.println(jsEngine); } else { System.out.println("\nNo supported script engine foundregistered as Rhino."); } } }
Run JavaScript Method in Java / ADF & OAF
Run JavaScript Method in Java / ADF & OAF
** it is not Oracle standard.
Example Code :
try {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("Js");
engine.eval("function run() {alert(123);}");
Invocable invokeEngine = (Invocable) engine;
Runnable runner = (Runnable)invokeEngine.getInterface(Runnable.class);
Thread t = new Thread(runner);
t.start();
t.join();
}
catch (ScriptException e)
{
// TODO
}
catch (InterruptedException e)
{
// TODO
}
incase of any null pointer Exception
visit Get JavaScript Engine Name
** it is not Oracle standard.
Example Code :
try {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("Js");
engine.eval("function run() {alert(123);}");
Invocable invokeEngine = (Invocable) engine;
Runnable runner = (Runnable)invokeEngine.getInterface(Runnable.class);
Thread t = new Thread(runner);
t.start();
t.join();
}
catch (ScriptException e)
{
// TODO
}
catch (InterruptedException e)
{
// TODO
}
incase of any null pointer Exception
visit Get JavaScript Engine Name
Java Code Examples for javax.script.ScriptEngineManager.getEngineFactories()
The following are Jave code examples for showing how to use getEngineFactories() of the javax.script.ScriptEngineManager class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
private boolean isJavaScriptAvailable() { if(isJSAvailableChecked) { return isJSAvailable; } ScriptEngineManager mgr = new ScriptEngineManager(); List<ScriptEngineFactory> factories = mgr.getEngineFactories(); for (ScriptEngineFactory factory: factories) { List<String> engNames = factory.getNames(); for(String name: engNames) { if(name.equalsIgnoreCase("js") || name.equalsIgnoreCase("javascript")) { //NOI18N isJSAvailableChecked = true; isJSAvailable = true; return isJSAvailable; } } } isJSAvailableChecked = true; isJSAvailable = false; return isJSAvailable; }
OAF:
Example
try
{
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngineFactory[] factories = (ScriptEngineFactory[]) mgr.getEngineFactories();
for (ScriptEngineFactory factory: factories) {
String[] engNames = factory.getNames();
for(String name: engNames) {
System.out.println(name);
}
}
}
catch (Exception e)
{
}
Friday, 1 November 2019
How To Convert Base64 in Java
//Default Package Name
//Import Class
import java.util.Base64;
public class decodeBase64
{
public static void main(String[]
paramArrayOfString) {
//Get First Parameter Value only
String str1 = paramArrayOfString[0];
//Get Byte of Base64
byte[] arrayOfByte = Base64.getDecoder().decode(str1);
String str2 = new String(arrayOfByte);
System.out.println(str1 + " = " + str2);
}
}
Wednesday, 30 October 2019
How To: Remove all rows from view object (VO) in OAF & ADF
Option 1:
The executeEmptyRowSet() method can be used to empty the VO. This is my preferred approach.
/* Use the following snippet in the Application Module (AM) */ OAViewObjectImpl vo = this .getMyDummyVO(); vo.executeEmptyRowSet(); |
Option 2:
Loop through the VO and remove each row. If the data set is too large this could be cost intensive. I do not prefer this option./* Use the following snippet in the Application Module (AM) */ OAViewObjectImpl vo = this .getMyDummyVO(); while (vo.hasNext()){ vo.next().remove(); } |
Subscribe to:
Posts (Atom)
OADBTransactionImpl in Oracle Application Framework (OAF)
OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...
-
Create Type Loop_Type is table of Varchar2(400) Create or Replace Function Find_Loop_F (P_End_loop in NUmber Default 10) Return Loop_Typ...
-
FND_PROFILE values: fnd_profile.value('PROFILEOPTION'); fnd_profile.value'MFG_ORGANIZATION_ID'); fnd_profile.value(...
-
//import oracle.cabo.ui.validate.Formatter; important Class for Formatting // Set Number fields Format public void se...