Bookmarkable page with parameters

Jang Vijay Singh | Feb 8, 2010 18:02 +0000
I should first mention, Frank Nimphus has an excellent viewlet on "How - to bookmark view activities in a taskflow".
This post addresses the bit about having a bookmarkable page with parameters.
e.g. On a search page, clicking on an item takes the user to a detail page, which the user would then like to bookmark for that particular item.
For this usecase, there's no option but to set the parameter in the URL itself, as a request parameter.
In the old fashioned world of JSP's, this was textbook. Somehow in the ADF world of hierarchical scopes, we might have lost touch with the nuts and bolts. So here's revisiting the basics - ADF style.

Step 1. Create a requestScoped 'bean' in the unbounded taskflow containing the bookmarkable page.



Step 2. Set the ItemId request parameter (set in the URL) in the requestScope parameter



Step 3. Access the value:









ADF Coding Ninja

(author unknown) | Feb 8, 2010 16:37 +0000

Want to know the inner secret of being an ADF Ninja. Awesome video!

ADF Sample: Declarative line item search

Jang Vijay Singh | Feb 8, 2010 13:01 +0000

A common functional requirement is to search for master objects based on some attributes of its detail objects.
- Search for requisitions containing an item costing more than a given amount.
- Invoices containing invoice lines with specific item names.

ADF has purely declarative support for implementing this kind of a usecase. To illustrate, I have implemented:
A search for departments which have at least one employee whose salary is greater than the salary entered in search form.

The core concept is that a 'view link accessor' (or an association accessor in the entity layer) can (should) be seen as just another attribute.

Download the example: LineItemSearch.zip.

ADF Code Corner on Twitter !

frank.nimphius | Feb 8, 2010 10:03 +0000

Just in case …

  • you are worried about missing bits of information about Oracle JDeveloper and ADF
  • you feel uncomfortable saying “If I had known this before it would have saved me …”
  • you don’t have time to frequently browse OTN
  • you enjoy technical stuff more than knowing what Paris Hilton did last week
  • you want to know more than others do

ADF Code Corner “twitters” interesting updates and information about Oracle JDeveloper, ADF and related topics.

Get More, Learn More: http://twitter.com/fnimphiu

Frank

I will be teacing an ADF course 24th March 2010

(author unknown) | Feb 8, 2010 03:27 +0000

..In London for Oracle partners. If you would like to register please click

SCAN 11g R2 JDBC Load Balance Test

Pas Apicella | Feb 7, 2010 20:58 +0000
Now that I have a SCAN 11g R2 setup I was able to quickly verify the load balancing of connections using a SCAN URL as shown below. I find it very useful to have such a simple JDBC URL. No matter what nodes are added or removed I never have to alter my client JDBC URL again for this RAC cluster.

Output

Test Started at Mon Feb 08 13:59:21 EST 2010
Obtaining 5 connections

=============
Database Product Name is ... Oracle
Database Product Version is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
=============
JDBC Driver Name is ........ Oracle JDBC driver
JDBC Driver Version is ..... 11.2.0.1.0
JDBC Driver Major Version is 11
JDBC Driver Minor Version is 2
=============
Connection #0 : instance[J11G22], host[auw2k4], service[J11G2]
Connection #1 : instance[J11G21], host[auw2k3], service[J11G2]
Connection #2 : instance[J11G22], host[auw2k4], service[J11G2]
Connection #3 : instance[J11G21], host[auw2k3], service[J11G2]
Connection #4 : instance[J11G22], host[auw2k4], service[J11G2]
Closing Connections
Test Ended at Mon Feb 08 13:59:22 EST 2010

Code
  
package au.support.jdbc.scan;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.sql.Statement;

import java.util.Date;

import oracle.jdbc.pool.OracleDataSource;

