Wednesday, August 21, 2013

WebCenter: Checking the installed version information

Use Case

While installing WebCenter Portal 11.1.1.8 you will see a screen like the following during the domain creation

First I thought there is something wrong but beeing some time with Oracle technology now I know that these version information might just not be the one you really installing.

So the purpose of this post is to double check the WebCenter version once installed.

Check installed versions with OPatch

Create a checkversion.sh script like the following

export MW_HOME=/oracle/fmwhome11118
export ORACLE_HOME=$MW_HOME/Oracle_WC1
export JAVA_HOME=/oracle/javahome/jdk1.6.0_29
export PATH=$JAVA_HOME/bin:$PATH

java -version

$ORACLE_HOME/OPatch/opatch lsinventory -details -jdk $JAVA_HOME

The setting of Oracle is needed in order to run OPatch successfully.
Next run the script from the command line:

[oracle@soabpm-vm fmwhome11118]$ sh checkversion.sh
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
Oracle Interim Patch Installer version 11.1.0.9.9
Copyright (c) 2012, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/fmwhome11118/Oracle_WC1
Central Inventory : /oracle/oraInventory
   from           : /oracle/fmwhome11118/Oracle_WC1/oraInst.loc
OPatch version    : 11.1.0.9.9
OUI version       : 11.1.0.9.0
Log file location : /oracle/fmwhome11118/Oracle_WC1/cfgtoollogs/opatch/opatch2013-08-17_06-35-49AM_1.log


OPatch detects the Middleware Home as "/oracle/fmwhome11118"

Lsinventory Output file location : /oracle/fmwhome11118/Oracle_WC1/cfgtoollogs/opatch/lsinv/lsinventory2013-08-17_06-35-49AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle WebCenter Portal Suite 11g                                    11.1.1.8.0
There are 1 products installed in this Oracle Home.


Installed Products (42):

Application Server 11g Cloning Component                             11.1.1.8.0
Installer SDK Component                                              11.1.0.9.0
Jython                                                               11.1.1.7.0
Oracle Bali Share                                                    11.1.1.7.0
Oracle Business Process Management Process Spaces                    11.1.1.7.0
Oracle Display Fonts                                                 11.1.1.7.0
Oracle Extended Windowing Toolkit                                    11.1.1.7.0
Oracle Fusion Middleware Admin Config                                11.1.1.6.0
Oracle Help for Java                                                 11.1.1.7.0
Oracle Help for the Web - UIX                                        11.1.1.7.0
Oracle Help for the Web Shared Library                               11.1.1.7.0
Oracle Help Share Library                                            11.1.1.7.0
Oracle Ice Browser                                                   11.1.1.7.0
Oracle Jakarta                                                       11.1.1.7.0
Oracle JFC Extended Windowing Toolkit                                11.1.1.7.0
Oracle JGroups                                                       11.1.1.7.0
Oracle JSCH                                                          11.1.1.7.0
Oracle One-Off Patch Installer                                       11.1.0.9.9
Oracle Remote Diagnostic Agent                                       11.1.1.7.0
Oracle Remote Intradoc Client                                        11.1.1.8.0
Oracle SOA workflow                                                  11.1.1.7.0
Oracle UIX                                                           11.1.1.7.0
Oracle Universal Installer                                           11.1.0.9.0
Oracle Upgrade Assistant                                             11.1.1.8.0
Oracle Upgrade Assistant                                             11.1.1.8.0
Oracle Upgrade Assistant for Webcenter                               11.1.1.8.0
Oracle WebCenter Portal Suite                                        11.1.1.8.0
Oracle WebCenter Portal Suite 11g                                    11.1.1.8.0
Oracle WebCenter Portal: Activity Graph                              11.1.1.8.0
Oracle WebCenter Portal: Analytics Collector                         11.1.1.8.0
Oracle WebCenter Portal: Discussions Server                          11.1.1.8.0
Oracle Webcenter Portal: Framework                                   11.1.1.8.0
Oracle Webcenter Portal: Framework Core                              11.1.1.8.0
Oracle WebCenter Portal: Pagelet Producers                           11.1.1.8.0
Oracle WebCenter Portal: Personalization                             11.1.1.8.0
Oracle Webcenter Portal: Portlet Server                              11.1.1.8.0
Oracle WebCenter Portal: RCU                                         11.1.1.8.0
Oracle Webcenter Portal: Spaces                                      11.1.1.8.0
Oracle WebCenter Portal: Suite Components                            11.1.1.8.0
Oracle WebCenter Portal: Wiki                                        11.1.1.8.0
Oracle WebLogic Communications Service Client Library                11.1.1.7.0
OracleAS Documentation                                               11.1.1.8.0
There are 42 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@soabpm-vm fmwhome11118]$

Further information
If you want to try out WebCenter follow the links for more information

Download WebCenter Portal 11.1.1.8

Neue Features und Ă„nderungen in WebCenter Portal  11.1.1.8.0
http://docs.oracle.com/cd/E29542_01/doc.1111/e27603/whatsnew.htm#sthref8

