Wednesday, December 17, 2014

How to import and Export Webcenter Portal MDS Data using WLST Scripts


What is MDS Data ?

Oracle Metadata Services (MDS) Repository contains metadata for certain types of deployed applications. Those deployed applications can be custom Java EE applications developed by your organization and some Oracle Fusion Middleware component applications, such as Oracle B2B and Oracle Web Services Manager. A Metadata Archive (MAR), a compressed archive of selected metadata, is used to deploy metadata content to the MDS Repository, which contains the metadata for the application.

For More Info, Please Refer http://docs.oracle.com/cd/E29542_01/core.1111/e10105/repos.htm#ASADM494

What is WLST Script ?

The WebLogic Scripting Tool (WLST) is a command-line scripting interface that system administrators and operators use to monitor and manage WebLogic Server instances and domains. The WLST scripting environment is based on the Java scripting interpreter, Jython. In addition to WebLogic scripting functions, you can use common features of interpreted languages, including local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic scripting language to suit their environmental needs by following the Jython language syntax

For more Info , Refer http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/using_WLST.html

Follow below steps in order to execute WLST Script

Step 1 : Execute wlst.sh , Go to common/bin directory and execute as shown below

               /devbox/fmw/product/111/wcp_111/common/bin> ./wlst.sh

Step 2 : Connect to respective server as shown below
                  fmadmin - User ID
                  simple4u - Password
                  Admin Server IP Address
                  Admin Server Port

                     connect('fmadmin','simple4u','t3://129.155.137.216:44501')

Step 3: Execute below command to export the data. Make sure upon successful export, you should see a message " Successfully exported"

exportMetadata(application='FM_PortalApp1',server='WC_CustomPortal1',toLocation='/tmp/Oracle',docs='/**')

For More Info : http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27738/wcadm_imp_exp_fw.htm#WCADM359

Step 4 : To Import, execute below command

importMetadata(application='FM_PortalApp1', server='WC_CustomPortal', fromLocation='/tmp/myrepos', docs='/**')




Tuesday, November 4, 2014

How to perform Redirect in ADF using Managed Bean ?

This blog explains various ways to perform redirect in ADF using Managed bean


Approach 1

FacesContext fcx =FacesContext.getCurrentInstance()
fcx.responseComplete();
fcx.getApplication().getNavigationHandler().handleNavigation(fcx, null, "gotoHomePage");  
fcx.renderResponse();

Approach 2

fcx.responseComplete();  
fcx.getExternalContext().redirect(getServletRequest().getContextPath() + "/pages/HomePage.jspx");

Approach 3

RequestDispatcher dispatcher = getServletRequest().getRequestDispatcher("HomePage.jspx");
dispatcher.forward(getServletRequest(), getServletResponse());

Approach 4
getServletResponse().sendRedirect("gotoHomePage.jspx")


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

Monday, September 29, 2014

How to add application specific context root entries in OHS


This blog explains about how and where to add the entries in OHS in order to configure any Custom application specific context root related entries in order to access the applications which are deployed in Weblogic console


Locate the mod_wl_ohs.conf file in your OHS directory

Example : /Box/admin/box_hostname/config/OHS/ohs1
                /dkxx40/admin/dkxx40_fmohskend0xx/config/OHS/ohs1

open mod_wl_ohs.conf file and add the below entry into it



#fmPortal domain
<Location /fmportal>
 SetHandler weblogic-handler
 WebLogicHost fmohskend031.oracleoutsourcing.com
 WeblogicPort 44716
</Location>

fmPortal - Context root of an application
WebLogicHost : host name
WeblogicPort : Port Name

Stop and Start OHS server in order to take effective these changes.

Tuesday, September 16, 2014

How to Add Roles/ Map App Roles to UCM/LDAP Roles, Add Member, Delete Member in Webcenter Portal Administrator


This blog explains about

 - Add Application Role
 - Edit Application Role
 - Map Application Role to LDAP/UCM Role
 - How to Add Users to App Role
  - How to add Members to App Role
  - How to Delete Members from App Role
  - Delete App Role

            Using Webcenter Portal Administrator Console

- Login to Webcenter Admin Portal console
- Click on 'Security' Tab
 - Follow below screenshot...

How to see logged in User Roles in UCM


This blog explains about viewing the logged in user UCM Roles,

Login to CS and click on 'Load' or 'Logged in User ID' link on the top right hand corner of the page as shown below.
You will see all the logged in user UCM roles.



Friday, August 29, 2014

How to collect Thread Dump using Weblogic Console


