Quantcast
Channel: Grassroots Oracle
Viewing all 405 articles
Browse latest View live

Implement Bullet Sparkline using extended Enkitec Plug-in

$
0
0
This post details the implementation of an extended version the Enkitec Sparklines Plug-in to include bullet charts. Previously I posted how this extension was made.

First you need to download and import the plug-in. Once this is done, you can define the data used, then create a dynamic action to convert the data into the sparkline chart.

In my case I didn't need to consider string aggregation techniques as my data came from different fields. I defined a dynamic PL/SQL block that generated HTML similar to
<span id="jobBullet">12,15,15,13</span>
Where the values are respectively Target (red line), Performance (inner blue line), Range (full background shading), Expected (first layer of shading, near red line)

Target, Performance, two ranges
We will probably use the inner blue line to represent "expected" target, and have just one background colour, so this data set would not have the fourth number.
Target, Performance, Range
I found the jQuery Sparkline documentation lacking when attempting to modify the tooltip values.
I ended up finding the information I need in the related Google Group.
tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Measurement'} }

This information forms part of the onLoad dynamic action that will convert the span of data into a sparkline.

The action utilised comes directly from the plug-in definition: Enkitec Sparklines [Plug-in]
I directly identify the data span with the jQuery selector #jobBullet
When generating a sparkline for every row in a report, it's likely your selector will be a class.
I wanted my sparkline to be larger, so I adjusted the plug-in to allow me to enter the common width property each time.


My next step is to parameterise the colour scheme so I can modify the Performance colour to be green or red, depending on the Target value.

CSS pull down menu using APEX List

$
0
0
I find APEX tab sets cause all sorts of issues in applications, either through management or behaviour. A common request is to create some pull-down menus as a replacement.
There are plenty of options for this, including a number of jQuery plugins, but here is an example that uses only CSS
http://www.lwis.net/free-css-drop-down-menu/ultimate.horizontal.html
This makes it lightweight and fast.

It's easy to implement this as a list template in APEX, enabling you to source your menu from a SQL query (possibly on your page meta-data) or a static list.

You might have seen this in the past as a Sumneva presentation from Scott Spendolini, which somehow I found after encountering the LWIS site - but it did confirm a few gaps for me. It also provides a good review of Tabs vs jQuery vs CSS.

I personally had a few issues implementing this as described, but I think there are some minor bugs during the rendering if list templates.
The following example renders it fine.

Upload supporting files

Upload the following files to your workspace - downloadable here under MIT/GNU licence.
default.css
default.ultimate.css
dropdown.css

Or place them in your fileserver - whichever is appropriate.
You'll also need these images (in this example, anyway)
grad1.png
grad2.png
nav-arrow-down.png
Note no JavaScript files required.

Create list template

