Thursday Dec 13, 2012

Accessing Secure Web Services from ADF Mobile

Most of the enterprise Web services you'll access are going to be secured - meaning they'll require you to pass a user/password in order to get to their data. 

If you never created a secured Web service, it's simple in JDeveloper! For the below video I just right clicked on a Java class that I exposed as a Web service, and chose  "Web Service Properties" and then checked the "oracle/wss_username_token_service_policy" box from the list of options (that's the option supported by ADF Mobile right now):


In the demo below we are going to use a "remote" login server that does the authentication of the user/pass.

The easiest way to "create" a remote login server is to create a "regular" web ADF application, secure it, and deploy it on a server. The secured ADF application can just require ADF Authentication with a simple HTTP Basic Authentication - basically the next two images in the Application->Secure->Configure ADF Security menu wizard.


ok - so now you have a secured ADF application - deploy it on a server and get the URL for that application. 

From this point on you'll see the process in the video which deals with the configuration of your ADF Mobile app.

First you'll need to enable security for your ADF mobile application, so it will prompt users to provide a user/pass combination.

You'll also need to configure security on specific features. And you can have them use remote login pointing to your regular secured ADF application.

Next define your Web service data control. Right click on the web service data control to "define Web Service Security".

You'll also need to define the adfCredentialStoreKey property for the Web Service data control in the connections.xml file.

This should be it. Here is the flow:

If you haven't already - you can read more about this in the Mobile developer guide, and Andrejus has a sample for you.

Calling Web Service with Complex Parameters in ADF Mobile

Many of the SOAP based web services out there have parameters of specific object types - so not just simple String/int inputs. The ADF Web service data control makes it quite simple to interact with them. And this applies also in the case of ADF Mobile.

Since there were several thread on OTN asking about this - I thought I'll do a quick demo to refresh people memory about how you pass these "complex" parameters to your Web service methods. By the way - this video is also relevant if you are not doing mobile development, you'll basically use the exact same process for building "regular web" ADF applications that access these types of Web services.

One more thing you might want to do after you create the page is look at the binding tab to see the method call in there, and notice the parameters for it in the structure property. Go and look at their NDValue property to get the complete picture.

Wednesday May 23, 2012

Adding LOV to non-database Field or Parameters

More and more people end up using ADF for applications that don't actually talk to a database backend but rather to Web services, Java classes, and SOA process instead. In these cases the ADF pages actually end up invoking methods and passing parameters to these methods. One question I got today was "how do I add a database driven LOV to such a parameter?".

The tricky part is that the LOV component - af:inputListOfValues - expects a specific data model to be able to show the advance searching the LOV offers. As a lazy developer I don't feel like creating a managed bean with this model and populating it manually from the database. Instead here is a little video that shows a no-coding possible solution.

I'm using ADF BC to get the LOV and data from the database. I then use a bit of binding trickery to eliminate the need for a managed bean with the model structure for the LOV. I associate the LOV model created for an ADF BC field with an LOV field that is mapped to the parameter being passed to the method.

Thursday Dec 15, 2011

Filtering Records by Time with ADF Business Components

I posted in the past a demo showing how you can get a time selector part to your date field using the right format mask and data type.

A question on the OTN forum asked how do you filter data in a view object based on time (and not only date).

Here is a quick example - the basic things to keep in mind is that you need to set your parameters to not be the default Date but rather timestamp and also you'll need to configure the UI hint for the format of the parameters you are using.

Here is a quick demo:

Monday Jan 10, 2011

Passing Parameters to an ADF Page through the URL - Part 2.

I showed before how to pass a parameter on the URL when invoking a taskflow (where the taskflow starts with a method call and then a page).
However in some simpler scenarios you don't actually need a full blown taskflow.
Instead you can use page level parameters defined for your page in the adfc-config.xml file.

So below is a demo of this technique.
I'm also taking advantage of this video to show the concept of a view object level service method and how to invoke it from your page.

P.S.
You might wonder - why not just reference #{param.amount} as the value set for the method parameter? Why do I need to copy it into a viewScope parameter?
The advantage of placing the value in the viewScope is that it is available even when the page went through several sumbits. For example if you switch the "partialSumbit" property of the "Next" button to false in the above example - the minute that you press the button to go to the next department - the param.amount value is gone.
However the ViewScope is still there as long as you stay on this page.

Tuesday Dec 28, 2010

Combining Multiple Queries and Parameters into One Operation

This question came up twice this week and while the solution is explained in a couple of previous blog entries I did, I thought that showing off the complete solution in a single video would be nice.

The scenario is that you have two VOs with queries that are based on a parameter, I showed in the past how to create a parameter form that executes the query - and you can do this for both.
But what if you actually need just one value to drive both queries? How do you combine two parameter forms and two buttons into one?

This is what this video shows you. The steps are:
Creating two parameter forms
Setting the value of a parameter in the binding tab
Creating a backing bean to execute the code for one button
Adding the code to execute another operation
Remarking the parts that can be dropped from the screen

Check it out here:

Wednesday Oct 06, 2010

Passing Parameters to ADF Application through the URL

A common scenario, especially for people who are creating ADF applications that extend or integrate with other systems, is the need to call an ADF page and pass some parameters to it.

For example, suppose you are in Oracle E-Business Suite and you are looking at a department and you want to invoke an ADF page that will show you more details about this specific department.

To achieve this you can expose bounded taskflows with a URL and define parameters that the taskflow will accept on the URL line.
In the following demo I show how to create a taskflow that shows a filtered VO, and then how to call this taskflow using a URL and pass the parameter that controls the filtering.

Update - in some cases you don't need a full taskflow for this. Here is an entry that shows you a simpler approach if you just need to reference the parameter in the page itself.

Friday Dec 04, 2009

ADF Query with Parameters and List of Values - Part II

In the previous blog entry I showed how to do a search page using the execute with parameters operation. This entry is a little more up-to-date and uses the new view criteria and query components that have been added in JDeveloper 11g.
One nice aspect here is that it also lets you change the UI component for the parameters to be input with list of values.

Here is the demo:

Thursday Dec 03, 2009

ADF Query with Parameters and List of Values

This one is probably for ADF beginners, but it is a very common use case - so having a little demo can never hurt.
The goal is to enable the user to select a few values from drop down lists and based on these values filter the results of a query and display them in a table.
In our case we want to filter employees by the department they work in and the salary they have. And we want to show a list of departments that the user can choose from.

All you need to do is create an ADF BC view object with bind parameters, and then in your page drag the parameters one by one to the page to drop them as select lists.

See this demo:

About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today