Pages

Thursday, March 24, 2016

Clearing cookies on browser close

In one of my project I had a requirement to clear all the session cookies set in my application on browser close. After exploring for a while I found out a simple configuration in WebLogic Server-specific deployment descriptor, weblogic.xml which will clear all the cookies on browser close. 

In session-descriptor section of weblogic.xml, there is a parameter, cookie-max-age-secs which sets the life span of the session cookie in seconds, after which it expires on the client. Setting this value to -1 expires the cookie on browser close.  Set this value as mentioned below.


Friday, October 23, 2015

How to install Apache Ant and run build script from command prompt

In this post, I will explain you the steps to install Apache Ant and run ant build script from command prompt.

Following are the steps to be followed to install Apache Ant.

1. Download Apache Ant's zip file from Apache Ant official website.
For example : apache-ant-1.9.5-bin.zip, unzip it to the folder where you want to store Apache Ant.


2. Make sure JDK is installed. And configure JAVA_HOME as environmental variable.


3. Configure ANT_HOME environmental variable as shown. In my case C:\apache-ant-1.9.5 stores Apache Ant.

 

4.  Set ANT_Home's path.


After the above steps, when you run the command ant -v from command prompt it should show you the following details:

 which means ant is setup successfully.

Follow the steps to run build script from command prompt.

1. Open command prompt and run the following command.

ant -f C:\Umesh\Code\Device.com\Portal\build.xml build 

Here C:\Umesh\Code\Device.com\Portal\ is the folder location where my build script exists.

2. Once you hit the above command, the script start executing as shown:


Once the script is run successfully, it will display confirmation message in command prompt.

Friday, April 10, 2015

How to generate HTML Javadocs using Jdeveloper

In this blog, I will explain the steps to create HTML Javadocs using Jdeveloper.

First add Javadocs for all the classes and its methods using  /** */.

Then follow the below steps to create HTML Javadocs.

1. Select the folder/file for which you want to create HTML Javadocs.

2. Go to Build menu and select Javadoc com.test to create HTML Javadoc.

3. Once the Javadoc is created, you should see the below message in the logs.


4. To view generated Javadoc for a specific class, Go to Java Doc in Navigate menu and search for the file.

 

5. Alternatively, you can go to the folder where Javadoc HTMLs are created.
In my case: C:\Jdeveloper\mywork\TestJavaDocApp\Javadoc\javadoc.
Click on index.html to view HTML javadocs.



Friday, June 6, 2014

Use case of scrollComponentIntoViewBehavior

The scrollComponentIntoViewBehavior tag is a declarative way to have a command component  scroll a component into view and optionally set focus on it. scrollComponentIntoViewBehavior.

In this post, I will explain a use case of scrollComponentIntoViewBehavior tag to scroll and set focus on a component in a page.

UseCase:
In a webcenter application, if you have a menu defined as mentioned below.


where all the selections(i.e Calendar, Choose Date etc.) are mapped to the same page i,e if a user selects any of these options, he/she is navigated to the same page but with the selected option/section scrolled and focused into. It is similar to anchor tag for jumping on a specific location of a page.

Steps implemented are:
1. Create a Webcenter Portal Framework Application.
2.Create a new jspx page. (eg: news.jspx). In this page, define the various components to set focus on based on selection in navigation menu.
3. Define the navigation menu as mentioned above.
  • Go to default-navigation-model & delete the default pageHierarchy
  • Click on Add new node and select link from various options. Modify Id, Type, URL, URL Attributes for the Home page as shown below.


  • Add another node of type link below Home as Calendar. Set the Id, Type, URL, URL Attributes for the new page. Additionally set a URL parameter for this node as shown below.


    Here the url parameter section is assigned value: pt1:pb1 which is clientId of the component to set focus on when Calendar is chosen from the navigation menu.
  • Repeat the above steps to add other nodes(Choose Date & Choose Color).
4. Define a command button with visible property set to false. Add scrollComponentIntoViewBehavior inside it as shown below.

Here the componentId property of scrollComponentIntoViewBehavior is set to #{param.section}.

5. Define a client listener method scrollToComponent on page Load. The java script code is

function scrollToComponent(loadEvent) {
     var id = "pt1:command1";
     var t = document.getElementById(id);
     t.click();
}


when the user selects any option(i.e Calendar, Choose Date) from the navigation menu, the page news.jspx is loaded which triggers the above java script and in turn clicks the command button and invokes scrollComponentIntoViewBehavior tag. 

Based on the url parameter set in the default-navigation-model the navigation jumps to the particular section of the page.

Sample workspace:
Download the sample workspace from here.

Saturday, September 21, 2013

Hide move all/remove all buttons from SelectManyShuttle component

In one of the earlier post, I explained how to implement SelectManyShuttle component. In this post, I will show how to hide move all/remove all buttons using skinning.

Generally SelectManyShuttle component looks like:


The skinning to hide move all/remove all buttons is:
af|selectManyShuttle::moveall-horizontal,
af|selectManyShuttle::moveall-vertical,
af|selectManyShuttle::removeall-horizontal,
af|selectManyShuttle::removeall-vertical{display:none}
The SelectManyShuttle component after skinning:

Sunday, April 14, 2013

Use case of Inlinestyle & ContentStyle

In this post, I will explain a use case of InlineStyle and ContentStyle on ADF UI components.

In one of my project I had a requirement where in I have to display few rows of table in bold if a specific criteria is met. The other rows where criteria is not met should be displayed as normal.

- Select columns in the table which you want to display in bold.

- Select the Style tab for the selected output text in the property inspector and set the inline style as below:



- Here the criteria is Salary should be greater than 10000. The column code looks like.


UI

If you want to apply similar style for the content of an InputText component, then make use of ContentStyle property rather than InlineStyle property as shown

Here in addition to bold, the content of InputText is right aligned.

UI

Thursday, January 31, 2013

Defining a tool tip message on Table column label

In one of my earlier post, I explained how to define tool tip for Table Column Filter. In this post, I will explain how to define tool tip message/short description on a table column label.

- Select the column in the table for which you want to define tool tip.

- Expand Column facets node for that column and select header facet.

- Inside the header facet add an Output Text component and set it's value property same as column header text as shown:


 - The custom tool tip for the table column label can now be set on the shortDesc property of Output Text. After this modification, the column code looks like:


UI