Oaf Interview Questions Part4

Oaf Interview Questions, www.askhareesh.com
31. Steps for VO substitution?
  • About this Page-> VO, AM, EO, Path of Page
  • Export Commad (in cmd Prompt)
  • New .jpr =Open page
  • Look for AM and VO or EO.
  • Copy the class files of VO,AM or EO
  • Decompile into Java and store it into MyProjects (with respective directory structure)
  • Open VO.xml in a new jpr
  • Create a new BC4J based on your Original VO.
  • Create a new VO and extends original VO
  • Change the query
  • Rebuild the project
  • Go to .jpx(double click)
  • Go to Substitutions
  • Substitute Vo
  • Rebuild your Project .jpr
  • Transfer New VO class and xml to respective directory structure
  • FTP .jpx into $JAVA _TOP
  • unix command promrt CD$ JAVA_TOP
  • jpx importer command
  • Bounce Apache Server

32. What are different methods for passing parameters?
eg. vname={@AttributeName}
Hash Maps:
eg. HashMap variablename=nre HashMap();
eg. pageContext.putSessionvalue(“ParamterName”,ParameterValue)

33. setForwardURL list?
There are many parameters, here is the complete list of it:-
public void setForwardURL(String functionName,
byte menuContextAction,
String menuName,
com.sun.java.util.collections.HashMap parameters,
boolean retainAM,
String addBreadCrumb,
byte messagingLevel)

functionName – This is the function name representing the page you want to forward to. If its null, an IllegalArgumentException will be thrown. 
Also if the function is not under the current HOMEPAGE a OAException will be thrown.

menuContextAction – Determines the behavior of the MenuContext after forwarding to the new page. It accepts the following values:
OAWebBeanConstants.KEEP_MENU_CONTEXT: Keeps the menu context as is.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT: Keeps the menu context as is, but will not display all menus including global buttons.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT_RETAIN_GLOBAL_BUTTONS: Keeps the menu context as is, but will not display all menus excluding global buttons.
OAWebBeanConstants.REMOVE_MENU_CONTEXT: Removes the menu context
OAWebBeanConstants.GUESS_MENU_CONTEXT: Selects the given functionName function if it exists in the current menu. 
 If not it will try to make a guess by moving up the menu tree until it finds it. An exception will be thrown if the function could not be located.
OAWebBeanConstants.RESET_MENU_CONTEXT: Reset the menu context to the given functionName and menuName.

menuName – The name of the HOMEPAGE menu to reset the Menu context to when the menuContextAction is OAWebBeanConstants.RESET_MENU_CONTEXT. 
If the menuName is not of type HOMEPAGE a OAException will be thrown. You can pass null otherwise.

parameters -
HashMap of parameter name/value pairs to append to the forward URL. The final forward URL parameters are in the following sequence:
It will first get the function’s corresponding URL call by querying the function information from the database. If the user is not authorized to execute this function, a security OAException will be thrown.
It will then append all parameters passed in the parameters HashMap. First parameter added to the HashMap will be first added to the URL. Also the framework will encode all parameter values before appending them to the URL.
It will remove all parameters if they have null values in the passed parameters HashMap. This provides an easy way for developers to set a certain parameter’s value to null if they want to remove it.
It will remove any OA Framework internal URL parameters such as bcrumb, retainAM, and so on..

retainAM – If true, all the cached application modules will be retained. If false, all the cached application modules will be released. 
Developers must use this parameter to control the release behavior of the cached appplication modules. 
This method will ignore any retainAM=true or retainAM=false as a URL parameter or as part of parameters.

34. Code to copy rows in VO?
public void copy()
 SuppliersVOImpl pervo = getSuppliersVO1();
 Row row[] = pervo.getFilteredRows("SelectFlag","Y");
 for (int i=0;i<row.length;i++)
 SuppliersVORowImpl rowi = (SuppliersVORowImpl)row;
 OADBTransaction trx = (OADBTransaction)getTransaction();
 Number b = trx.getSequenceValue("FWK_TBX_SUPPLIERS_S");
 AttributeList a = (AttributeList)rowi;
 SuppliersVORowImpl r =(SuppliersVORowImpl)pervo.createAndInitRow(a);
 //Set here your unique attribute values, I'm setting here Supplier Id as for every new row it should be different.

35. what for isPreparedForExecution() and executeQuery() methods used?
isPreparedForExecution function will check whether all parameters are assigned properly and query is ready for execution. 
On multiple navigations to the page this query will not be executed multiple times.
While executeQuery function is used for executing the VO query so that it can fetch the data from database into VO cache.

36. What is the pattern used in developing any OAF component?
MVC (Model, View, Controller)
Lists the components in the MVC architecture
Model: Application Module, View Objects, View Links, Entity Objects, Entity Associations etc.
View: Page, Region, Attributesets etc.
Controller: Controller class files

37. Which is the component responsible for user actions?
Controller is the object. The code present in ProcessFormRequest gets executed up on the user action.

38. If we have to initialize something during the page loading, which is the right place?
ProcessRequest() method of the Controller file is the right place.

39. What is the significance of ProcessFormData()?
For a ‘POST’ request the data on the page is binded to the view object in this method

40. Does ‘GET’ request result in calling ProcessFormData()?
No, only POST request calls that.

<<<Previous         Continue>>>


No comments:

Post a Comment