General

Is the purpose of testing to verify that the software works or is it to try to break it?

This question is asked many often. However there is no one answer. Reading a lot of reactions – in one of the Linkedin community groups – I noticed that the answer is strongly related to the (test) experience of the responder. A number of the reactions endorse this question and of course other people have another opinion.
Read the rest of this entry »

JHeadstart 11g: Tree-Form with drag and drop functionallity

A little over two years ago I wrote a post on drag and drop in an adf tree component. That post was based on ADF only. In the following post I show that you can have JHeadstart generate a tree for you that supports drag and drop.

Not out of the box, but with use of custom templates, and some ADF knowledge. Read the rest of this entry »

Installing a subversion server

Source control is off course an essential part of the development process and Subversion is an excellent system for that purpose. In the past, installation of subversion was a bit complicated because it involved several steps, an Apache webserver and not-so-accessible user management and repository configuration. However, nowadays installation and management can’t be easier, on whatever platform you are either with Collabnet Subversion Edge or with VisualSVN Server.

Read the rest of this entry »

ADF 11g: That is one very smart toolbarbutton !

There are situations where you need a toolbar to provide the user with functionality like insert, update, delete, next, previous and so on. This looks straightforward, but it is not that easy to have only one toolbar to service your whole page. In this post I will show an example of how to implement such a toolbar. I will create a single button that can do an insert on multiple different components. Let’s start with showing how you would usually create insert functionality; a simple example. Read the rest of this entry »

Call for Papers UKOUG ends on Monday

Be aware that the Call for papers for the UKOUG Tech. Conference in December is closing on Monday.

….and yes I know, having Oracle Open World almost opening its doors or The Michigan OakTable Symposium just coming up in the agenda, thinking about stuff in December is a bit strange, but…do you want to miss out like last year on probably the best European Conference of the year…

Impress and/or be impressed…

ADF 11g: Select all rows in an ADF table.

I get a lot of questions on how to select all rows in a table. In this post I describe how you can do that. A common use case for this is when you want to apply changes on a set of records, for instance change the status of all records in a table. You might expect a whole bunch of code here (so did I…) but in fact, this is very easy. I’ll provide the (absolutely not complicated) solution and also the proof that it works Read the rest of this entry »

External Views (XML based)

Something new? Eh? Should you do this? Eh?

In all, probably not, but for me this was a good exercise towards some more updated demo scripting for my “Boost your environment with XMLDB” presentation or hopefully more clearer relabeled Oracle Open World name for the almost same presentation called “Interfacing with Your Database via Oracle XML DB” (S319105). Just up front, there are some issues with the following:

  • Why should you do it at all. You should have a good reason doing so…
  • It can cause a lot of Physical I/O, at least initially when not cached in the SGA
  • Until current versions, AFAIK, it will do a lot of “Pickler Fetching”, serializing in memory, which is very resource intensive (CPU/PGA)
  • …and its probably not supported…?

…but it is good fun for a small exercise based on the following OTN Thread: “Error with basic XMLTable“…

Let me show you what I mean.

Via “bfilename” you are able, since a long time, I guess Oracle 9.2 and onwards, to read a file as a BLOB and because an “XMLTYPE” can swallow almost any datatype, you could do the following…

[oracle@localhost ~]$ sqlplus / AS sysdba

SQL*Plus: Release 11.2.0.1.0 Production ON Thu Jul 29 09:20:24 2010

Copyright (c) 1982, 2009, Oracle.  ALL rights reserved.

Connected TO:
Oracle DATABASE 11g Enterprise Edition Release 11.2.0.1.0 - Production
WITH the Partitioning, OLAP, DATA Mining AND Real Application Testing options

SQL> CREATE user otn IDENTIFIED BY otn account UNLOCK;

User created.

SQL> GRANT dba TO otn;

GRANT succeeded.

SQL> conn otn/otn
Connected.

SQL> sho user
USER IS "OTN"

SQL> SET pages 5000
SQL> SET LINES 1000
SQL> SET long 10000

SQL> SELECT xmltype(cursor(SELECT owner, schema_url, LOCAL FROM all_xml_schemas ORDER BY owner)) FROM dual;

XMLTYPE(CURSOR(SELECTOWNER,SCHEMA_URL,LOCALFROMALL_XML_SCHEMASORDERBYOWNER))
-----------------------------------------------------------------------------------------------------------
< ?xml version="1.0"?>
<rowset>
  <row>
    <owner>EXFSYS</owner>
    <schema_url>http://xmlns.oracle.com/rlmgr/rclsprop.xsd</schema_url>
    <local>NO</local>
  </row>
  <row>
    <owner>EXFSYS</owner>
    <schema_url>http://xmlns.oracle.com/rlmgr/rulecond.xsd</schema_url>
    <local>NO</local>
  </row>
  <row>
    <owner>MDSYS</owner>
    <schema_url>http://www.opengis.net/gml/feature.xsd</schema_url>
    <local>NO</local>
  </row>
  <row>
