Porting a SAML-project from 9 IAS to 10g

At my customers’ site all projects need to be ported from an IAS 9 enviroment to 10g, normally you would think just redeploy the ear-files and everything will run just fine but this isn’t the case.

For example, an application using SAML Tokens wasn’t working any more when trying to deploy it to the 10g environment. When we tried to run the application in the embedded container in JDeveloper the application didn’t work either.

No changes were made to the application and it runs fine on 9 IAS but it doesn’t anymore on 10G or embedded OC4J in JDeveloper

This needs some investigation wright …

The exception that was thrown by the application when trying to run it embedded was the following:

SAMLSignedObject.fromDOM() detected an XML security exception: The requested algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not exist.

Trying to replace the different jar-files such as xercesImpl and xalan didn’t do the trick and then finally I stumbled on a post concerning troubles with IBM-libraries and XMLSec.jar.

In the post the following was stated:

xmlsec 1.1 and the IBM JRE don’t get along. Endorsement isn’t the issue, the
algorithms have to registered in the xmlsec config file inside the jar and
by default it doesn’t know about their JCE.

You might try dropping in the 1.2 xmlsec code, I believe they dumped the old
scheme and just use the JCE calls to get algorithms now. Another option is
to use the BouncyCastle JCE, if it even runs with IBM’s JRE.

So I thought it might be a problem with the JDK version we were using, the older version used JDK 1.4.2 and now, with JDeveloper we were using JDK 1.5.

So let’s try the same proposition as for IBM, download the latest version of the xml security library.

We downloaded the latest version of the xmlsec-libraries from apache ‘http://santuario.apache.org/download.html’, the lib xmlsec-1.4.1.jar.

Retested the application again and now everything runs fine.

I’ve read a lot of people are running into this error in IAS 10g, please replace the library and try again.

Data Driven Application using Adobe Flex – Part 3

Today I’m having a closer look at the Data Features provided by Adobe Flex using the Adobe Developer Guide and the forum for more information.

In the Flex Developer Guide, CHAPTER 37 Representing Data, an explanation is given about the different possibilities you have to define a data driven application.

In the first example you can check out how to define a model with some data fields and show these fields in your application. Note ! You need to enclose the inputfields in an mx:form-container to be able to view the fields or set the lay-out different from absolute because this renders the fields inapproprialty as well.

In the next example you can check out the validation-framework in Flex SDK where you can add validation to specific fields. Flex includes a set of validators for common types of user input data, such as ZIP codes, phone numbers, and credit card numbers.

If you have a closer look at the 2nd example you will notice the ZIPCodeValidator is used which is one of the default validators included in Flex. When you run the application a red box is shown when a validation exception occurs. Note : When you have a look at chapter 40 you will notice that the first example on page 1282, the PhoneValidator, doesn’t work properly. You need to add the listener- and trigger-attribute into the PhoneValidator to let the code work.

A view on the validation exception and message box is shown in the following screenshot:

As you can see it’s fairly easy to create a form-based application with validation defined on the input fields. If you want to have more information regarding the functionality that’s behind these validators you can check out the class-files by going to the source-tab of your application and clicking ‘go to definition’ on one of the validators.

If you want to change the error-message you can override the resource-bundle which is used in Adobe and you can even override the style of the message. E.g. if you want the message to appear in your favorite color, or house-style you can provide the following int ‘mx:style’-tag:

