Friday, October 31, 2014

How to import certificate to keystore



What is Keystore ?

A Java KeyStore (JKS) is a repository of security certificates – either authorization certificates or public key certificates – used for instance in SSL encryption. In Oracle WebLogic Server, a file with extension jks serves as keystore.

What is DemoTrust.jks ?

DemoTrust.jks Contains a list of certificate authorities trusted by WebLogic Server. This keystore establishes trust for WebLogic Server.

How to add import a certificate  to DemoTrust.jks Keystore ?

keytool -import -alias <certificate name> -file <certificate path> -keystore <DemoTrust.jks path>

Example : Execute below command in CMD in Windows


keytool -import -alias FM-CA -file C:\libs\FM\FM-CA.cer -keystore C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks

How to see existing certificates in DemoTrust.jks ?

keytool -list -v -keystore C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks

Here is the default password for DemoTrust.jks : DemoTrustKeyStorePassPhrase

For More Info : http://docs.oracle.com/cd/E19118-01/n1.sprovsys51/819-1655/fapsf/index.html

Sunday, October 12, 2014

How to implement Skins in ADF ?


This blog explains about how to apply skinning for any ADF application
- Create trinidad-skins.xml file 




-   Configure your .css file in above created trinidad-skin.xml as shown below

<?xml version="1.0" encoding="UTF-8" ?> 
<skins xmlns="http://myfaces.apache.org/trinidad/skin">
 <skin>
  <id>mySkin.desktop</id>
  <family>mySkin</family>
  <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
  <extends>fusion.desktop</extends>
  <style-sheet-name>/css/fmStyle.css</style-sheet-name>
 </skin>
</skins> 

- Below is sample .css file



-  Refer the  CSS file entries in your page or page fragment as shown below .



For More info, Please refer below links

https://blogs.oracle.com/jdevotnharvest/entry/how_to_learn_adf_skinning


Wednesday, October 1, 2014

How to dynamically replace Hard coded values Programatically

This blog explains about how to eliminate hard coded URL's in any web application. Especially hard coding the environment specific WSDL URL's or any other string values.

- Create a properties file and define all the values as  key value pair. Key must contains host name.

For eg : dev340 is the host name
              dev340_EMPWSDL =dev340:9080/emp/EmployeeManage?WSDL





- Wherever you want to retrieve the values from the properties file dynamically where the application is running
// Below code gives the host name where the application is running.
String hostName = java.net.InetAddress.getLocalHost().getHostName();

For eg : If the application is running in DEV environment, hostName value will be obtained as 'dev340' ,


- You need to retrieve property value from .properties file by passing hostname, Follow below blog to how to read properties file

http://fortunefusionminds.blogspot.com/2014/02/how-to-read-properties-file-in-java.html