This blog explains about how to get the thread dump using Weblogic Console

 - Login to Weblogic Console
 - Expand domain -> Environment -> Servers
 - Select the server, you want to collect the thread dump, Click on it
 - Monitoring -> 'Dump Thread Stacks'

Wednesday, August 27, 2014

How to prepare Custom UCM Query to search in UCM


This blog explains about how to perform a custom query similar to Webcenter out of box search query

       
import com.incresearch.common.constant.PortalConstant;
import com.incresearch.common.contentmanagement.UCMFile;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.logging.Level;

import oracle.adf.share.logging.ADFLogger;

import oracle.jbo.JboException;

import oracle.stellent.ridc.IdcClient;
import oracle.stellent.ridc.IdcClientException;
import oracle.stellent.ridc.IdcClientManager;
import oracle.stellent.ridc.IdcContext;
import oracle.stellent.ridc.model.DataBinder;
import oracle.stellent.ridc.model.DataObject;
import oracle.stellent.ridc.model.DataResultSet;
import oracle.stellent.ridc.model.TransferFile;
import oracle.stellent.ridc.protocol.ServiceResponse;

        public List getCustomQuerySearchResults(String pSearchCriteria) {
        List fileList = new ArrayList();
        try {
            init("ohsadmin");
            String contributedPagesQuery =
                "(dDocTitle  `" + pSearchCriteria + "`" +
                "   (" + pSearchCriteria + "))";

            System.out.println("Custom Search Query: " +contributedPagesQuery);
            DataBinder dataBinder = myIdcClient.createBinder();
            dataBinder.putLocal("IdcService", "GET_SEARCH_RESULTS");
            dataBinder.putLocal("ResultCount", "50000"); 
            dataBinder.putLocal("QueryText", contributedPagesQuery);
            //setting date format
            dataBinder.putLocal("dInDate", "MMMM dd, yyyy hh:mm tt");
            
            ServiceResponse response;
            DataBinder serverBinder = null;
            response = myIdcClient.sendRequest(userContext, dataBinder);
            serverBinder = response.getResponseAsBinder();
            DataResultSet resultSet =
                serverBinder.getResultSet("SearchResults");
            int index = 0;
            if (resultSet != null) {
                UCMFile ucmFile = null;
                for (DataObject dataObject1 : resultSet.getRows()) {
                    String docName = dataObject1.get("dDocName");
                    ucmFile = new UCMFile();
                    ucmFile.setDocumentId(dataObject1.get("dID"));
                    ucmFile.setContentID(docName);
                    ucmFile.setDatasource("UCM#dDocName:" +
                                          dataObject1.get("dDocName"));
                    ucmFile.setDescription(dataObject1.get("xComments"));
                    ucmFile.setTitle(dataObject1.get("dDocTitle"));
                    ucmFile.setUrl(getDocWebUrl(dataObject1.get("dDocName")));
                    String date = formatDate(dataObject1.get("dInDate"));
                    ucmFile.setUploadDate(date);
                    ucmFile.setAuthor(dataObject1.get("dDocAuthor"));
                    ucmFile.setExt(dataObject1.get("dExtension"));

                    fileList.add(ucmFile);

                    index++;
                }
            }
        } catch (Exception ice) {
            System.out.println(ice.getMessage());
            ice.printStackTrace();
        } finally {

        }
        System.out.println("file size " + fileList.size());
        return fileList;
    }   
  
       
 

How to Download specific file from UCM using RIDC API ?

This blog explains about how to download a specific file from UCM using RIDC API

Use this method in FileDownloadListener component in .jsff or .jspx.

       

      public void downloadUCMFile(FacesContext facesContext,
                                OutputStream outputStream) {
        try {
  import org.apache.commons.io.IOUtils;
  
            String docName = "VMOHSKEND05482003131";
            String path =
                "https://privdev-oneinc.oracleoutsourcing.com/cs/groups/insight_application1/documents/document/ndgy/mdaz/~edisp/vmohskend05482003131.html";
            //need get docId dynamically
            Object obj =JSFUtils.getFromRequest("docID");
            System.out.println(obj);
            String docID = "2874";
            //String docID=downloadLink.getText();
            RIDCUtil ridc = new RIDCUtil();
            InputStream inputStream = ridc.getDocumentByID(docID, "ohsadmin");
            // copy hte data from the BlobDomain to the output stream
            IOUtils.copy(inputStream, outputStream);
            //   Tike tika = new Tika();
            //  System.out.println(tika.detect(inputStream));
            outputStream.flush();
        } catch (Exception e) {
            // handle errors
            e.printStackTrace();
            FacesMessage msg =
                new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(),
                                 "");
            FacesContext.getCurrentInstance().addMessage(null, msg);
        }
    }
       
 