Create new list template from scratch (don't be scared!)

Name: CSS Horizontal Dropdown Menu
Class: Pull Down Menu or Custom n -- either would be worthwhile

Once created, edit the template and enter the following in the relevant locations, or download the template export from here and adjust the supporting file locations accordingly.

Before List Entry
"List template before rows"
Here you'll need to modify the CSS location as appropriate. In fact when loading things into the APEX workspace, default.css also needs to be included here and the @import command removed from default.ultimate.css
Likewise, the CSS needs to be modified so all the supporting images are referenced using something like
background-image: url(http://www.lwis.net/free-css-drop-down-menu/images/default/nav-arrow-down.png);
unless you come to other arrangements.
<link href="#WORKSPACE_IMAGES#default.css" media="screen" rel="stylesheet" type="text/css" />
<link href="#WORKSPACE_IMAGES#dropdown.css" media="screen" rel="stylesheet" type="text/css" />
<link href="#WORKSPACE_IMAGES#default.ultimate.css" media="screen" rel="stylesheet" type="text/css" />
<div id="navwrap">
<ul id="nav" class="dropdown dropdown-horizontal" style="margin-bottom:10px;">


<style> 
ul {
  list-style-type: none;
}

#navwrap {
  float:left;
  width:100%;
  margin-bottom:4px;
  background:#f6f6f6;
  border-style:solid;
  border-color:#d9d9d9 #d9d9d9 #d9d9d9;
  border-width:1px 1px 1px 0;
}

</style>

This also includes an override for the user agent stylesheet for unordered lists, otherwise you see bullet points instead of images.
The navwrap ID settings pushes the menu across the width of the page.

Template Definition
"List template current"
<li><a href="#LINK#">#TEXT#</a></li>

"List template current with sublist items"
<li><a style="color:black;" class="dir">#TEXT#</a><ul>

"List template non current"
<li><a href="#LINK#">#TEXT#</a></li>

"List template noncurrent with sublist items"
<li><a style="color:black;" class="dir">#TEXT#</a><ul>

Before Sublist Entry
"Sublist template before rows"
<!-- I don't believe this renders with dynamic lists!
this is why the opening UL is in the definitions above -->


Sublist Entry
"Sublist template current"
<li><a href="#LINK#">#TEXT#</a></li>

"Sublist template current with sublist items"
<li><a href="#LINK#" class="dir">#TEXT#</a>

"Sublist template noncurrent"
<li><a href="#LINK#">#TEXT#</a></li>

"Sublist template noncurrent with sublist items"
<li><a href="#LINK#" class="dir">#TEXT#</a>

After Sublist Entry
"Sublist template after rows"
</ul></li>

After List Entry
"List template after rows"
 </li></ul></div>

Prepare menu hierarchy

Before defining the region that renders the list, you need a list defined - this will be your hierarchical menu. This way it can either be a static list where you manually define the menu options, or it could be a query over your application's meta-data.

In this example I'll use a dynamic query - but before creating your list, we need to prepare the hierarchy.

I defined a few Page Groups to be my menu headings, and the allocated pages will live under the relevant drop down.
Application Builder -> Utilities -> Cross page utilities -> Page groups
Page group allocation

Create List 

Now we've prepared the meta-data, we can create a list based on a query that our list region will use.
The query is structure in three parts -
  • Home link - often identified by page alias of HOME, but you could get clever with this. 
Once I embedded this into the template itself, allowing me to parameterise a logo as the home link via substitution strings
<li >
  <a href="f?p=&APP_ID.:HOME:&SESSION." style="padding:0 5px;">
    <img src="&TEMPLATE_LOCATION.logo_&APP_ALIAS..png" style="max-height:26px;"/>
</a></li>   
  • Top menus - by default this are links, but I've modified these to just facilitate opening the menu - particularly for mobile devices where your finger is used instead of a mouse hover.
  • Drop down options - the destination pages for your menu
So create a new dynamic list from scratch called Menu. Use the following query
select -- Link to home page
1 lvl
,page_name label
,'f?p='||:APP_ID||':'||page_id||':'||:APP_SESSION||'::'||:DEBUG target
,null is_current_list_entry
,null image
,null image_attribute
,null image_alt_attribute
from apex_application_pages ap
where application_id = :APP_ID
and page_alias = 'HOME' -- identify however you like
union all
select -- Menu options, don't link anywhere to aid touch devices
1 lvl
,page_group_name label
,'#' target
,null is_current_list_entry
,null image
,null image_attribute
,null image_alt_attribute
from apex_application_page_groups pg
where application_id = :APP_ID
union all
select -- drop down menu options - pages belonging to groups
2 lvl
,page_title label
,'f?p='||:APP_ID||':'||page_id||':'||:APP_SESSION||'::'||:DEBUG target
,null is_current_list_entry
,null image
,null image_attribute
,null image_alt_attribute
from apex_application_pages ap
where application_id = :APP_ID
and page_group is not null -- you may limit this to set groups, allowing further management of utility pages, popups etc
order by page_group_name, lvl,label
If you find the menu not displaying in the hierarchy you expected, check the order by. It should group results as you might translate to the menu - all the relevant menus together, and the top menu is the first record of each group.

Create list region

Create your global page (page zero) if you haven't done so already. This is the perfect place for your menu's list region.
Create a new list region in the global page, with the display point appropriate for your particular template. I chose region position 1. The region requires no template, but you use the List Template you just created.
You will also need to ensure the menu doesn't appear on pages that don't require it - logon, popups, etc. So make sure your region condition is appropriate. To start with it might be
:APP_PAGE_ID != 101

Remove tabs

Now that you have a CSS menu system in place, you can now remove the tab list that may have previously supported your pages. You might be able to make one change, depending on how you've managed your page templates. This could be modifying the Page template default in your current theme from "One Level Tabs" to "No Tabs". For the theme (2) I have been using in my sample application I also needed to remove the div that housed the tab set. 
CSS menu system
It's not quite as pretty as when implemented using one of the newer themes, but still looks neat and clean. I'll have to update this in future. You may also wish to replace the pixel style down arrows to something more contemporary, less retro.

This biggest bugbear I have with this solution is it doesn't seem touch-screen friendly, despite my interpretation of assurances in the LWIS FAQ. While it drop's down, it doesn't allow me to select "Employees" using Chrome on my Samsung Galaxy III. On a Windows Latitude using IE, the drop-downs don't even open. First level selections are ok.

A similar alternative is an Enkitec plug-in incorporating the Twitter Bootstrap framework.

Scott

ps - a few weeks after I drafted this I noticed Dutch blogger Kees Spot posting about the same framework.

Freezing the Navbar Menu plugin to top of page

$
0
0
Recently I blogged about a nifty CSS only menu that is a great alternative to the horrible APEX tab-sets. Unfortunately I had to ditch it for a recent project because it didn't work well on touch screen devices, so I picked up Enkitec's Navbar plugin instead.

I wanted to freeze the menu at the top of the page, so when the user scrolled down, the menu would remain at the top of the screen.
I tried doing this some time ago with a side-bar menu but came across a bunch of problems - this time round it required very little CSS to make it happen. This stackoverflow post suggested 2 lines, but my APEX example extended a touch more:
.navbar {
position:fixed;
width:100%;
z-index:10000;
}
.apex_span_12, .apex_span_10 {
margin-top:50px;
}
The key is the position fixed, width 100%, but the fixed position had some minor side effects - some objects overlapped my menu, and all existing content shifted up underneath the menu.

To fix the overlap I used z-index, which is the third dimension beyond height/width and decides which components appear above another when the position is set. I added a large z-index value so the menu always overlapped other objects I had such as a google map, CSS checkbox switches and other maps that by default went over the menu instead of under like all the APEX components.

Then I had to make sure all my regular content started underneath the menu, so this is where the margin comes in. Since I was using the responsive Theme 25, I identified those classes as the lowest common denominator for moving my content.

Depending on the page template used, it was either of those classes - basically if I had a side-bar region the apex_span_n changed. I'm happy to receive feedback on a smarter solution, but this worked for me.

I used 50 pixels, but the font in my menu is at 130% to benefit bigger fingers on the touch screen.

Hope it helps!

Scott

Review: Oracle APEX for Mobile Web Applications

$
0
0
Oracle Application Express for Mobile Web Applications

If you haven't heard about this book yet, you're not reading enough media on-line.

APEX regulars Roel Hartman, Christian Rokitta and APEX product manager David Peake are the published authors, but I think it’s safe to say we can also thank Dan McGhan for starting the project.
(I mention Roel explicitly a few times where I'm pretty sure he was involved, sorry if I apply undue credit anywhere!)

I've been meaning to write this review for quite some time - I had the pleasure of technical reviewing this book & from the first chapter I knew this was going to be a winner - something very popular for anyone with half a brain that can bust out an APEX application.

Introduction to APEX for Mobile Development

Let’s be honest, the title alone sold the book for me. Mobile development is apparently kinda popular right now, as is APEX - so it seemed the perfect pair.

I think it was a great introduction to what’s expected out of mobile development, particularly through the eyes of an APEX developer. It details issues such as web vs native & responsive design. It should whet your appetite, if not - you’re in the wrong game ;-)

Creating Mobile Pages

This chapter starts of by de-constructing a basic jQuery Mobile page, which sets the scene well for the type of HTML to expect from these pages.
You are then walked through the creating of your ‘first’ mobile page using a list view and a basic form. The author then uses these to illustrate the many ways you can define navigation between pages, including a mobile dialog.
He then finishes with an intro to transitions, loading widgets and templates.

Highlights - realising the programmatic flexibility APEX can provide.

Presenting Data through List Views

As I’ve learned in a current project developing an application for a tablet - list views are a fundamental cultural shift from the desktop, providing a standard workflow construct.
This chapter details the various options APEX provides when defining these lists views.
The author also includes some sample CSS to help show how to identify then manipulate components on the page - it’s not too hard once you are shown some examples.

Highlights - advanced formatting with CSS examples; swipe to delete

Accepting Input via Forms

This chapter starts with the simplest, most common form ever - the login page. The author notes how bland the stock form is, and uses the power of CSS to tart it up.

The next most important aspect of mobile development is discussed - grid layout.
Screen real estate is also precious, so there are some examples of collapsible content.

Also included are discussions regarding HTML5 input options such as the slider & toggle switch, and ways to enhance existing selectors such as radio groups and select lists.

I keep saying things are important, but mobile is a whole new world and notifications are another example of a fundamental product feature that needs re-addressing in the mobile world.
If you’re a fan of iOS, Roel continues the chapter by showing how to customise the delete dialog box with a native looking popup; then follows it up with a much nicer success confirmation.

If that’s not enough, the chapter puts finishing touches on your ‘first’ form to make it look ultra professional - and we’re only four chapters in!

Highlights - more CSS examples, grid layout, notifications

Displaying Calendars and Charts

As if your application isn't looking sexy enough already, we can also add various charts and calendars.

Out of the box calendar’s are not too bad - but again Roel takes things a few steps further with some inspiration from iOS.

He doesn't go into too much detail with charts - they’re already pretty nifty and the APEX team are constantly working with AnyChart to ensure greater capability and conformity with various devices. Later in the chapter though he demonstrates some of the other options out there such as Highcharts & Flotcharts - which includes an example of a RESTful web-service.

The surface is also skimmed with mapping options, but I think again it’s because of the reliance on external interfaces.

Highlights - calendar enhancement

Implementing a Navigation Springboard

This chapter starts with an obvious lean towards Apple devices, but springs back to setting up a very nifty iconic menu (see what I did there?).

Roel then shows how to add tab navigation across the footer of your page - useful for certain applications but it could be considered dead real estate.
Shortly after he does detail how to move away from the typical HTML style buttons to iconic buttons in your header that you’d expect from a mobile application.

The coolest part of this chapter is a slide menu just like the one you see in Facebook mobile. He really puts list templates to work - one of my favourite APEX constructs.

Highlights - iconic menu with notification counters; sliding menu

Theming Your Mobile Application

This is a small but useful chapter describing how to turn your application from a royal blue to something more suitable to your client’s needs.

It’s also a chapter where I’ll claim a little credit for improvement. Changing swatches within templates can be tedious, so I suggested the author provide instructions to parameterise the templates with some form of substitution string - thereby making it easier to switch between swatches.

It finishes with a short piece on managing icons between devices using CSS media queries.

Highlights - media query example

Working with Dynamic Actions

Let’s face it, dynamic actions are one of the top 3 features of APEX. This is why I'm a little torn with the approach of this chapter - the first half is a simple breakdown of how dynamic actions work and how to use them, something that seemed a little below the target audience and previously presumed skill level of the reader (my perspective). I do, however, feel they’re vital to good applications and I'm glad there is another chance to show the community how they work.

The second half shows how dynamic actions have been modified for APEX 4.2, and introduces the new declarative events such as orientation change, scrolling, tapping & touching & swipes.
The author provides a few mobile specific examples of dynamic actions, then details some advanced topics such as non-standard selection types, event scope & custom events - all of which are also useful in desktop environments.

Given the style of the book so far, I was a little disappointed with this chapter - I think it had more potential than was delivered, with respect to whoever wrote this chapter.

Highlights - advanced dynamic action techniques.

Deploying Applications Natively

If you want to interact with the hardware of your device using a toolkit such as PhoneGap, you should buy this book for this chapter alone.
HTML5 is still catching up with hardware capability, and the various browsers are even further behind - so these types of interfaces allow you to embed your APEX application in a lower layer within a mobile device.

The chapter starts with a good philosophical discussion on native vs web vs hybrid applications, then describes the PhoneGap architecture.
From there it’s a step-by-step guide on configuring an Android Development environment for Cordova. iPhone users - there is also a section on cross-platform support.
It then shows how to use the PhoneGap APIs in your APEX pages using the device’s camera as an example.

Unfortunately I didn't have the time to implement an application natively during the technical review, partially because I had some laptop issues myself when this chapter was ready. The chapter is very detailed, however, and it will be front row & centre very shortly for when I do.

Highlights - all of it - I believe you can thank Christian for this one

Securing your Mobile Application

I wouldn’t consider myself an expert in security, but I have a high level of interest - a presentation I wrote on the topic won me best paper in 2011. So I was looking forward to reading the implications for mobile.

It’s a fairly concise chapter, covering SSL, idle sessions, encryption & session state protection. I think the best pages discuss application & schema splitting, getting the reader to think about these implications, but doesn’t go into a large amount of detail.

Highlights - timeout messaging techniques

Conclusion

I think the book is excellent. It covers all the topics you think you’ll need for mobile development, and packs a whole bunch more.

I will say it started strong, but tapered off towards the end - but I think that may be due to the fact books are difficult to manage, author & produce while still maintaining some sort of life. Kudos to the authors involved.

It’s a little biased towards iPhones - evident because I own an Android, but there isn't much content that requires such a device. Of course, this is the nature of the real world, and considerations need to be made when developing applications for mobile devices - what is your target market?

You will also need patience. It’s bleeding edge material that sometimes requires supplementary files or Oracle database adjustments. If you’re still learning the power of jQuery & CSS (aren't we all?) then there may be times your code isn't quite right and it might take some time to work out, but it’s part of the learning process - it just demonstrates how valuable this book is.

Well done gang.

If you're interested in more of my reviews, check this out.

APEX Easter fun

$
0
0
This isn't really an easter egg, just more of a mild bug that makes you think - hopefully a little more about your own applications.

If you type in "0" in the page navigation bar, it takes you to the typical global page / page zero for desktop.
Instead of displaying page processing and shared components, it displays application level components - items, process, computations; and an "About" region in the third column, above recently edited pages. Useful stuff...

If you type "-0", it renders page zero detail as if it were a normal page.

If you type "-1", or any other negative number,
- in 4.2.1 it takes you into a horrible "no data found" that's annoying to recover from, similar to if you type a positive page number that doesn't exist
- in 4.2.2 it handles it a little more elegantly, a little better than it did pre 4.2 - displaying no page detail.

Harmless "fun".

Analytic functions within Pivot statements

$
0
0
Today I found that SQL analytics go hand in hand with PIVOT statements.

I had percentage data pivoted by a certain column, but I needed to sort it by
the total across each row.

For the purpose of this demo I create a table with some random monthly data
create table my_data as 
select /*+ no_merge */ username, round(dbms_random.value(1,12)) mth, round(dbms_random.value(1,100),0) val
from my_users connect by level < 4;
Now with the following query I transpose the monthly totals across as columns using the PIVOT.
select * from (
select sum(val) av, username, mth
,sum(sum(val)) over (partition by username order by null) tot
from my_data
group by username, mth
)
pivot
(avg(av) -- avg() because I didn't need to modify the value any further
-- I'm open to other suggestions
for mth in
(1 as jan
,2 as feb
,3 as mar
,4 as apr
,5 as may
,6 as jun
,7 as jul
,8 as aug
,9 as sep
,10 as oct
,11 as nov
,12 as dec
)
)
order by tot desc
Note the highlighted line - an analytical statement that sums yearly total for each username. This was the simplest way I could determine
a) a way to determine that total
b) order the report by the user with the highest totals