public class LoadBalanceTest
{
private OracleDataSource ods = null;
public final String userId = "scott";
public final String password = "tiger";

private static final String url =
"jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" +
"(HOST=apctcsol1.au.oracle.com)(PORT=1521))" +
"(CONNECT_DATA=(SERVICE_NAME=J11G2)))";

public LoadBalanceTest() throws SQLException
{
ods = new OracleDataSource();
ods.setUser(userId);
ods.setPassword(password);
ods.setURL(url);
}

public Connection getConnection() throws SQLException
{
return ods.getConnection();
}

public void run () throws SQLException
{
Connection[] connArray = new Connection[5];

System.out.println("Obtaining 5 connections");
for (int i = 0; i < connArray.length; i++)
{
connArray[i] = getConnection();
}

for (int j = 0; j < connArray.length; j++)
{
if (j == 0)
{
DatabaseMetaData meta = connArray[j].getMetaData ();

// gets driver info:

System.out.println("\n=============\nDatabase Product Name is ... " +
meta.getDatabaseProductName());
System.out.println("Database Product Version is " +
meta.getDatabaseProductVersion());
System.out.println("=============\nJDBC Driver Name is ........ " +
meta.getDriverName());
System.out.println("JDBC Driver Version is ..... " +
meta.getDriverVersion());
System.out.println("JDBC Driver Major Version is " +
meta.getDriverMajorVersion());
System.out.println("JDBC Driver Minor Version is " +
meta.getDriverMinorVersion());
System.out.println("=============");
}

getInstanceDetails(connArray[j], j);
}

System.out.println("Closing Connections");
for (int y = 0; y < connArray.length; y++)
{
connArray[y].close();
}
}

public void getInstanceDetails (Connection conn, int i) throws SQLException
{
String sql =
"select sys_context('userenv', 'instance_name'), " +
"sys_context('userenv', 'server_host'), " +
"sys_context('userenv', 'service_name') " +
"from dual";

Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(sql);
while (rset.next())
{
System.out.println
("Connection #" + i + " : instance[" + rset.getString(1) + "], host[" +
rset.getString(2) + "], service[" + rset.getString(3) + "]");
}

stmt.close();
rset.close();
}

public static void main(String[] args)
{
LoadBalanceTest loadBalanceTest;
try
{
System.out.println("Test Started at " + new Date());
loadBalanceTest = new LoadBalanceTest();
loadBalanceTest.run();
System.out.println("Test Ended at " + new Date());
}
catch (SQLException e)
{
e.printStackTrace();
System.exit(1);
}
}
}

http://feeds.feedburner.com/TheBlasFromPas

Using SCAN – Single Client Access Name to Connect to 11g R2 RAC from JDeveloper 11g

Pas Apicella | Feb 7, 2010 16:08 +0000
The ability to have a single / simple connect string for a RAC cluster seemed like something worth trying which SCAN allows us to have as part of 11g R2. Trying to understand how SCAN works and it's setup was not what I had time for so I took an existing setup and verified I could connect from JDeveloper 11g without any issues.

The tnsnames.ora alias was defined as follows. As you can see there is nothing to suggest we are connecting to RAC here, but we are.

RAC11G2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = apctcsol1.au.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = J11G2)
)
)

Being able to connect from SQL*PLus was what I first tried and that worked fine.

d:\temp>sqlplus scott/tiger@RAC11G2

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Feb 8 09:15:59 2010

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SCOTT@RAC11G2>
So from JDeveloper here it shows it can connect fine as well as expected.




















So from a JDBC client we would be connecting as follows ensuring we use a URL which indicates the use of service name as follows.

private static final String url =
"jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" +
"(HOST=apctcsol1.au.oracle.com)(PORT=1521))" +
"(CONNECT_DATA=(SERVICE_NAME=J11G2)))";
We could also use a connect string as follows:

private static final String url = "jdbc:oracle:thin:@apctcsol1.au.oracle.com:1521/J11G2";
Here are some of the commands I ran to verify the SCAN setup and ports on one of the remote RAC instances. RAC Instances register to SCAN listeners as remote listeners.