Saturday, August 23, 2014

How to configure Java Mission Control


Java Mission Control (JMC) is a tool that runs on Oracle JDK to perform Java monitoring, profiling and Java Application performance in both development and production environments. With this tool we can diagnose ADF application for any possible memory leaks, stuck threads or identify slowness of the application.
The JMX Console is used for monitoring and managing a running JVM instance.
Java Flight Recorder (JFR) is inbuilt in JMC and it produces detailed recordings about the running application. Once the recording is done, we can analyze it offline. The recording data include Memory and CPU usage statistics, Heap Statistics, Thread Dumps, Garbage collection Statistics, Object allocations, events etc.
JMC is included in JDK Package, It can be found in JAVA_HOME location.
E.g. C:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin

You can run the tool directly from there or through command line or by adding it JDeveloper as External Tool.


Staring Weblogic with Flight Recording Enabled
You need to start Weblogic server using flight recording enabled, for the JMC flight Recorder to work.
To do that follow below steps
·       Right click viewcontroller and go to project properties à Run/Debug à Edit the default profile configuration (or your profile configuration).
·       Paste the following lines in Java Options
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder




 ·        Restart the server and run your application.
Using JMC
·        Open Java Mission control (JMC) after starting your application.


·        You can see Weblogic server running in JVM Browser Tab.
Optional Step:
If you are using a remote agent (This step is optional if you are running application locally)
·        Add the following parameters for Project properties / as VM arguments for running server
        -Dcom.sun.management.jmxremote=true
        -Dcom.sun.management.jmxremote.port=7091
        -Dcom.sun.management.jmxremote.authenticate=false
        -Dcom.sun.management.jmxremote.ssl=false
·        You can add/enable a remote agent using “Create New Custom JVM Connection “link


 ·        Right click on Weblogic and select à Start JMX console

·        In JMX Console you can see the live CPU, Memory usage in Graph , also there are tabs at the bottom to see detailed thread and memory usage.





q
Flight Recorder – recording data

·        Right click on Weblogic server and select “Start Flight Recording”. 
·        In Create flight recording dialog, choose name, and Recording time. Click finish to start flight recording

·        You can check Flight recorder by expanding Weblogic server à Flight Recorder. Also can stop and dump or edit the recording while it is in progress
·        Once recording is done, JMC opens the recording automatically or open it manually from location you choose to save or from default location (C:\Users\<user>\.jmc\5.3.0\).

·        Now you can analyze the data to find the problems

Analyzing a sample application:
·        Image below shows that High Memory Usage and Full Garbage collection was running sometimes, at that point application slows down and even freezes. 

·       Below Data shows there are 2 stuck threads and are running with high percentage and pointing to a method in the code.

·        Other Example Data

Check the below links for information and tutorials about how to analyze the JMC Flight recording.
·       Java Mission Control and Flight Recorder Demo Series http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/mc-jfr/index.html



More Information:

Monday, August 11, 2014

How to Configure Jdeveloper to Launch in various roles?


Below is the screen shot to know how to configure Jdeveloper to launch in different roles,

Customization Developer - If you want to launch the jdeveloper to customize out of box features, then launch the Jdeveloper in this mode.


Friday, July 18, 2014

How to unlock specific User in Oracle Database


Make sure you have installed Oracle Database already installed on your machine. For individual development purpose, Oracle has Express Edition light weight database s/w, that you can download and install on your machine.

- Connect to SQL Command Line prompt
    Start -> All Programs ->  Oracle Database <Version> Edition -> Expand -> SQL Command Line

-  Execute below command
                     SQL> connect / as sysdba

- You should notice as below

- Execute Below commands
          ALTER USER HR IDENTIFIED BY HR;
          ALTER USER HR ACCOUNT UNLOCK;


Tuesday, July 15, 2014

Unable to obtain credential store using jps-config



If you notice below error in your Jdeveloper, follow below solution to resolve.

Unable to obtain credential store using jps-config



Solution : Take backup of 'cwallet.sso' and delete this file from /Application/src/META-INF/

Configuring OHS Server Configuration files


What is httpd.conf file ?

This is a server configuration file which typically contains directives that affect how the server runs, such as user and group IDs it should use, and location of other files. Because the server configuration file is the main file that the server starts with, Oracle HTTP Server does not include any directive that says where to locate it. The location is passed on command line when the server starts.