I haven't used PIVOT queries too often yet, but I can see how analytical functions will be vital to providing, er, pivotal information.

INSYNC13 National Conference series

$
0
0


In 2013 the Insync Conference Series has expanded to include six capital cities within Australia, thereby bringing Insync to multiple east coast locations and incoporating the Oracle with 20:20 Foresight Perth leg.

The website has been updated, and the call for papers is coming to a close this Friday 24th May.

2013 Conferences


We've already received a range of abstracts, but I would love to see more submitted before the end of the week - including mine!

Keeping with tradition, the Perth conference is a couple months after the rest (after Oracle Open World), so we might be a little more lenient with late submissions.

We encourage abstracts for any of these fields, and this year we hope to bring even more workshops to the programme.

  • DBA: Application | Development | Production
  • Dev: PL/SQL | Forms & Reporting | Apex | ADF
  • E-Business Suite/Fusion Apps: Financials | OBIEE | Hyperion | Primavera
  • Middleware: Content | WL Server | BPM | BPEL | SOA
  • Other Oracle Products that you believe are a current 'HOT TOPIC'.

If you've never visited Australia before, I recommend you take the opportunity to attend and/or speak at least one of these events. I would personally hope to see some first time international guests from the APEX space (hint hint!)

Use the #INSYNC13 or #AUSOUG tags to keep up with details on Twitter.