...
  </row><row>
    <owner>XDB</owner>
    <schema_url>http://xmlns.oracle.com/xdb/dav.xsd</schema_url>
    <local>NO</local>
  </row>
</rowset>

51 rows selected.

Lets write the output to disk in the /tmp directory or my Oracle Enterprise Linux environment…

SQL> sho user
USER IS "OTN"

SQL> CREATE OR REPLACE directory XMLDIR AS '/tmp/';

Directory created.

SQL> declare
  2     rc sys_refcursor;
  3  begin
  4     open rc FOR SELECT * FROM (SELECT owner, schema_url, LOCAL FROM all_xml_schemas ORDER BY owner);
  5  dbms_xslprocessor.clob2file(xmltype(rc).getClobVal(),'TMPDIR','otn_dev_xsd_schema.xml');
  6  end;
  7 ;

PL/SQL procedure successfully completed.

SQL> commit;

commit complete

SQL> ! ls -ltra /tmp/*.xml

-rw-rw-r-- 1 oracle oracle 6563 Jul 29 09:36 /tmp/otn_dev_xsd_schema.xml

Due to the fact the content of this XML file (be aware: 6K) is wellformed XML, for example the alert log is not wellformed, and I know its format, I could read it directly from my database session via the following…

Read the rest of this entry »

ADF 11g Skinning: Three ways to change look and feel

On the JDeveloper ADF forum there are many questions on how to change the look and feel of components. In this post I’ll explain three ways to do that. Read the rest of this entry »

Invoke SOA Composite application through RMI as remote EJB (using binding.adf)

In a recent post I described how we can use the EJB Binding in SOA Suite 11g PS2 to invoke a SOA Composite application through RMI as a remote EJB. This interaction can be fully based on Java interfaces – no WSDL or XML required. However convenient that is, I have not yet been able to make it work for complex arguments or return parameters: methods that use simple types work fine, but using custom POJOs as input or return value did not result in a properly exposed EJB (even though deployment seems successful).

There is another way to invoke a SOA Composite as EJB via RMI. This other way is through the binding.adf binding type. The main difference with the inbound EJB binding is that we communicate in terms of XML (over RMI) with the SOA Suite’s generic Client API – and not directly to a service specific EJB. I was able to get this to work thanks to articles by Edwin Biemond (http://biemond.blogspot.com/2009/11/invoking-soa-suite-11g-service-from.html) and Changjae Lee (http://blogs.oracle.com/jaylee/2009/08/invoking_composite_from_javajs.html). They laid the foundation – and I adapted it for SOA Suite 11g R1 PS2.

The steps we go through:

Expose the Composite service through the binding.adf:

1. Create the SOA Composite application like you always do.

2. Duplicate the service with SOAP binding (binding.ws) and configure the clone as binding.adf (based on the same WSDL).

3. Deploy the composite with this new service of type binding.adf

Read the rest of this entry »

Publish SOA Composite application as EJB to be invoked from Java applications using EJB Binding

With the recent (April 2010) SOA Suite 11g R1 Patch Set 2 (11.1.1.3.0), several new capabilities have been added to the SOA Suite. One these is the EJB Binding. Or rather, an enhanced version of this binding. In previous releases, this binding was available to provide interaction with SDO enabled EJBs – based on a WSDL interface and XML messages. The PS2 release added full Java support to the EJB binding. This means that we do not have to concern ourselves with WSDL and XSD that maps to the Java interface we want to invoke or expose, nor with sending a XML based payload when we invoke the composite service. All we need is the Java interface that describes either the EJB that we want to invoke (for an EJB Binding Reference) or that we want to expose (for an EJB Binding Service).

Steps:

1. Create Composite like always

2. Create a Java Interface (and possibly Java domain classes or bean types describing the structure of the input and ouput of the methods on the EJB (that should correspond with the operations available in the Composite application)

package nl.amis.utilities;

public interface FilterAndTranslate {
 public String translate(String input);
}

Note: steps 1 and 2 can be reversed; especially when you want to work according to the contract (or design) driven approach, that would probably be best.

Note: thusfar I have only been successful with a Java interface that only uses simple types (my own domain objects and beans prevented deployment of the EJB for some reason)

3. Create an EJB Binding in the Services lane, based on this Java interface. Specify the JNDI Name for this EJB. For example: FilterAndTranslateEJB

Read the rest of this entry »