Location :
Example :
/<box_name>/admin/ohs_instances_fm042/config/OHS/ohs1

Follow below link for more information

http://docs.oracle.com/cd/B12037_01/server.101/b12255/conffile.htm

mod_wl_ohs.conf : This file contains all the EM/CS related entries

http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27738/wcadm_documents.htm#WCADM10693

Wednesday, July 2, 2014

Error: An unreported error occurred in Appc. No errors were reported, but the tool returned a failure result code: 1.



If you encounter below error while running your ADF app locally, add below code in web.xml just before </web-app> and it should resolve this compilation error.


Error: An unreported error occurred in Appc. No errors were reported, but the tool returned a failure result code: 1.

 <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsff</url-pattern>
            <is-xml>true</is-xml>
        </jsp-property-group>
    </jsp-config>

Monday, June 30, 2014

How to manage Content Repository Connections using Enterprise Manager


This blog explains about how to add/delete/edit Content Repository connections using Oracle Enterprise Manager.

Step1 : Login to Oracle Enterprise Manager, Expand 'Webcenter -> Spaces -> Right click on any of webcenter nodes as shown below -> Choose Settings -> Service Configuration

Step 2 : Click on 'Content Repository' Link on right hand side as shown below, Create/Delete/Edit Content repository connections here.


Step 3


Wednesday, June 18, 2014

Oracle ADF Workshop Assignments



Business Components

1- Generate EmployeeEO Entity for Employees Database table.
2- Generate Updatable View object (EmployeeVO) based on  above EmployeeEO
3- Create Application Module (EmployeeService)
4- Add 'EmployeeVO' to EmployeeService Application Module

5- Test 'EmployeeVO' by adding/modifyinig/deleting using EmployeeService Application Module.

6- Create Read Only View Object (EmployeeROVO) , Add it to EmployeeService Application Module, Test the EmployeeROVO data.

7- Add two bind variables to 'EmployeeROVO' BindFirstName, BindLastName and modify the query to include these two bind variables, Test EmployeeROVO by passing 'First Name' and 'Last Name' Values and verify the results displayed correctly based on bind variables.

8- Modify 'EmployeeROVO' as per below criteria
     - BindFirstName and BindLastName  variables or optional, If user supplies values to either of them then only apply those values to query, otherwise don't include them in query..
     - For eg : If User supplies only BindFirstName, then fetch only all the employees whose first name match with the provided input value.
    - For eg : If User doesn't supply any value for BindFistName or BindLastName, then fetch all the employees from the database.



9- Modify 'EmployeeVO' to have 'ViewCriteria' with below criteria
     - Create BindFirstName Bind Variable
     - Create ViewCriteria to include BindFirstName bind variable.
     - Test View Criteria using App Module.

10- Modify 'EmployeeVO' as per below requirement.
       - Add 'Country' transient attribute , data type as String.
       - Test 'EmployeeVO' using App  module, and you should see blank value for this attribute.

11- Create 'Static List of Values ' View object i.e 'CountryNamesLOV' which include two attributes, such as 'Country Code' and 'Country Name' , Include below values for respective attributes
              - US, USA
              - IN, India
              - CN, Canada.
              - Add 'CountryNamesLOV' to 'EmployeeService' application module, and test the View Object.

12 - Modify 'EmployeeVO' view object as per below requirement.
           - Create a View accessor for 'CountryNamesLOV' as created in above step.
           - Create 'List Of Values' to 'Country Attribute' using above created view accessor
           - Display 'Country Name' Attribute, and map 'CountryCode' attribute to 'Country' attribute of EmployeeVO
           - Test 'EmployeeVO' using Application Module, You should see drop down list for 'Country' attribute.

13- Modify Employees DB table to include a new column called 'QUALIFICATION' type of Varchar2(40)
       -> Syrnchronize 'EmployeeEO' to reflect newly updated changes on corresponding DB table.

14- Generate Entities for Departments and Job table such as 'DepartmentEO' and 'JobsEO' respectively, along with updateable View objects such as 'DepartmentsVO' and 'JobsVO' respectively
         -> Ensure Associations and View links created automatically b/w 'Employee & Jobs' , 'Employee & Departments' , If they are not created automatically, try synchronizing 'EmployeeEO' and make sure View Links and associations created.

15- Generate Java classes for 'EmployeeService' Application Module

