Sunday, February 23, 2014

How to Display Hints on disabled field in ADF

This blog explains about How to display 'Hints' on a disabled field. Normally if you set tool tip message at attribute level for any inputtext, By placing mouse cursor on any editable inputText field, you will see corresponding tool tip message, But if you have 'Disabled' field, this approach won't work

Define a face with 'Context' as shown below.

<af:inputText value="#{bindings.ProjCoopFund.inputValue}"
                          label="#{tireprouiBundle.TOTAL_PROJ_COOP}"
                          autoSubmit="true" columns="20" disabled="true"
                          maximumLength="#{bindings.ProjCoopFund.hints.precision}"
                          shortDesc="#{bindings.ProjCoopFund.hints.tooltip}"
                          id="projcoops" rows="1"
                          contentStyle="text-align:right">
              <f:validator binding="#{bindings.ProjCoopFund.validator}"/>
              <af:convertNumber groupingUsed="false"
                                pattern="#{bindings.ProjCoopFund.format}"
                                minFractionDigits="2"/>
              <f:facet name="context">
                <af:contextInfo shortDesc="Sample Tool Tip"
                                id="ctx1"/>
              </f:facet>
            </af:inputText>


How to dynamically create View Criteria and execute in ADF ?


This blog explains about how to create 'View Criteria' dynamically



       

  EmployeeVOImpl empVO =
                getEmployeeVO();
            ViewCriteria vc =empVO.createViewCriteria();
            ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
            if(employeeID != null){
                ViewCriteriaItem vci=vcRow.ensureCriteriaItem("EmployeeId");
                vci.setValue(new Number(employeeID));
                vc.addElement(vcRow);
                empVO.appendViewCriteria(vc);
            }
            empVO.executeQuery();
            
            Row[] filterRows =
                empVO.getFilteredRows("EmployeeId", new Number(employeeID));
       
 

How to load long runing Taskflows in a Page or Page Fragment using inlineFrame & How to embed taskflow into inlineFrame ?


This blog explains about loading running taskflows onto a page or page fragment. So that when page getting loaded we don't need to wait until all the long running taskflows get loaded.

- Create a taskflow as shown below,  This approach will work only with pages and not with fragments.       unselect 'Use Page Fragments' and  set 'url-invoke-allowed' value to 'URL Invoke' attribute as shown below.



- Drag '<af:inlineFrame"' component from the component pallet, and set 'src' attribute value as shown below. In this example, I used above taskflow as 'src'

- Run you page, and you can notice rest of all the components will be rendered though <af:inlineFrame> associated taskflow takes time to load, and user can click any command button/link while 'inlineFrame' is being loaded.



Tuesday, February 18, 2014

How to install patches to Jdeveloper using opatch utility tool ?


This blog explains about applying patch to Jdeveloper using 'opatch' utility

- Download the correct version of OPatch utility software from the Oracle site.
- Take a backup of your existing 'Opatch' folder in your FMW-HOME directory.


- Unzip and copy the downloaded 'OPatch' folder to your FMW_HOME folder. for instance : C:\Oracle\Middleware\jdeveloper
- Download the respective patch, Unzip
- Create ORA_HOME environment variable as shown below.

- Append 'Opatch' direct to 'Path' Environment variable

- CMD to respective Patch folder and verify the version of the 'Opatch' that you have installed

- Apply the patch as shown below

- Follow the steps, This should install the patch


If you encounter below error while applying patch, that indicates clearly you are having wrong version of 'Opatch' s/w, Try to download the correct version of Opatch s/w

OPatch was not able to find OUI jars to load them runtime. Please provide valid
oui location using 'oui_loc' option.

OPatch failed with error code = 255

Monday, February 17, 2014

How to display content based on attribute value ?


This blog explains about how to display/refresh <af:table> data based on specific attribute value

Scenario  : Display only rows where 'isDeleted' attribute value is 'N'

Implementation

1 Create 'Tree Iterator Binding' for the view object which is dragged on to the page/fragment as <af:table> component , and select the 'Filter Attribute' and 'Filter Value' as shown below


