Development

Working with multiple Trees on the same APEX Page (4.2/5.0)

Dimitri Gielis - Mon, 2015-03-16 16:36
Ever tried to put multiple Trees on the same page in APEX 4.2?

Here's my example:


On the left Tree the "Selected Node Link with" is set to hidden item P1_TREE1, on the right Tree the value that sets the tree is set to P1_TREE2. At least it should do that, but by default if you're values are not unique - in this case empno is the value behind both trees - it doesn't work...
Your first tree will be highlighted twice; one time for ALLEN and one time for SCOTT and not as it should be, on the left ALLEN selected and on the right SCOTT selected.

To fix this issue in APEX 4.2, you need to adapt your select statement so you have unique values for both trees. I typically put a meaningful character in front of the value; for example you can concatenate 'N' for new values (new tree) and 'O' for old values (old tree).


So that fixes the issue of the "Selected Node Page Item" issue with non unique values.
Behind the tree implementation in APEX 4.2, jsTree is used. APEX is not using the most recent version and the way the JavaScript is coded doesn't really work that nicely. If you really like jsTree and for example want to search in it, or you have a very large dataset, check out Tom Petrus' tree plugin and explanation.

So what about APEX 5.0? The tree implementation in APEX 5.0 has the same functionalities, but is a lot better. Behind the scenes jsTree is not used anymore, instead the tree that is also used in the Page Designer is used. The issue with unique values is off the table, so no worries anymore in APEX 5.0.


Categories: Development

Implementing the Tree Navigation Oracle Alta UI Design Pattern

Shay Shmeltzer - Fri, 2015-03-13 16:10

The Oracle Alta UI design patterns offer many new approaches for navigation in your application as you can see in the navigation patterns section. One of those is the Tree Navigation pattern - which is an updated approach to the way that many applications display menus today.

While the "old" way of building these menus was using the tree component, the new design uses an interface that works better on mobile devices and is easier on the eyes. It uses animation to do in-place replacement of one level in the menu with the next one. 

old new img

You could also use this approach to represent other types of hierarchical/master-detail relationships. 

In the demo below I show you how to quickly implement such navigation pattern with ADF Faces and a combination of af:listView components along with the af:deck component.

There are a bunch of further things you might want to do in your actual application beyond what the demo does.

One is to show on the right side of the page the information on the object you select on the left side. Using a deck component there you can also switch that section to show either Dept or Emp data in the same area. You'll already have the actionListener in place to do the switch of display, and ADF already has the right record selected - so just dropping the same data control on the right as a form will be enough.

Another nice enhancement would be to condition the showing of the right caret to be based on whether there are actually details. This should be easy to achieve with a calculated attribute using groovy - as shown here

In the demo I also show how to invoke the makeCurrent row selection functionality from a managed bean, this allows me to do two operations when a menu option is selected. The code I use ,which is based on code I found on Ashish's blog, is:

public void deptSelect(SelectionEvent selectionEvent) {
        ELContext elcontext = FacesContext.getCurrentInstance().getELContext();
        MethodExpression methodExpression =
            FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createMethodExpression(elcontext,
                                                "#{bindings.DepartmentsView1.treeModel.makeCurrent}",
                                                                                                             Object.class, new Class[] {
                                                                                                             SelectionEvent.class });
        methodExpression.invoke(elcontext, new Object[] { selectionEvent });
        deck.setDisplayedChild("pgl2");
        AdfFacesContext.getCurrentInstance().addPartialTarget(deck);
    } 

I also use styleClass="AFAppNavbarButton" for the "back" button to make it look a bit better. 

