Posts

Showing posts from 2014

How to check the logs generated by MAF application

Image
Hi Friends, How to check the logs generated by the MAF application In MAF application, if you deploy the app on emulator and would like to see the logs generated by your application. Use below steps:   1)       Add logger in your code      Logger.getLogger(Utility.APP_LOGNAME).logp(Level.INFO, this.getClass().getName(), "Kiran","button has been pressed"); 2)       Or add System.println.out(“”); statement. 3)       Change the level of logging in logging.properties. 4)       Deploy app in debug mode. How to view the logs: To view the logs you can use the utility available in sdk Sdk path: /sdk/tools/ddms Run the ddms utility to see the logs.

Oracle WebCenter Content : Admin Applets issue

Image
This information will be useful for all those who has started to understand about UCM now it is known as Oracle WebCenter Content. I am using Oracle WebCenter Content 11g (11.1.1.6.0) Issue: First time Admin applets will not run properly in your environment. It will ask to update the JRE on your machine and if you will update the JRE 1.8 update 25 then also admin applets will not run properly. You will get below error probably, Solution: you can try the following workaround for this issue: Navigate to the <JRE_install_location>\lib\security Open the java.policy file for editing In the list of permissions, add the following line:   permission java.util.PropertyPermission "user.timezone", "write";  permission java.security.AllPermission; Save and exit the file Restart the windows. Verify that you're now able to open the Admin applets. Hope this info is useful to all.

Image download servlet

Image
Requirement : In Application we need to show image in image component. I have followed below approach. Created servlet and mapped its url to image source attribute. Please follow below screen shot. and ImageServlet code.. public class ImageServlet extends HttpServlet {     private static final String CONTENT_TYPE = "image/jpeg; charset=UTF-8";     public void init(ServletConfig config) throws ServletException {         super.init(config);     }     public void doGet(HttpServletRequest request,                       HttpServletResponse response) throws ServletException,                                                            IOException {         response.setContentType(CONTENT_TYPE);         String appModuleName = "yash.hr.model.am.AppModule";         String appModuleConfig = "AppModuleLocal";         ApplicationModule am = null;         ViewObject vo = null;         try{             String emp_id=request.getParameter("em

How to track the row changes in ADF

Requirement:  Want to store the old value of attribute in some other table if user change it. Solution : Define EntityImpl Class. Override the doDML() method of the same entity. Define EntityDefImpl Class of another entity though which preserve the changes in some another table. Please see below code     protected void doDML(int operation, TransactionEvent e) {         super.doDML(operation, e);         if(operation==DML_INSERT){           System.out.println("DML INSERT");           }         if(operation==DML_UPDATE){             System.out.println("Update operation");             System.out.println("-1-");             String entityName = "yash.hr.model.eo.EmpAudit";             System.out.println("-2-");             EntityDefImpl deptDef = EntityDefImpl.findDefObject(entityName);             System.out.println("-3-");             EntityImpl newDept = deptDef.createInstance2(getDBTransaction(), null); Sys

How to fix the ADF Security error “JpsAnonymousRoleImpl” in Jdev 11.1.1.6.0

I have created a sample ADF application in Jdev 11.1.1.6.0 and when executed in “Integrated Weblogic server” within Jdev, it did not display any error message in the console and the application web page is loaded in the default browser successfully. Now I added the  ADF Security  for the Application. To do this, From the Menu options select the  Application  –> select  Secure -> Configure ADF Security ADF Authentication and Authorization  –> Form Based Authentication (Generate the default login and error pages. Should be something like “/ login.html “) -> No Automatic Grants -> Finish. Now when I executed my Application in Jdev, I was getting the “ <CodebasePolicyHandler> <migrateDeploymentPolicies> Migration of codebase policy failed. Reason: {0}. oracle.security.jps.JpsException: java.lang.IllegalArgumentException: oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl ”    error before my web page opens up in the browser. Even after yo

How to call method call activity between train flow in taskflow

Image
Problem : We need to call method call activity in between two view activity in Taskflow. Solution : We need to to following changes in Taskflow, 1) Add wild card flow and point it to method call activity 2) Set the outcome attribute of view activity under the Train stop section to the wild card flow outcome. Please refer below screen shot,

Groovy expression for assigning DB Sequence value to a Key attribute

Image
In DB table we have primary key column and primary key is generated by Sequence. There are couple of way to assign the value to primary key attribute in ADF. 1) User Groove experssion: Add groove experssion into Entity key attribute and set value field,      (new oracle.jbo.server.SequenceImpl("<Sequence Name>",adf.object.getDBTransaction())).getSequenceNumber() 2)  Generate Entity object class for entity object as shown in figure below figure             Override the doDML method as below,         protected void doDML(int operation, TransactionEvent e) {         if(operation==DML_INSERT)            this.setFileid(( new SequenceImpl("Sequence Name",getDBTransaction  ()).getSequenceNumber()));         super.doDML(operation, e);     }   Or Override the Create method of entityImpl class ...   Enjoy :)   

How to hide the search operator from Query Panel

Image
Query Panel: How to hide the search operator from Query Panel : 1) Open the VC defined in VO object and go to UI hints tab and select show operator as never.   2) Or We can add CompOper tag in VO as below, 3) if we want to remove selected operator from the list then add the CompOper tag for every operator.      Please refer this link for more information  CompOper                 

Programmetic View Object in ADF

Image
Sometime we need to call Stored Procedure or Stored function in ADF application. Programmetic View objects are used for this. In this blog I will explain how to use Programmetic VO to call the Strored procedure and function. We need to override following methods of the ViewImpl class executeQueryForCollection() hasNextForCollection() createRowFromResultSet() releaseUserDataForCollection() Below are the detailed steps create VO as below    2. add the needed atributes    3. Override the above mentioned methods in VOImpl Class    4. Make sure all the attributes in VO are updatable    5. Atleast one attribute should be key attribute    6. I have created Employee VO as below      Define the Stored Function in DB, CREATE OR REPLACE FUNCTION HR.FUNC_returnEmployee RETURN SYS_REFCURSOR AS REF_TEST   SYS_REFCURSOR; BEGIN OPEN REF_TEST FOR SELECT   employee_id,first_name,phone_number,salary FROM   employees; RETURN REF_TEST; END; Code of ViewObject