Scott Wesley
2013 Program Chair (Perth)





Performance of APEX conditions

$
0
0
I often think about performance of conditional expressions. I'm not just talking about the expense of whatever the test is, but the difference between the condition types used.

I’ve heard about it from a few sources, and Tony Andrews blogged about it recently, but never really been able to/had a chance quantify it. Roel Hartman has also blogged about this after reading my tweet. He shows some figures, but difficult to rinse, repeat & measure like a PL/SQL process.

For example, while I’ve always encouraged this type of expression for consistency (which runs dynamically), particularly with new developers learning the differences between item substitution syntax.

This performs better (declaratively):

I don't see this second debug statement when using the declartive method.
The benefit is minor, but if multiplied by 50 separate events, that’s 1.5 seconds extra in rendering time.

I welcome further discussion at this forum post.

Oracle APEX Techniques - Video Course

$
0
0
Little pig, little pig...I'm happy to finally announce a project this little green pig was assisting me with last year - a video series on Oracle Application Express techniques, published thanks to Packt Publishing.
http://www.packtpub.com/content/oracle-apex-techniques/video

The course targets new to intermediate APEX developers who have a general understanding of SQL and PL/SQL, and is based on APEX 4.2.

The course is 8 sections of 5 videos, each about 3-4 minutes each. The videos are screencasts from my laptop, with my voice describing what's happening on screen - very similar to a webinar.

