Saturday May 14, 2016

Consuming a SOAP Web Service quickly using Web Service Data Control (WSDL) in ADF by Ashish Awasthi


clip_image001Creating and Consuming Web Servie is an important part development cycle . In earlier posts i have described about creating SOAP/REST Web Service
Create REST Web Service with Application Module declaratively in ADF 12.2.1
Create SOAP Web Service with Application Module quickly in ADF 12.2.1
Now this post is about consuming a SOAP Web Service. A very simple way to consume Web Service is to create Web Service Data Control (WSDL) for external Web Service URL
Here i am using a Country-Currency Web Service (http://www.webservicex.net/country.asmx) to create WSDL

  • Create a Fusion Web Application with default Model and ViewController project
  • Right click on Model project , Select New--> From Gallery--> Business Tier--> Web Services and select Web Service Data Control SOAP/REST 
  • It opens WSDL creation wizard , First Step is to provide Web Service Name and URL. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Friday May 13, 2016

Database Change Notification Listener Implementation by Andrejus Baranovskis

clip_image002

Oracle DB could notify client, when table data changes. Data could be changed by third party process or by different client session. Notification implementation is important, when we want to inform client about changes in the data, without manual re-query. I had a post about ADS (Active Data Service), where notifications were received from DB through change notification listener - Practical Example for ADF Active Data Service. Now I would like to focus on change notification listener, because it can be used in ADF not only with ADS, but also with WebSockets. ADF BC is using change notification to reload VO, when configured for auto refresh - Auto Refresh for ADF BC Cached LOV.
Change notification is iniatilized by DB and handled by JDBC listener. There are two important steps for such listener - start and stop. Sample application - WebSocketReusableApp.zip, implements servlet DBNotificationManagerImpl. I'm starting and stopping DB change listener in servlet init and destroy methods: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Thursday May 12, 2016

Edit Use Case for ADF 12.2.1 Dashboard with Masonry Layout by Andrejus Baranovskis

clip_image002

I was researching ways to implement edit functionality for dashboard created with ADF 12.2.1 masonry layout. Check my previous post, where dashboard was implemented - ADF 12.2.1 Responsive Dashboard with Masonry Layout. I have decided to use panel drawer component, which would bring editable fields in the context of data displayed in the dashboard. Panel drawer icon is displayed in the top right corner of the dashboard.

User can click on the icon and this shows editable form for the data rendered in the dashboard:

Dashboard is implemented with masontry layout, it makes it possible to re-arrange tiles. This proves to be useful when editing data. I can move tile with the chart and change salary value. Chart is synched and new value becomes visible. Two actions are done at once - data update and change review in the chart:

One more use case - validation. While editing salary, we can check tile with minimum and maximum salary values. This could help to understand, what salary value can be accepted. For example, if too low salary is set, validation error is returned. User can cross check this in the chart with minimum and maximum values: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Wednesday May 11, 2016

Add and delete values in POJO based selectOneListbox/selectOneChoice in ADF by Ashish Awasthi

clip_image001Previously i have posted about populating selectOneChoice programmatically using POJO
Programmatically populate values in a af:selectOneChoice component in ADF
In same way we can populate values in selectOneListBox as both ADF Faces components are used for single selection and share same structure
Here i have used a List to populate values in selectOneListBox (For details read complete article in above link)
And to get selected value from af:selectOneListBox/selectOneChoice in bean- Used a String variable , created it's accessors

And see here how both List and String variable are bound to af:selectOneListBox. Read the complete article here.


WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Tuesday May 10, 2016

Close the containing parent popup component without binding using an actionEvent by Marvin Muuß


clip_image001When using popups in ADF we suffered the problem to close the popup after finishing the activity.
So this is the request: We have a table providing data with an info facet holding buttons for adding, editing and deleting a selected row. While the add and edit button open a popup with a form the delete button opens a dialog to confirm the delete action. This is realized with a showPopupBeavior. Of course there is a cancel button in all of these popups closing it immediately and rolling back.

So this is an example what a popup might look like.

As the cancel button immediately rollbacks, the save button immediately commits the made changes.

This cancel button is just out of the box, closing the dialog and not rolling back because there is nothing to rollback. But delete executes this action, commits and closes the dialog.

How is this implemented?

Every button has an actionListener property which we will use. After completing out task in the code before we will call a closePopup method. Read the complete article here.


WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Monday May 09, 2016

Automatic ADF Logout on Browser Close with WebSocket by Andrejus Baranovski

clip_image002

Every ADF project could have a requirement to handle browser close event effectively. Differently than desktop applications where we could handle such events, browser doesn't send any event to the server, when browser page is closed. This is especially important for transactional data, when user locks data row and lock must be released automatically, in case if user is closing browser without unlocking. Besides transactional data management, it is important for performance improvement - Web session will be closed instantly and WebLogic resources will be released. There was no reliable solution to handle this, now we can do it with WebLogic 12c and WebSockets. WebLogic 12c supports WebSockets natively, there is no need to configure anything or add libraries.
When WebSocket channel is closed, it delivers event to the server on browser close. We could use this event to release locked resources, we need to logout ADF session to force ROLLBACK. Sample application implements HTTP client invoked by WebSocket server endpoint. This HTTP client simulates browser activity and redirects to adfAuthentication with logout request, using original JSESSION ID from closed browser session. This works also during accidental client computer power off. Download sample application where I have described all important implementation steps - ADFSessionHandlingWebSocket.zip.
Sample application is protected with ADF Security, you can login with redsam/welcome1 user. It includes Oracle JET libraries, one of the dashboard tiles implements JET fragment. JET is not required for the sample to work, it is used only to implement dashboard UI.
You can observe from browser log when WebSocket connection is opened. Connection is established on initial page load, immediatelly after login. This opens WebSocket communication chanel, as soon as this chanel will be closed - WebSocket server endpoint will force logout for ADF session from closed browser. As soon as WebSocket channel is established, ADF web session ID (JSESSIONID is retrieved from the cookie) is sent to WebSocket server endpoint. Sample logs ID of ADF web session: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Sunday May 08, 2016

ADF: Filtering parent and child nodes in af:tree / af:treeTable by Rubén Rodríguez Santiago

clip_image001

One of our customers required to filter data in a page with a tree component. Using Ashish's post I am going to show you how to filter both parent and child nodes having just a single filter value. This can also be applied to treeTable component.
The first thing we need is a tree component and data structure, in this case we are going to use Oracle's hr schema tables: Departments and Employees.
In our page we drag and drop DepartmentsView from datacontrols palette and create a tree component.

The next thing we have to do is to create a View Criteria in Departments View Object (parent). Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Friday May 06, 2016

Handling ADF BC 12.2.1 REST Validation in Oracle JET by Andrejus Baranovskis

clip_image002

CRUD use case would not be complete without validation logic implementation. Oracle JET allows to implement standard and custom validators on the client. Probably most of the simple to average complexity logic will be implemented in Oracle JET. Complex use cases can be handled in ADF BC validation rules, data will be validated through REST calls. When validation fails in ADF BC, error message is propagated through REST back to Oracle JET client, where we can parse it and attach to the UI field.
You can watch demo video, it shows how it works. I'm trying to update a row with invalid data, rules are executed in ADF BC and validation messages are displayed next to the UI fields in JET:

There are three rules defined in ADF BC. It might be tricky to map UI field with error message. This is easy in case of PATCH method, ADF BC REST returns failed attribute name together with the message. This doesn't work in the same way with POST method, when new row is created. For this reason, I have introduced custom indicator into each validation message *AttributeName*. I'm parsing this value in JET, to understand which UI field should be marked as incorrect.
Rule 1. Unique Key validation rule for Email attribute.

Rule 2. Hire Date validation rule, it should not be in the future. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Saturday Apr 23, 2016

Dynamic table in ADF 12c by Edward Orlowski

clip_image001A while ago I decided to create an ADF page based on a dynamic table, and I found that, although there are quite some articles about the subject online, I still faced some challenges while implementing such a solution in ADF 12c. These challenges, however, can be solved easily when you know some basic principles, and I would like to share those.

First, let me define what I mean with dynamic table in this post. It is an ADF table, specified in the JSF file with the af:table tag, with an unknown number of columns and rows. Moreover, the number of columns is still unknown when you run the page, as opposed to solutions where a table is created at runtime, based on a query.
We can add to that another feature: this table is not based on a database table nor a query, but will be built up at runtime based an a set of data that we will retrieve at the user’s request.

Use case: importing data with a time dimension

Why would we need such a table? Let me give a practical example: we want to let the user import a file, which is a CSV file export of a spreadsheet, in which the columns represent the time dimension. For instance, each column represents a day. Since we don’t know on forehand for how many days we will import data, we cannot build a view or table which has a column for each day.
On the other hand, when we will store the data in a database table, this table will have a date column (or attribute) in which the date column value from the CSV file will be stored.
So the database data model is very different from the data model we can read from the CSV file.
And the reason we want to show this data in the ADF table is simple: we want to show to the user that the CSV file has been read by the program successfully and that the columns as shown in our ADF page correspond to the columns in the spreadsheet the data has come from.

Demo: creating rows and columns at the user’s request

The demo application that I provide with this post, is meant to illustrate how a dynamic ADF table can be created, and how data can be read from and written to that table. As I want to keep the demo application as simple as possible, I concentrate on the ADF table, and will leave out the functionality of the storing data in the database or reading it from a file.
What I do include in the demo, is that the table is editable, so we can see that it is working properly.
For this purpose, the demo contains three buttons: two for adding columns and rows, and one to dump the contents of the entire table to the console.
On starting the application up, the following screen appears: a table with zero columns and zero rows. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Thursday Apr 21, 2016

Checking for Data Consistency with ADF BC REST 12.2.1 by Andrejus Baranovskis

clip_image002

ADF BC REST supports HTTP ETag to check for data consistency. This is common approach to implement caching and optimistic locking in REST.  ADF BC REST relies on EO change indicator attribute, when change indicator attribute value is updated, new ETag is generated. All clients with previous ETag value should be prevented from updating data, without refreshing to the latest state. Read more - 22.9.1 Checking for Data Consistency When Updating ADF REST Resource Items. There are issues with data consistency check in ADF BC REST, hopefully it will be fixed in the future (read below).
To test data consistency check, enable discriminator attribute in EO. I have enabled Salary as discriminator. Each time when this attribute is changed, new ETag value will be generated and clients holding previous value will require to re-query:

GET with If-Non-Match use case (works)
Initially we don't know ETag attribute value, we can query with empty value in If-Non-Match header. Current ETag value for the row will be returned together with the data: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Technorati Tags: ADF,Andrejus Baranovskis,WebLogic,WebLogic Community,Oracle,OPN,Jürgen Kress

Wednesday Apr 20, 2016

ADF: Display Map values in af:table by Rubén Rodríguez Santiago

clip_image001

When we want to populate an af:table programatically we usually use a collection based on a java bean (e.g. List<MyObject>) but in this post of JDeveloper & ADF the developer required to populate the table with Map values.

First we need to create a Map in our bean and add the values that we are going to show in the table.

If we try to populate the table we can see tat we need to know the keys of the Map to get the values.

As you can see Value Columns displays the value in the Map for 'Key 1' key, but using this method we can not dynamically display all values. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Tuesday Apr 19, 2016

Create SOAP Web Service with Application Module quickly in ADF 12.2.1 by Ashish Awasthi

clip_image001

SOAP stands for Simple Object Access Protocol, a protocol to exchange information in XML format between two applications over HTTP. This protocol is used to create ,access and consume web services.
SOA (Service Oriented Architecture) focuses on re-usability and exposing application module as web service makes it's methods and objects accessible from any device , any platform and these methods and objects can be further used by any other application
In ADF 12.2.1 we can create a SOAP web service within seconds , See how to configure Application Module to expose it's methods and objects to service interface

  • Created a Fusion Web Application using Departments and Employees table of HR Schema
  • Open Application Module and Web Service tab, there is a separate tab for SOAP , click on green plus icon
  • Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Sunday Apr 17, 2016

ADF BC Groovy Improvements in ADF 12.2.1 by Andrejus Baranovskis

clip_image002

Groovy scripting is improved in ADF 12.2.1. There are no inline Groovy expressions anymore. Expressions are saved in separate Groovy language file, external codesource. Each EO/VO will be assigned with separate file to keep Groovy expressions. This improves Groovy script maintenance (easier to check all Groovy expressions from EO/VO located in one file), also it improves runtime performance (as JDeveloper ADF code audit rule suggests).
Inline Groovy expressions created with previous JDeveloper versions are compatible in 12.2.1. All new expressions are created in separate *.bcs file. Sample application - ADFGroovyApp.zip, comes with validation rule implement in Groovy script expression:

We should check how validation rule definition looks in EO source. There is one inline Groovy expression I have created with previous JDeveloper version. It is marked as deprecated and suggested to be moved to external codebase: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Saturday Apr 16, 2016

New look of dvt:pieChart as donut chart for Data Visualization in ADF 12.2.1.0 by Ashish Awasthi

clip_image001Oracle Jdeveloper 12C (12.2.1.0) documentation tells about a new enhancement in look of pie chart
We can now design donut chart using dvt:pieChart , innerRadius property allows us to create donut chart look on the base of default pie chart.
Donut chart is nothing just a variation of pie chart that show data in sections of a circle, I believe everyone knows how to design a pie chart in ADF Faces
I have dropped a viewObject (it has Department wise Salary detail) as pie chart on page and default pie chart looks like this
Now to change it's look to donut chart , just change in some properties
InnerRadius  property creates donut look , SliceGaps  is the gap between slices and CenterLabel  is the text shown in center. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Sunday Jan 31, 2016

ADF Performance Monitor: New Whitepaper Published by Frank Houweling

clip_image002The AMIS ADF Performance Monitor is an application performance management tool (APM) tool that really understands Oracle ADF applications. Web applications often contain frustrating blind spots and mysterious, recurring problems that are often difficult to identify, diagnose, and fix. The ADF Performance Monitor helps enterprises by delivering insight into real end-user experiences. It helps development, QA teams and administrators detect, analyze and resolve common and less common issues in response times and resource usage of ADF applications.
This blog publishes a new whitepaper that gives detailed information about the architecture and implementation of the ADF Performance Monitor.

The first version of this monitor (ADF 10g version) was already released in 2009. Since then many new versions have been released. The monitor supports all ADF versions (ADF 10g, ADF11g R1/R2 , ADF 12C). Last years the monitor has been improved with many new and advanced features. Get the Withepaper here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Search

Archives
« May 2016
SunMonTueWedThuFriSat
7
27
28
29
30
31
    
       
Today