{ borderColor: #0000FF}

In the previous examples we’ve used curly braces to bind our data, you can also use the mx:Binding-tag, see page 1253 for an example.

Now that we’ve seen the different functionalities to create data bound applications, let’s have a look at the different Flex Data Management Features.

What if we want to store data and synchronize data in client-server applications or in MVC-applications? The following screen can give us a clearer view on the different features we can use:

As you can see there are 3 different components we can use to store and retrieve managed data, which are HTTPService, WebService and RemoteObject.

And I need to look into an example using RemoteObjects, more on this next time!

Buzzing About Adobe Flex – Part 2

Some useful background information you need to know about Adobe Flex … (which you can find in the Adobe Flex Developer Guide):

About Flash Player 9
While Flex applications run in a browser, they take advantage of the Flash Player 9 runtime environment for executing client-side logic, rendering graphics, and playing animation, audio, or video.
Flash Player 9 supports a new higher-performance version of ActionScript
(ActionScript 3.0) that works in conjunction with the expressiveness innovations
in Flash Player 8.

At the core of the Flex product line is the Flex Software Development Kit (SDK). Flex 2 SDK consists of the Flex framework (class library), the Flex compilers, the debugger, the MXML and ActionScript programming languages, and other utilities. Flex SDK also includes the source code for the core Flex framework class library, enabling you to study the code of the classes as well as customize or extend them for your own use.

About Flex Builder 2
Flex Builder is an integrated development environment (IDE) for developing applications with Flex SDK, Flex Data Services, and the Flash Player. The Flex Builder IDE provides tools that help you develop, design, and debug Flex applications, including an integrated incremental compiler and a step-through debugger.

About Flex Data Services 2
You build on the functionality of Flex 2 SDK by adding Flex Data Services. Flex Data Services adds enterprise messaging support and a greatly enhanced data services architecture to the Flex 2 SDK. You deploy Flex Data Services as a standard web application on your J2EE application server or servlet container.

– Adobe Flex Developer Guide – is the document to have a look at.

Today I want to have a closer look at the data-binding layer of Adobe and how I can create CRUD-screens.

Working with data services
Flex is designed to interact with several types of services that provide access to local and remote server-side logic. For example, a Flex application can use AMF to connect to a web service that uses the Simple Object Access Protocol (SOAP), an HTTP URL that returns XML, or for Flex Data Services, a Java object that resides on the same application server as Flex. The MXML components that provide data access are called data service components. MXML includes the following types of data service components:
WebService Provides access to SOAP-based web services.
HTTPService Provides access to HTTP URLs that return data.
RemoteObject Provides access to Java objects (Java Beans, EJBs, POJOs) by using the AMF protocol. This option is only available with Flex Data Services or Macromedia ColdFusion MX 7.0.2.

I need to use the Flex Data Services to be able to add data-bound components into my Adobe Flex Application.

How to build a Data-Driven application (using the Adobe Flex Developer Guide, Chapter 9):

Using the HTTPService – data service component I’m able to integrate an existing rss-feed from a blog to populate a DataGrid-component in my Flex Application. Looks very fancy and it’s not hard to try this out.

Using the WebService – data service component I can call a webservice and get back the results in a datagrid-component. You can learn how to pass parameters into the webservice and how to react when the webservice is calles, e.g. when the user invokes a certain action or when the application has been displayed (e.g. onPageLoad or to say in Flex-language on
creationComplete). You will actually work in the same way as when using the HTTPService only you’re invoking a webservice endpoint instead of a HTTP request.

Data Management Services, chapter 19, discusses the different adapters that are need to use persistent or transient data in an Adobe Flex Application.
The ActionScript object Data Management Service adapter persists data in server memory and is useful for applications that require transient distributed data that is not persisted.
The Data Management Service Java adapter will be used for data that is persisted to a data store.

I need to download a trial version of LiveCycle Data Services ES , to be able to integrate Data into my Adobe Flex application.

I’ve already tried to create a Database Accessor to my Oracle schema but this doesn’t seem to work regarding a bug reported by Adobe. When you try to create a connection to an oracle db with more than 1 schema, which would be the case for 99% of th time, the data connector can’t establish the connection.

So when you want to create a CRUD-application using Oracle as your db, you need to wait for a patch/new beta release.

What are the pro’s and con’s I’ve seen today:

  • Pro: integrating a HTTPService, a blog for example, is very straightforward and doesn’t ask any specific modifications or knowledge from the developer (except reading the dev guide ;o) )
  • Con: renaming the mxml file still holds the old swf- and html-files in the bin-folder, these can be removed manually without any impact on the application
  • Con: Not able to delete a Database Accessor you’ve defined earlier, not clear how to edit the existing Database Accessor either
  • Con: Exceptions thrown when having a look at existing , e.g. try to access www.papervision.org twice in a new browser session => the following error is shown:

ArgumentError: Error #2082: Connect failed because the object is already
connected. at flash.net::LocalConnection/connect() at
com.noventaynueve.underwater::Launch() at main() at
[execute-queued] at [io]

That’s it for today … I hope I can build a small application using an Oracle database.

Buzzing about Adobe Flex

I’ve heard a lot of rumours and buzzing around Adobe Flex … so what’s the catch ;o)

For one of my projects I need to get acquanted with Adobe Flex to see what it has to offer and how fast you can learn and implement a real-time application (small test case). I’ve already created a small test case in ADF and now I need to have a look at Adobe Flex .

