ADF EMG Audit Rules available on JDeveloper 12.1.3

I got a few questions from people why the ADF EMG Audit Rules are not available in JDeveloper 12.1.3. So there has been a new release of the ADF EMG Audit Rules. No new functionality is implemented this time, but the extension is now available for JDeveloper 12.1.3.

If you go to Help -> Check for Updates, tick the Open source and Partner Extensions checkbox and press Next: 

Select the ADF EMG Audit Rules and click Next:

The extension ADF EMG Audit Rules should be installed correctly, click finish and restart JDeveloper 12.1.3:

Now if you go to your Tools -> Preferences, there is a button ‘Manage Profles’ on top of the Audit tab, you will find your profiles under that submenu. Press the button to open the Profiles menu:

Within the Audit Profile, you should see the ADF EMG Audit Rules appear:

Presentations at Oracle Open World 2014

I am proud to announce that I will be giving two presentation at Oracle Open World this year in San Francisco. So some shameless self-plug on my blog to put them both under a little extra attention.

The first one will be on the ODTUG's and ADF EMG ADF Sunday, together with Wilfred. We will explain and demonstrate our new open source project/product the ADF EMG XML DataControl.
If you’re working with Oracle ADF and WebServices, this one should be very interesting for you.

The second one is on Tuesday, together with Frank Houweling from AMIS and Frédéric Desbiens from Oracle. We will be talking about build environments, performance within ADF and quality assurance. I am confident I will be able to mention my other open source initiative the ADF EMG Audit Rules.

Hope to see you there!

Use tree binding accessors to show detail rows

Tree bindings can be very handy, for example to combine details in the same row as the master. Let’s assume we have the following starting point based on the HR schema:

We see the department in a form layout with navigation buttons, with a table under the form showing information about the employees. As you can see in the screenshot below in the ApplicationModule, there is also a Jobs detail under the EmployeeView.

If you go to the bindings on the page, you see the Tree Binding ‘EmployeesView’. You can edit the Tree binding very easily through the overview of the binding page. If we add the JobsView as detail this will be available in the page as well.

Don’t forget to shuffle the attributes that you need to the right:

After pressing ok, the source of the PageDef should now look something like this:

You see that the first nodeDefinition in the tree has gained an Accessors element, in this Accessors element there is an item with the name JobsView. We can now use this accessor in our table in the page as well. To illustrate I add two new columns to the table.

The editor does not really understand this, so you do not get any help from the IDE. You can see that the EL expression to the hints of the EmployeeView is the same, but after that we use the accessor value to navigate to that nodeDefinition in the Tree, after which we enter the value from the AttrName inside this nodeDefinition.
The value itself however, we need to access through the row. You can see the EL expression in the value of the outputText. After the row we again first use the accessor value but then go to the bindings, after the bindings we enter the AttrName value and we end the EL expression with the inputValue.

On run time this results in the two extra added columns:

Access your MDS-SOA repository from your ADF application

In our Enterprise Landscape the SOA Services and our Canonical Data Model (CDM) live on a different WebLogic Server than our ADF application. But often we want to use these services and CDM in our ADF application. 
Calling WebServices from an ADF application is not that difficult, however, we often want to manipulate the result that comes from this WebService. In 90 percent of the time, this are little adjustments to the existing CDM that are UI specific. This knowledge is not something we want to put in our CDM or in our WebService, but in the ADF application. We decided to create an UI specific XSD and map the result from the WebService in CDM to this UI specific XSD. 
To accomplish this, we created an XSD that extends the existing XSD from the CDM. The problem with this approach was to reach the XSD from the CDM that lives on the SOA Server from our ADF Application that lives on our ADF Server. 

It turns out, you can configure the MetaData Repositories on your WebLogic Server to look at different servers. When logged in to the Enterprise Manager, you can go to the MetaData Repositories, now if you click on an existing MDS, you can go through to menu to Administration -> Register/Deregister:

In here you see an overview of both the database and the file based repositories.
Now you can click the Register button to register a new database MDS repository.

This will bring up the screen to register a database based metadata repository in which you need to provide the information of your SOA MDS where the CDM is found.

After filling in the information, press query and enter the repository name ‘mds-soa’ and fill in the correct password. Pressing the OK button will register this mds-soa metadata repository and will bring up the next screen:

In here it is very important not to forget to target the correct server on which you ADF application is running.
Once this has been set up, your ADF application will be able to connect on run time to your CDM that lives inside the soa-mds repository under the /soa-infra partition. Next you need to configure your ADF application to actually look for this repository. You do this in the adf-config.xml:

In the adf-config file you see the mds-config, here you tell the application to look for any mds repository starting with /apps to look in the ‘mstore-usage_2’ this mstore is defined below in the metadata-store-usage section.
You need to enter the partition-name, which is ‘soa-infra’, the metadata-path is used locally and points to an environment variable. When deploying this application from JDeveloper, the deployment wizard understand that the MDS needs to be configured and it brings up the Deployment Configuration wizard:

In this wizard we select the mds-soa repository and select the correct repository and the correct partition. After this your ADF application will be able to resolve oramds urls and you can import XSDs from the CDM. As a result your ADF application specific XSD will be able to understand an import like this:

Meaning you can extend any XSD type defined in the CDM and make it UI specific for your needs.

Disabling and Enabling the Auto Map for XSL

When working with more complex XSL files, it can sometimes be useful to disable the Auto Map option. This can easily be achieved in the Auto Map Preferences popup you get when drawing lines in the design view of an XSL Map.

However, once disabled, you will not get this popup anymore to re-enable the Auto Map option. You need to do this through the Tools -> Preferences menu in JDeveloper. On the bottom of the list you see the XSL Maps menu with a submenu for Auto Map properties.

Here you can re-enable the Auto Map option for you XSL maps.

Announcement: ADF EMG XML DataControl

During the ADF community event at AMIS Services last Thursday (22 may 2014), Wilfred and myself announced a new upcoming open source project, named XML DataControl.

On the AMIS Live blog there was a good summary about the functionality of the XML DataControl:
The XML Data Control is an ADF Data Control that is used by developers to create data bindings in ADF Faces pages, just like the ADF BC Data Control and the POJO Data Control. The data exposed through this data control can be any XML source – from a SOAP or REST WebService, from a static XML document or a custom Java Class that produces an XML document from anywhere. It offers much more control and flexibility than the Web Service Data Control does (that is very limited in scope and usability).

You can check out the slides of this very short presentation if you like, but there is more news, in the very near future, an official launch event for this component will be held on the premises of MN in The Hague. To attend this event or to be informed about the next steps with the XML Data Control, you can register through this signup form.

Last, but not least, I would like to leave with a quote from Wilfred about the XML Datacontrol:
"This is a real time saver for ADF/SOA projects. We now have junior ADF developers finishing their Model project in half an hour and fully focusing on the View side of things. I really think something like the XML DataControl can turn around the perception of ADF as an overly complex framework. It makes things so much simpler."

We expect and hope to have an official and stable release coming out this summer!

Share your source between projects

Normally we pack functionality into libraries and use this library to share the functionality. However, during development of several JDeveloper Extensions our goal was to have one shared java source between our JDeveloper 11g and JDeveloper 12c extension.
Off course we wanted the ability to easily develop, test, debug and run the extension, but we also want to share the java code to introduce reusability.

We accomplished this, by creating a separated ‘coresrc’ folder and add this folder as a Java source path both in JDeveloper 11g and JDeveloper 12c. To illustrate two screenshots of the open source project ADF EMG Audit Rules.

JDeveloper 11g:

JDeveloper 12c:

A great trick to share your Java source between several projects, where you can still keep project specific source in the regular project src directory.