The presentation desribes an approach of supporting Oracle Application Express development based on metadata. The presentation was hold at Kscope14 in seattle on 24.th of june 2014.
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
APEX QA Plugin: Rules-Based Checks for Application Quality
1. |
The APEX QA Plugin
Oliver Lemm
Competence Center Leader APEX
Seattle, 24.06.2014
2. |
MT AG
LEGAL STATUS OWNER MANAGED AG
CITY RATINGEN
FOUNDED IN 1994
EMPLOYEE 190 EMPLOYEE
SUB-COMPANIES MT-IFS GMBH (RATINGEN), MT-IFS SARL (LUXEMBURG)
business by integration
BUSINESS
INTELLIGENCE SOLUTIONS
SOCIAL BUSINESS
SOLUTIONS
MOBILE
SOLUTIONS
APPLICATION
DEVELOPMENT
INTEGRATION
SERVICES
IT SYSTEM
SERVICES
3. |
About me
Oliver Lemm, Competence Center Leader APEX
Born in 1980, married, two daughters
Studied Applience Science 2001-2006
Since 02/2007 employed at MT AG in Ratingen
Working with APEX since its inception back in 2007
Responsible for project-leading and archtitect for APEX projects
- https://apex.mt-ag.com & http://oliverlemm.blogspot.com
- Organizing APEX UserGroup Düsseldorf
You can find me here:
- Online: Xing, LinkedIn, Twitter, Google plus
- Offline: DOAG Conference, DOAG Development Conference, ODTUG
Kaleidoscope, Regional APEX UserGroup (Meetup)
Kscope 2014, Seattle3
4. ||
Agenda
ODTUG KScope 2014
1. The Requirements
2. The Concept
3. Region Plugin vs. Process Plugin
4. Live Demo
5. The Implementation
6. Conclusion & Perspective
4
8. |
The Concept
Every check
a rule
Categories
Objecttypes Message
Comment
Exclude
Activate /
deactivate Layer
Predecessor
ODTUG 20148
9. |
The Concept
Support new Developers
Show the problems in Realtime when developing
Support Developer & Tester
Get the complexity of the application
ODTUG Kscope 20149
13. |
Livedemo - Install the Plugin
1. Download @ Apex-plugin.com
2. Extract
3. Go to your application and Import the plugin
APEXregion_type_plugin_com_mtag_olemm_qa_region.sql
4. Install the Database Objects, using SQL Workshop
plugin_qa_install.sql
5. Import the Rules, using SQL Workshop
DMLplugin_qa_rules.sql
6. Go to Global Page and Region Region Plugin
ODTUG KScope 201413
18. |
The Rule Table – PLUGIN_QA_RULES
PIQA_ID Primary Key
PIQA_NAME Name of the Rule, Unique Key
PIQA_CATEGORY APEX, DDL or DATA
PIQA_OBJECT_TYPES ITEM:REGION:DA:BUTTON:..
PIQA_ERROR_MESSAGE Message which comes up when hitting the rule
PIQA_EXCLUDE_OBJECTS objects which should not be checked
PIQA_ERROR_LEVEL 1=Error, 2=Warning, 4=Information
PIQA_IS_ACTIVE 1=active / 0=deactivated
PIQA_SQL rule based on SQL with maxlength of 32767 char
PIQA_PREDECESSOR_IDS colon delimited ID‘s which has to throw no msg
PIQA_LAYER rule on PAGE or APPLICATION level
ODTUG Kscope 201418
19. |
Example Rule - LOV Extra Values ‚YES‘
piqa_name Display Extra Value is Yes
piqa_category APEX
piqa_object_types ITEM
piqa_error_message Display Extra Value is Yes
piqa_comment Identifiy LOV Items with Extra Values YES
piqa_exclude_objects null
piqa_error_level 2
piqa_is_active 1
piqa_sql <query>
piqa_predecessor_ids null
piqa_layer PAGE
ODTUG 201419
20. |
Example Rule – LOV Extra Values ‚YES‘ - Query
with param as (select :1 piqa_id, :2 app_id, :3 page_id from dual)
select t_plugin_qa_rule( piqa_id => piqa.piqa_id
,piqa_category => piqa.piqa_category
,piqa_error_level => piqa.piqa_error_level
,piqa_object_type => piqa.piqa_object_types
,piqa_error_message => piqa.piqa_error_message
,object_id => aapi.item_id
,object_name => aapi.item_name
,object_value => aapi.lov_display_extra
,object_updated_user => aapi.last_updated_by
,object_updated_date => aapi.last_updated_on
,apex_app_id => aapi.application_id
,apex_page_id => aapi.page_id
,apex_region_id => aapi.region_id)
from plugin_qa_rules piqa
join param p on p.piqa_id = piqa.piqa_id
join apex_application_page_items aapi on aapi.application_id = p.app_id and aapi.page_id = p.page_id
where aapi.display_as = 'Checkbox' and aapi.lov_display_extra = 'Yes'
ODTUG 201420
21. |
Other included rules for Example
Display Dynamic Actions
Help Labels without Help
Label Alignment left
Named LOV
No Never Condition
Page is Public
Page without ALIAS
Page without Pagegroup
ODTUG Kscope 201421
22. |
Using the Plugin
ODTUG Kscope 201422
• Region
Global
Page
• APEX_Application.g_edit_cookie_session_id IS
NOT NULLVisibility
• Mailing
• DBMS_SchedulerJob
reusable => don‘t implement twice, checks are often equal or equal to check
flexible => use it for checks againts database, apex or data
Easy to use => no need for complex configuration or big documentation, at the start
Easy to deploy => import functionality or import only rules
integrated => Something like a part of apex => as a developer useable and can access on whole database
Objekttypen => Item, Region, Dynamic Action, … Trigger, Table, ….
Every check a rule => define SQL Queries for every rule
Categories => APEX, Database, Data
Activate/Deactivate => Easy Option to active or deactivate a single rule
Message => Which Error Message should be written. Should Contain information about object
Comment => Explain what a rule does
Predecessor => Define Relationship between rules -> A rule should not be executed if the predecessor finds an error
Exclude => Exclude Objects based on their name
Layer => Rule is defined for whole application or for every page
Introduce new developers to guidelines without reading manuels
Show problems when executing the page
Ist usable for developers and also for testing users
Show the complexity by printing out dynamic actions or other components below your application
Implementation as Region or Process Plugin
Region => direct output, output as a table or htp.p, using global page possible
Process => further implementation can be done by developer
Code is merged together in one Package
Only Render/Process function differs
Process Plugin using APEX_COLLECTIONS
problems
LOV for plugins only static => need lov based on table / dynamic
No process plugin on global page possible => need plugin to run on every page
http://apex.mt-ag.com/pls/apex/f?p=185 - mt_apex_qa_demo / olemm
Call application without being logged into workspace
Show different pages
Edit links
Make changes => remove region
Apex.mt-ag.com demo/demo
MT_APEX_QA_PLUGIN_DEMO / olemm / langes pw
Page template region 5
Apex.mt-ag.com
MT_APEX_QA_PLUGIN_DEMO / olemm / langes pw
-> show region on global page
-> show attributes
-> show plugin information
Plugin is based on Type, Package & Ruletable
Configuration => Region Attr. => Region can be used with css or Report => apexir_WORKSHEET_DATA
=> Plugin Attri => Page_ID & APP_ID, Activate / Deactivate not possible because of static LOV
Package => Render Region => Region Plugin
Execute Process => Process Plugin
Edit Link => APEX Components can be changed on-the-fly
Run Rules => function to call all rules
Type => next slide for details
Tabelle => Enthält Regeln und Metainformationen zur Ausführung einer Regel
Object_TYPE => used for generating links
name => name for rule
Category => APEX, DDL or DATA => only APEX will generate links
Object_Types => REGION:ITEM:RPT_COL:BUTTON:COMPUTATION:VALIDATION:PROCESS:BRANCH:DA => based on this information problem can be found by edit link or by developer
Error_Message => Static message, can also be overwriten by query => this message will be shown
Comment => long exlpanation for rule => understand what does the rule
Exclude_objects => Object name by colon delimited list => exclude when special objects
Error_level => 1 Error, 2 Warning und 4 Info => filter result by error_level
Is_active => 1 active / 0 inactive => run rule when active
Sql => next slide
piqa_predecessor_ids => piqa_ids seperated in colon delimited list => run rule when predecessor has no errors found
Layer => PAGE, APPLICATION, DATABASE => PAGE is generating links
Red => Parameter for Running Query only on this data => Filter
Blue => Parameters based on rule in standard rules
Green => Metadata based on APEX or DB dictionary
Purple => Where Clause is identifing the elements which
=> never.sql -> complex example
Best place to use => Global Page as Region Plugin
Visibility for Developers
Job Possible to run the rules
Advisor -> only predefined checks, no automatismn, nothing to configure per check
Application Tracker -> not in-time checks, external application
External Tools -> not APEX specific, not integrated, but can be powerful
Import & Export Functionality for rules
Advisor Integration or any other SQL Check Mechanismn
Aggregation of Rules und better Visibility
Icons
Log Entries