Check we have SCAN listener configured

[oracle@auw2k3 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

Check status of SCAN listeners

[oracle@auw2k3 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node auw2k4
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node auw2k3
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node auw2k3

[oracle@auw2k3 ~]$ ps -aef | grep -i SCAN
oragrid 20168 1 0 Feb05 ? 00:00:12 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN2 -inherit
oragrid 20179 1 0 Feb05 ? 00:00:11 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN3 -inherit

Finally verify that the service I need to connect to existed on the SCAN listener

[oracle@auw2k3 ~]$ lsnrctl services LISTENER_SCAN2

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-FEB-2010 10:05:41

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
Services Summary...
Service "J10G" has 2 instance(s).
Instance "J10G1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k3-vip)(PORT=1521))
Instance "J10G2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k4-vip)(PORT=1521))
Service "J10GXDB" has 2 instance(s).
Instance "J10G1", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=auw2k3)(PORT=55880))
Instance "J10G2", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=auw2k4)(PORT=31825))
Service "J10G_TAF" has 2 instance(s).
Instance "J10G1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k3-vip)(PORT=1521))
Instance "J10G2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k4-vip)(PORT=1521))
Service "J10G_XPT" has 2 instance(s).
Instance "J10G1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k3-vip)(PORT=1521))
Instance "J10G2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k4-vip)(PORT=1521))
Service "J11G2" has 2 instance(s).
Instance "J11G21", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k3-vip)(PORT=1521)))
Instance "J11G22", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k4-vip)(PORT=1521)))
Service "J11G2XDB" has 2 instance(s).
Instance "J11G21", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=auw2k3)(PORT=63414))
Instance "J11G22", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=auw2k4)(PORT=62891))
Service "sv1" has 2 instance(s).
Instance "J11G21", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k3-vip)(PORT=1521)))
Instance "J11G22", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=auw2k4-vip)(PORT=1521)))
The command completed successfully
[oracle@auw2k3 ~]$
http://feeds.feedburner.com/TheBlasFromPas

WebCenter Suite 11g and ADF 11g Consulting in Middle East

Recently I was busy in Middle East, consulting and deploying production system based on WebCenter Suite 11g and ADF 11g technologies. This system will have public access, expect URL posted soon ! :-)

Nature is beautiful here - Red Sea coast:

Web service references and Soa configuration plan

Edwin Biemond | Feb 7, 2010 10:02 +0000

With Soa Suite 11g you can off course use web service adapters in your composite application and use a configuration plan to change these reference endpoints, so it can work in production or acceptance environment. In a project I did this for a customer where I used composites as a reference and I just generated a configuration plan.
JDeveloper generates a plan and already did some good work for you by detecting the web service references. We only have to change the location attribute of the ws binding of this reference.
But when I deployed these composite to acceptance, I got deployment errors. Looking at the error in the soa_server1-diagnostic.log file I saw that it is complaining about there are more versions of one XSD. This can be true because the calling composite in development has a higher release than that of acceptance. Somehow there is still a reference to the development enviroment. Analyzing the soa project I saw there are some import references in the composite.xml
and in my mediator.wsdl. I also need to change these endpoints in the just generated configuration plan. First let change the import references of the composite.xml. JDeveloper already generated did some work for you.
Change this from
To this
And now I have to change the component WSDL's and XSD's of this composite application. JDeveloper already generates a wsdlAndSchema element with all your project files. When you add composite references or add components, you probably need to update your configuration plan.
So change this
to this.
and now you can deploy this composite to acceptance or production.

Read only View Object should *also* be based on Entities

Jang Vijay Singh | Feb 7, 2010 08:02 +0000
This might involve a wee bit of paradigm shift for developers moving on from 10g. 
The prevailing wisdom in 10g has been to not base read-only view objects on Entities and for good reason: performance gain. 


The recommended approach in the Fusion developer guide, however, is to base all view objects on Entities - a fact that might have gone unnoticed, especially in projects newly migrating over from 10g. 