With my Oracle Fusion Middleware background, ADF for example, I can make a comparison with Flex, how intuitive is the IDE (it’s based on Eclipse), what about J2EE-requirements such as bindings between the different tiers, …

One major drawback of Flex is that it’s again another proprietary code you have to learn, using basic xml tagging but yet another format, another language. If I have a look at ADF it’s much more standardized and if you have a J2EE background it’s comprehensive and you just use the existing knowledge and experience to build on.

But that’s enough talking wright … let’s create a Flex playground =>

First I’ve installed a trial version of flex builder 3 and then I went to search the internet for some sort of a ‘Adobe Flex for dummies’-guide ;o)

I’m using the quickstart guide, which you can find on http://www.adobe.com/devnet/flex/quickstart/coding_with_mxml_and_actionscript/ to get started with Adobe Flex.

The first impressions are … sexy and vivid applications with the same look & feel as flashplayer applications. Let’s try and create one myself:

  1. The first section in the Quickstart-guide : Coding with MXML and ActionScript works very well, and if you want to use the TIP

Tip: To see the intermediary ActionScript files that Flex generates, add the
–keep-generated-actionscript option to your mxmlc command.

Just use this command in the developer-prompt of adobe flex:

C:\adobe_flex\QuickStart>mxmlc –strict=true –keep-generated-actionscript MyFirstExample.mxml

After you’ve done the first chapter you were able to define and compile a flex application using the Adobe Flex 3 SDK Command Prompt.

In the second chapter : Creating your first application , you perform almost the same exercise but now you’ll use the Flex Development Environment which uses the Eclipse IDE. So J2EE Developers which are used to Eclipse should recognize this immediatly, it’s the same IDE you’re working with, only the needed plug-ins for Flex are added/used.

Steps you need to perform to build a ‘hello world’ (sounds familiair) application:

  1. Create a new Flex Project (accept all the defaults)
  2. Copy/paste the code from chapter 2 and choose to run the application
  3. Start playing around yourself

Let’s compare the IDE I’m used to, which is JDeveloper, with Adobe Flex Builder 3 using the sample application from the 2nd chapter.

  1. :( => I can’t re-organise my components in the outline-view which can be compared to the structure-view in JDeveloper. I have to use the design-or source-view in Flex to re-organize the components, let’s say for instance I want to move my components (textarea, panel and label) from the tile into a VDividedBox, I need to do this in the source-or design-view and can’t rearrange using the outline-view.
  2. :( => I don’t have a look-up of the existing functions that are defined in the mx:
    Script tag. To avoid erroneous referring of functions in the CDATA-part you could have a drop-down or look-up of the existing functions in the properties that can use these, e.g. the onclick-event could have such a drop-down. This is usefull code insight when working with the ‘Flex Properties’-panel in the IDE.
  3. :) => The code-insight on each component (each component you’ve defined an ID for, such as myText or myLabel) is very helpfull to have a look at the available methods on these objects.
  4. :) => different ways of specifying eventHandlers which gives each developer the choice between different approaches and if you’re referring to a non-existant label/field/method a compile time error will be shown.
  5. :) => when you’ve messed up the mxml file, meaning the tags aren’t constructed properly anymore for a mx:application, the design-tab won’t work anymore. This is a very handy feature because it will point you to the code that produces the exception. You have the possibility to check what’s wrong with your source code without having to search inside your mx:application for tags that aren’t closed properly etc. In the following screen-shot you can see the behaviour:

That’s it for playground time today, I have to get back to business with JDeveloper but untill now I’m still curious.

Apex Dictionary Views: sitemap

Some time ago a customer asked me if it was possible to have a sitemap on a developed application. Of course one could make a static sitemap and update it each time pages are added/changed but having a generic solution would make life so much easier.

This was again an excellent opportunity to make use of the apex dictionary views, seeing I consistently made use of the breadcrumbs, it just was a matter of getting the right query for the correct info. Once I have this info I could use the ApEx Tree option to represent it.

After some trial & error I came up with this:
SELECT breadcrumb_entry_id id,
decode(parent_breadcrumb_id ,
NULL,1,parent_breadcrumb_id )parent_id,
entry_label name
WHERE application_id = v(‘APP_ID’)

Now I made a view on this query: v_sitemap
When you make the tree base it on your view and make sure you choose as root value the option static assignment with value 0.

All done and now you have a nice sitemap for your application.