Friday, March 5, 2010

Managing ADF Customizations with MDS

In this simple scenario I am an ISV who needs to deliver different versions of my app to different customers. I also want to give end users the possibility to „personalize“ the application.

A customized application contains a base application and one or more layers
containing customizations. MDS stores the customizations in a metadata repository and retrieves them at runtime to merge the customizations with the base metadata to reveal the customized application. Since the customizations are saved separately from the base, the customizations are upgrade safe; a new patch to base can be applied without breaking customizations. When a customized application is launched, the customization content is applied over the base application.

Seeded customization of an application is the process of taking a generalized
application and making modifications to suit the needs of a particular group, such as a specific industry or site. Seeded customizations exist as part of the deployed application, and endure for the life of a given deployment.






















package oracle.model.cust;

import java.io.IOException;
import java.io.InputStream;

import java.util.Properties;

import oracle.mds.core.MetadataObject;
import oracle.mds.core.RestrictedSession;
import oracle.mds.cust.CacheHint;
import oracle.mds.cust.CustomizationClass;

public class CustCC extends CustomizationClass {
private static final String DEFAULT_LAYER_NAME = "CustSite";
private String mLayerName = DEFAULT_LAYER_NAME;

public CustCC() {
}

public CustCC(String layerName) {
mLayerName = layerName;
}

public CacheHint getCacheHint() {
return CacheHint.ALL_USERS;
}

public String getName() {
return mLayerName;
}

public String[] getValue(RestrictedSession sess, MetadataObject mo) {

// This needs to return the site value at runtime.
// For now, it's always null.
Properties properties = new Properties();
String configuredValue = null;
Class clazz = CustCC.class;
InputStream is = clazz.getResourceAsStream("/customization.properties");
if (is != null){
try {
properties.load(is);
String propValue = properties.getProperty(mLayerName);
if (propValue != null){
configuredValue = propValue;
}
} catch (IOException e) {
e.printStackTrace();
}
}
return new String[] {configuredValue};
}

}















Step 4 - Add the customization class available to the MDS Configuration, by editing the adf-config.xml file.









Step 5 – Create the customization.properties file in the Model project. Ensure it is in the \src directory.



Add the following entries

#Configured values for the default layer values
#CustSite=Cust1
CustSite=Cust2

Step 6 – These “layer” values must also be added to the base CustomizationLayerValues.xml file.



Add the following entries –



Step 7 – In JDeveloper, Switch to customiser role
Tools / Preferences / Roles



View Customization Context



Customising the ADF Model
In this section we will customise the Model for Cust2 and add the emp_email attribute to EO and VO.

Step 1 – Enter Edit mode and select Cust2



Step 2 - In SQLPLUS, add the new column to the table.
alter table myEmps add
(emp_email varchar2(20))


Step 3 – Amend the Model project and add the emp_email attribute to the EO and VO.



This change is saved in a separate xml file, specific for cust2.



Do the same for the VO.



Customizing the UI
In this section we will amend the browseEmps.jspx to include the emp_email attribute for cust2.

Step 1 – open browseEmps.jspx.

The datacontrol now includes the new attribute –









Thursday, February 25, 2010

Using Oracle Rules for Human Workflow Routing

In this simple loanApproval scenario I will use Oracle Rules to work out who to route to.

Car – car loans will be approved by jcooper
Home – home loans will be approved by mtwain
Personal – personal loans will be approved by jstein



Define participants via Rules -










Auto-generate task form

Deploy & Test

Tuesday, February 9, 2010

ADF11g calling Oracle Rules

Simple scenario here -

I have created a simple Rules component and deployed it to SOA Suite 11g.
I now want to execute the Rules from an ADF app. No coding required!!!

I create / deploy a very simple Rules app

Input XSD (simpleCheck.xsd)–



Output XSD (simpleResult.xsd)–





to soa_domain

The Rules are as follows –





Test using default WLS Tester

I test via http://localhost:8001/soa-infra









Test using ADF Web Service DataControl




Create a new ADF App in JDeveloper







location = file:///path to your simpleResult.xsd





































Tuesday, February 2, 2010

Memory issues after installing SOA Suite 11g PS1?

I had issues starting the weblogic adminServer after installing PS1 on an older laptop of mine.

Solution -

amend the setSOADomain.cmd in the
D:\soaSuite11gPS1\user_projects\domains\soa_domain\bin
directory.

set DEFAULT_MEM_ARGS=-Xms512m -Xmx512m
set DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=128m -XX:MaxPermSize=384m