Check out this sample clip looking at Interactive Reports detail view.

After having read a number of technical books and heard from other authors regarding the work involved, I can certainly say it was an interesting project to be involved with. I would love to include many other techniques I've acquired over the past six months in addition to the wealth of information that's out there - but we only had a limited number of minutes available - they sure add up quickly!

So if you're starting to learn Oracle Application Express; or you've been using it for a while and you're wondering if you've missed anything useful - you might like to consider this video series. I hope you find it valuable.

Oracle APEX Techniques
Oracle APEX Techniques
Cheers,

Scott

Ubuntu Milestones - Oracle

$
0
0
For many, many years I've yearned to move away from windows. Everyone has their reasons, some have motivation, I finally had opportunity to make some baby steps.

I needed to set up an environment using APEX 3.2, and I had an old XP laptop that I finally moved my ipod synch off so I figured it was free to experiment with. I was already running it with dual boot, but I never pulled my finger out to restart & play around with the Ubuntu half.

Earlier in the year I experimented a little with Ubuntu using VirtualBox on my existing Windows7 laptop - I've even drafted a blog post rambling about my experience, but I've got some fresh thoughts with my recent jump in the deep end.

First impressions - it's an OS worth me pursuing.

It's certainly a cultural change. Of course, you need to be able to do many of the same type of operations - move files, close windows, setup Oracle... but to use a balinese catch phrase - it's same same, but different.

Installing Oracle

I was a little bit of a cowboy with this - while I was keeping note of the websites that I was using as a reference, I didn't take note of each command I performed. This was going to be a temporary db, and I figured this first attempt justified a little gun-ho action.

