Friday 19 October 2012

Differences between Oracle APEX 4.1.1 and 4.2

                      Having used Oracle APEX since its first appearance on the Early Adopter Platform I finally got my hands on the real thing and installed in on my test-system.
This Post tries to give you a summary of the big changes in Oracle APEX 4.2 (compared to 4.1.1) from a datamodel/view/API Point of view.
If you are coming from APEX 4.0 (or older) read the Posts about the differences in Oracle APEX 4.1 and the Patchset 4.1.1 at first.

What I did to find all those changes is mainly doing a DIFF (using Mac’s FileMerge Tool) of the apex_views.sql File which is located in the /core folder of the APEX Zip-File. I found this method the easiest one to get a good overview, because when you see what changed in the public APEX Views, you also can guess what changed in the Application Builder and in the API’s.
To get in deeper I also did a Schema-Compare of APEX_040100 and APEX_040200, but that gives you a mix of internal and public objects and they also use other names on their packages internally. e.g. the public APEX_UTIL Package is just a synonym on HTMLDB_UTIL . In the end this can get pretty confusing.
Here we go, a summary of more or less important findings. Please note that this isn’t a complete list, there is always more to find out :-)

General :-

  • All Scripts in the Installation Process give now more and better information when installing (prompt…), so if anything would go wrong you should have all the information you need to fix it or request support.
  • Security fixes like prefixing SYS-Objects with the Schema-Name (e.g. SYS.DUAL)
  • Many Views got a COMPONENT_SIGNATURE added, with a Help-Text that sounds very promising for future enhancements: Identifies attributes defined at a given component level to facilitate application comparisons

New Concepts:-

User Interfaces
  • Within a single Application you can have Desktop and Mobile Pages with individual Themes each
  • That means an Application can have multiple active Themes
  • Pages and Themes know which User-Interface-Type they belong to
  • In the future this can be enhanced with other UI-Types, e.g. Smart-TV
Grid Layout
  • With Grid Layouts you can achieve “Responsive Web Design” as demonstrated by Shakeeb at Open World
  • This gives you a better control over how to structure a Page Template
  • A famous Library of CSS Grids is Twitter Bootstrap
Display Points
  • a Display Point is a placeholder in a Template (ie. a Position where a Region is displayed)
  • the new thing here is that you can define a readable Name (e.g. Sidebar) for a Placeholder (e.g. REGION_POSITION_03) and define how this Display Point behaves in a Grid
  • this also replaces the former Region-Template-Flag “Render Form Items in Table” (introduced in APEX 4.1). If you migrate an Application which used that flag it will be a Region-Display-Point instead
  • that all sounds very vague right now, but I’m sure this will be enhanced to User-Defined Placeholders in the Future (next Version)
Debug
  • can now be fine-grained by setting LEVEL1 – LEVEL9 instead of just YES/NO in the URL
  • complete overhaul with a new Package (APEX_DEBUG instead of APEX_DEBUG_MESSAGE)
  • see below at API for more Info