While no measurable metrics seem to be available for 10g, the Fusion developer guide (Section 39.2.2) mentions that 
"there is no significant performance degradation incurred by using the entity object to create the local cache"


Not just that, for entity based view objects, "The data in the view object will reflect the state of the local cache rather than need to return to the database for each read operation"
This is something that ANY object-relational mapping/persistence technology should have built in - so does ADFbc, with its entity and view caches. 


While any Entity usage can be marked as 'non updatable' in the VO (as discussed in the dev guide section referenced above), in 11g, there is an additional EO level property that allows you to mark the whole Entity as non-updatable. 


Possible usecases might be:
- A way of enforcing read-only access to certain data, say, in a shared service or ADFbc library.


To sum up some of the benefits of having your read-only view objects to be entity based:
1. Declarative SQL generation.
2. Reuse of common properties (like attribute hints, labels etc.) across different views of data, enforcing consistency (unless some views explicitly have to display something differently, they get to just reuse the EO properties) 
3. Additional overhead of maintaining the view-entity coordination is minimal, and possibly overshadowed by performance gains from local caching. (an expert-mode VO would need to return to DB for each read operation)

Custom Attribute to Pass ADF Button Key

I got a question, based on my previous post - CRUD Operations in Oracle ADF 11g Table Using PopUp Component. Blog reader was asking, if its possible to identify ADF button component in Backing Bean without checking component Id. Answer is yes, it is possible - just need to use JSF attribute component. You can declare JSF attribute for ADF button and pass button key through this attribute:


It will be possible to access value passed through JSF attribute in Backing Bean. You just need to specify JSF attribute name and value. In this example, I will use insert value in order to identify Insert button:


In Backing Bean, you will need to access UI Component (ADF button in this case) object, and use getAttributes() function to get a map of available attributes. Retrieve defined JSF attribute using its name:


In a case, if Insert button will be pressed, we will check attribute and will invoke CreateInsert operation:


In other case - row will be opened for editing:


Download sample application - TableDialogEdit3.zip.

JSF Attribute to Pass Component Key

I got a question, based on my previous post - CRUD Operations in Oracle ADF 11g Table Using PopUp Component. Blog reader was asking, if its possible to identify ADF button component in Backing Bean without checking component Id. Answer is yes, it is possible - just need to use JSF attribute component. You can declare JSF attribute for ADF button and pass button key through this attribute:


It will be possible to access value passed through JSF attribute in Backing Bean. You just need to specify JSF attribute name and value. In this example, I will use insert value in order to identify Insert button:


In Backing Bean, you will need to access UI Component (ADF button in this case) object, and use getAttributes() function to get a map of available attributes. Retrieve defined JSF attribute using its name:


In a case, if Insert button will be pressed, we will check attribute and will invoke CreateInsert operation:


In other case - row will be opened for editing:


Download sample application - TableDialogEdit3.zip.

ADF Example: LOV search region fields and operators

Jang Vijay Singh | Feb 6, 2010 06:09 +0000
The (11.1.1.1.0) example can be downloaded here.
Based on a recent forum thread, seems this idea could use some more 'how-to' type clarity. 
For LOV's on an ADF Faces UI, a popup dialog with search form and search results is presented to the user to facilitate search for specific values.
By default, the search form contains all queriable fields.
This example illustrates how to replace this by specific fields and/or operators chosen at design time.
1. DepartmentView has a view criteria defined as shown:


2. EmployeeView has a view accessor to DepartmentView which uses the criteria defined above (edit view accessor and shuttle the criteria from available to 'selected'

3. DepartmentName attribute of EmployeeView has an LOV defined - which is in turn based on a view accessor to DepartmentView. With the below settings, fields (and operators) defined in the criteria from DepartmentView will appear on the search region of the LOV:
PS: LOV = List of Values
LOV's are commonly defined on ViewObject attributes in 11g. That makes a more model-driven UI and keeps the business logic (that a field can hold a specific set of values) in ADFbc components. Not much work is required on the UI itself - apart from drag and drop.

WebCenter/ADF 11g Consulting Around Red Sea

These weeks I'm busy in Red Sea region, doing WebCenter/ADF 11g consulting and deployment. You can find beautiful nature here:

Forms 10g now certified on Windows 7 and IE8

(author unknown) | Feb 5, 2010 08:03 +0000

I've just posted the details of the latest client side certification of Forms 10g. This includes support for Windows 7 and IE8 running Oracle Forms.

ADF Faces RC: af:document uncommittedDataWarning property

Thanks to some assistance from Richard Wright from Oracle Corp on the OTN forums a week or so ago, I learnt about the uncommittedDataWarning property in the af:document tag, which I'd like to describe in this post.

This property is useful in the following scenario. Imagine you have a page as follows:


As you can see the page allows the user to change values of the current employee, and behind the scenes this is based on the usual ADFm bindings. In turn note the 3 buttons and their labels. For this screen there is a strict requirement for the developer to either Commit their changes or Undo them, before navigating back to the Home page.

Before the introduction of the uncommittedDataWarning property, the user could select the Go Home button and bypass this requirement. A workaround would be to set the Go Home button's disabled property such that the user couldn't navigate through the button if there were changes to be saved. However this is easily defeated by the user hitting the browser's back button, with the ensuing "JBO-35007: Row currency has changed since the user interface was rendered" mess that confuses users and developers no end.

With the introduction of the uncommitedDataWarning property for the af:document tag, and setting it to "on", if the user selects either the Go Home button (assuming we haven't disabled it) or the browser's back button without committing or undoing their work, they'll see the following browser error:


The dialog gives the user the option to Cancel, which leaves them on the current page, or Ok, which allows them to complete their action.

This is definitely an interesting feature, especially with its browser back button support.

One thing to note is that it only works for data that goes through the ADF binding layer. As such if you've JSF components based on a bean that isn't exposed to the ADF layer through a data control, it won't capture the data change. Thus this is another reason to ensure you don't hack code into the JSF layer, but expose it all through ADF Business Components or the other supported business service layer in ADF.

Also at this time the feature has a couple of limitations worth mentioning:

1) If the dialog displays and the user selects ok, the dialog will continue to display on each further page navigation until the user either commits or rolls back their changes. I can imagine this will become confusing or frustrating for some users, especially if you don't provide commit/rollback buttons on other pages.

2) As noted in this OTN post, I note that it is a warning mechanism and not an error mechanism (or at least, it doesn't have an option to enforce no navigation). It would seem ideal, especially with its back button functionality, to display an error only, leaving the user on the same page and forcing them to do a commit. Obviously this wouldn't be ideal in all cases, but certainly in some. I've raised ER 9299581 with Oracle Support for this.

3) As Richard Wright points out in the same post, "for a similar use case there has been a request to allow the user to continue with either a commit or rollback from the dialog. It would be analogous to the "Save" dialog received when exiting a native app (e.g., Word, Excel, JDev)." Hopefully we'll see these ERs in a future release.

I'm not overly sure when this property became available but I'm guessing the original JDev 11g release. It's definitely available in 11gR1 which this post was written against.

Oracle Sun – SOA and Integration strategy outline

The webcast of the SOA and Integration strategy was a few days later available as the overall strategy. You can find the entire webcast here.

SOA Platform

The combined Oracle Sun solution focus boils down to the following bullets:

  • Oracle SOA Suite continues as the strategic product.
  • Sun JCAPS continues to be supported and maintained
  • GlassFish ESB continues as an open source project
  • A bridging technology is planned to support collaboration between JCAPS and Oracle SOA Suite.
  • Key functions from the Sun SOA products will be incorporated in the Oracle SOA products.

Portal technologies

