Wednesday, December 23, 2009

What is a Price Band

My first edit to wikipedia: http://en.wikipedia.org/wiki/Price_band Needs a lot of work, but hey at least I devoted a few minutes to enhancing community knowledge :)

Tuesday, December 1, 2009

Setting ADF view object bind variable programatically

Let's say you have an ADF VO defined which uses a Bind Variable, such as:

...and line.order_header_id = :paramOrderHeaderId

You want to set this parameter before the view is used, perhaps before a page is displayed which shows data from that view. There are a couple of ways to do this:


Option 1: Use a page invokeAction to call an AM method to set the bind variable. (RECOMMEND WAY)

Firstly create a method in your application module to set the view parameter, such as:


public void initializeMyVO() {
MyVOImpl vo = (MyVOImpl)findViewObject("MyVO1"); vo.setNamedWhereClauseParam("paramOrderHeaderId",new Long("100000013205391"));

}

Next in your application module definition expose this method on the client interface.

On the page which has a binding for your view, create a method action binding for this method such as:

<methodAction id="initializeMyVO" InstanceName="MyAppModuleDataControl.dataProvider" DataControl="MyAppModuleDataControl" RequiresUpdateModel="true" Action="invokeMethod" MethodName="initializeMyVO" IsViewObjectMethod="false"/>

Then create an invokeAction to call your AM method. This is done in the page definition file such as:

<invokeAction id="executeInitialize" Binds="initializeMyVO" Refresh="prepareModel" RefreshCondition="${!adfFacesContext.postback}"/>

The above refresh conditions should call this method only once when the page is shown. For more explanation on the refresh conditions see: http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#sthref837



Option 2: Call AM method from a task flow

Optionally you can also create the same application module method as above, but call it from a task flow. Just drag and drop the method from your application module's data control to the task flow diagram. You can call the method before your page is invoked or as needed. If you have a bounded task flow, you could make this call the default activity.


Option 3: Retrieve the bind variable variable from user session data hash table



With this option you can have your bind variable use a Groovy expression to get the value of a variable that was placed in the user data hash table. This method is described in Manish Rungta's blog at: http://blog.us.oracle.com/manish/?96498842

Tuesday, October 6, 2009

Configuring JDeveloper integrated Weblogic server for SOA Suite

This post covers how to create a SOA development environement using the Weblogic server that is installed along with JDeveloper 11GR1. JDeveloper 11 includes an embedded Weblogic 10.3 installation, however that install is not setup for SOA suite. While many development setups will involve deploying from a local JDev to a standalone Weblogic server somewhere else, sometimes you want to develop and test all on the same machine and you won't need to install Weblogic seperatly to do this.

Pre-reqs: You'll need JDeveloper installed already and a database. Ideally you've already deployed something to JDev to make sure its all working.


1. First you need to install the JDeveloper SOA Suite extension. Goto Help/Check for Updates/ and pick the "Oracle SOA ..." choice. Restart JDev after this.

2. You'll need to download Oracle SOA Suite (http://www.oracle.com/technologies/soa/soa-suite.html), unzip and run setup. When prompted for a FMW home directory, select the directory created when you installed JDeveloper.

3. Setup database schemas using the RCU tool. Certain schemas (such as MDS) are required before installing SOA suite. You'll need to use the FMW RCU tool to create them. For more information consult: http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14259/overview.htm.

4. Run the domain configuration wizard which will be installed at fmw/Oracle_SOA1/common/bin/config.cmd . You will prompted for a domain and you should select the DefaultDomain already created when you setup JDeveloper. It will be a path like jdeveloper/systemxxxxx/DefaultDomain .
Next select "Oracle SOA Suite 11.1.1.0" when prompted on which components to add to the domain. You should also select Oracle Enterprise Manager and Business Activity Monitoring. EM and BAM will be very helpful in developing SOA apps.
You will then be prompted for a data source (you may have already created a datasource in your Weblogic server to reuse). After that you'll be asked for the schema information for the schemas created previously using the RCU tool.

5. Start your servers! You're domain now has 3 servers: an admin server, soa server and bam server. You can start your default server and soa server using these commands:

DefaultDomain\startWebLogic
DefaultDomain\startManagedWebLogic soa_server1


Your domain's config.xml will have been modified with the new server settings including the port numbers if you forget them or need to change them.

It begins...

In my career as a software developer I often find myself scouring the Internet for solutions to problems. I also end up creating lots of notes on internal wiki pages or in personal documents as I figure things out. I've decided to attempt at keeping up a blog where I post some of this information that will hopefully be useful to other developers. This will also be useful for myself to manage my own notes.

I currently work for Oracle developing SaaS pricing applications using the latest in Java and Fusion Middleware technologies. Some frameworks and products I use often are SOA, ADF, webservices, Weblogic, Siebel, CRM OnDemand, JDeveloper, SQL, JSP, Oracle DB ... and many more.

Any opinions expressed in this blog are entirely my own and do not represent those of my employer.