Besides, my ultimate plan is to use Virtualbox to run different environments in their own confined buckets. This old laptop is destined to be a sandpit.

I used this Linoob address to help install the db. In the end I'm pretty sure the apt-get just opened up the software centre.
Oracle in Ubuntu Software Centre
I think it's a selling point for this particular distribution of *nix based systems, installing software is just like searching Google Play or the Apple Store - they aren't the scary domain of sysadmins anymore.

Setting up SQL Developer was a little more tricky since there is no download available specifically for Ubuntu. Instead, there is a package builder for .deb packages, so I still just needed to download the base file, run a few commands and it could be installed no problem.

Installing a JDK to support SQL Developer was a little more interesting. I used the manual option, which again is just a list of commands. I'm positive I haven't put the JDK folder in a 'typical' location, but that's the burn of learning.

Having to run commands like this in a way reminds me of the days of DOS, which you could take as no really progressing from the Windows environment of just clicking "Next" - but I don't see this as a con. I see it as liberation, a way to gain flexibility. Some of the commands seem foreign now, but I don't think it's far away from recognisable, then second nature.

All that being said, you could look at setting up SQL Developer in Ubuntu on par with setting it up in Windows. In the latter, I still need do download a set of files, extract, and on first run point it to the java.exe that I always need a few attempts with getting the path just right. In Ubuntu, I surprisingly got this path first go!

The only oops I did was download the latest and greatest JDK (7), which SQL Developer is not ready to support, though it ran anyway. I'll fix that later...

The closest I got to the OS was when I had to add my user account to the DBA group. I needed to do this before the database fired up. After an initial scare of making it all this way and not being sure why it wouldn't start - I found a pretty clear instruction on the OTN forum.

With all this gun slinging, I forgot to configure the DB.
/etc/init.d/oracle-xe configure

Configuring APEX

From here it was familiar territory in upgrading APEX from v2 to my target of v3.2.1

These commands I could run from SQL Developer
Upgrade
@apexins SYSAUX SYSAUX TEMP /i/