The full source of the JSF page is:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html>
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled3.jsf" id="d1">
        <af:messages id="m1"/>
        <af:form id="f1">
            <af:pageTemplate viewId="/oracle/templates/tabletFirstTemplate.jspx" id="pt1">
                <f:facet name="header"/>
                <f:facet name="status"/>
                <f:facet name="appNav"/>
                <f:facet name="globalLinks"/>
                <f:facet name="footer"/>
                <f:facet name="center"/>
                <f:facet name="start">
                    <af:deck id="d2" binding="#{mb3.deck}" displayedChild="pgl1">
                        <af:panelGroupLayout id="pgl1">
                            <af:listView value="#{bindings.DepartmentsView1.collectionModel}" var="item"
                                         emptyText="#{bindings.DepartmentsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                         fetchSize="#{bindings.DepartmentsView1.rangeSize}" id="lv1" selection="single"
                                         selectionListener="#{mb3.deptSelect}">
                                <af:listItem id="li1">
                                    <af:panelGridLayout id="pgl3">
                                        <af:gridRow marginTop="5px" height="auto" marginBottom="5px" id="gr1">
                                            <af:gridCell marginStart="5px" width="80%" id="gc1">
                                                <af:outputFormatted value="#{item.bindings.DepartmentName.inputValue}"
                                                                    id="of1"/>
                                            </af:gridCell>
                                            <af:gridCell marginStart="5px" width="20%" marginEnd="5px" id="gc2">
                                                <af:image source="func_caretright_16_ena.png" id="i1"/>
                                            </af:gridCell>
                                        </af:gridRow>
                                    </af:panelGridLayout>
                                </af:listItem>
                            </af:listView>
                        </af:panelGroupLayout>
                        <af:panelGroupLayout id="pgl2">
                            <af:button text="#{bindings.DepartmentName.inputValue}" id="b1"
                                       actionListener="#{mb3.backToDept}" styleClass="AFAppNavbarButton"
                                       icon="/func_caretleft_16_ena.png"/>
                            <af:listView value="#{bindings.EmployeesView4.collectionModel}" var="item"
                                         emptyText="#{bindings.EmployeesView4.viewable ? 'No data to display.' : 'Access Denied.'}"
                                         fetchSize="#{bindings.EmployeesView4.rangeSize}" id="lv2">
                                <af:listItem id="li2">
                                    <af:panelGridLayout id="pgl4">
                                        <af:gridRow marginTop="5px" height="auto" marginBottom="5px" id="gr2">
                                            <af:gridCell marginStart="5px" width="80%" id="gc3">
                                                <af:outputFormatted value="#{item.bindings.LastName.inputValue}"
                                                                    id="of2"/>
                                            </af:gridCell>
                                            <af:gridCell marginStart="5px" width="20%" marginEnd="5px" id="gc4">
                                                <af:image source="func_caretright_16_ena.png" id="i2"/>
                                            </af:gridCell>
                                        </af:gridRow>
                                    </af:panelGridLayout>
                                </af:listItem>
                            </af:listView>
                        </af:panelGroupLayout>
                        <af:transition triggerType="forwardNavigate" transition="slideLeft"/>
                        <af:transition triggerType="backNavigate" transition="slideRight"/>
                    </af:deck>
                </f:facet>
                <f:facet name="end"/>
                <f:attribute name="endWidth" value="0px"/>
                <f:attribute name="startWidth" value="200px"/>
            </af:pageTemplate>
        </af:form>
    </af:document>
</f:view> 

Categories: Development

APEX 5.0: pimping the Login page

Dimitri Gielis - Wed, 2015-03-11 18:29
When you create a new application in APEX 5.0, the login page probably looks like this:


I love the build-in login page of APEX itself - luckily it's easy enough to build that in our own apps too. Thank you APEX Dev team!

The first step is to change the region type to be of Login Region Template:


We want to add a nice icon on top of the Login text. You can use the Icon CSS Class in the Region options - in this case I opted for fa-medkit:


Next up is making the Login button bigger and make it the complete width like the items.
In APEX 5.0 you can use the Template Options to do that:


Once we stretched the Login button it fits the entire size.

Next up is getting some icons in the username and password field.
For the username we use the "icon-login-username" css class.
Instead of the label we make that hidden and specify a placeholder, so before you start typing you see the word username and when you start typing the text disappears.


For the password field we do the same thing, but for the css class we specify "icon-login-password".


Finally your login screen looks like this:


Great? Absolutely - and so easy with APEX 5.0!

What's next? Is there anything better? Euh... yes, what about live validation?
Sure we can do that in APEX 5.0 without too much hassle :)) Thanks once again APEX Dev Team!

In the item make sure the item is set to Value Required and add in the Post Text following span:


That will give you a nice visual indication if you entered text:


Cool? Creating login pages in APEX 5.0 is ... (you fill in the word)

Interested in more? We're doing an APEX 5.0 UI Training in May.
Categories: Development

Loading CSV files with special characters in Oracle DB

Dimitri Gielis - Tue, 2015-03-10 11:08
I often need to load the data of Excel or CSV files into the Oracle Database.

Ever got those annoying question marks when you try to load the data? or instead of question marks you just get empty blanks when the file is using special characters? Here's an example:


My database characterset is UTF-8, so ideally you want to load your data UTF-8 encoded.

With Excel I've not found an easy way to specify the encoding to UTF-8 when saving to a CSV file.
Although in Excel (OSX) - Preferences - General - Web Options - Encoding, I specified UTF-8, it still saves the file as Western (Mac OS Roman).

I've two workarounds I use to get around the issue. Open the file in a text editor e.g. BBEdit and click the encoding option and select UTF-8.


Another way is to open Terminal and use the iconv command line tool to convert the file

iconv -t UTF8 -f MACROMAN < file.csv > file-utf8.csv

If you get a CSV file and you want to import it in Excel first, the best way I found is to create a new Workbook and import the CSV file (instead of opening directly). You can import either by using File - Import or Data - Get External Data - Import Text File. During the import you can specify the File origin and you can see which data format works for you.


After the manipulations in Excel you can save again as CSV as outlines above to make sure you resulting CSV file is UTF-8 encoded.

Finally to import the data you can use APEX, SQL Developer or SQLcl to load your CSV file into your table.
Categories: Development

Oracle Database Tools updated - check out SQLcl

Dimitri Gielis - Mon, 2015-03-09 17:31
Today Oracle released new versions of:

Also Oracle REST Data Services 3 got a new EA2 version.
You may want to check Kris Rice's blog for new features.

I already blogged about all of the tools before, but not yet about SQLcl.
This is a command line tool, I call it "SQL*Plus on steroids" (or as Jeff calls it SQL Developer meets SQL*Plus). It's particularly useful when you're on your server and quickly need to run some queries. Or if you're a command line guy/girl all the time, this tool is for you.

