Showing posts with label OA Framework. Show all posts
Showing posts with label OA Framework. Show all posts

Sunday, September 13, 2009

Open Workflow status monitor diagram page in OAF

Create a VO for the query which is given below through this you can get the current diagram url,

select WF_MONITOR.GetDiagramURL(WF_CORE.Translate('WF_WEB_AGENT'),NtfEO.MESSAGE_TYPE,NtfEO.ITEM_KEY,'NO') monitor_url from
(SELECT ITEM_KEY,MESSAGE_TYPE FROM WF_NOTIFICATIONS WHERE NOTIFICATION_ID = :1) NtfEO

First find the button component of your page.
call VO with the input parameters which will return the diagram url.
Put that url into the java script function.

Through the java script you can open a new popup window which will display the status monitor diagram

OASubmitButtonBean reAssignBea1n = (OASubmitButtonBean) paramOAWebBean.findChildRecursive("WfMonDiagramCtrl");

Serializable[] parameters1 = { NotificationId };
Serializable aa1 = am.invokeMethod("getMonitorURL", parameters1);
if (aa1 != null && !aa1.toString().equals(""))
{
String url = "window.open('" + aa1.toString() + "')";
paramOAPageContext.putJavaScriptFunction("LaunchMonitor", url);
}

Determine the transaction state that is, whether changes have been made to view objects or not

Use the following methods:

ApplicationModule.getTransaction().isDirty() - This method tells you whether the transaction contains any changes in the view objects. This works for transactions made by entity object-based view objects only.

OAViewObject.isDirty() - This method tells you whether a particular view object contains changes or not. This works for both entity object-based view objects and view objects based on OAPlsqlViewObjectImpl. For view objects based on OAPlsqlViewObjectImpl, you can also use OAPlsqlViewObjectImpl.getState() method

Always call remove() after done using a dynamic view object

Always call VO.remove() after you are done using a dynamic view object:

ViewObject voobject = null;
try
{
voobject = mTransaction.createViewObjectFromQueryStmt("sql statement");
boolean exists = ( voobject.first() != null);
}
finally
{
voobject.remove();
}
Make sure to surround your VO.remove(); with finally.
If you don't, a java runtime exception could fire before you even get to your VO.remove().

Create a run time VO in OA framework

To create a run time VO you have to follow these steps which are given below:

OAApplicationModule am = pageContext.getApplicationModule(webBean);

OADBTransaction oadbtransaction = am.getOADBTransaction();
String validateStr1 = "select column_name from table_name where column_name = :1";

ViewObject validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 == null)
validateViewObject1 = (ViewObject)am.createViewObjectFromQueryStmt("ValidateCodeVO1", validateStr1);

validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 != null)
{
validateViewObject1.setWhereClause(null);
validateViewObject1.setWhereClauseParam(0, pageContext.getParameter("NtfId"));
validateViewObject1.executeQuery();
validateViewObject1.reset();

oracle.jbo.Row validaterow = validateViewObject1.first();

if (validaterow != null)
message_type = validaterow.getAttribute(0).toString();
}

Tuesday, July 28, 2009

Oracle apps standard query

To Find invalid objects:
select owner, object_name, object_type,status from all_objects
where status != 'VALID' order by owner, object_type, object_name;

Validate username/password combination:
select fnd_web_sec.validate_login('AK185109','ak185109') from dual ;

If it return N then look the error message by this query
select fnd_message.get from dual;

Find the Instance:
select NODE_NAME, NODE_ID , SERVER_ID , SERVER_ADDRESS from FND_NODES;

Validate the ICX_PARAMETERS table:
select * from icx_parameters;

Find the Responsiblity :
select responsibility_id,responsibility_key,responsibility_name,description from fnd_responsibility_vl where responsibility_key = 'SERVICE'

Find the Menu, Function:
SELECT * fnd_responsibility_vl a,
fnd_menu_entries_vl b,
fnd_form_functions_vl c
where a.responsibility_id=20638
and a.menu_id=b.menu_id
and b.function_id=c.function_id

JDR UTILITY in OAF

In Oracle OA Framework, is the MDS page/document definition stored in database or in the file system?

The MDS document details are loaded into database, in the following sets of tables.
JDR_ATTRIBUTES
JDR_ATTRIBUTES_TRANS
JDR_COMPONENTS
JDR_PATHS
The Document is loaded via XMLImporter.

and Through the JDR API you can get all this information from the database with the help of these statement..

