Skip to main content

Setting the starting point for KScope2011: Get XFILES running...

As a preparation for a joint presentation with Marco Gralike for ODTUG Kaleidoscope 2011, I tried to (re)install the not-yet-so-famous XFILES Application. That application was the result of the collaboration of Mark Drake (Sr Product Manager XMLDB) and Carl Backstrom. They did a presentation about it during OOW2008. The idea behind the presentation/application was leveraging the power of XML-DB with an APEX UI. Due to Carl's tragic car accident, the application never reached a final stage. Marco already did a sequel about XFILES on his blog. You can also find a download link to the latest version of the application there.
But back to the installation....I used the OTN Developer Days VM as a start and patched it with the latest APEX patch (4.0.1). There is a sort of how-to included in the XFILES download, but that isn't flawless (yet). But after executing all the steps I fired up the application and got this:

So all my images where missing. Inspecting the code learned that the images had a path of /XFILES/APEX/lib/icons/, so not pointing to images included in the application itself (as Application or Workspace Images) but to a directory on the filesystem....that wasn't there.  If I entered http:/localhost/XFILES I did get the directory listing. And drilling down I could see the images. After some investigation it turned out that localhost was using the standard port 80, which was used by the (standard installed - or done by the XFILES installation ??) Embedded PL/SQL Gateway (EPG). And I was using the Apex Listener (with Apache/Tomcat) on port 8888. So the APEX Listener was looking for the XFILES directory on it's root (/home/oracle/apache-tomcat-6.0.20/webapps/ROOT). So in order to get the images in my application I could just extract them from the XDB Repository and copy them onto the filesystem. But that would have been too easy ;-). I though it would be more fun if I could create a mapping from the right location on the filesystem into the right location in the XDB Repository! But as I am not a *nix wizard - nor a XML-DB guru -, I couldn't quite figure out how to do that - even after some Googling around . So I send out a "help Tweet". But it is hard to explain a situation in just 140 characters...
Nevertheless I got a lot of replies (thanks Learco, Iloon, Jacco, Peter, etc). But Marco acted as my mainstay and Skyped me. And just like Marco is, he dived in deep and came up with a solution! And wrote a long post about it...
But in short there are only two additional steps necessary:
1. Create the XFILES directory on the webserver :
2. As su, mount the XFILES Folder in the XDB Repository to that directory:
mount -t  davfs  http://localhost:80/XFILES /home/oracle/apache-tomcat-6.0.20/webapps/ROOT/XFILES

And the result is:

The funny thing about this solution is, that I - as a user - can replace one of the images with my own one and it will immediately show up in the application itself:

Now I first have to solve a performance problem, because the app is deadly slow... Maybe just because of this solution? Don't know yet, will have to find out!
After that the next step is to make it a full blown APEX 4.0-style application, before moving on...


Roel said…
I am already convinced that the "map Unix directory to XDB folder" doesn't speed up performance... If I replace the mounted directory with a real one, the response time increases dramatically...

Popular posts from this blog

apex_application.g_f0x array processing in Oracle 12

If you created your own "updatable reports" or your custom version of tabular forms in Oracle Application Express, you'll end up with a query that looks similar to this one:
then you disable the "Escape special characters" property and the result is an updatable multirecord form.
That was easy, right? But now we need to process the changes in the Ename column when the form is submitted, but only if the checkbox is checked. All the columns are submitted as separated arrays, named apex_application.g_f0x - where the "x" is the value of the "p_idx" parameter you specified in the apex_item calls. So we have apex_application.g_f01, g_f02 and g_f03. But then you discover APEX has the oddity that the "checkbox" array only contains values for the checked rows. Thus if you just check "Jones", the length of g_f02 is 1 and it contains only the empno of Jones - while the other two arrays will contain all (14) rows. So for processing y…

Adding items to your Interactive Grid Toolbar

The APEX Interactive Grid uses the Toolbar widget to create the default Toolbar showing the Search box, Actions menu, Save button etc. And since quite a while there is a nice Plugin "Extend IG Toolbar" by Marko Goricki that makes it very easy to add additional buttons to the Toolbar.

But what if you need more than a button? 
Inspecting the contents of widget.toolbar.js, you can easily spot there can be added more to the Toolbar than just a button: The type of control, available values:
The first example will show a way to easily switch from one filter to another. Of course we could use the standard functionality and create two different Report views, but using a Radio Group on the Toolbar gives a more "Tab" like user experience.

So how can we create a Radio Group that looks like a switch in the Toolbar?
In the Javascript Code …

Refresh selected row(s) in an Interactive Grid

In my previous post I blogged about pushing changed rows from the dabatase into an Interactive Grid. The use case I'll cover right here is probably more common - and therefore more useful!

Until we had the IG, we showed the data in a report (Interactive or Classic). Changes to the data where made by popping up a form page, making changes, saving and refreshing the report upon closing the dialog. Or by clicking an icon / button / link in your report that makes some changes to the data (like changing a status) and ... refresh the report.  That all works fine, but the downsides are: The whole dataset is returned from the server to the client - again and again. And if your pagination size is large, that does lead to more and more network traffic, more interpretation by the browser and more waiting time for the end user.The "current record" might be out of focus after the refresh, especially by larger pagination sizes, as the first rows will be shown. Or (even worse) while you…