Here's a screenshot how to connect to your database with SQLcl from Linux.


Typing help will show you a list of quick shortcuts.

For example if you type APEX you get a list of your APEX applications


What I really like about SQLcl is that it formats the output so nicely. With SQL*Plus you had to set column widths, page sizes etc. Not with SQLcl, it's smart and formats it nicely.

Next to that you can quickly output your query in JSON format by typing "set sqlformat json":


There're many more features - a good starting point is this presentation and video by Jeff Smith.
Categories: Development

Who enjoys the feather display of a male peacock?

FeuerThoughts - Tue, 2015-02-24 08:25


Who appreciates the display of feathers by a male peacock?

Female peacocks seem to get a kick out of them. They seem to play a role in mating rituals.

Who else? Why, humans, of course!

We know that humans greatly appreciate those displays, because of the aaahing and ooohing that goes on when we see them. We like those colors. We like the irridescence. We like the shapes and patterns.

If one were to speculate on why a female peacock gets all worked up about a particular male's feather display, we would inevitably hear about instinctual responses, hard-wiring, genetic determinism, and so on.

And if one were to speculate on why a human goes into raptures, we would then experience a major shift in explanation. 

Time to talk about anything but a physiological, hard-wired sort of response.

No, for humans, the attraction has to do with our big brains, our ability to create and appreciate "art". And that is most definitely not something other animals do, right?

Oh, sure, right. Like these instinctive, hard-wired bowerbird mating nests:


That clearly has nothing to do with an aesthetic sense or "art". Just instinct.

Why? Because we humans say so. We just assert this "fact."

Most convenient, eh?

Categories: Development

Developing On-Device Java Mobile Apps for iOS...and Android Too

Shay Shmeltzer - Wed, 2015-02-04 15:25

At the last JavaOne conference I presented a session titled "Developing On-Device Java Mobile Apps for iOS...and Android Too"

The recording of this session just became available, and I wanted to share it with you.

This session should be a good introduction to how Oracle enables Java developers to take their skills to the mobile world.

The first 28 minutes provide the overview, but if you are not into slides fast forward to minute 29 and start watching the extensive demo of developing an iOS application with Java and Eclipse. 

&amp;amp;lt;br /&amp;amp;gt;


Categories: Development

Getting started with iOS development using Eclipse and Java

Shay Shmeltzer - Fri, 2015-01-30 16:05

Want to use Eclipse to build an on-device mobile application that runs on iOS devices (iPhones and iPads)?

No problem - here is a step by step demo on how to do this:

Oh, and by the way the same app will function also on Android without any changes to the code :-)  

This is an extract from an online seminar that I recorded for one of Oracle's Virtual Technology Summits - and I figured people who didn't sign up for that event might still benefit from having access to the demo part of the video.

In the demo I show how to build an on-device app that access local data as well as remote data through web services, and how easy it is to integrate device features too.

If you want to try this on your own, get a copy of the Oracle Enterprise Pack for Eclipse, and follow the setup steps in the tutorial here.

And then just follow the video steps.

The location of the web service I accessed is at: http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

And the Java classes I use to simulate local data are  here.



Categories: Development

Four Secrets of Success

FeuerThoughts - Thu, 2015-01-01 09:56
More than a few people think that I am pretty good at what I do, that I am successful. I respect their judgement and thought about what contributed to my success. I came up with four that form a foundation for (my) success. Since it is possible that others will find them helpful, I have decided to share my Four Secrets of Success (book in the works, film rights sold to Branjolina Films).

Follow these four recommendations, and you will be more successful in anything and everything you seek to accomplish.

1. Drink lots of water.

if you are dehydrated, nothing about you is operating optimally. By the time you realize you are thirsty, you are depleted. You are tired and listless. You think about getting another cup of coffee but your stomach complains at the thought.

No problem. Just get yourself a big glass of water, room termperature, no ice, and drink it down. You will feel the very substance of life trickle into your body and bring you back to life. Then drink another glass. 

Couldn’t hurt to try, right?

2. Work your abs.

What they say about a strong core? It’s all true. Strengthen your abdominal muscles and you will be amazed at the change in your life. I vouch for it from my own experience. 

I’m not talking about buying an Ab-Roller or going nuts with crazy crunches. Just do something every day, and see if you can do a little more every day. 

Couldn’t hurt to try, right?

3. Go outside. 

Preferably amongst trees, in a forest. 

We did not evolve to sit in front of a screen, typing. Our bodies do not like what we force them to do. Go outside and you will make your body happy. And seeing how your brain is inside your body, it will make you happy, too. Then when you get back to the screen, you will be energized, creative and ready to solve problems.

Couldn’t hurt to try, right?

How do I know these three things will make a difference? Because whenever I stop doing any of them for very long, I start to feel bad, ineffective, unfocused. 

Oh, wait a minute. I said “Four Secrets of Success”. So there’s one more. This one’s different from the others. The above three are things I suggest you do. Number Four is, in contrast, something I suggest you stop doing:

4. Turn off your TV.

By which I mean: stop looking at screens for sources of information about the world. Rely on direct experience as much as possible.

Not only is television bad for humans physically, but you essentially turn off your brain when you watch it. If, instead, you turn off the TV, you will find that you have more time (objectively and subjectively) to think about things (and go outside, and work your abs, and...).

