Showing posts with label ADF newbie tip. Show all posts
Showing posts with label ADF newbie tip. Show all posts

26 May 2011

Code templates

Intro
Code template is for example sop.
So, if you write: sop and you Press Ctrl+ Enter,
JDeveloper editor will replace it with System.out.println();

You can see the existing Code Templates under
Tools -- Preferences --Code Editor --- Code Templates

You can write sop in the Search box to quickly find sop

Write your own
Let's write a template for a think a developer performs frequently. A template for logger.debug();
Click +
Under Shortcut you add: logd . This is the string you want to type. 
Under Context you choose the "place" this template will be prompted. In this case Java.
Under Code tab the text that will replace the logd when pressing Ctrl+Enter, which will be logger.debug($end$);  The $end$ indicated where the cursor will be placed for you to write after inserting the logger.debug();. So, logger.debug(); will be inserted and you ll start to write after (.



05 May 2011

"Automatically Acquire Lock and Activate Changes" in Weblogic

There is an feature in Weblogic that gives you the ability to Automatically Lock & Edit and Activate Changes in weblogic.

This feature is enable by default in domains that are not in Production mode (Development mode) like the DefaultDomain that the embedded weblogic of JDevelopment is shipped with. This feature is not available at all in production mode.

Some people prefer to Lock & Edit manually, so to disable this feature in a Development mode server:

Go to Preferences

Uncheck "Automatically Acquire Lock and Activate Changes"




01 March 2011

Where deploying directory of embedded Weblogic is?

When you run an Fusion ADF application in JDeveloper, it is deployed behind the scenes in the embedded Weblogic (WLS) in order to run. The directory that your application is deployed  is located under
%JDEV_SYSTEM_ROOT%\o.j2ee\drs
where JDEV_SYSTEM_ROOT is JDeveloper's system directory and its default value is:
C:\Documents and Settings\username\Application Data\JDeveloper\
so the default place is:
C:\Documents and Settings\username\Application Data\JDeveloper\\o.j2ee\drs


Under directory drs  you ll find a directory (with the same name as the application) for each application that you have deployed.

Why you need to know that?
Sometimes the deployed application is not refreshed with new changes and you ll need it to clear it n order to be recreated from scratch.


Note 1:
Make sure to change username with your Windows user.

Note 2:
Find more on  JDeveloper's system directory here.

15 February 2011

Define default editor for each file type

Set the editor that JDeveloper will open a file
Tools--> Preferences




SVN comment template


Each commit should have the appropriate comments as a good developing practise.
In order not to write again and again the same comments we can use SVN comment templates

So when we are about to commit a source for the 1st time
Click comment templates
and Add
 here set you template


You can have of course more than 1 template and moreover JDeveloper keeps history of the previous comments. Just click the down arrow next to the comment.

Check if your Weblogic domain is in Production mode

There are 2 types of weblogic domains:
  • Production domain
  • Non-production domain or  Development domain


To check the type of your domain:
  • Open console (http:\\hostname:port\console  eg http://127.0.0.1:7101/console/)
  • Click your domain (first node in Domain Structure panel)
  • Check setting of Production mode

09 February 2011

Auto Code HighLight

A feature that I used to love in Eclispe (enabled by Default), can also be enabled in JDeveloper :)

It automatically highlights all occurances of the variable you have clicked on.




Dig:

14 December 2010

TROUBLESHOOTING: af:query does not search when in query field, String is used

This is an ADF newbie tip.

Problem
Let's say you got a af:query with one query field (of type String) and a result table (typical scenario).
You can search using Number but you cannot search (it brings everything) using String.
No error occurs.

Solution
The bind var of the query field is of type Number, which is the wrong type. Change it to String.

09 December 2010

TROUBLESHOOTING: "Low Memory Warning" of JDeveloper or How to tweak memory settings.

Last updated on: 14/12/2010
Here are the 2 well known tips to make JDeveloper use more mem, and workaround the "Low Memory Warning".


The files to modify
The following 2 files  must be modified

  • C:\Oracle\Middleware\jdeveloper\ide\bin\ide.conf
  • C:\Oracle\Middleware\jdeveloper\jdev\bin\jdev.conf

here I have used the default installation folder that is proposed by JDev. If you have another just search the 2 files in hte installaiton folder.

The mods
For ide.conf
Tweak the following lines

AddVMOption  -Xmx940M
AddVMOption  -Xms128M


For jdev.conf
Tweak
AddVMOption  -XX:MaxPermSize=356M

these are the setting I use and my jdeveloper.exe limits up to around 1200MB

Remember the limit of the mem that can me allocated to a java process in Windows is around 1.5Gigs.
These so if (Xmx + XX:MaxPermSize) around 1.5 gigs JDeveloper will not start and through a related jvm.dll error.


Note:
This is a common and old practice to increase memory of JDeveloper (back to the first days of 11g release when the mem leaks where creting pools of memory). These days are in to the past and the tool now behaves  almost ideally.

Note2 :
Also if you machine is really old, decreasing history of JDeveloper might help a lot.


12 October 2010

Adding a lib / jar dependency to my project

Create new File System Connetion to the directory tha contains the external libs/jars







Now if you go Project properties  > Libraries and Classpath > ADF Library > Edit
You can see the lib  that you add it.

Note:
JDeveloper also makes the followng file
\Application1\ViewController\ADF_Library_Dependencies.library
where it writes all the dependencies:



which you can saafely delete.

You might also like:

Related Posts Plugin for WordPress, Blogger...