Oracle WebCenter stays the strategic portal offering. Support for both GlassFish Web Space Server and Sun Portal Server will be continued. An upgrade path to WebCenter is planned for both. The IP (Intellectual Property) for Sun’s Web Space Server will be released into the Liferay open source community.

Blinded by the Light?

Video Series: Overreacting to Oracle Acquisition


It seems our over-dressed friends are at it again. Oracle's recent acquisition of Sun has lead to a few misunderstandings about community support and product longevity—and even conference confusion. But everything can be clarified with a little explanation and a lot of costuming.

Check out the new Overreacting to Oracle Acquisition playlist on the Oracle WebVideo YouTube channel. If you were one of those with apprehension about how Sun community members would be affected, these short—and hopefully humorous—clips should shed a light on any area where you might be concerned. For Oracle OpenWorld Blog readers, one of the most important items to note about the Sun transition is what's going to happen to JavaOne.

JavaOne is going to be co-located with Oracle Develop during this year's Oracle OpenWorld and will focus solely on Java Technology and its associated ecosystem. In addition, JavaOne and Oracle Develop will be hitting the road, heading to Brazil, Russia, India, and China in the months ahead.

If you still have questions about the Oracle + Sun combination, download the official Overview and Frequently Asked Questions for the Developer Community. You can also watch the Oracle + Sun Product Strategy Webcast Series to see roadmaps for some of Sun's major product lines. Or, post a comment here and we'll track down the answers.

Default Value for Date Field in Query Criteria

I got a question about how to assign default value for Date type field available in Query Criteria. Developer had a requirement to initialize Date type query field with date equal to 10 days before current date. This requirement is very simple for ADF and can be implemented in 5 minutes without writing any code.

Download sample application - DateSearch.zip. This sample returns default value for HireDate attribute on page load automatically:


In order to implement this requirement, open View Criteria definition and assign Bind Variable parameter to HireDate attribute. Its very important, make sure you uncheck Ignore Null Values checkbox:


This will initialize Bind Variable with Null value, when user will try to search with empty HireDate attribute value. Otherwise you will get Missing In and Out parameters SQL error.

For getting correct default date value, you can use Groovy language for Bind Variable default value expression:

Creating Users and Groups in Weblogic with WLST

Edwin Biemond | Feb 4, 2010 02:10 +0000

A small blogpost how you can create users and groups with WLST scripting in Weblogic. This can be handy when you have a lot of application environments for Dev, Test ...) In WLST there is no default WLST function for creating users and groups, but in the serverConfig() we can lookup the right MBean and call the createUser, createGroup and addMemberToGroup operation.
Here is an example of the user creation phyton script.

serverConfig()

print 'lookup DefaultAuthenticator'

password = 'weblogic1'

atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')

print 'create group App-MHS-Users'
group = 'App-MHS-Users'
atnr.createGroup(group,group)

users = ['user1','user2']
for user in users:
print 'create user: ',user
atnr.createUser(user,password,user)
atnr.addMemberToGroup(group,user)


print 'create group App-MHS-Admin'
group = 'App-MHS-Admin'
atnr.createGroup(group,group)

users = ['admin1','admin2']
for user in users:
print 'create user: ',user
atnr.createUser(user,password,user)
atnr.addMemberToGroup(group,user)


print 'create group App-MHS-SB'
group = 'App-MHS-SB'
atnr.createGroup(group,group)

users = ['sbuser1','sbuser2']
for user in users:
print 'create user: ',user
atnr.createUser(user,password,user)
atnr.addMemberToGroup(group,user)


To run this script we need a Weblogic environment ( can be remote ) and start wlst.cmd or wlst.sh

Go to the C:\Oracle\jdevstudio111120\wlserver_10.3\common\bin folder and start wlst.cmd

connect('weblogic','weblogic1','t3://server.domainname:7001')
execfile('/oracle/wls_scripts/createDefaultUserAndGroup.py')
disconnect()
exit()

that's all.