Couldn’t hurt to try, right?

Well, actually, you might find it kind of painful to turn off your TV. It depends on how comfortable you are living inside your own mind. 

And if you are not comfortable, well, how does that make you feel?

Wishing you the best in 2015,
Steven Feuerstein
Categories: Development

Dynamcially add components to an Oracle MAF AMX page & show and hide components

Shay Shmeltzer - Wed, 2014-12-31 14:18

A question I saw a couple of times about Oracle MAF AMX pages is "how can I add a component to the page at runtime?".

In this blog entry I'm going to show you a little trick that will allow you to dynamically "add" components to an AMX page at runtime, even though right now there is no API that allows you to add a component to an AMX page by coding.

Let's suppose you want to add a bunch of buttons to a page at runtime. All you'll need to have is an array that contain entries for every button you want to add to the page.

We are going to use the amx:iterator component that is bounded to the above array and simply goes over the records and renders a component for each one.

Going one step beyond that, I'm going to show how to control which components from that array actually shows up, based on another value in the array.

So this is another thing you get to see in this example and this is how to dynamically show or hide a component in an AMX page with conditional EL. Usually you'll use this EL in the rendered property of a component, but in the iterator situation we need to use another approach using the inlineStyle that you change dynamically.

You can further refine this approach to control which type of component you render - see for example this demo I did for regular ADF Faces apps and apply a similar approach. 

By the way - this demo is done with Eclipse using OEPE - but if you are using JDeveloper it should be just as easy :-) 

&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;

Here is the relevant code from the AMX page:

<amx:iterator value="#{bindings.emps1.collectionModel}" var="row" id="i2">

<amx:commandButton id="c1" text="#{row.name}" inlineStyle="#{row.salary >4000 ? 'display: none;' : 'display: inline;'}">

<amx:setPropertyListener id="s1" from="#{row.name}" to="#{viewScope.title}"/>

</amx:commandButton>

</amx:iterator> 

Categories: Development

The insanity that is Uber - a 100$B company?

FeuerThoughts - Tue, 2014-11-25 20:55
So we've had taxis for years and we know that generally taxi drivers work hard, long hours and make small amounts of money. The cab companies make more, of course, but I don't think there are a whole lot of billionaires in the taxi business.

And now there is Uber. An earlier round of VC $ put its value at $17B. According to Fortune, Uber is now "raising new funding at a valuation of between $35 billion and $40 billion, according to a new report from Bloomberg. This would be one of the richest “venture capital” rounds in history (Facebook still holds the crown), and likely mean that investors expect Uber to eventually go public at a valuation of at least $100 billion."

How are to make any sense of this? Where would all the money come from to make all these investors (and shareholders) rich? 

By cutting out the "middleman" (regulation to ensure safe rides, primarily)? Maybe, but I can't imagine it will generate that much revenue?

By reducing the cost of a ride, compared to a taxi? That's true, apparently, some of the time with Uber, but often it is way MORE expensive - because prices are "market-driven."

By shifting more and more of the costs and risks to the drivers? That's pretty darn likely. Just look at the poor "contractors" who have to pay for their trucks and lease their gear from FedEx. 

By shifting riders from mass transit to Uber (in other greatly expanding the "pie" of pay-per-ride)? Again, that seems unlikely.

What am I missing? How could Uber replace an existing business that brings in nowhere near that much money and suddenly be printing the stuff?

Oh, and that's if they don't self-destruct due to their cavalier, arrogant attitudes and actions of their management.
Categories: Development

Feeling trepidatious? Time to lay very low?

FeuerThoughts - Mon, 2014-11-24 12:34
Sure, "trepidatious" might not be a word, per se.

But I am confident it is something that more than one very famous male actor is feeling right now, as they watch Bill Cosby go down in flames.

As in: seriously and deeply apprehensive about what the future might bring.

There are a few things we can be sure of right now, even if Cosby never faces a judge or jury:

1. Bill Cosby is a nasty piece of work, and very likely (was) a pedophile.

The pattern of behavior, finally brought to light after years of self-censorship by victims and callous disregard by the media and judicial system, is overwhelming and seemingly never-ending. Mr. Cosby is a serial rapist, and he did it by drugging young women, some of them less than 18 years old at the time.

2. Bill Cosby is an actor. 

The roles he played were just that: roles. We are easily fooled into thinking of the people behind the roles as sharing characteristics of their characters, but that's just, well, foolish.

The whole point of being a great actor is that you can act really well. You can pretend to be someone else really convincingly. But they are still someone else and not the "real you."

3. Bill Cosby cannot be the only one.

That's where the trepidation comes in. Seriously, what's the chance that Cosby is the only famous, powerful, rich actor who has a long history of taking advantage of and raping women (and/or men, for that matter)?

There have got to be others, and they've got to be terrified that soon their victims will say "Enough!" and then the next deluge will begin.

So my advice to all those A-listers who are also serial rapists:

Lay low, lay really low. Do not provoke your victims. Do not laugh in their faces.

And then maybe you will be able to retire and fade into the sunset, so that your obituary will not be some variation of:

Funny Guy, Sure, But Also a Rapist
Categories: Development

Modifying the Oracle Alta Skin

