Tuesday, October 7, 2014

SAX! <facepalm />

It has been a long time since I have run into a bug in the JDK, let alone in an older version such as JDK 6 update 45.  But low and behold...

So there I was doing a code review on a colleagues code, and ended up breaking it (SURPRISE, SURPRISE!).  As I was debugging it, I discovered that the issue was actually my fault.  I had accidentally created some corrupt data files that it was trying to read.  My colleague's code actually handled the exception decently, so that was good.  Seeing as this was a web services application that was storing its data in XML files (don't ask how we came to that decision), I decided rather than restart my local weblogic, I would just get rid of the bad files and make the call again.

As I waited for windows to lie to me about how long it was going to take to delete the files, my screen suddenly changed.  I got the following:

Inbox Zero

Oy, has it ever been a long time since I've updated this blog....Well, I'm not going to make any promises about do it more frequently.  Instead, I'll simply post something that has been amazing in my work life lately.

I am probably severely late to this party, but the InboxZero concept described by Merlin Mann in this video has had a profound effect on how I manage e-mail.



Thursday, October 17, 2013

ADF Managed Bean Scope Issues

So yesterday we were having issues trying to access an ADF managed bean from code using the typical EL resolver code:

    FacesContext fctx = FacesContext.getCurrentInstance();
    Application app = fctx.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elCtx = fctx.getELContext();

    String el = "#{pageData}";
    ValueExpression ve = elFactory.createValueExpression(elCtx, el, Object.class);
    Object bean = ve.getValue(elCtx);

The problem was that the very last line was always returning null! Our pageData bean was originally scoped as "pageFlow", but setting it to "session", or "application", or "request" allowed the code to work. The only two scopes that did not work were "pageFlow" and "view". In fact our page that was referencing this bean with EL was also not seeing it when the bean was scoped this this way.

Turns out that unlike normal JSF scopes, ADF scopes require the scope to be specified when accessing the bean.  So we needed to change our EL statement from #{pageData} to #{pageFlowScope.pageData}.  In both the code and on the page this resolved our issue.

What notified me of this odd behavior was a small note in the ADF documentation here:

Note:
Write EL expressions that explicitly qualify the scope to access when writing EL expressions to access custom scopes unique to Oracle ADF (pageFlow, backingBean, and view scopes). For example, write an EL expression to access a pageFlow scope as follows:
#{pageFlowScope.inpTxtBB.uiComponent}

Personally, I find this behavior somewhat counterproductive, because you are going to need to find all references whenever you change a bean's scope (which will likely only happen in initial development).  Given that EL is very silent about missing references (by design), this increases the risk of broken code.  Hopefully it will not be too big of a deal in the future.

Wednesday, October 16, 2013

JDeveloper and SVN

As most of you are most likely aware, JDeveloper's SVN integration is not the easiest to use, and there are a number of features that seem relatively absent.  One such feature that I completely miss from Eclipse plug-ins like Subversive and Subclipse is the fact that they automatically do an SVN "Add" operation when new files are created.  Alas, JDeveloper may be capable of doing the same thing!

Friday, October 4, 2013

WebCenter Portal - Out-of-box services

I am working on a project right now to get our developers some practice with the WebCenter Portal (WCP) and ADF toolset.  As such, one of the things we needed to know was the complete list of features/services we can utilize in our custom development (beyond the basic ADF capabilities and navigation).  Since I could not find an nice quick list from a developer POV, I decided to create one, for my own future reference, and in case anyone else was looking for something similar.