This site promotes and supports the development and deployment of JSF, Oracle ADF applications, and other web development topics. If you have interesting facts to share about any of these or any related technologies, please feel free to post a comment.
Thursday, April 30, 2009
exclusively programmatic use of PageDef iterators
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
Open World Abstract...
At the height of my smugness I decided I would try and extend a rich faces component…that did not work out quite as well as I had hoped. I was able to put markup before and after the af:table (rich table, that is), but I cannot seem (yet) to figure out how to get into the middle of it – inside the box where the columns are or in-between the columns. I thought I knew where to look for this, but I am not finding what I expected when I look where I thought I should.
So far my efforts to augment these components have met with very limited success. There is a section in the Fusion Developers ADF Guide 11g about extending components (I hope they mean UI components and not business components) that I should read for sure and probably reference. Maybe that will give me some insight. Maybe for my understanding level, it would be more helpful to attendees if I stick with more basic concepts, like how the pieces I know about interact.
I know the declarative components are custom component combinations, which is quite handy. I have a 10g project where I could really use something like that. Maybe that is something I can explore for my paper: implementing declarative component conceptually, in order to help understand custom component development.
For my edification however I would like to know more details on how Oracle implemented their rich components. When I try to alter them or get inside of them, everything I do seems to not allow me to get at the inner parts of the component. I do not know how Oracle is hiding this.
For starters I see that there are property elements in the components when they are defined in faces-config.xml. I did not know that component properties could be define or elaborated on there. I do not know what that adds, but I would like to know.
I should study JSF details from the Java EE 5.0 tutorial. Hopefully they would have some further explanation of this. Or maybe the standards for Java EE 5.0: maybe they specify some details of JSF that would help me understand what Oracle and everybody else is doing with their components…and help me with this paper.
ADF 10g interfacing with Pentaho
Yesterday I went down a path I had probably been down before but forgotten.
I used a tree binding on a table to have a table in the details facet of an af:table. This worked reasonably well until I tried to update the child table data. At that point all kinds of strange things started to happen. The rows would get mixed up as to who their parent was, I think there might have been some errors....at any rate I backed out of that and went another route because that one was proving somewhat unstable.
Things are starting to get green here in Virginia!
Thursday, March 26, 2009
JSF Portlet Bridge and WebCenter
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.
web.xml role-name with spaces
<role-name><![CDATA[my role name]]></role-name>instead of
<role-name>my role name</role-name>
Wednesday, March 25, 2009
Quick Note about JSF, ADF and Postbacks
So what is a postback? In short it is when a JSF page submits and it stays right where it is. In other words the action of the form is set to post to itself, passing all of its named fields as parameters. When the Faces Servlet sees this occurring it alters its “behavior”. The normal JSF request lifecycle has 7 or 8 phases when it is drawn out for others to see…but all these phases only come into play on a post back. When you first call a JSF page, all that you actually get is the first and the last phase…everything else is left out.
These postbacks are extremely important in the Rich Component world though. You have to postback in order to implement a very nice way to do AJAX functionality without having to make others who want to use your components add servlets to their web.xml.
Programmer Metamorphosis Psychology 101
I am undergoing a change of a drastic nature. I am going from being a Forms/Reports guy to being a Java guy. I have been elated during most of the professional “metamorphosis” time – especially where I did things I was afraid to do at first, but then I realized I could handle it. I was productive and HAPPY about having done these things…about having suspended my disbelief long enough to know that I was about to say I could do something, that I had no idea I how I would do…long enough to put on a happy face to the person that wanted someone who appeared confident to tell them we would make miracles happen. And after a fashion I would even see how I was going to get these things done. But I never would have tried if I had not suspended the disbelief long enough to say: ‘I can do this’ to someone without having the slightest idea of how I was going to make that happen.
And…when all was said and done…I was better for this “lie”, and so was my employer. I was always taught not to lie.
In the Constitution of System Engineering Services Corporation®, there is a phrase in there: that they expect their employees to Stretch. That is what I am talking about.
When I was doing the work and working miracles, I was happy, and excited…LIKE I HAVE WANTED TO BE IN MY PROFESSION ALL ALONG. I thought the right thing to do was to be faithful to your technology, and your boss and their wishes. But…what if your bosses are fearful? What if they don’t know this secret about stretching? What if they know it but don’t want to do it because it’s scary? Then they suffer. Their company suffers. Their employees suffer…at least those that buy into this mode of behavior.
Why should anybody GRIND IT OUT with embarrassingly outdated technology at their job which is providing a paycheck, but which is providing a place where they are losing ground? Why?? Everybody is failing then…employer and employee…
All you need is to find a risk taker…and to be a risk taker. And I think you have to renew your vows to be such a risk taking creature on a daily basis. But the result is you have fun, learn lots, become more marketable, make friends, um…is there a downside to this?
I am still learning gobs…I hope that never stops. I guess I have something to do with it stopping or not, eh?
I hope you can benefit from the following analysis, and hope it aides you in whatever metamorphosis you are currently undergoing.
12/15/08 – Slight addendum to this forward: I am currently looking for work. So this transition is causing me some pain now. I feel it is because there are not jobs running out of everybody’s ears now that the economy is messed up. It is also because it is late in the year and that is a notoriously bad time to be out of work. But there is another thing the fledgling risk-takers should be aware of. You should strive to find good positions where you will continue to learn, but most employers want you to already be experts in whatever their suite of technologies is…and you also have to be better at this particular suite than 90% of the other candidates who are applying for that position.
Obviously, this is a difficult situation. Yes it is. I do not regret trying to leave Forms/Reports behind. I am a little worried I have not been more responsible…on a bad day, but mostly this is just the trough of the biorhythm of learning a new bunch of technology. Because…as I recall: finding a new job is ALWAYS a little…OK: a LOT…scary! When I get my job I will be elated…not bored and internally dead and miserable.
1/8/09 – I may have found a place in Minnesota (Trane Corporation) that does custom JSF component development, and really likes my work. So: off I go (happily) to St. Paul for the next 6 months to a year.
1/20/09 – Trane just announced a hiring freeze. Darn. Back to more looking.
Tuesday, March 24, 2009 -- OK: I am now at Fairfax, VA. Things are going well and we are speeding our way toward our first ADF app for this company. It would be ideal (in my boss’s words) if we could do work in WebLogic with the new ADF 11g technology. Wouldn’t that be sweet…??? Back on top of the world.
Wednesday, March 18, 2009
Developer Day Notes
Here are my notes from the session. Hope they are helpful.
OTN Developer Day Notes
· OPI? OPEE?? (Eclipse Oracle Developer pack)
· Panel Collection – can surround a table to et a header and footer
· Rebuild will allow you to sometimes avoid rerunning a page in IDE
· Export to Excel – component to do that (uses a listener of some sort)
· FMW 11g released – calendar year 2009
· Moving splitters – maintained per user by session. To persist user settings you can use Oracle MDS – for example for a set of users you could create a preference set and store it on a database.
· When I deployed to 11g, I did not see OC4J as an option. But Lynn Munsinger says it is among the app servers they offer.
· The focus of the binding layer (JSR 227) is to abstract business services so that you don’t have to know implementation specific details SOAP,WSRP. Also it reduced the number of backing beans you need to write, and also shortens the
· I need to build a wiki of some sort (there is support for this in WebCenter suite).
· Components are ADA (Americans with disapbilities act) compliant
· Learn more about MDS (Metadata Services).
· Although ADF/BC control hints is UI mixed in Model (violation of mvc), it allows us to set standards.
· Can package up ADF BC’s as a library and deploy it, so developers can use this.
· Static list – keep small.
· You need to get a handle on deploying Application Modules for use by company.
· Google “ADF Methodology” – google group has a grassroots naming standards.
· Can create resource bundle on the fly when you create control hints.
· How do you create a plsql web service? Then you can use them in ADF/BC.
· JSF Component good because for example, table takes a collection and is trusted with doing the right thing with the data to make the table viable in HTML.
· What is stateless again? Lynne kept talking about stateless components.
· Check out print component, poll, listeners (that’s that client/javascript thing, I think)…
· Graphs are svg or flash.
· ADF Data Visualization are the graphs I think.
· Experiment with reusing a task flow.
· Task flows can go into a region really easily.
· Bounded task flows can battle the back button (huge reason for using task flows).
· Task flows are integrated with database transactions and process trains
· Can bundle components (like address block) as declarative components.
· It is better to add javascript to a component by creating a custom component and adding javascript.
· Decorative box is a nice layout; three column template is the fusion look.
· Awesome demo; my bosses really should have been there for it. Lynn Munsinger was doing it.
· If using non-adf business components (EJB, or session bean…), you can create declarative validation on the adf binding layer….not used to much often.
· Read the fusion developer guide.
· Read the Fusion UI Developer’s Guide
· (there will be a SOA Developers Guide)
· Q&A on OTn
· JDeveloper might be “less free” if we do not deploy to WebLogic server.
· While we are waiting for FMW 11g to come on line, I need to be establishing standards, best practices, packaging task flows and app modules for reuse, creating templates, creating declarative combined components, skins, page fragments, backing bean bases, ADF/BC component bases, ….
· Active Data Services – pushes changes to data. (ADS) better than polling.
· If we deploy to Tomcat 6.0 we have to pay for license to use the ADF libraries.
· For some reasons, when I was trying to add a default value to an entity date attribute, the groovy expression that I typed in did not register as having “taken”. I typed the value in and hit enter…well actually the first thing I did was enter the expression editor, which opens a dialog. But as soon as I went away from that context and came back the value I had entered did not appear. I bet if I had just entered the default value groovy expression on the property, the value would have taken as expected. At any rate entering the value in the field and switching to the source for the page made the little green dot appear in the property sheet, but no corresponding XML attribute value appeared for the “attribute” element for hireDate attribute. So finally I quit out of JDeveloper and reentered the tool. Then I entered the groovy expression, pressed enter, and it took: got the green dot (signifying non-default value in this property), and I checked the source screen and saw the corresponding DefaultValue attribute pop up with the Groovy value in it. Yay! Oddly enough once I got this to take I had accidentally left the value type to literal…which caused an error…because “adf.currentDate” is not really a valid date, is it? But changing to expression type made the XML change to a Transient expression and the data was put in a “CDATA” thingy. Lol Then it worked.
· Do the demo on page 23, 25, 27, etc. of the class pdf for your bosses.
· I wonder if the Fusion Developer’s guide has good documentation on the aspects of the groovy language that you need to know in order to, for example, express the endpoint values of a validation rule’s range as parameters that could be incorporated into an error message.
· For column selection I am not sure what freeze, wrap do. Not sure what the point is of detatch, but maybe I would discover all this stuff down the road. The tutorial called attention to the features, but I do not see what to do with them yet; and the tutorial did not say either.
· When you do a new ViewObject on the model, and you are to select the entities you want to use, the first one you select is marked as updatable, and reference checkbox is grayed out. When you shuttle over the second entity it assumes it is a reference. Of course this maybe due that not only is employee a child of department, but department is a child of employee due to the manager FK.
· Lynn said to post test cases of bugs on JDeveloper Forums
· Need to download a slightly newer version of JDev 11g which has fixes to memory leaks and many other issues…the memory leak issue actually makes the permgen error happen, and when you try to correct for it by restarting the embedded web logic server the same error happens. If you just restart JDeveloper, the WL Server won’t start because it says there is already one running. The fix for this is either remove the java.exe process in task manager and probably restart JDeveloper…or download this new version of JDeveloper that has a patch for this and other problems.
Questions
· Page Flow versus Task Flow – which one if either is related to an open source standard? Is Page Flow simply JSF’s built in controller, or is it something else?
· Is there a version of OC4J which works with Java EE 5.0. Yes! OC4J 10.1.4 (did not know that existed.) It does not quite do JPA 3.0 right because it was produced prior to the spec being completed for Java EE…but everything else is fine. When I asked Lynn if ADF Faces Rich Client could be deployed to this, she said “no, because of differences in libraries”.
· Could developers use either JDev 10.1.3 ADF Faces, or JDev 11g Trinidad for the same app depending on their preference?
· Client/Server: what does it buy you to run the components on the client side? Server side?
· Custom login modules? Are these harder to write in WebLogic? The same? Are there more built in options.
· Can you pass parameters in via EL? Used to be only HashMaps would allow this. Other means now? (In Java EE unified EL)
· What kind of expressions are allowed in the Token Message Expression area of the validation for an entity? For example, on a range how would you access the ends of the range? Is it Groovy? Where is the list of valid Groovy expressions?
Friday, March 13, 2009
doing battle with WSRP, Part II
If I do all this, he demonstrated that the same ear I was having problems with, worked like a champ! YAY.
(The SR is 7381737.994 if you need it for reference. If you cannot access it, please leave a comment for this blog entry, and I will see if our situations are similar enough to warrent further action.)