Load images to EPG (I wasn't game to attempt APEX Listener just yet)
@apxldimg.sql /home/scott

Unlock the public user account (I was doing this mostly from memory, after setting up APEX so often, I even remembered this one after my attempt to log in just stalled in the browser)
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;

The only script that didn't want to run from SQL Developer was the one to change the ADMIN password (apxchpwd.sql)
Instead, I just pasted the code in the SQL worksheet and ran it from there.

Restarting the OS

After restarting, the database didn't restart (an option I chose), but the scripts in the menu did not work. Again, I think this just came down to me lacking understanding of some permission issues, and I found a command that worked for me.
sudo /etc/init.d/oracle-xe restart

Conclusion

I got up and running in a few distracted hours. While there was a few hurdles, there was never anything that really concerned me or had me stuck for too long. Google was my dear friend, but I'll keep perusing my Beginning Ubuntu Linux book.

Next I'll be looking for alternatives to some programs I regularly use in Windows.

Highlight cell background in APEX report

$
0
0
It seems a very common question in APEX is how do you highlight the background of cells within reports?

There is a heap of information out there, and some of it is becoming dated so I thought I'd offer what seems to be an elegant solution - particularly when you're not targeting a specific column.

We can thank Tyler Muth for an APEX 3.x compatible solution that highlights the text within the column. He described how to use the HTML Expression column attribute - I still use this frequently today.

There are a few solutions that use report templates, but they can be a little fiddly and I don't find them as flexible.

Jari Laine brings us into the APEX 4.x world using jQuery within a dynamic action.

Then I found this stackoverflow post by Tom Petrus (who has also assisted me with jQuery on the OTN forums), which I thought I could adapt for my purposes.

Since I wanted to highlight cells with certain values regardless of column/row, I defined a classic report with a static ID of 'pivot' with the PIVOT sql found in this post.

I added this to the "Execute when Page Loads" page attribute - it could utilised within a dynamic action, if required.
$("#report_pivot tbody tr td").each(function(){
if ($(this).attr('headers') != 'TOT') {
if (parseInt($(this).text()) < 1000)
$(this).css({"background-color":"SandyBrown"});
else if(parseInt($(this).text()) > 2000)
$(this).css({"background-color":"lightgreen"});
}
});
I wanted to ignore the 'Total' column, so I found the first IF statement satisfies that easier than a CSS exclusion clause.
This block could be adapted to do all sorts of things - for instance, I've cleared out the cells in other reports where the value equals 100.

I also added this as inline CSS just to border all the report cells.
table.uReportStandard>tbody>tr>td {
border: 1px solid #ddd;
}
Here is a screenshot of the final output.
Classic Report with cell highlighting
You can find an example of this report here.

Review: 2013 OTN Forums upgrade

$
0
0
While there is a post discussing the ins/outs of the ugraded forum site, I thought I'd add a summary of what I've found here.

First impressions

Too much dead space (a bugbear of mine), but some key improvements should outweigh what can be fixed or adjusted.
I'm sure I'll get used to the new navigation & layout, but there does seem like some ambiguous double ups exist, eg: Content tab

Note: forums are now 'spaces', and threads are 'discussions'.

With my APEX hat on, it took me a while to find the 'Application Express' space from the home page - it's under 'Database', not 'Development tools' - which I probably would have known if I didn't always bookmark my forums - thankfully those still work, even though you can't open old URLs that include the forumID.
Turns out there is a search region hidden at the bottom of the page.

As for existing notification e-mails, Thread links from emails will not work - Message links are ok, even though the new id doesn't seem to match up to old one:
https://forums.oracle.com/forums/thread.jspa?forumID=137&threadID=2546249
https://forums.oracle.com/message/11060390

Basically you can open up old URLs without the forumID - which thankfully means google search results are re-routed

The biggest gripe

This seems to be the list of forum posts is what I might call the IR Detail style, meaning you only see a handful of discussions per page scroll, rather than dozens. I wish there was an option to toggle between views styles.
I thought by maybe 'Following' the Application Express space might make these posts appear in my Content->Following option, but alas - I'm yet to discover what this does or if it works.

As I tidy this post from some initial notes, it seems that the Overview tab for the space is too verbose, while the Content tab shows a view more to my liking - except the first half of the screen is wasted on chaff.

The search appears to be more effective - but I always used to search using Google anyway.

New discussion

Start of a new discussion shows how great the new editor is, various ways to make your postings pretty.
New discussion
The SQL syntax highlight is not fixed width font, which for me negates a true advantage of syntax highlighting.
Will be annoying to use that menu to set syntax, I hope there will be a shortcut like {code}. I saw /pre mentioned somewhere at one point, some people have been asking for a brief manual which I'm sure will be forthcoming with updated FAQ that is easy for newcombers to locate.
Ability to add tables to posts wil probably be nifty, too.

Marking responses

I don't have any responses to give helpful/correct answers, but that functionality appears to have been consolidated and should be a lot easier to interpret, more intuitive and should encourage newer users of forum to indicate what's going on.

At the moment thought it seems you can reward yourself with correct answers. This may help some complaints of missing/extra points, which will be looked at. At the moment it seems missing points due to old threads that were always marked for deletion. My theory for extra points are for unrewarded single responses to answered questions. I think I'm about 150-200 points up, and this seems like a fair guess.

Layout of discussions are nicer, softened, contemporary. The syntax highlighting is great!
Reply a lot better, just some fanciness that opens a text area on the bottom of the page, making it a lot easier to reference older information
Old layout
New layout
I haven't been active enough yet to see how it really handles, or what's going on with the new notification e-mails, but there is chatter about it on the upgrade discussion.

Account settings

Existing bio information is mostly gone, just your name and status level, with a nearby legend. You are supposed to be able to add it back in Edit Profile (drop down near your name), but I haven't yet been able to save this.

There is a message on the home page regarding known issues, and you can find your old posts under Browse->Content->Participated

Posts related to you
Activity isn't too dissimilar from the IR detail style report for the Space overview, but I found the Content tab a lot more useful, listing 'Authored','Participated','Following' as different options
I think this shows the value of simple, row by row reports - though it has an option to change to a view that merges 'iconic' with discussion text and quicklinks.

Avatar can be changed in the Activity tab for your account, but only to list of icons (for now). Other Preferences changed here also.

Friends is obviously reminding everyone of Facebook, but you might also read it as 'Interesting people' that you might tag to keep an eye on their comments.
Having Friends also allows you to use the @ sign to make them aware of posts.

The Tasks tab option is currently disabled, although you will get emails regarding action items (when you get friends) that take you to the main 'Task List'. More ambiguity.

Speaking of ambiguity - the content is different depending on if you come from main Browse tab; account detail or the Space you're in - for instance I can see 'Jive Genius' option via the Browse tab..

Conclusion

I think it has been worth the wait, and we always expected some people to be happy/unhappy - so give Sonya & the team some kudos for some very hard work and be patient while the wrinkles are ironed out.

Scott

Google Web Designer - a HTML5 development tool

$
0
0
So, in the coming months Google will be launching a HTML5 web development tool targeted at creative agencies and designers.

My geeky mind thought about that, remembered geocities and thought - boy we've come a long way.

My APEX mind read that and thought - I wonder how many similarities this may have with a tool like Oracle Application Express, and I wonder what we might be able to learn from it?

I wonder what sort of databases could be attached to it, or maybe a good API into further enhanced HTML5 storage capabilities will make other databases superfluous in this instance?

There are a number of tools out there today that probably do whatever Google is going to do, but with Google's brand and inertia, we might just give the crazies an even more effective tool for duping the masses.

I'm also interested what it might mean for bloggers...?

Thursday thought: How can you read that?

$
0
0
Every website that has some form of feed needs this option:

Thanks Google+
This sort of responsive web layout isn't always cool, IMHO - it's like watching a tennis match.

Sage Computing Services now on Google+

$
0
0
I've recently created a Google+ page for Sage Computing Services, the wonderful company I work for that has just celebrated 20 years of consulting & training in Perth.


We aim to use this social media presence to announce public training events, community involvement, and anything else we find relevant. No doubt it's usefulness will expand over time.

Check us out!

Oracle 12c now up for grabs

$
0
0
For many geeks out there, throw todays productivity out the window - Oracle 12c is now available for Linux/Solaris.

I'm not sure the official press release is out, the documentation sure isn't - but Twitter sure is abuzz.

While searching, I also spotted an article saying the pluggable database component will be a costed option.

Let's see how long it takes Tim Hall to release a string of articles on new features.

Here I was betting on a July release... at least all our Insync13 onference submissions for 12c can be ratified!

12 new 12c features for developers

$
0
0
I haven't installed 12c yet because
a) I haven't had the time
b) my Linux skills aren't the best