Below is how the pageDef.xml looks like


You will see results in <af:table> component only 'isDeleted' attribute value equals 'N'.

Friday, February 14, 2014

Most Commonly Used UNIX command


change directory - cd /u02/oracle/admin
open a specific file - vi Employee.txt
List all the files and directories - ls -ltr
To get the Present working directory - pwd
To search all the files for a specific string - grep 'Echo' *.*
Issue Sudo command - sudo su - adfadmin
Clear the screen - clear
Remove specific file - rm Employee.log
How to tail specific file - tail -f Employee.log
How to close a file in VI mode without saving - Esc :q!
How to save a file in VI mode - Esc:wq!
How to reach last line of file in vi Mode - Esc : $ Enter

How to search from bottom of the file to Top of the file ?
Answer : open file in vi mode, Hit 'Esc : $' and press enter - enter '/<search string>' hit enter - Hold Shift +n

How to find a specific file in by file name ?
$ find . -name 'config.cmd'

How to find a specific directory/folder in linux by name
Answer : $ find / -type d -name 'foldername'

How to Monitor performance of CPU, Memory
Answer : $ top
How to find Virtual Memory statistics ?
Answer : $ vmstat

How to change permissions to a specific file ?
chmod 644 ravi.txt

Below is the description for each file
7 = 4+2+1 (read/write/execute)
6 = 4+2 (read/write)
5 = 4+1 (read/execute)
4 = 4 (read)
3 = 2+1 (write/execute)
2 = 2 (write)
1 = 1 (execute)

chmod 666 ravi.txt read/write by anybody! (the devil loves this one!)
chmod 755 ravi.txt rwx for owner, rx for group and rx for the world
chmod 777 ravi.txt read, write, execute for all! (may not be the best plan in the world...)

How to telnet a specific port 
Eg : telnet <server_name> <portNum> eg : telnet uxunt540 4444

- Follow below command to see all the properties and configuration parameters for a specific server instance

       ps -eaf | grep WC_CustomPortal1

- Follow below command to grep for specific string
      find . -type f -exec grep "=jdk" {} \;

- Follow below command to copy a specific file with different name
      $ cp setDomainEnv.sh setDomainEnv_07-72014.sh
Ref : http://www.tecmint.com/command-line-tools-to-monitor-linux-performance/

- Follow below command to execute shell script
   ./<script_name>.sh
  Also , bash test.sh

- How to take Thread Pool Dump in Unix.
      - Issue below command : ps - ef | grep java , Which will give you process ID (pid) as shown below
   - Once determining pid using above step, then issue below command
                kill -3 <pid> , This will generate thread dump in server STDOUT.
- To all the running processes
                   ps –ef | grep java

 - To Kill any specific running process
          Kill -9 pid
- To see installed Lunix s/w
        uname -a
- To see memory on linux 
           grep MemTotal /proc/meminfo
           grep SwapTotal /proc/meminfo
           df -h /tmp
- Search for all the groups exists in Linux
   cat  /etc/group

- How to create  a new group ?
        groupadd -g 800 dba

- To find specific user details
          id <user name > example : id oracle
- How to install a JAR file in linux environment ?
           java -jar installer.jar

-How to install specific missing RPM ?
           yum install <rpm name>

- How to install a rpm ?
      rpm -i <rpm Name> to install any rpm

- How to perform Update on linux machine ?
     yup update

- How to reboot Linux machine ?
       reboot
- Installing Oracle Fusion Middleware installers on linux machine
  ./runInstallaer -jreLoc usr/java/jdk... (Enter)

-How to set Display attributes in Linux machine
   DISPLAY 111.111.45.254:0.0; export DISPLAY

Ref : http://middlewaremagic.com/weblogic/?p=823

Wednesday, February 12, 2014

Check not null condition in EL (Expression Language)


Use below EL to check 'null' condition

visible="#{not empty pageFlowScope.ManagedBean.propertyName}"