Wednesday May 22, 2013

UKOUG ADF Mobile Demo

Yesterday I participated in a Special Interest Group meeting organised by the UK Oracle User Group on ADF Mobile. 

As part of my session I concentrated on building an ADF Mobile application from the ground up based on grabbing JSON data from Hudson. This demo shows the core techniques for dealing with URL based data and parsing the same. Several folks at the event had asked for the demo code so I've packaged and uploaded onto the ADF EMG Code Samples Repository:

Enjoy!

Friday May 17, 2013

Launching JConsole as an External Tool From JDeveloper

I find JConsole to be a useful tool, particularly for MBean browsing, but frankly getting the correct command line arguments to get it to connect correctly to my WebLogic instances is a bit of a pain. I always have to go and look it up. - generally from here. However, setting all those paths is tedious. Given that I'm usually working in an environment where my JDeveloper, and the WebLogic servers I'm using JConsole on, are matched from a version perspective I can get JDeveloper's external tools capability to do the lifting.

Very simple this. Just choose Tools > External Tools from the menu and press New.  Then run through the wizard:

  1. Type is External Program
  2. Program Options > Program Executable = jconsole 
  3. Program Options > Arguments =  (All on one line of course, reformatted here for readability)
 -J-Djava.class.path=${java.path}/lib/jconsole.jar:
                     ${java.path}/lib/tools.jar:
                     ${prop:name=weblogic.home}/lib/wljmxclient.jar 
 -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote 

And that's it.  JDeveloper helpfully substitutes both the Java location and the WebLogic location for us saving all that hunting around.  

Tip

 Thanks to Torsten Kleiber who discovered and followed up on the twist of ${java.path} not expanding correctly (or rather expanding to null). Before running the tool command with the macro make sure that you have a project open and selected as the actual java path is obtained in the context of the JRE version used by the selected project. (Project Properties > Libraries and Classpath > Java SE Version)


Wednesday May 15, 2013

Conveyor Visualization for Tabs in ADF

If you look carefully at the online demos for panelTabbed in 11.1.1.7 you may notice that the tabs are sporting a slightly changed UI for situations where the number of tabs can't fit into the available horizontal space. 

Here's the situation with the default representation of a tab-set when it overflows. The chevron  on the right of the tab-set can be clicked to display a drop-down list of the remaining tabs. 

Basic tab visualization

In 11.1.1.7 we now have an alternative visualization where the hidden tabs are available on a conveyor belt and the user can scroll along the belt rather than having to use the pull-down list.

Conveyor Tabs

Enabling this feature

This visualization is not controlled by any property on the component but rather is switched on through the skin being used in the application. As such, all tab-sets within the application will gain the visualization if it is switched on. 

To enable it you will need to create a custom skin, if you are not familiar with  process then there are plenty of articles and documentation out there to help you, or you can download the demo that I've created to go along with this article. Basically I've created a custom skin that extends the new Skyros skin that 11.1.1.7 uses by default, and plugged that in to replace Skyros.

Within the skin file there is a single entry to make for panelTabbed (and a similar one for navigationPane):

 af|panelTabbed {
    -tr-layout-type:conveyor; 
}

And that's it, as simple as that.  As I mentioned you can download a simple sample (DRM009) which shows this in action from the ADF EMG Demos Site

Friday May 03, 2013

Slide, Charlie Brown! Slide!

Following on from an earlier article(Using inputNumberSlider with Dates) where I showed you how you could use an <af:inputNumberSlider> to display formatted date strings rather than numbers, I've been expanding into other uses for the slider components. 

Specifically the most recent use case  was to represent text labels for the number "stops" on the slider so that it could be used as a way of filtering datasets. So this is what it looks like:

So, no problem you say, the previous article shows pretty much how to do that - why a new one?   Well the twist here is in the form of tables.

What if I want to use the slider in a table, and I want to have different slider labels for different rows, like this:

Well that's a bit more of a problem.  Why you ask?  It's because of the way that tables work.  When you define a table, each row is stamped out from the same set of components.  So If I have one converter that say converts numbers to  Domain, Kingdom, Phylum etc. associated with the slider then that's the converter that I'm going to use for every row as it's stamped out. I can't use a different converter per row. (Well OK I could use EL to specify a different converter value for each but then I'd need to define as many converters as I have value lists and plus I would have to know in advance what all the possible lists of filter values are.  In this case, the reality is that the values shown in the sliders come from user configuration rather than being baked into the application anyway, so a hardcoded solution is out) . 

So my aim here was to build a converter that could be used generically with as many different lists as required. You can download the resulting code from here.

If you take a look at the demo you will see that the converter is defined by name in the faces-config.xml  and then associated with the inputSlider

<af:inputNumberSlider value="..." minimum="0" maximum="3" minorIncrement="1" 
                      converter="ismsConverter">
    <f:attribute name="imsConverterMeasureElements" value="John,Paul,Ringo,George"/>
</af:inputNumberSlider> 

The actual list of elements which will be displayed as labels for each slider stop are then passed as a comma delimited string using the <f:attribute> tag.

This version of the converter always assumes a zero indexed list and the labels are assigned in order from zero. So selecting George in the slider above will translate into a value of 3. It would be perfectly possible to adapt the code to allow specific mapping between a number and the label, e.g. if you wanted a 1 based list you might pass a definition string like this:

"1:John,2:Paul,3:Ringo,4:George"

You'd just need to do a little more parsing in the converter itself to make this work though.

Even with no change you can use the converter out of the box with <af:inputRangeSlider>. Here's a version with Roman numerals:

 Finally on the matter of datatypes there is a slight twist when using a model attribute of type oracle.job.domain.Number.  The ismsConverter will handle the basic Java types, float, int, long double etc. and then there us a second converter called ismsJboConverter that handles the JBO Number type.  All of this is shown in the demo.

About

Hawaii, Yes! Duncan has been around Oracle technology way too long but occasionally has interesting things to say. He works in the Development Tools Division at Oracle, but you guessed that right? In his spare time he contributes to the Hudson CI Server Project at Eclipse
Follow DuncanMills on Twitter

Note that comments on this blog are moderated so (1) There may be a delay before it gets published (2) I reserve the right to ignore silly questions and comment spam is not tolerated - it gets deleted so don't even bother, we all have better things to do with our lives.
However, don't be put off, I want to hear what you have to say!

Search

Archives
« May 2013 »
MonTueWedThuFriSatSun
  
1
2
4
5
6
7
8
9
10
11
12
13
14
16
18
19
20
21
23
24
25
26
27
28
29
30
31
  
       
Today