16- Write below java method in 'EmployeeServiceImpl' class
        -> public int add(int a, int b) , which returns sum of given two numbers.
        -> Expose this method to client interface.
        -> Test 'EmployeeService' Application module, Test 'add()' method and make sure it returns correct values.


17- Write a java method in 'EmployeeServiceImpl' class as per  below requirement.
       -> public List<String> getAllEmployees();    
       -> Execute 'EmployeeROVO' without passing any bind parameters, Iterate the view object, Prepare List with all employees Last Name and return the List.
       -> Expose getAllEmployees() method to client interface.
      -> Test this method and make sure you get all the employees last name.

18- Write a java method in 'EmployeeServiceImpl' class as per below requirement
   -> Define a method public String getLastNameById(String empID)
   -> Create a EmployeeROVO with EmployeeID as bind variable, set the above method input param value to bind parameter , execute the query, If there were any results found, then get the corresponding Row Object, get the 'Last Name' and return Last name of the corresponding empID
  -> Expose 'getLastNameById() method to client interface and test this method by passing various emp ID's.

19- Write a java method in 'EmployeeServiceImpl' class as per below requirement
   -> Define a method public String setLastNameById(String empID, String lastName)
   -> Create a EmployeeVO with EmployeeID as bind variable, set the above method input param value to bind parameter , execute the query, If there were any results found, then get the corresponding Row Object.
   -> Set the provided lastName(input) to the above result Result Row.
   -> Perform getDBTransaction().commit() operation.
  -> Expose 'setLastNameById() method to client interface and test this method by passing various emp ID's.

20 - Create 'EmployeeTRVO' Transient view object with below attributes
                   firstName,lastName,age(int),DOB(Date), salary(Double)
          -> Generate the Row Impl java class and VOImpl java classes for this view object.
          -> Add this view object to App Module

22 - Create a java method in 'EmployeeServiceImpl' as per below requirement
       -> public void insertEmpDetails(String name, int empID, int age, Date dob, double salary);
       -> Ensure none of those values are blank
       -> Create a brand new row 'EmployeeTRVO' and set above all values to each setter attribute
       -> Insert newly created row into 'EmployeeTRVO'
       -> Print the VO Row count , eg : vo.getRowCount()
       -> Test this method using AM, Invoke this method couple of times and verify 'EmployeeTRVO' row count should increment by one for every method invocation.

ADF UI

 1- Create 'EmployeeUI' View Controller project , if this project doeson't exist

 2- Create "employee-home.jspx' Page with below heading
             " Welcome to Fortune Minds Employee Portal "
         -> Run the page and ensure you will see this page properly

3- Create Hello World page using Page Fragment
       -> Crate .jsff page frament, and display 'Hello World' using outputText
       -> Create a ADF Taskflow, drag above fragment as default activity
        -> Create a .jspx page and drag above taskflow as a <af:region>
        -> Run the .jspx page and verify 'Hello World' text message displayed on the screen

- Invoke Application Module Method from a Page.
       -> Create a public String sayHello(String name) method in Application Module Impl
       -> Provide the implementation to return 'Hello' +name & print entered name in console using System.out.println()
       -> Expose this method to the client interface.
       -> Develop 'test-appmodule-method.jspx' page.
       -> Drag the above created method onto the page as a button from the Data control.
       -> Launch the application in debug mode, keep a debug point in sayHello() method, Click on button, ensure control goes to the Application Module method.

4-  Bind Backing bean with Page Fragment.
            -> Repeat above exercise (Create Hello World Page using Page Fragment)
            -> Create 'com.view.backing.EmployeeBean' java class in View Controller Page.
            -> Configure above created backing bean in Taskflow
            -> Provide a button on .jsff page fragment, and bind 'action' attribute of the <af:command> button to EmployeeBean method, Print 'Hello World" in this method using System.out.println("Hello World")
            -> Run the page, Click on the button, ensure 'Hello World' should be printed in console.