Shay Shmeltzer - Wed, 2014-11-19 14:38

In the previous blog entries I showed you how to create an ADF project that uses the new Alta UI and then showed you an example of implementing one of the design patterns for a flip card. In this blog/video I'm going to show you how you can further fine tune the look and feel of your Alta application by modifying and extending your skin with CSS.

At the end of the day, this is going to be done in a similar way to how you skinned previous ADF applications. (If you have never done this before, you might want to watch the videos in these two blog entries).

But since the skinning design time is not completely there for Alta in JDeveloper 12.1.3 there are a couple of tricks. Specifically when you create the new skin, you'll need to change the trinidad-skins.xml file to indicate it is extending the alta-v1 and not skyros-v1  - <extends>alta-v1.desktop</extends>

Then the rest of your tasks would be basically the same (although you won't see the overview tab in your skin editor).

So here we go:

Categories: Development

Interstellar Madness

FeuerThoughts - Sun, 2014-11-16 09:19
Saw Interstellar last night. Only had to wait through TWENTY MINUTES of trailers. Had to put fingers in my ears for much of it. So loud, so invasive, so manipulative. Anyway....

I don't watch TV anymore, rarely watch a movie or read a novel. So when I do subject myself to high-resolution artificial input to my brain, it is a jarring experience.

And enjoyable. I haven't stopped watching TV because I don't like it. I have stopped watching TV because I can't help but "like" it, be drawn to it. I am a product of millions of years of evolution, and both Madison Ave (marketeers) and Hollywood know it, and take advantage of it.

Anyway....

I enjoyed watching Interstellar, with its time-traveling plot ridiculousnesses and plenty of engaging human drama. 

But one line really ticked me off. The movie is, to a large extent, a propaganda campaign to get Americans excited about being "explorers and pioneers" again. 

Cooper (McConaughey) complains that "Now we're a generation of caretakers." and asserts that:

"Mankind was born on earth. It was never meant to die here."

That is the worst sort of human species-ism. It is a statement of incredible arrogance. And it is an encouragement to humans to continue to despoil this planet, because don't worry! 

Science and technology can and will save us! Right? 'Cause it sure has done the trick so far. We are feeding more people, clothing more people, putting more people in cars and inside homes with air conditioners, getting iPhones in the hands of more and more humans. 

Go, science, go!

And if we can't figure out how to grow food for 10 billion and then 20 billion people, if we totally exhaust this planet trying to keep every human alive and healthy into old age, not to worry! There are lots of other planets out there and, statistically, lots and lots of them should be able to support human life. Just have to find them and, oh, right, get there.

But there's no way to get there without a drastic acceleration of consumption of resources of our own planet. Traveling to space is, shall we say, resource-intensive.

Where and how did we (the self-aware sliver of human organisms) go so wrong? 

I think it goes back to the development of recorded knowledge (writing, essentially or, more broadly, culture). As long as humans were constrained by the ability to transmit information only orally, the damage we could do was relatively limited, though still quite destructive.

Once, however, we could write down what we knew, then we could build upon that knowledge, generation after generation, never losing anything but a sense of responsibility about how best to use that knowledge.

That sense of responsibility might also be termed "wisdom", and unfortunately wisdom is something that humans acquire through experience in the world, not by reading a book or a webpage. 

Mankind was born on earth and there is no reason at all to think that we - the entire species - shouldn't live and die right here on earth. Especially if we recognize that the price to be paid for leaving earth is the destruction of large swaths of earth and our co-inhabitants and....

Being the moral creatures that we like to think we are, we decide that this price is unacceptable.


Categories: Development

Card Flip Effect with Oracle Alta UI

Shay Shmeltzer - Fri, 2014-11-14 17:00

The Oracle Alta UI focuses on reducing clatter in the user interface. So one of the first thing you'll try and do when creating an Alta UI is decide which information is not that important and can be removed from the page.

But what happens if you still have semi-important information that the user would like to see, but you don't want it to overcrowd the initial page UI? You can put it on the other side of the page - or in the Alta UI approach - create a flip card.

Think of a flip card as an area that switches the shown content to reveal more information - and with ADF's support for animation you can make a flip effect.

In the demo below I show you how to create this flip card effect using the new af:deck and af:transition components in ADF Faces. 

A few other minor things you can see here:

  • Use conditional ELs and viewScope variables - specifically the code I use is 
#{viewScope.box eq 'box2' ? 'box2' : 'box1'} 
  • Add additional field to a collection after you initially drag and dropped it onto a page - using the binding tab
  • Setting up partialSubmit and PartialTriggers for updates to the page without full refresh 

Categories: Development

Science needs to explain this?

FeuerThoughts - Sun, 2014-11-02 08:57
Christopher Nolan of Dark Knight fame releasing new sci-fi movie: Interstellar.

In a Chicago Tribune interview, he says:

I could be wrong, but science needs to cross a threshold and explain why a monkey typing infinitely would never type the works of Shakespeare.

Well, I could be wrong, but maybe Nolan is a bit of an idiot when it comes to science.

Please, Mr. Nolan, tell me which scientists make this claim?

I guess he read somewhere about infinity and how incredibly awesome and big and never-ending it is, and so eventually anything would be done by anybody or anything and so even monkeys would "eventually" write Shakespeare and and and....

Produce a movie called Interstellar with Matthew McConaughey. 

In fact, maybe Chris Nolan is actually a monkey who crossed over from that obelisk in 2001, and got super smart and so a monkey already has produced a movie called Interstellar.

Damn, that is just so cool and so weird and it's like, that's never going to happen, man, no way.

So scientists had better figure out WHY that is not going to happen when they obviously really believe that it WILL happen (go, monkey, go!).

And to do that, they are going to have a cross a threshold, 'cause clearly science has hit its limit here. Just like with souls. Science can't explain souls, so I guess scientists had better cross over - maybe into a parallel universe -

Because really what could be cooler than parallel universes?




Categories: Development

Developing Your First Oracle Alta UI page with Oracle ADF Faces

Shay Shmeltzer - Mon, 2014-10-27 12:20

At Oracle OpenWorld this year Oracle announced the new Oracle Alta UI - a set of UI guidelines that will help you create better looking and functioning applications. We use these guidelines to build all our modern cloud based applications and products - and you can use it too today if you are on JDeveloper 12.1.3. 

The Alta UI site is at http://bit.ly/oraclealta

Take a look for example at one page from the master details pattern page:

altapage

You might be wondering how do I go about starting to create such an Alta page layout?

Below is a quick video that shows you how to build such a page from scratch.


A few things you'll see during the demo:

  • Basic work with the panelGridLayout - for easier page structure
  • Working with the new tablet first page template 
  • Enabling selection on a listView component
  • Working with the circular status meter
  • The new AFAppNavbarButton style class
  •  Hot-swap usage to reduce page re-runs

One point to raise about this video is that it focuses more on getting the layout and look rather then the Alta way of designing an application flow and content. In a more complete Alta mind-set you'll also figure out things like fields that probably don't need to be shown (such as the employee_id), you'll think more about "why is the user on this page and what will he want to do here?" which might mean you'll add things like a way to see all the employees in a department in a hierarchy viewer rather than a form that scroll a record at a time.  There are more things you can do to this page to get even better functionality, but on those in future blog entries... 

Categories: Development

What I like best about myself

FeuerThoughts - Sun, 2014-10-05 09:23
What could be more self-centered?

Why should anyone else in the world care what I like best about myself?

I have no idea. That is for sure. But, hey, what can I say? This is the world we live in (I mean: the artificial environment humans have created, mainly to avoid actually living in and on our amazing world).

It is an age of, ahem, sharing. And, ahem, advertising. Actually, first and foremost, advertising.

Anyway, screw all that. Here's what I like best about myself:

I love to be with kids. And I am, to put it stupidly but perhaps clearly, a kid whisperer.

Given the choice between spending time with an adult or spending time with a child, there is no contest. None at all. It's a bit of a compulsion, I suppose, but....

If there is a child in the room, I pay them all of my attention, I cannot stop myself from doing this. It just happens. Adults, for the most part, disappear. I engage with a child as a peer, another whole human. And usually children respond to me instantly and with great enthusiasm. 

Chances are, if your child is between, say, three months old to five years, we will be fast friends within minutes. Your cranky baby might fall asleep in my arms, as I sing Moonshadow to her or whisper nonsense words in her ear. Your shy three-year old son might find himself talking excitedly about a snake he saw on a trail that day (he hadn't mentioned it to you). Your teenage daughter might be telling me about playing games on her phone and how she doesn't think her dad realizes how much she is doing it.

I have the most amazing discussions with children. And though I bet this will sound strange to you: some of my favorite and memorable conversations have been with five month old babies. How is this possible, you might wonder. They can't even talk. Well, you can find ouit. Just try this at home with your baby:

Hold her about a foot away from your face, cradled in your arms. Look deeply and fully into her eyes. Smile deeply. And then say something along these lines, moving your mouth slowly: "Ooooh. Aaaaah. Maaaaa. Paaaaa." And then she will (sometimes) answer back, eyes never leaving yours....and you have a conversation. Your very first game of verbal Ping Pong. 

I suppose I could try to explain the feeling of pure happiness I experience at moments like this. I don't think, though, that written language is good for stuff like that. It's better for recording knowledge needed to destroy more and more of our planet to make humans comfortable.

And with my granddaughter, oh, don't even get me started. Sometimes I will be talking to her, our heads close together, and realize her face has gone into this kind of open, relaxed state in which she is rapt, almost in a trance, absorbing everything I am saying, the sound of my voice, my mouth moving. Just taking it all in. You'd better believe that I put some thought into what I am saying to this incredibly smart and observant "big girl." (who turns three in three weeks)

Here's another "try this at home" with your three year old (or two or four): talk about shadows. Where do they come from/ How do they relate to your body? Why does their shape change as the day goes on? Loey and I have had fun with shadows several times.

I have always been this way. I have no idea why. I have this funny feeling that it might actually be at least in some small way the result of a genetic mutation. I have a nephew who resembles me in several different, seemingly unconnected ways, including this love of and deep affinity for children.

I don't think that many people understand what I am doing when I spend time with children. I am called a "doting" grandfather. It offends me, though I certainly understand that no offense was intended.

I don't dote on Loey. Instead,I  seek out every opportunity to share my wonder of our world and life with her, help her understand and live in the world as effectively as possible. What this has meant lately is that I talk with her a lot about trees, how much I love them, how amazing they are. 

One day at the park, as we walked past the entrance to the playground, I noticed a very small oak sapling - in essence, a baby oak tree.

When we got inside the park, there was a mature oak towering over our stroller. I asked Loey if she wanted to see a baby tree. She said yes, so I picked her up to get close to the mature oak's leaf. I showed her the shape of the leaf, and the big tree to which it was attached.

Then I took her outside and we looked at the sapling. I showed her how the leaves on this tiny baby tree were the same, shape and size, as those on the big tree. That's how we knew it was a baby of that big tree. And it certainly was interesting that the leaves would be the same size on the tiny sapling. Held her attention throughout. That was deeply satisfying.

Mostly what I do is look children directly in the eyes, give them my full attention, smile with great joy at seeing them. Babies are deeply hard-wired to read faces. They can see in the wrinkles around my widened eyes and the smile that is stretching across my face that I love them, accept them fully. And with that more or less physical connection established, they seem to relax, melt, soften with trust. They know they can trust me, and they are absolutely correct. 

In that moment, I would do anything for them.

This wisdom (that's how I see it) to accept the primacy of our young, my willingness to appear to adults as absolutely foolish, but to a child appear as a bright light, making them glow right back at me:

That is what I like best about me. 
Categories: Development

An OOW Summary from the ADF and MAF perspective

Shay Shmeltzer - Fri, 2014-10-03 13:39

Another Oracle OpenWorld is behind us, and it was certainly a busy one for us. In case you didn't have a chance to attend, or follow the twitter frenzy during the week, here are the key take aways that you should be aware of if you are developing with either Oracle ADF or Oracle MAF.

 Oracle Alta UI

We released our design patterns for building modern applications for multiple channels. This include a new skin and many samples that show you how to create the type of UIs that we are now using for our modern cloud based interfaces.

All the resources are at http://bit.ly/oraclealta

The nice thing is that you can start using it today in both Oracle ADF Faces and Oracle MAF - just switch the skin to get the basic color scheme. Instructions here.

Note however that Alta is much more than just a color change, if you really want an Alta type UI you need to start designing your UI differently - take a look at some of the screen samples or our demo application for ideas.

Cloud Based Development

A few weeks before OOW we released our Developer Cloud Service in production, and our booth and sessions showing this were quite popular. For those who are not familiar, the Developer Cloud Service, gives you a hosted environment for managing your code life cycle (git version management, Hudson continuos integration, and easy cloud deployment), and it also gives you a way to track your requirements, and manage team work.

While this would be relevant to any Java developing team, for ADF developers there are specific templates in place to make things even easier.

You can get to experience this in a trial mode by getting a trial Java service account here.

Another developer oriented cloud service that got a lot of focus this year was on the upcoming Oracle Mobile Cloud Service - which includes everything your team will need in order to build mobile backends (APIs, Connectors, Notification, Storage and more). We ran multiple hands-on labs and sessions covering this, and it was featured in many keynotes too.

 In the Application development tools general session we also announced that in the future we'll provide a capability called Oracle Mobile Application Accelerator (which we call Oracle MAX for short) which will allow power users to build on device mobile applications easily through a web interface. The applications will leverage MAF as the framework, and as a MAF developer you'll be able to provide additional templates, components and functionality for those.

Another capability we showed in the same session was a cloud based development environment that we are planning to add to both the Developer Cloud Service and the Mobile Cloud Service - for developers to be able to code in the cloud with the usual functions that you would expect from a modern code editor.

dcs

The Developer Community is Alive and Kicking

The ADF and MAF sessions were quite full this year, and additional community activities were successful as well. Starting with a set of ADF/MAF session by users on the Sunday courtesy of ODTUG and the ADF EMG. In one of the sessions there members of the community announced a new ADF data control for XML. Check out the work they did!

ODTUG also hosted a nice meet up for ADF/MAF developers, and announced their upcoming mobile conference in December. They also have their upcoming KScope15 summer conference that is looking for your abstract right now!

Coding Competition

Want to earn some money on the side? Check out the Oracle MAF Developer Challenge - build a mobile app and you can earn prizes that range from $6,000 to $1,000.

Sessions

With so many events taking place it sometime hard to hit all the sessions that you are interested in. And while the best experience is to be in the room, you might get some mileage from just looking at the slides. You can find the slides for many sessions in the session catalog here. And a list of the ADF/MAF sessions here.

See you next year. 

Categories: Development

What I felt sad about last night

FeuerThoughts - Mon, 2014-09-22 07:16
A few weeks ago, I moved my office into the basement. That was a big change. That room upstairs, with big windows looking out onto Pratt Ave was where I'd spent almost all of my professional career (we moved to the house in 1992, three months before leaving Oracle for a consulting gig), wrote my books (including the first, Oracle PL/SQL Programming, that changed the course of my life), built the software (Xray Vision for SQL Forms 3, QNXO, Qute, PL/Vision, Code Tester for Oracle, Quest CodeGen Utility, etc.), did the webinars, wrote 1000+ quizzes for the PL/SQL Challenge.

But you know what? Bye, bye, no big deal. Change is good (like this change: Veva and I are taking ballroom dancing classes. I will learn what to do with my feet when I dance!).

I like my cave, I mean, office. It's spacious, and I can make as much noise as I want. Which is very important, since I will be churning out lots of really noisy videos about PL/SQL and my latest dance moves. 

I'm getting my artwork up on the walls:


My father did the painting on the bottom left. It has a lot of power and feeling. My dry cleaner created the beautiful painting on top.

I re-established my sand table with beautiful pieces by Terry Hogan, and many other shells and coral from the sea:


And I put some of my awards and other mementos up on shelves that used to hold a small library of science fiction/fantasy books:


So, yes, settling in to my new office. And last night I started nailing up corkboard tiles to the thick wood paneling, so I could pin up photos of my granddaughter, Loey. Oh, I suppose other people, too. But Loey mainly, because she is the light of my life, and oh my she is a bright light.


In any case, as I hammered the tiny nails needed to hold up the corkboard, I became aware that I felt kind of down, as if the day had not gone well. Why would I be feeling that way? It had been a good day. And then I (the conscious part of me) realized that the non-conscious part of me was feeling bad about having broken a branch in the woods earlier in the day.

That sounds kind of weird, right? I mean, seriously, how bad are humans supposed to feel about breaking the branch of a tree? It's not like they'd notice, right?

But it made perfect sense to me, so I decided to share with you why a broken branch would set my brain to brooding, thereby giving you a sense of how I see the world these days.

As to why anyone should care what I think of the world, well, I leave that entirely up to the reader. No readers, then no one cares. :-) 

As soon as the thought (brooding about broken branch) broke into my consciousness, I immediately knew it was true (that happens to you, too, right? You can instantly sense that a thought is correct. Now try thinking about what is going on in your brain for this to happen and how much of your brain is the "I" that is you). 

You see, I had earlier been thinking back over to when I was in the woods this morning cutting down buckthorn. At one point a rather large tree came down hard against a nearby native tree I was working to rescue. 

To my great dismay, one of its branches was caught by the twisty, grabby buckthorn. It snapped and hung loosely. I did that. That was probably two years' new growth, hard work against buckthorn. And I killed it. 

That bummed me out (and still does), but I reminded myself that I have to accept that even when I move carefully and always safely, I cannot always control where a large tree will fall. I will make mistakes and there will be setbacks. But I just have to keep going.

"Going where?" you might ask. I have developed a new, very strong compulsion: to rescue trees. To do what I can with my own hands, with my own time, with, in other words, a solid chunk of my life, to heal some of the damage we humans inflict on our co-inhabitants and the planet itself.

I think about it as direct and positive action, a principle I attempt to follow in all aspects of my life these days.

Here in Chicago, buckthorn - an invasive import from northern Europe - grows aggressively, crowding out the native trees. In particular, they don't allow young trees, the saplings, the next generation of the natives, to survive. And as the buckthorn grows taller,  it also kills off the lower branches of the mature trees. 

Buckthorn is really an impressive, powerful, successful species. I admire it greatly - and I cut down on the order of 200 buckthorn trees a week (many of them quite small, but not all). Contradiction? Not at all. A necessary corrective action to human abuse of our world. We travel about, carrying with us the seeds (and ballast and larvae) of destruction for many ecosystems.

I do not want to lose our native trees (and even the non-invasive imports). I want my children and grandchildren to enjoy forests. I want to respect trees, since we could never have evolved to what we are today without trees. And even today the forests of the world are absolutely critical to the functioning of the global ecosystem(s).

I want to treat trees with respect and do penance for our cutting down 95% of the trees in the continental US. So I go out and rescue trees. It is now my only form of exercise and it keeps me in great shape - especially for picking up, carrying and playing with Loey. She loves for me to hang her upside down by her ankles and swing her like a pendulum. She trusts me implicitly. I love that.

Sorry, you must be wondering: what is the point of all this? 

To give me an opportunity to marvel at the current state of my life, in which I have quite an intimate relationship with trees. I study them, I read them. Really, it's quite amazing. I can go into the woods now, look at how a native tree's branch has withered, identify the buckthorn that is doing the damage, and actually play it out in my mind's eye: years of slow growth, of slow-motion battle, and of losing it to the buckthorn. Everywhere I look, I find the trees telling their stories.

My greatest joy is to uncover a small sapling that was so completely surrounded and covered by buckthorn I didn't even see it there when I started cutting. Then I open it to the sun and the wind. I did this with a lovely 15 foot tall maple sapling last week. I will be visiting it (and hundreds of other trees) each year now, making sure the buckthorn (and grapevine) leaves it alone, allowing it to grow to a big, thick, incredibly strong and life-giving tree.

There, right there, that's what I marvel at: I know that the 10+ hours I spend each week in the woods rescuing trees will mean that 20 years from now there will be trees with a diameter of a foot or more that simply would not be there if it hadn't been for my effort and my attention paid to something other than human stuff.

That makes me feel happy and less guilty about my consumption (and indirect killing of many, many trees). It gives me a purpose in life, besides family and work.

I plan to rescue trees for as long as my body is able to do the work.

Anyone care to join me?





Categories: Development

Pages

Subscribe to Oracle FAQ aggregator - Development