Changed Views: -

  • APEX_WORKSPACES shows the Consumer Group (Resource Management) and if Restful-Services are allowed
  • APEX_WORKSPACE_USERS finally gives you first/last name and a flag showing if the Account is locked
  • new: APEX_WORKSPACE_UI_TYPES gives you the available Userinterface Types (Desktop or Mobile)
  • APEX_APPLICATIONS got many Interface changes, some columns have been changed and wont return values in special cases anymore (HOME_LINK, PAGE_TEMPLATE, ERROR_PAGE_TEMPLATE,…), others where added (NLS_SORT, NLS_COMP, CONTENT_DELIVERY_NETWORK,…) that all reflects the conceptual enhancements for Applications. ie having multiple UI-Types within an Application. And of course all the little improvements like DEEP_LINKING, HTML_ESCAPING_MODE…
  • new: APEX_APPL_USER_INTERFACE returns all those information that previously was in APEX_APPLICATIONS but isn’t unique within an App-Id anymore when you use multiple User-Interfaces (Desktop and Mobile) in one App: HOME_LINK, PAGE_TEMPLATE, ERROR_PAGE_TEMPLATE,…
  • APEX_APPLICATION_PAGES shows which UI-Type is used and renamed the former “Page Zero” to “Global Page”, because (UI-Types) you can have multiple Global Pages in an Application now (with any number you want). It also shows the new Page Attributes for JAVASCRIPT_FILE_URL, CSS_FILE_URLS, INLINE_CSS and – of course – the new Readonly-Section on Page Level (you can switch all fields on a Page to readonly)
  • APEX_APPLICATION_PAGE_ITEMS benefit from HTML5 Improvements (PLACEHOLDER) and the new Grid-Layout (NEW_GRID, NEW_GRID_ROW, …) which replaces the old BEGINS_ON_NEW_ROW (which is still there)
  • APEX_APPLICATION_PAGE_REGIONS also show the new Grid Settings (NEW_GRID, NEW_GRID_COLUMN, …). And Regions now can be shown Above or Below the Display Point chosen. Regions also now have Readonly Settings and support up to 25 Plugin-Attributes.
  • APEX_APPLICATION_PAGE_PROC now got rid of the Deprecated Process Points “Before/After Showing Page Items”
  • APEX_APPLICATION_PAGE_BRANCHES now support BRANCH_NAME, a convenient enhancement because up to now you couldn’t set a name for a branch. That should make organization of bigger Pages with many branches easier.
  • APEX_APPLICATION_PAGE_BUTTONS -> Grid Layout Support and CSS_CLASS, plus a new Condition Type “Button Readonly” so that you can hide a Button (alternative to disable) when the Region is Readonly
  • APEX_APPLICATION_PAGE_DA now shows a CONDITION_PAGE_ITEM and 2 new Attributes for Event binding (WHEN_EVENT_STATIC_CONTAINER and WHEN_EVENT_CUSTOM_NAME). That means easy use for Custom-Event-Names, not limited to the ones provided by jQuery (or some Plugin) anymore.
  • APEX_APPLICATION_PAGE_DA_ACTS shows AFFECTED_BUTTON and AFFECTED_BUTTON_ID and let you decide if the Action should wait until it is finished (WAIT_FOR_RESULT) before giving control to the next Action.
  • APEX_APPLICATION_ITEMS can now be global or local, identified by SCOPE.
  • APEX_APPLICATION_LISTS don’t return TEMPLATE anymore because Lists don’t have a default Template anymore. The Template used for showing the List is defined in the Region only.
  • APEX_APPLICATION_THEMES provides the UI-Type and some mobile enhancements: DEFAULT_HEADER/FOOTER_TEMPLATE, DEFAULT_PAGE/POPUP_TRANSITION. All the with 4.1 introduced (never used, though) attributes starting with MOBILE_ have been dropped again.
  • new: APEX_APPLICATION_THEME_STYLES identifies the CSS file URLs which should be used for a theme
  • new: APEX_APPL_THEME_DISPLAY_POINTS identify the available display points in page and region templates – for future use
  • APEX_APPLICATION_TEMP_PAGE has some new settings for Javascript and Css File-Urls, Inline Code and onload Code. There there is a bunch new Attributes for Grid Layouts and a flag to globally turn off/on Edit-Links. Column MOBILE has been dropped (was never used).
  • new: APEX_APPL_TEMP_PAGE_DP identify the available display points in a page template
  • APEX_APPLICATION_TEMP_REGION removed RENDER_FORM_ITEMS_IN_TABLE, added LAYOUT and some new DEFAULT_-Attributes (field, label, button, …)
  • new: APEX_APPL_TEMP_REGION_DP identify the available display points in a region template
  • APEX_APPLICATION_TEMP_REPORT added the column-heading-sort-Attributes to the View-Interface.
  • APEX_APPLICATION_TEMP_CALENDAR can now have AGENDA-Templates/-Formats
  • APEX_APPLICATION_TEMPLATES shows “Grid” as new TEMPLATE_TYPE
  • APEX_DICTIONARY reflects the changes to all Dictionary-Views
  • APEX_APPL_PLUGINS lets you decide which UI-Types a Plugin supports and if Plugin Settings are subscribed. All ATTRIBUTE_xx-Columns are marked as obsolete, as they are now available through APEX_APPL_PLUGIN_SETTINGS.
  • APEX_APPL_PLUGIN_ATTRIBUTES got a COLUMN_DATA_TYPES to determine which data-types are supported for Region SQL Statement Column.
  • new: APEX_APPL_PLUGIN_SETTINGS contains now the Attributes of Plugins (internal DM change, moved to own table)
  • APEX_APPLICATION_PAGE_FLASH5 now has a CHART_RENDERING column to decide between Flash and HTML5
  • APEX_APPLICATION_PAGE_FLASH5_S : the Chart-Series is conditional now and also supports Authorization Scheme and Build-Options
  • APEX_APPLICATION_PAGE_IR supports a From-Email-Address and customer-icon-views
  • APEX_APPLICATION_PAGE_IR_COL was enhanced by a HTML_EXPRESSION we already know (and love) from Classic Reports
  • APEX_APPLICATION_PAGE_IR_SUB now remembers the LANGUAGE and EMAIL_FROM
  • APEX_APPL_LOAD_TABLES got a VERSION_COLUMN_NAME and a COLUMN_NAMES_LOV_ID