5-  Develop Tabbed Layout UI Page

     -> Develop below three page fragments(.jsff) customer-home.jsff, vendor-home.jsff and employee-home.jsff , Have some dummy text on each page
     -> Develop three respective Task flows , and drag each page fragment(.jsff) on to corresponding Task flow
     -> Develop a Home Page (.jspx) with three different tabs (use <af:pnaelTab>) with 'Customer', 'Vendor' and 'Employee' tabs
    -> Drag above three respective task flows onto each <af:showDetailItem> as <af:region> component.
    -> Run the home page, you should see three different tabs, by clicking on each tab you should see corresponding message.


 6- Develop Login Page as per below requirement
       -> Create EmpLoginTRVO Programatic View object with userID and password attributes. userID should be key attribute
       -> Shuffle this VO to App Module
       -> Create'emplogin.jspx' page
       -> Drag userID and Password attributes as <af:inputText> components on to emplogin.jspx page.
       -> Write a method validateEmpLogin() method in Application Module, which returns boolean attribute, This method should get the current row from EmpLoginTRVO row, get userID and password attributes, If both values are not null , then query Emp table with these two parameters using 'Read Only view Object', If there were any results found then return true otherwise return false.
    Note : If emp table doesn't have 'userID' and 'password' fields, then alter the table and include these two new columns.
        -> Expose above method to client interface and drag this method as a button onto 'emplogin.jspx' page, rename the button to 'Login'
        -> Enter valid login credentials, click on 'Login' button, debug the code and see whether given login credentials match with the database or not.

7. Upload CSV file content into Database table

    -> Create employee.csv file with Id, firstName, lastName, Dob columns and have 5 sample employee rows and save it as .csv file in c:\tmp directory
   - Develop ADF UI which allows the user to upload any csv file using 'Browse'
   - Create Entity and Updatable View Object for Employee table
   - Provide a Save button on UI Page, By clicking on 'Save' button , Read the contents of uploaded CSV file, set into Updatable view object and perform DB commit,
   - Upon successful save, display information message saying 'Successfully Saved'
   - If there are any errors while saving into DB, Display error message " Error/Failure occurs while saving"

8 Read Database Table and convert into CSV file

   - Develop ADF UI application, Display a page which accepts 'DB table Name'
   - Provide a 'Download' button
   - Without entering any value for 'DB Table Name' , By clicking on 'download' button prompt 'DB Table Name is required' message
  - By clicking on 'Download' button, Verify whether given DB table name exists in database or not, If exists read the content from DB table and write into CSV file allow the user to open or save .

9 Table with top line Filter and Sorting features

     -> Create a 'EmployeeROVO' by selecting all the attributes
     -> Create Page fragment (.jsff), Taskflow, and page (.jspx)
     -> Drag the 'EmployeeROVO' as <af:table> onto the page fragment, Ensure select selection criteria (Single/Multiple), Sorting, Filtering options while dragging onto the page fragment
     -> Drag the taskflow onto the page as <af:region>
     -> Run the application, You will see all the employee results in a table format along with top line filter (input text field on top of every column in a table) , Also sorting (Ascending/Descending little triangles) on top of each column name.
    -> Test the top line filter by entering any value and hit enter, Frame work filter the results based on the filter input value and refresh the <af:table> component, Also you can sort by column as well


10. View Criteria
      -> Create 'EmployeeROVO'  with :BindFName, :BindLName, :BindEmail bind variable, and define below view Criteria
                  -> First Name, Last Name, Email
      -
      ->  Add this ROVO to Application Module, Test the view criteria by entering either of those values or all of them and make sure you get correct results.
      -> Create 'employee-search.jsff' page by dragging above created view criteria on to it, You should able to see Query Panel along with results table.
      -> Create 'employee-search-config.xml' Task flow, Drag above page fragment onto it.
      -> Develop 'employee-home.jspx' , Drag above taskflow as <af:region>
      -> Run the application, Test the search query with all possible values and make sure you see corresponding results.

11. View Criteria with List of Values.

    -> In addition to above assignment (View Criteria), Implement below functionality
    -> Create 'EmployeeFirstNameROVO', 'EmployeeLastNameROVO'
    -> Create List of values for 'FirstName', 'LastName' attributes in 'EmployeeROVO' with above ROVO's as view accessors
    -> Delete previously defined search criteria and results from 'employee-search.jsff' and drag the 'EmployeeROVO' view criteria again onto it as <af:QueryPannel> along with results,
   -> Test the application, ensure you see List of values for First Name and Last Name in Query criteria, and Search make sure you see correct results.

12. Provide 'Add' Button to Employee Search Results table.

         - This assignment is in  addition to Assignment # 11, Ensure Assignment #11 shows the results in <af:table> format.
         - Redo the assignment #10 using Updatable view ojbect(EmployeeVO) instead of Read Only View Object (ROVO)
         -  Provide 'Add' button on 'employee-search.jsff' page, By clicking on this button create an empty row for EmployeeVO
         -  Allow the user to enter values for newly created EmployeeVO Row, By clicking 'Save' button, ensure to save to Employee table.