What I have done though is read through some of the documentation in the New Features manual.

The APEX features are just regurgitating what's in 4.2, since that's what's shipped out of the box with 12c - but I always like to look through what's improved with SQL and PL/SQL.

No doubt many of you may have seen or read presentations on what's coming up as early as last year, but for those who haven't - here are some I've spotted that made the cut for 12c and I look foward to tinkering with
  1. PL/SQL function in the WITH clause. I think this may sometimes come in handy, and other times it will be abused and lead to some real ugly code. Performance will be interesting.
  2. Increased size limit for VARCHAR2 etc - no doubt people have been asking for this since at least 8i...
  3. dbms_utility.expand_sql_text - Recursively replace any view references with relevant tables. This would have been brilliant in a project I often visit where there are views upon views upon views.
  4. utl_call_stack - returns structured information about an exception stack. Tom Kyte has already blogged about this one, I'd suggest he's been pushing for something like this for a while.
  5. Sequences can be used as column DEFAULT. Yes. So very yes. Though again I will be interested in performance, since 11g's :new.id := my_seq.nextval was the same as selecting from dual.
  6. Default value on explicit null insertion - for those times where you really must have a default value in the column!
  7. Identity columns - full examples are scant, but looks interesting.
  8. row_limiting_clause - for top-N reporting, apparently an ANSI standard. This definitely needs exploring.
  9. Row pattern matching. Um, wow. Big data influences?
  10. Cross apply; Lateral clauses. From what I think is going on here, this could be mighty handy.
  11. SYS_CONTEXT sys_session_roles - role interrogation for current session - cool, and will be very handy. A little late for many Forms applications, though.
  12. TRUNCATE TABLE CASCADE - where is that sledgehammer?
I listened to an Oracle Magazine podcast recently talking about MySQL - I wonder if the collaboration going on here has influenced 12c features, because it sounds like the quality of MySQL is enhanced with Oracle IP.

Of course, if you're in Australia or would like to visit, the Insync13 national conference series already has a bunch of 12c presentations that span JDeveloper, Optimizer, Coherence, Weblogic and general features.

APEX rendering issues in IE10

$
0
0
I'm sure anyone who's tried to write an APEX application that works across the "big 3" browsers - Chrome, Firefox & IE will be familiar with the pain of rendering differences.

Especially when it comes to version differences across Internet Explorer.

Thanks to Trent in the OTN forum, I have this nifty tip if you find some rendering issues in IE10 using APEX that aren't present in 'normal' pages.

Ensure your page template has the meta http-equiv illustrated here
<!--[if (gt IE 9)|!(IE)]>  <!--> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--<![endif]-->
Instead of
<!--[if (gt IE 9)|!(IE)]><!-->  <!--<![endif]-->
I found this improved rendering of (amongst now doubt other issues)
  • sliders rendered properly;
  • login form fields had expected width;
  • and the list template "Featured List with Subtext" rendered consistently.
Scott

SAGE seminars at Insync13

$
0
0
It's officially less than a month before the 2013 Insync national conference series kicks off in Sydney.

The SAGE Computing Services team has a heavy presence this year. You can find Penny & myself scattered amongst all Australian states, with Kylie & Ray boosting the Perth schedule. Check out the Insync website for schedule updates.

Penny
Case Study: Redesigning core on-line systems in ADF JDeveloper
New Optimizer Features in Oracle 12c
Redeveloping a legacy application in JDeveloper ADF - a half day workshop

Scott
APEX in your hands: Lessons learnt from a tablet project
Reasons why you should upgrade your APEX environment

Ray
"Elementary my Dear Weblogic" - the Case of Spying on ADF

Kylie
Oracle ADF for Newbies: Surviving your first project

We'll be posting further information about the workshops on the Sage website, but remember - you'll need to at least bring your laptop.

Keep an eye out for Eddie, too - he's working on something regaring ADF Essentials.

Scott






12c for Windows

Viewing all 405 articles
Browse latest View live