Saturday Jul 16, 2016

ADF BC REST Support for List Of Values (LOV) Data by Andrejus Baranovskis

clip_image002


ADF BC REST service out of the box supports LOV list data. You can define LOV for ADF BC View Object attribute and use it straight away in REST service. This is especially useful when LOV list is filtered based on other attributes from current row - no need to collect and send these attributes to the service separately, filtering logic will be handled for you in ADF BC backend. One more benefit - you can reuse existing ADF BC with LOV's implementation and expose it through REST service.
Below you can see employee #108 attributes with values returned by REST service, generated on top of ADF BC View Object. ManagerId attribute in View Object is configured with LOV list. Based on this configuration, each item in REST collection will have a link to REST resource providing LOV data (Employees/280/lov/EmployeesLovView1). For employee #108, it retrieves LOV data from VO EmployeesLovView1:

We can get LOV list entries for employee #108 by executing simple REST request, no need to specify additional parameters. 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 Jul 13, 2016

ADF 12.2.1: Publish and secure ADF Business Components as REST services by Rubén Rodríguez Santiago

clip_image002In ADF 12.2.1, released just before OOW, many new features were introduced, and one of them is to expose ADF Business Components as REST Web Services. You can check other ADF 12.2.1 features in my ADF 12.2.1 release post.
In this post I am going to publish and secure ADF BC as REST services.
The first thing we have to do is to configure a release version for REST. You can do this in adf.config.xml file.

In previous versions we could expose BC as SOAP web services in Application Module Web Services tab, and now we can choose also REST.

We can select the view instances and set a resource name.

A xml file will be automatically created where for example we can set the attributes we want to expose and also if we want to expose any custom methods that we have created in the view implementation classes. 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 Jul 12, 2016

Configure ADF Skin in JDeveloper 11.1.1.7 by Ashish Awasthi


clip_image002

In Jdeveloper 11.1.1.7 there is no option to create ADF Skin declaratively
In order to apply skin we have to create a simple CSS file and then configure application to use this CSS file as skin. Jdeveloper doesn't do this for us clip_image003we have to do it manually
So first step is to enable Skin Selectors for ADF Faces, Without enabling this CSS editor doesn't show ADF Faces component tags
CSS files by default supports HTML tags  only
Go to Tools > Preferences > CSS Editor and set CSS level to level 3 and check the box to support ADF Faces Components

Now create a CSS file -
Right Click on View Controller project > Select New > Web Tier > HTML > CSS File

Provide a name for CSS file and click OK. 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 Jul 09, 2016

Extending ADF Cloud User Experience Rapid Development Kit (RDK) by Andrejus Baranovskis


clip_image002

You should be familiar with AppCloudUIKit ADF application from - The Cloud User Experience Rapid Development Kit. It provides a set of templates, components and sample flows to get you started with successful ADF setup. I will explain how to extend it, if you want to add extra parameters for the menu item, to be passed to the Task Flow.
The use case - each time when custom TF Manage Users is opened, criteria item First Name is assigned with TF parameter value (value "C" in the example below): 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 Jul 08, 2016

ADF and Cloud User Experience Rapid Development Kit by Andrejus Baranovskis

clip_image002

Oracle published new set of UI templates - The Oracle Applications Cloud User Experience Rapid Development Kit (RDK). This includes methodology based on Oracle Fusion Applications experience and contains ADF source code. Kit is shipped with ADF application (download it from Oracle site), you could use it as a jumpstart. This could be next UI Shell. It is more than UI Shell, RDK comes with a set of declarative components (header/toolbar is one of them).
I have implemented my own simple TF and tested how it works in RDK. Custom TF can be opened from My Team group, Manage Users item. Home UI in RDK:

Manage Users - custom TF. When TF is opened, in the top area user have possibility to switch to other items (items can be hidden). First fragments brings search screen, user can edit selected record: 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 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
Search

Archives
« July 2016
SunMonTueWedThuFriSat
     
23
24
25
26
27
28
29
30
31
      
Today