13. Provide 'Delete' Button to Employee Search Results table.

         - This assignment is in  addition to Assignment # 12,
         -  Provide 'Delete' button on 'employee-search.jsff' page, By clicking on this button delete selected row from EmployeeVO
         -  Ensure, User must select a row before clicking on 'Delete' button, If not throw validation message otherwise delete from <af:table> component.
        - By clicking on 'Save' button, ensure to remove the deleted row from database table.

14. Provide 'Edit' Button to Employee Search Results table.

         - This assignment is in  addition to Assignment # 12.
         - Create 'RowSelect' Transiet attribute of type 'String' in EmployeeVO , Mark this attribute as 'Updatable' , So that user can able to update the value.
         - Drag this attribute as 'SelectbooleanCheckBox' first column in above <af:table>, So that user can able to select /unselect the row in <af:table>
         -  Provide 'Edit' button on 'employee-search.jsff' page, By clicking on this button delete selected row from EmployeeVO.
         - Ensure User must select ONLY one row corresponding check box before clicking 'Edit' button, otherwise display error message as 'At least one row must be selected in order to Edit'
        - By clicking on 'Edit' button, Display selected Emplyoee row in Edit form
         -  Provide 'Save' button in 'Edit' form, User should able to modify the existing data and save it into Database.

15. Display selected rows on <af:table> component in a backing bean. 
        - This is in addition to Assignment # 13,
        - Allow the user to select more than one row in <af:table> component.
        - Provide a buttoon 'getSelectedEmployeeRows' button on employee-search.jsff page.
        - By clicking on this button, Display all the selected employee rows details such as ID, First Name, Last Name in backing bean method using System.out.println

16. Partial Trigger Based on selected value from Select One Choice
      - Create a 'CountryTRVO' Transient View object with 'Code' and 'Description' values
      - Create rows programatically with below values 'IN,India', 'US,USA', 'CN,China', 'MX,Mexico'
         in initlizaeCountryValues() method, which should be defined in AMImpl, expose this to client interface
      - Define a page fragment with below components
                 - Country List of values <selectOneChoice> - Drag 'CountryTRVO' as <af:selectOneChoice> component onto screen
                  - Define a output text, Based on the selected value from the above list of values, display selected value associated 'Description' i.e  India is selected then display "India' in output text field
      - Create 'countrylist-config.xml' Taskflow, Drag the initializeCountryValues() as default activity, and drag above pagefragment onto it
      - Create .jspx file, Drag the above taskflow as <af;region> Test the behavior.
   

17. Select Many Choice List Example

        - Create 'selectmanydemo.jsff', 'selectmanychoicedemo-config.xml' (Taskflow), 'selectmanychoicedemo.jspx'
        - Create a 'LanguageLOV' static list of values with below key value pair of values
                 En,English
                 Fr, French
                 Hn, Hindi
                 Ur, Urdu
                 Sp,Spanish
                 Jn,Japanese

        - Display Employee Name (InputText), EmployeeID(InputText) , Languages (SelectManyChoice) components on page fragment
        - Allow the user to enter those values, If user select more than one language, store all the selected values into different table with 'Employee ID, Language Code' key value pair.
        - Provide a search page with 'Employee Name' (Select One Choice), 'Language' (Mutli selection) , Perform the search and display the matching results based on given criteria.
       - Provide 'Edit' button to the <af:table> component, By clicking on this button, Display the selected employee information in a editable format. Make sure, If user has selected more than one language display them as selected in <af:selectManyChoice> component.

18. Data Control using POJO (Plain Old Java Object)

   - Create MathUtil java class with below method
                          public int add(int a, int b), implement to return sum of a+b;
   - Generate a Data control for 'MathUtil' java class , Right click on it, Generate Data Control
   - Create 'mathutil.jsff', 'mathutil-config.xml(Taskflow)', MathUtilHome.jspx
   - Drag .jsff onto taskflow, Taskflow onto .jspx
   - Provide two input text fields onto .jsff
   - Drag <af;outputtext> onto .jsff and name it as 'Result'
   - Create method bindings for 'add(int,int) method in 'mathutil.jsff' page definition.
   - Drag <af:commandButton> onto .jsff page as 'Add' button.
  - By clicking on 'Add' button, perform below activities
              - Make sure user enters values for both a and b input text fields otherwise display error message.
             - If above validation successful, then invoke backing bean method, get the values for above two input text fields , invoke add() method from MathUtil data control by passing a, b values entered by the user , Set the result of the above method to 'Result' outputtext field.

