40
Building A User- Definable, Flexible UI with Oracle Application Express (ApEx) By Bradley D. Brown, InteliVideo

Building a Flexible UI with Oracle ApEx

Embed Size (px)

DESCRIPTION

How to build a very flexible user interface using Oracle Application Express.

Citation preview

Page 1: Building a Flexible UI with Oracle ApEx

Building A User-Definable, Flexible UI with Oracle Application Express (ApEx)

By Bradley D. Brown, InteliVideo

Page 2: Building a Flexible UI with Oracle ApEx

Who am I?

• Bradley D. Brown

http://bradleydbrown.blogspot.com

• Founder

• TUSC in 1988

• Sold to Rolta in 2008

• IntelliReal in 2005

• Sold to Equifax in 2011

• 10+ other companies, boards

• Professor – DU

• Advisor for Founders Institute

• Author – 6 technical books

• Today

• InteliVideo in April 2012

• Video Monetization Platform

• Built it to sell training online

• Focused on mid and long tail and corporate deals

• ApEx provides a “quick turns” approach to our offering

• Founders Institute

Page 3: Building a Flexible UI with Oracle ApEx

My Interests

• Making a difference

• Helping people – teaching, advising, …

• Building companies

• Using my talents with technology

• The outdoors

Page 4: Building a Flexible UI with Oracle ApEx

• User Definable

• Flexible UI

• Project / POC Goals

• Application Specifics

• Application Design

• Database Specifics

• ERD

• Tables

• Functions

• Materialized views

Agenda

Page 5: Building a Flexible UI with Oracle ApEx

User Definable

• Data Driven

• Drive code based on data rather than hard coded

• Examples

• ES valuation model at IntelliReal

• Partners “turning off” partners on InteliVideo site

• Flexible Database

• Do you need the ability to add “columns” without “adding columns?”

• Trade-offs

• Performance

• “Readability” of code

• Too many choices

• Advantages

• Quick Turns

• Testing 100s of models, variable changes, etc. can all be done programmatically (perfect value)

Page 6: Building a Flexible UI with Oracle ApEx

Flexible UI

• Data Driven

• What page to start at (after login)

• What partners to show

• Colors to display

• Easy with Apex

• Authorization rules

• Display rules at all levels

• My bottom line

• If I’m doing the original coding or I’m going to make a change to my code and there is an assumption (i.e. a hard coded number that I might put into my code), I stop and think

• Should I add a column to a table and should I change the code so it points at the column?

• What level? Per user? Per customer?

Page 7: Building a Flexible UI with Oracle ApEx

• Dave read the book

• Called the author – Fipp (John Avalon)

• Met with him and discussed the concepts

• We met with numerous political campaign target market experts

• I developed the software, secured data,…

• We did demos to politicians, target market people, etc.

• EC2 platform

Independent Nation – POC Goals

Page 8: Building a Flexible UI with Oracle ApEx

• Politicians want to share their views with targeted groups of people who are voting

• Key target groups (lobstermen, working moms, first time home owners)

• Identify and find those people

• Invite them to custom events (per group)

• Drive custom messages (reduced taxes for lobster, better day care options, incentives for buying your first home) – email, text, phone

• Visit the networkers

Political Premise

Page 9: Building a Flexible UI with Oracle ApEx

• Provide intelligence to political campaigns

• Build a GUI and GIS application (with ApEx)

• Application for Independent Nation, but wanted something we could use for any customer with Google map needs

• Application that is dynamic and flexible

• Design and develop application that allows customization by changing data, not code.

• Data about people, their properties or addresses they live at, and other information about them – yet, stay open for others

Project / POC Goals

Page 10: Building a Flexible UI with Oracle ApEx

• Independent Nation is a company that specializes in provide intelligence about voters to political campaigns

• Data sourcing - merged voter registration, voter contribution and numerous other data sources as the starting data set

• Goal was to provide a flexible database design that will allow for SIMPLE attribute additions without new coding. New data feeds won’t require DB changes.

Application Specifics

Page 11: Building a Flexible UI with Oracle ApEx

• Developed for Independent Nation

• Every user

• Starts in a different part of the world

• Has their own color scheme and search criteria

• Uses Google Maps

• Could integrate other mapping solutions in

• Database

• Generic driving table with attributes

• Not many tables (i.e. simple design)

Application Design

12

Page 12: Building a Flexible UI with Oracle ApEx

• Contributors by party contributed to…

Political contributors in NJ

13

Page 13: Building a Flexible UI with Oracle ApEx

Other Visual SearchesAge – Education, Income

14

Page 14: Building a Flexible UI with Oracle ApEx

• Application Data

• Attribute

• Category

• People

• People Attribute

• Property

• People Property

Key Tables

• User Driven Data

• User

• User Attribute

• User Attribute Color

• User Option

• User Option User

Page 15: Building a Flexible UI with Oracle ApEx

ERD

Page 16: Building a Flexible UI with Oracle ApEx

• Attributes (fields)

• Short Description

• Long Description

• Category

Attribute Table

• Parent Attribute

• Text 1,2

• Data 1,2

• Number 1,2

Page 17: Building a Flexible UI with Oracle ApEx

• Categories of Windows/Tabs

• Category ID

• Short Description

• Full Description

• Parent Category

Category Table

• Add a new category, assign it to attribute(s) and it shows up for all of the people…

Page 18: Building a Flexible UI with Oracle ApEx

• People

• ID

• First, Last Name

• Voter ID

• Property ID

• People Attribute

• People ID

• Attribute ID

• Start and End Date

• Source, Integrity

• Text, Number, Date Values

People

Page 19: Building a Flexible UI with Oracle ApEx

• Property

• ID

