Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

MOUG17: How to Build Multi-Client APEX Applications

129 vues

Publié le

Midwest Oracle Users Group Training Day 2017 Presentation by Tony Jedlinski from Konoso Nice Features

Publié dans : Technologie
  • Soyez le premier à commenter

MOUG17: How to Build Multi-Client APEX Applications

  1. 1. How to build Multi-Client APEX Applications Reduce the number of applications and schemas required to serve clients with similar needs but different data while maintaining privacy and personalization. By Tony Jedlinski President Konoso LLC
  2. 2. Tony Jedlinski President - Konoso LLC Vice President - MOUG Former Executive VP, Director Web Content and Initiatives - IOUG •Recognized by Oracle Magazine as a leading expert in Oracle Application Express (ApEx) development (named HTML-DB Developer of the year – 2005). •Published ApEx author (Oracle Magazine May/Jun 2006), (IOUG SELECT Journal Q4 2005). •ApEx presenter (Oracle World 2004, 2006, 7), (IOUG Live! 2004,5), (Collaborate 2006,7,8,9,10,11). •More than 25 of years experience as an Oracle systems architect / developer, and 35 years of experience in system analysis and development.
  3. 3. The idea Sometimes multiple users have the basically same needs but require some customization, for example Oracle User Groups When working on a tight budget, you may not have the luxury of separate schemas for each client, rather you may need to have multiple clients share the same tables and other objects. Having everyone sharing the same application and underlying data structure can reduce support and maintenance cost and time.
  4. 4. Customization is still possible using these techniques • Automatically selected theme roller themes • Option settings • Saved settings (e.g. logo file location) in database • Custom Dictionary Values • Use application level variables to substitute variable text e.g. Organization Name
  5. 5. Setup • Determine at what level(s) you will customize (e.g. Organization) • Add a foreign key column to the USER dictionary to identify which Organization the user belongs to. • Use this same technique for other tables such as dictionaries
  6. 6. Setup ACP_MHBS table defines the Organizations Each user is associated with a particular Organization and given appropriate privileges and personality
  7. 7. Set application level fields to easily reference the User’s Organization Do not allow these fields to be set from the browser . Re-calculate them on every page display so that any setting changes are reflected immediately.
  8. 8. Now report queries etc. can be limited to just the rows of the current user’s Organization
  9. 9. Changing Theme Roller settings dynamically • Based on current user • Based on current user’s affiliation (e.g. Organization) • Any other entity in the database
  10. 10. Define several themes using theme roller Associate each Organization with a Style
  11. 11. Create an Application Process: Set Style On Load
  12. 12. PL/SQL Procedure holds the complexity The code to manipulate styles is in the APEX_THEME package provided by Oracle Look up the current style and the desired style tor the user’s Organization. If they are different, set to the desired style using apex_theme.set_user_style
  13. 13. Demo
  14. 14. Options data • Set up a table to manage options and how they are applied • Integrate using APEX authorizations or pl/sql conditions
  15. 15. Options Table and Form
  16. 16. Set up authorization
  17. 17. Complexity is within the function HAS_OPTION CREATE OR REPLACE FUNCTION has_option (acp_mhb_num_in IN PLS_INTEGER, option_code_in IN VARCHAR2) RETURN VARCHAR2 AS CURSOR o_cur IS SELECT * FROM options WHERE code = UPPER (option_code_in); result_v VARCHAR2 (1) := 'N'; BEGIN FOR o_rec IN o_cur LOOP IF INSTR (':' || o_rec.acp_mhb_nums || ':', ':' || TRIM (TO_CHAR (acp_mhb_num_in)) || ':') > 0 THEN result_v := 'Y'; END IF; END LOOP; RETURN result_v; END; / Look up the Organization(s) who have this option. If the current Organization is included, return Y else return N
  18. 18. Add this authorization to the appropriate page element(s), in this case the entire EMP page and it’s navigation bar entry.
  19. 19. Demo
  20. 20. Saved settings • For example, store the organization’s logo location in a table and display using a report
  21. 21. Store the LOGO URL in the Organization dictionary
  22. 22. Reference this field in a report query
  23. 23. Demo
  24. 24. Custom Dictionary Values • For example, each organization can have their own choices for “emp type”
  25. 25. Make sure there is a foreign Key to the parent entity (Organization) on both EMP and EMP_TYPE
  26. 26. Make sure all reports and LOVs include only the appropriate rows
  27. 27. In Editable Interactive Reports, be sure the ACP_MHB_NUM column is present, hidden and defaults to :MHB_NUM
  28. 28. Demo
  29. 29. Dynamic Application level variables • Personalize text areas (e.g. Report titles) by setting and referencing a dynamic application variable For example SHORT_NAME.
  30. 30. Set SHORT_NAME on each page display
  31. 31. Use &SHORT_NAME. notation to reference
  32. 32. Demo
  33. 33. More questions ? Tony Jedlinski Tony@konoso.com