19.  Implement Auto suggestion or Type ahead

 - Develop a Employee Search Page with below attributes
            - First Name - Auto suggestion , While typing the name, display list of all existing first names
            - Last Name - Auto suggestion , While typing the last name, display all existing last names
            - Country ( Select One Choice)
            - Search Button - By clicking on this button, Perform search and display all the matching employee search results in ,af:table format
- Refer this blog for more info : http://fortunefusionminds.blogspot.com/2013/03/type-ahead-autosuggestion.html

20. Implement Security to ADF application

    - Develop a sample ADF application with below requirement
             - Display all the employees in a Read only table on 'searchemp.jsff' page fragment, Provide a button 'Edit Employee' button.
             - By selecting one employee from the list, click on 'Edit Employee' button, it should redirect to different page(editemp.jsff) in editable format.
             - Implement security to ADF application
             - Create a two application roles called 'AppAdmin' , 'AppUser'
             - Create two Enterprise roles such as 'Admin', 'User'
             - Map 'AppAdmin' to 'Admin'  (Application Role to Enterprise role)
             - Map 'AppUser' to 'User' role
             - Create a user 'Sam' and grant 'AppAdmin' role
             - Create a user 'Tom' and grant 'AppUser' Role.
             -  Launch the application, User should be prompted to login page, Only 'Sam' and 'Tom' should able to login to the application
            - Only 'AppAdmin' User should able to see 'editemp.jsff' in Editable form.
            - 'AppUser' should able to see 'editemp.jsff' in read only .




Monday, June 16, 2014

How to Create Database connection using Jdeveloper ?


This blog explains about how to configure Database connection using Jdeveloper, and test SQL script statements in Jdeveloper

- Launch Jdeveloper, Choose 'Database Navigator' as highlighted below
- Right click on 'IDE Connections' and choose 'New Connection'

- Enter the Database connection details - User Name, Password, Host Name, JDBC Port Name and SID/Service Name are required fields,
- If you know the JDBC URL, then select the ' Enter Custom JDBC URL' check box, paste the URL and click on 'Test' connection.
- After successful connection, You will see newly created connection in 'IDE Connections' , expand newly created connection, Right click on it, Choose 'Open SQL Worksheet' as shown below
- You can test all SQL statement sin SQL worksheet as per below screenshot.

Thursday, June 5, 2014

How to Search Images in UCM Server


This blog explains about how to perform a search in UCM for a specific image

- Login to UCM Server
- Choose Search -> Standard Search



How to Identify whether Oracle Coherence is correctly Configured in Webcenter Portal Application



This blog explains about various techniques to monitor whether Coherence is properly configured and actively being used for a Portal application or not.

Remember,  it's important to note that not all the content that you fetch from UCM will automatically gets cached. Only if you are using Content Presenter or other out of the box components then it gets cached. Any calls using RIDC and not using content presenter would not be cached. 

- If you notice below entry in your <Managed_Server>-diagnostic.log file, that means coherence is not properly configured, you need to correct.

[APP: AviTrustSamplePortal#V2.0] Unable to load Coherence configuration file content-coherence-cache-config.xml. Using in-memory (local) caches.

- Use Oracle EnterPrise MBean Browser as shown below
     - Login to Enterprise Manager
     - Select the application which you want to verify
     

- Select 'Application Deployment' drop down, Select 'System MBean Browser'
       - Ensure, You should see 'Managed Server Instances' in 'Application Defined MBeans -> Coherence' , If you don't see your managed server instances here, that means Coherence is not configured .
 - Another way of identifying is, Login to 'Webcenter Content Server'
 - Select 'Administration-> System Audit Information'
- Select 'system, requestaudit' and 'Full verbose Tracing' ash shown below, click on 'Update'
- Click on 'View Server Output' link
- Clear the content by 'Clear' link
- Open the page which has content presenter, Click on 'Refresh' button on UCM Server - View Server output window
- You should see a query and execution time in the UCM Log
- Now clear the log, and refresh the page again, You shouldn't see that query in UCM, It should have got the data from Oracle Coherence.

Trouble Shooting
- Ensure 'portal-coherence.jar' available in src->APP-INF->lib
- Ensure 'content-coherence-cache-config.xml' contains valid entries based on your requirements, focus on 'local-cache' or 'distributed-cache' based on your hardware infrastructure, concurrent user count, throughput
- Ensure 'portal-coherence.jar' deployed to '/tken4o/admin/wcp_domain/mserver/wcp_domain/lib' - This is example only, you need to find your {WL-HOME} path and identify as per this.