See more Screenshots of the WebCenter Portal  11.1.1.8.0 on our german blog
http://www.enpit.de/webcenter-portal-11-1-1-8-mit-zahlreichen-neuerungen/

Saturday, August 17, 2013

ADF: Creating a custom train button bar, reflecting the disabled state

Requirement

In some cases there is a need to obtain more control over the ADF train button bar. The generated default does not allow to add an additional actionListener.



Environment

JDeveloper/ADF 11.1.1.7

Solution

There is a simple solution I found on http://www.adftips.com/2010/10/adf-ui-how-to-specify-actionlistener.html to create custom buttons for the previous / next functionality.


But there is still one thing missing. The buttons are always enabled. Unfortunataly there is no easy way to set the disabled property right from the given trainModel that is accessible by EL.

To solve this we create a managed bean as follows:



Now it is possible to bind the properties for disabled status




Similiar posts


Friday, August 2, 2013

JDeveloper 12c: Create RESTful Service from Java Class

With JDeveloper 12c finally it is possible to create RESTful Services from a Java Class. The implementation is based on Jersey following the Java EE 6 specification JAX-RS. For testing JDeveloper includes a comprehensive Tooling. In general RESTful services are really popular for mobile applications, e.g. ADF Mobile.

Get started
Create a simple Java Class for your business domain object plus a Service Facade that you want to expose as a RESTful Service.
Make sure to annotate the class with the @XmlRootElement otherwise the REST Service will not work for this domain object.

Next create a simple service facade with some test data, e.g.
package enpit.sample.adf12c.pojorest.model;
import java.util.ArrayList;
import java.util.Date;import java.util.List;

public class PersonService {

    
private List<Person> persons;
    
private Person person;

    
public PersonService() {
        
super();
        
this.persons = new ArrayList<Person>();
        
for (long i = 0; i < 10; i++) {
            Person p = 
new Person();
            p.setId(i);
            p.setFirstname(
"Firstname " + i);
            p.setLastname(
"Last " + i);
            p.setHiredate(
new Date());
            
this.persons.add(p);
        }
        
this.person = this.persons.get(0);
    }

    public List<Person> getPersons(){
        return this.persons;
    }

    public void addPerson(Person person) {
        System.out.println(
"add person " + person);

        
if(person != null){
            getPersons().add(person);
        }
    }
    public Person getPerson(){
        
return person;
    }
}

So far there is nothing special. 

Create RESTful Service with the help of JDeveloper 12c
Now comes the interesting part. Select the PersonService.java in the application navigator and
choose "Create RESTful Service…"

You will get a wizard to specify the RESTful Service interface. Set the desired root path. Choose the desired media types and the Methods you want to expose as REST Service
After finishing the wizard the following happens
- JAX-RS Annotations are generated  on the Java Class
package enpit.sample.adf12c.pojorest.model;
import java.util.ArrayList;
import java.util.Date;import java.util.List;import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;import javax.ws.rs.POST;import javax.ws.rs.Path;import
 javax.ws.rs.Produces;


@Path(
"rest")
@Produces(value = { "application/json""application/xml" })
@Consumes(value = { "application/json""application/xml" })
public class PersonService {

    
private List<Person> persons;
    
private Person person;

    
public PersonService() {
        
super();
        
this.persons = new ArrayList<Person>(){
        
for (long i = 0; i < 10; i++) {
            Person p = 
new Person();
            p.setId(i);
            p.setFirstname(
"Firstname " + i);
            p.setLastname(
"Last " + i);
            p.setHiredate(
new Date());
            
this.persons.add(p);
        }
        
this.person = this.persons.get(0);
    }

    @GET
    @Path(
"/persons")
    
public List<Person> getPersons(){
        
return this.persons;
    }

    @POST
    @Path(
"/person")    
    
public void addPerson(@FormParam("person"Person person) {
        System.out.println("add person " + person);

        
if(person != null){
            getPersons().add(person);
        }
    }

    @GET
    @Path(
"/person")
    
public Person getPerson(){
        
return person;
    }
}

- web.xml is created. The Jersey Servlet is configured properly.

Testing the RESTful Service in JDeveloper 12c
Jdeveloper is quite powerful. It lets you test the RESTful service right in the IDE.
Right-Click on the PersonService.java class and choose Run.

In background WebLogic Server 12c starts and the RESTFul Service gets deployed.

The WADL is kind of WSDL for RESTful Services. Clicking on the "Target Application WADL" URL brings you to the overview of the provided service operations

You can test each Service Operation right from the IDE. Pressing the "Test" Button brings you to the HTTP Analyzer Screen.
Here you can choose the Method, change HTTP Headers (e.g. what kind of media type you want to accept).
Press "Send Request" to actually test the Service Operation. Make sure to change the view to "HTTP Content" not "WADL Structure" otherwise you want see the pretty formatted output on the right hand side.

Change the Accept-Header to application/json and send the request again. The output automatically will be in JSON format.
The HTTP Analyzer is even so good to parse the POST Parameter to create a good looking form for data entry

Conclusion
Creating and Testing RESTful Services is really simple with JDeveloper 12c.