Changed API’s

That is a list of all the public APIs.
APEX_APPLICATION
  • plenty global variables representing all the new Settings on Application Level (nls-sort, global-page, javascript-file-urls, user-interface, …)
  • c_max_size_vc2 is set to 32767 for DB Version 12c, below it is 4000
  • Procedures show got two new arguments: “j” and “XMLCallDate”
  • Procedure accept also got 100 new item arguments -> the max number Page Items was increased to 200
  • some new internal helper functions, not for public use
APEX_APPLICATION_INSTALL
  • new function PUBLISH_APPLICATION to create a translated version (!Mapping and seeded data must already exist!)
APEX_AUTHENTICATION
  • it finally found its way into the API Reference Documentation !
  • This API is meant for creating your own Authentication Plugins and provides some helpful Functions
new: APEX_DEBUG
  • replaces Package APEX_DEBUG_MESSAGE (which is still available as synonym, but everyone should change that to APEX_DEBUG)
  • all the old Procedures are still there, your code wont break. But you’ll get Messages saying that this function is deprecated
  • The new Interfaces as described in the API Reference Documentation now support different Log-Levels (from 1=Error to 9=Trace) and Placeholders in the Message-Text.
  • You should take a couple minutes and get used to the new possibilities, this is way more powerful now !
new: APEX_ESCAPE
  • new API bringing helper Functions for escaping Strings in various Situations
  • available for LDAP, JS, HTML
  • check the API Reference Documentation for more Info
APEX_ERROR
  • Package was splitted into a public and an internal one, so some functions you shouldn’t have used are now gone
  • new Function GET_INTERNAL_ERROR to get hold of APEX engine error messages
APEX_INSTANCE_ADMIN
  • Documentation got improved
  • new Procedure REMOVE_SUBSCRIPTION to remove a specific IR Subscription
new: APEX_IR
  • Finally a Package decicated to manage Interactive Reports via PL/SQL
  • Use this Package to get an interactive report runtime query, add filters, reset or clear report settings, delete saved reports and manage subscriptions
  • check the API Reference Documentation for more Info
APEX_JAVASCRIPT
  • Procedure ADD_LIBRARY has been enhanced
  • can now set Internet-Explorer Conditions
  • use Procedure ADD_3RD_PARTY_LIBRARY_FILE to add jQuery or jQuery-UI from Directory or CDN
APEX_LDAP
  • supports nested-members now
  • support for “uid=xxx” RDNs
APEX_PAGE
  • (yet) Undocumented, but public, API
  • Functions to get Infos about the current Page (IS_PAGE_READONLY, IS_DESKTOP_UI, IS_JQM_SMARTPHONE_UI, IS_JQM_TABLET_UI)
  • Procedure to Purge the Page Cache: PURGE_CACHE
APEX_PLUGIN
  • Region Plugins support up to 25 Attributes now -> Type t_region extended
APEX_PLUGIN_UTIL
  • new Function GET_ELEMENT_ATTRIBUTES used to get a consistent HTML-Input/Select/Textarea Element
  • additional Interface for PRINT_DISPLAY_ONLY which accepts the t_page_item record as input
  • new Function GET_DATA_TYPE to map p_sql_handler.column_list(x).col_type to one of the APEX_PLUGIN_UTIL Constants
  • new Function GET_COLUMN_NO that returns the index of the specified column alias in p_sql_handler.column_list
  • additional Interface for GET_DATA and GET_DATA2 which accepts a SEARCH_COLUMN_NAME (instead of the _NO), but watch out for parameters which aren’t defaulted anymore. You might need to update your Plugin Code.
  • GET_DISPLAY_DATA, GET_SQL_HANDLER and PREPARE_QUERY can now do auto-binding of a given bind-list
APEX_REGION
  • (yet) Undocumented, but public, API
  • Function IS_READONLY returns true/false
  • Use Procedure PURGE_CACHE to purge the cache for a certain region
APEX_UTIL
  • CREATE_USER can now set a default-date-format and set some privileges for that user (allow app building, sql workshop, websheet development, …)
  • IR_FILTER, IR_RESET and such have been deprecated, use the new Package APEX_IR instead
  • new function GET_BUILD_OPTION_STATUS
Javascript API
  • Most important change here is the slight movement of functions to Legacy status
  • Your Application has a switch where you can decide whether Legacy-JS should be supported or not
  • Depending on that switch the legacy.js is included
  • Check the API Reference Documentation for a list of the Deprecated JS Methods

No comments:

Post a Comment