Showing posts with label ADF Faces. Show all posts
Showing posts with label ADF Faces. Show all posts

Saturday, June 13, 2009

sun's blueprints

Very nice. I just had another look at Duncan Mills' Autosuggest tutorial using Sun's blueprint project. I am really beginning to understand what they were doing. I downloaded a bunch more stuff to look at on the plane going back to Virginia. Very interesting.

http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html

This is the article I am talking about. I looked at it a year or so ago; I understand it much better today. The blueprint project has a bunch of very useful, interesting custom JSF component code to look at for free. What a learning opportunity.

So was able to implement this as is, but I had some trouble using the BindingContainer. But I used #{data..dataProvider} to get the application module instead of going through the bindings layer, and that got me to the same place. I have not isolated the exact trouble with the bindings layer yet.

I realize that the BindingContainer layer (JSR 227?) is very important, but I believe I am still abiding by the overall architechtural bent of using the Application Module as a repository for services, and accessing only the exposed ones. Right now I just have some vague notion that creating a PageDef and hooking it into the DataBindings.cpx file is somehow fraut with opportunities to make mistakes. I have made a variety of mistakes setting these up, but the binding layer issues have the trouble of not yet revealing to me how on earth to troubleshoot the problem. I only see that when I get the value for #{bindings} that it is null.

Ah well. On the lighter side, I was able to download the source for this textfield.jar that this example uses; and I was able to get the source working just fine. I also obtained the source to the other aspects of J2EE blueprints avaialble in the same download, and also an additional download which gives the updates for Java EE 5.0 :-)

That should keep me busy on those 3.5 hour plane-trips. ;-)

One thing I would like to improve upon for this component is that it does not respond to a down arrow or up-arrow. I think this should be doable.

Thursday, April 30, 2009

exclusively programmatic use of PageDef iterators

Revision: if you have an iterator that you have included for usage programatically only, be very careful! I kept getting JBO-35007 errors when I did a post back!! So finally I removed the iterator and just got the app module programmatically, and did a findViewObject("viewObjectInstanceName") from it.

Friday, April 17, 2009

Where and how does ADF expand on or deviate from JSF?

ADF is different from JSF, that is for sure.


JSF is an open standard, whereas ADF open for its Trinidad components, but not its newest ones. For example ADF Faces UI components are custom JSF UI components. Generalizing about ADF Faces components, they usually have many more properties than the JSF components. For example, compare the af:table with the h:dataTable. There function is to be the same, but the af:table has many additional features that the h:dataTable does not have. For example the af:table has a selectionListener and sortListener built right into the component’s properties. The h:dataTable has no such property. It is still possible to have a radio button select a particular row in the table, but the way that is to be done is totally different. Selecting a row in a table can involve many things: selectionListener of the table, an tableBinding, the CollectionModel interface (for the value of the af:table), and the af:table’s selection facet. The h:dataTable does not have nearly so many hooks into this row selection functionality.
On the other hand there is a certain simplicity to the way JSF without ADF Faces works. For example, you may not need a SortListener, when you can write a backing bean method that does the sorting, and have your table column header link simply call the sucker.


Another difference between af:table and h:dataTable is that af:table can use the built-in Partial Page Rendering to simply refresh the table without refreshing the entire page. This refreshing can get a bit involved, but usually it is not if you remember one thing: the command item that instigates the partial page rendering of the table cannot be from within the table itself. So for example if there is a button within the action facet of a table that needs PPR-ing, then either the button needs to be moved out of the table, or it needs to use its onclick event property to press another (perhaps hidden) button which is outside of the table. But even with this odd caveat af:tables can do PPR relatively easily.


(PPR outside of tables seems to be pretty straight forward and helpful; some rudimentary AJAX at its best.)


Another add-on for af:table’s are how they work with the page def table binding and iterator definitions in order to easily page groups of rows forwards and backwards. The component that supports the h:table has hooks for this, but it must all be implemented relatively manually. This binding layer is part and parcel of JSR227 (Data binding). Part of this data binding layer also implements DataControl’s. I think this is very important for allowing the layers to be interchangeable, and hiding the implementation of the business service layer.


Another big addition that ADF brings to the table is the Page Definition file; this is also part of the data binding layer they implement. JSF components typically connect to backing beans for their values, whereas Oracle ADF likes to route value properties (and others) through the bindings in the page definition file for that page. Most times I think the addition of binding layer functionality is a boon.


At another level, Oracle ADF Faces Lifecycle augments the JSF Request Processing lifecycle; ADF lifecycle adds a prepareModel and a prepareRender and an extra validation phase to the various JSF phases.


Here is Oracle’s point of view of some of these differences:
The Java Server Faces components differ from the ADF Faces components in ways completely spelled out at the following URL: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/spec-diff.html

The following list gives Oracle’s list of advantages of ADF Faces component set over straight JSF HTML and Core components (Oracle Corporation, 2006)
1) Provide more efficient implementations of client-side state saving (reduced per-component size)
2) Rich set of components, validators, and converters
3) ADF Faces tags often offer more features than the standard tags; for example, all input components offer built-in label and message display support ( For more information on the differences between the ADF Faces tags and the standard Faces tags, please see the following document ).
4) Client-side converters/validators - JavaScript enabled converters and validators that attempt to catch and display errors on the client
5) ADF Faces tags can be used inside of the <> tag (it is, unfortunately, not possible to support standard tags inside <> ).
6) Accessibility - support similar to ADF UIX Accessibility
7) Bidirectional language support - ADF Faces components automatically render themselves appropriately for bidirectional languages. Users can also use the "start" and "end" constants described in ADF UIX Bidirectional Language Support
8) Partial Page Rendering (PPR) - support similar to ADF UIX PPR overview
9) Skinning - support similar to ADF UIX Look and Feel
10) ADF integration - including support for JSR227 (Data binding)
11) Rich Client - upcoming rich DHTML client-side renderers