• Address

• Phone, Cell

• Valuation

• Lat and Long

• People Property

• People ID

• Property ID

• Start and End Date

Properties and People

Page 20: Building a Flexible UI with Oracle ApEx

• User Attribute Color

• Colorization

• Limiting data

• User Option

• Saved Filters

• Descriptions, Include, Exclude

• Starting map location

• User Option User

• Users who share a filter

• Default filter

User Specific Data

Page 21: Building a Flexible UI with Oracle ApEx

• Get_Desc

• Gets the description for a specific attribute for a specific user

• Get_Option

• Gets the default filter for a user

Functions

• Get_People

• Brains for everything here

• Pipeline (or table-based) function

• Finds the people that live within the lat/long range on the map, matching the filters

Page 22: Building a Flexible UI with Oracle ApEx

• Add the category

• Change attributes to be in the category

• Refresh the Materialized View

• Test it out in the UI

Let’s Add a New Category

Page 23: Building a Flexible UI with Oracle ApEx

• Education of Too Youngs…

• Color by education level

• Include <18 year olds

• Exclude other age categories

• Save it

Let’s Create a New Filter

Page 24: Building a Flexible UI with Oracle ApEx

• Uses the same service as the map

• Shows the details

• Can be exported

List of People Matching

Page 25: Building a Flexible UI with Oracle ApEx

• Person’s name

• Municipality

• Address

• District

Search

Page 26: Building a Flexible UI with Oracle ApEx

• Clicking View shows them on the map

Finds People

Page 27: Building a Flexible UI with Oracle ApEx

• Created materialized view

• PEOPLE_MV

• Indexed search columns

• Turned on query re-write• ALTER SESSION SET

query_rewrite_enabled=TRUE;

• Or…I could have just changed queries (people_mv)

Performance

• Faster Spatial Options• Change from

lat/long to spatial column

• sdo_geometry

• Change query to use sdo functions

Page 28: Building a Flexible UI with Oracle ApEx

• AJAX

• var url = "f?p=&APP_ID.:6:' || v('app_session') || '::::P6_SW_LAT,P6_SW_LONG,P6_NE_LAT,P6_NE_LONG,P6_ZOOM,P6_MAPTYPE:" + sw.lat() + "," + sw.lng() + "," + ne.lat() + "," + ne.lng() + "," + zm + "," + mt;

• See Page 6 in my application

• XML Report

• Cast function as if it’s a table

How the Maps Works

• select * from table(cast(get_people(:P6_SW_LAT, :P6_NE_LAT, :P6_SW_LONG, :P6_NE_LONG, :P1_COLOR_ATTRIBUTE_ID, independent_authentication.get_user_id(:APP_USER),:P1_INCLUDE_LIST, :P1_REMOVE_LIST, :P1_SHOW_UNCOLORED, :P1_PEOPLE_ID, nvl(:P1_ROWS,1000)) as people_Table))

Page 29: Building a Flexible UI with Oracle ApEx

• Could use a Cloud provider

• Yahoo Pipes

• Google App Engine

• We put this in a hosted environment

• Amazon EC2

• MaxApex

Other Options

• Yahoo Pipes requires data in XML format

• Can come from ApEx too

• iPerspective

Page 30: Building a Flexible UI with Oracle ApEx

• Politicians don’t decide much of anything

• Their interns and experts do

• They don’t want to pay for anything

• They do know what groups they want to get to

• They cannot craft a message to them – for fear one person will get the wrong message and spread it

• They want to deliver generic messages

• This killed Independent Nation in the end…

BTW – Political Reality

Page 31: Building a Flexible UI with Oracle ApEx

• Heat Maps

• GeoSearch

• Highlight and Visual Search

• Test Scores within a Radius

• Get Creative!

Getting Started, then Other Mapping I’ve Done

Page 32: Building a Flexible UI with Oracle ApEx

• Easy integration Starts At:

• http://www.google.com/apis/maps/

• Simple Pushpins:

Google Map Integration

Page 33: Building a Flexible UI with Oracle ApEx

• A look at different neighborhood trends in home values

Heat Maps

Page 34: Building a Flexible UI with Oracle ApEx

• Grouping of properties

• Colorized and customizable

GeoSearch

Page 35: Building a Flexible UI with Oracle ApEx

• Highlight it

• Build your search, see it

Highlight and Visual Search

Page 36: Building a Flexible UI with Oracle ApEx

• Visual results

Test Scores within a radius

Page 37: Building a Flexible UI with Oracle ApEx

• Flexible Database and UI – can overdue it

• Project / POC Goals – sales engine

• Application Specifics – functional

• Application Design - flexible reuse

• Demo for Customers – cool UI

• Database Specifics – data driven app

Summary – Building a Flexible UI

Page 38: Building a Flexible UI with Oracle ApEx

Questions?

Page 39: Building a Flexible UI with Oracle ApEx

• Java-based Oracle Web Development

• Java Server Pages

• JavaMail

• Java for the PL/SQL Developer

• Web Cache – achieving 150 the performance

• 9iAS Installation, Configuration, and Tuning

• Wireless

Brad’s Papers and Presentations

• Practical Portal Practices

• Implementing JSP in Portal

• UltraSearch

• Search Engines

• Utl_smtp and Utl_http

• iFS

• JavaScript

• Top DBA scripts for Web Developers

• Security

Page 40: Building a Flexible UI with Oracle ApEx

• Neither InteliVideo, Rolta TUSC nor the author guarantee this document to be error-free. Please provide comments/questions to [email protected].

• InteliVideo, Rolta TUSC © 2012. This document cannot be reproduced without expressed written consent from an officer of Rolta or InteliVideo.

Copyright Information