jdr_utils.listdocuments('/oracle/apps/cs/', TRUE);
jdr_utils.listdocuments('/oracle/apps/cs/pagging//server/',TRUE);
jdr_utils.listcustomizations(p_document => '/oracle/apps/cs/pagging/webui/CustomPaggingPG');
jdr_utils.printdocument(p_document => '/oracle/apps/cs/pagging/server/CustomPageAM');
jdr_utils.printdocument(p_document => '/oracle/apps/cs/pagging/webui/CustomMailPG');
jdr_utils.deletedocument(p_document => '/oracle/apps/cs/pagging/server/CustomPageAM');

Logging in the OAF

logging in the OAF

You can log your message in OAF page using writeDiagnostics method

pageContext.writeDiagnostics(this,"building :"+s_building,OAFwkConstants.STATEMENT);
Syntax:void writeDiagnostics(Object module,String messageText,int logLevel)

Writes an entry to the diagnostics log according to a specific log level.

Parameters:module - current module, usually the "this" pointermessageText - message to be included in the log. Limit 4000 characters.logLevel - category or type of log message. Valid values are are from OAFwkConstants. (UNEXPECTED, ERROR, EXCEPTION, EVENT, PROCEDURE, STATEMENT, PERFORMANCE

To log bc4j objects in OAF
Pagecontext will not be available for AM, View Object Impl and Entity object Impl. So in this case, you can use OADBTransactionImpl.writeDiagnostics to log your messages.

oracle.apps.fnd.framework.server.OADBTransactionImpl

if (OADBTranasctionImpl.isLoggingEnabled(OAFwkConstants.PROCEDURE))OADBTransactionImpl.writeDiagnostics(this, "your message", OAFwkConstants.PROCEDURE);

Now you will be able to see the application log appened to the bottom of the page.

Then set profile option "FND: Debug Log Level" (at user-level).

Finally query FND_LOG_MESSAGES in the database for all the debugging messages:

SELECT module, message_textFROM fnd_log_messagesWHERE user_id = AND timestamp > SYSDATE - (1/24/60) -- in the past minute; this cuts down the number of recordsORDER BY timestamp;

How to see the log?

You can see the output in the OAF Screen itself.
1. Select Diagnostics button from any page
2. In the Diagnostics page select Show Log on Screen option

Thursday, July 10, 2008

New to OA Framework

OAF stands for Oracle Applications Framework and is a MVC architecture based J2EE framework customized for use in Oracle Applications development. It is tailor made for use in the development, customization of Oracle Apps pages and any custom application development to be hosted, integrated in Oracle Apps. OAF provides classes for all the standard web widgets seen on the Self Service pages like Text field, List of Values, Table, HGrid, Buttons etc. You can get that detail in the OAF Dev guide.
Only choice of tool to work with OAF is Jdeveloper with OA Extension. There is no OA extension /plugin available for any other IDE. This is another factor where people keep getting confused. Jdeveloper is a generic Java IDE but the one without the OA extension can't be used for OAF development. OA extension is what provides the required OA libraries and enables OA based Workspace, Project creation.
OAF is the only option for any Oracle Apps related development. Release 11i and recently launched Release 12 version of Oracle Apps is based on OAF. For look & feel and business logic changes to Oracle provided seeded Self Service pages, one can make use of Extension and Personalization features of OAF. Modifications done following the Extension and Personalization guidelines are upgrade and patch safe. Any direct modification made to seeded code will be overwritten during the patching.
If You are going to start work in OA Framework,


1). The First thing you should khow which patch is suitable for your Orcale application release.
2). Once you get the patch number of OA Extension, Download it from the metalink & just extract that zip file into your machine.

a). Then you have to configure the JDEV_USER_HOME Environment Variable, Please follow these setup to configure this:
- Go to your desktop and select My Computer, right-click and select Properties.
- On the System Properties dialog, select the Advanced tab.
- On the Advanced page, select the Environment Variables button.
- On the Environment Variables dialog, select the New button from the User variables for box.
- On the New User Variable dialog, enter JDEV_USER_HOME in the Variable Name field. Set the Variable Value field to :\jdevhome\jdev where is the drive where you installed the JDeveloper OA Extension zip file. For example: c:\jdevhome\jdev. - Select OK in each of the dialogs you opened to save the new user environment variable.

b). Obtaining a Database Connection File
- Obtain the FND database connection (.dbc) file from the system administrator who installed the OA Framework database where you want to do your development. Place this file in the \dbc_files\secure directory.

Then start your Jdeveloper and start working in OA Framework.