Thursday, March 26, 2009

JSF Portlet Bridge and WebCenter

I did a post a while back on JSF Portlet Bridge that I will now revise, because things are not quite like I thought they were.

Let's say that your organization has an Oracle Portal 10g install. Then let's say you want to start integrating ADF Faces apps that were generated from JDev 10g. (That would be Apache Trinidad in JDev 11g parlance). Here is what you would want to do: install your ADF apps on a 10.1.3.4 Oracle App Server. Let's say you did not have the WebCenter license of any kind. Then you would need to add some kind of generic web page with an iframe on it that called out to the ADF Page. That would be your option.

But let's say you had the minimal, or "Services" WebCenter License (I believe that is priced by CPU-core count.). Then you can deploy your ADF Faces apps to that same 10.1.3.4 after you have doctored it up. By doctored it up I mean the following:
1. Install SOA 10.1.3.1
2. Apply patchset 10.1.3.4
3. Create new oc4j in EM. Call it wsrp2
4. Install portlet-server-install.jar
5. PER NOTE: Note 752220.1 Java.Lang.Noclassdeffounderror: Javax/Xml/Soap/Soapelement Deploying Standalone Application
cd $ORACLE_HOME/j2ee/wsrp2/config
vi server.xml

6. Start container. (opmnctl startproc process-type=wsrp2)
7. Deploy application. NO ERROR


A few notes about this process above:
  • You can get the portlet-server-install.jar by looking at the following:

http://www.oracle.com/technology/products/webcenter/pdk.html

http://www.oracle.com/technology/products/webcenter/portlet_download.html

(http://download.oracle.com/otndocs/tech/webcenter/files/pdksoftware.zip)

Oracle Portlet Container and PDK-Java 10.1.3.2

  • Your Oracle Portal installation will need to be up to date. So that means at least your Portal Repository needs to be at 10.1.4.0...but then you will have a work-around because your images will not work right. It is best if you upgrade to 10.1.2.3 on your iAS and 10.1.4.2 on your Portal Repository and do all the pertinent patches...and there are a few! But they are documented.
  • At this point there will still be some CSS-related issues that are documented in an Oracle bug. (7968131) I am gathering this case is not being worked too hard, though.

So then you can consume your "produced", portletized ADF apps just fine. They work pretty darn well, too!

Apparently, though, JSF Portlet Bridge is not supported by Oracle for Apps that you deploy to the OC4J 10.1.2.x -- which is Portal 10g's current iAS platform until Portal 11g comes out.

Wednesday, March 4, 2009

ADF/Portal interview with Peter Moskovits

The company I am with and I interviewed Peter Moskovits, and got some questions answered we had about migration path of Oracle Portal 10g users and how to integrate the changing versions of ADF, which version of WSRP to use in which case, etc. Here are part of the minutes to the meeting:

Peter started with an overview of the Oracle products and product direction. Peter noted that Portal technology is a decade older than ADF technology, so efforts to merge them are challenging. Peter mentioned that there are a couple of kinds of portlets at work here: PDK Java Portlets, and WSRP/JSR168 Portlets. The latter is where the future is. In each case each technology offers something the other does not have, so Oracle promotes both. With Portal you have features such as runtime customization, reusable portlets, and content integration. So you can include portlets into ADF using WebCenter technology, or you can bring ADF portlets over and consume them WSRP 1.0 or 2.0 using JSF Portlet Bridge technology.

Regarding Portlet Bridge licensing…Peter says that there are two kinds of licensing for WebCenter: a WebCenter services license (meant mostly for developers) and a suite license (to get everything). The services license would be cheaper also than the suite license. If the Portlet Bridge was the only part of WebCenter that you were using, it sounded like you should get WebCenter Services license which is cheaper. The Portlet Bridge enables communication with OAS/OC4J 10.1.3.4 to obtain exposed portlets through WSRP portlet producer. If we are using 10g portal (OAS 10.1.2.0.2/Portal 10.1.4), we would need to use WSRP 1.0 (I have a question out to Peter to know if we could use ADF Faces (10g) PPR features with WSRP 1.0 or not).

Peter acknowledged that if you had to use OAS 10.1.2.0.2/Portal 10.1.4 that you would be much better off if you deployed your portletized 10g ADF Faces apps to OAS 10.1.3.4, and then consumed them with the 10.1.2.0.2 server with WSRP 1.0; rather than deploying directly to OAS 10.1.2.0.2 and having to dumb your 10g ADF Faces app down from 10.1.3.x down to 10.1.2 technology (J2EE 1.3/JDK 1.4 from J2EE 1.4/JDK 1.5).

We should not deploy portlets with the SOAP provider if we are using ADF; we should use the JSF Portlet Bridge. SOAP was only for Struts applications.

Peter and Jay both let me know that deploying a 10g ADF program was no big deal: a 3-step process, that was well documented in the 10g WebCenter Developer’s Guide.

Friday, February 27, 2009

MyFaces Orchestra conversation-scope

I have experienced some issues with ADF Faces (out of JDev 10.1.3) which (I was told) were probably related to inadequate garbage collection (probably on session-scoped managed beans and variables). So I have been looking for something that would help this application's robustness.

I saw a product which may help with some of this. It is called MyFaces Orchestra, and it might be worth looking into. It would allow custom bean scopes called conversation-scope. This framework uses Spring. If there is a problem with accumulating garbage, this would surely help keep such things under control. Apparently improving things like this could be an iterative process; conversations are by default of session duration. But later you can group beans and garbage collect whenever you decide the need arises. But even the act of putting all session-scoped beans into this framework might be a great first step to helping this situation.