{"id":5369,"date":"2023-01-20T15:27:40","date_gmt":"2023-01-20T14:27:40","guid":{"rendered":"https:\/\/gpmfactory.com\/?p=5369"},"modified":"2023-01-20T16:38:56","modified_gmt":"2023-01-20T15:38:56","slug":"customizing-the-contextual-help-system-in-an-oracle-apex-application","status":"publish","type":"post","link":"https:\/\/gpmfactory.com\/index.php\/2023\/01\/20\/customizing-the-contextual-help-system-in-an-oracle-apex-application\/","title":{"rendered":"Customizing the contextual Help system in an Oracle APEX application"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Context and Objectives<\/h3>\n\n\n\n<p>In an Oracle APEX application, there is possibility to enter Help text at development stage. The help text may be used to provide page level context sensitive help. <br>In almost every component, there is a specific property (<code>Help Text<\/code>)  aimed to receive the text.<\/p>\n\n\n\n<p>Usually, the developer is responsible for this task and that has drawbacks :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The text can only be provided in the Developer interface.<\/li>\n\n\n\n<li>There is no rich text editor support at this level<\/li>\n\n\n\n<li>The developer himself is not, most of time, the best qualified person to handle this job<\/li>\n<\/ul>\n\n\n\n<p>Given these above considerations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We need a more confortable tool for authoring Help Text<\/li>\n\n\n\n<li>It&rsquo;s better to delegate this job to a writer who will  have better user sensitivity.<\/li>\n\n\n\n<li>the text needs to be continually improved as it is used, without doing back and forth in the development console.<\/li>\n<\/ul>\n\n\n\n<p>Let&rsquo;s consider a possible solution to achieve our goal.<\/p>\n\n\n\n<p>In this paper, we&rsquo;ll focus on <strong>Help Text<\/strong> at page level only and we&rsquo;ll not consider the other level of component (items) neither <code>Inline Help Text<\/code>. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Global approach<\/h3>\n\n\n\n<p>One solution is to add an application table wich contains specific help text.<br>The authors will need a regular access to application in order to modify the help text through a dedicated form page.<\/p>\n\n\n\n<p>In standard, the help texts are accessible through an APEX view:  A<code>PEX_APPLICATION_PAGES<\/code><\/p>\n\n\n\n<p>Access key is : APPLICATION_ID + PAGE_ID<br>text: HELP_TEXT<\/p>\n\n\n\n<p>We build a new table which contains customized help texts. Let&rsquo;s say : PLA_HELP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE PLA_HELP\n( APP_ID NUMBER,\n  PAGE_ID NUMBER,\n  HELP_TEXT CLOB,\n  CREATED_BY VARCHAR2(50),\n  CREATED_ON DATE,\n  CONSTRAINT PLA_HELP_PK PRIMARY KEY (APP_ID,PAGE_ID)\n  USING INDEX ENABLE\n) <\/code><\/pre>\n\n\n\n<p>We build a view <code>PLA_HELP_V<\/code> that superimposes help text derived from repository and help text coming from our specific table.<br>Priority is given to Customized Help Text.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE OR REPLACE FORCE EDITIONABLE VIEW PLA_HELP_V (APP_ID, PAGE_ID, CREATED_BY, CREATED_ON, PAGE_TITLE, HELP_TEXT, IS_FACTORY) AS\nselect\n  p.APPLICATION_ID,\n  p.PAGE_ID,\n  h.CREATED_BY,\n  h.CREATED_ON,\n  p.PAGE_TITLE,\n  case when h.HELP_TEXT is null \n     then p.HELP_TEXT\n     else h.HELP_TEXT\n  end HELP_TEXT,\n  case when h.HELP_TEXT is null \n     then 'Y'\n     else 'N'\n  end IS_FACTORY\nfrom APEX_APPLICATION_PAGES p,\n     PLA_HELP h\nwhere p.APPLICATION_ID = h.APP_ID(+)\nand p.PAGE_ID = h.PAGE_ID(+)<\/code><\/pre>\n\n\n\n<p>Displaying help text needs a specific page dedicated to that. <br>When we launch the wizzard, the page and navigation icons are automatically created if a page at least is added, but it&rsquo;s not the case otherwise.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"916\" height=\"663\" src=\"http:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Image9.png\" alt=\"\" class=\"wp-image-5374\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Image9.png 916w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Image9-300x217.png 300w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Image9-768x556.png 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><figcaption class=\"wp-element-caption\">Help about a page. A edit icon allows to navigate to edit mode for authorized users.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"669\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Capture-decran-2023-01-20-144825.png\" alt=\"\" class=\"wp-image-5378\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Capture-decran-2023-01-20-144825.png 745w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Capture-decran-2023-01-20-144825-300x269.png 300w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><figcaption class=\"wp-element-caption\">Edit Help text page.<\/figcaption><\/figure>\n\n\n\n<p>My first choice has been to create a  I<em>nstead of Trigger<\/em> but this way reached an obstacle: I got an -1031 error <em>insufficient privileges<\/em>, because of presence of a system APEX view. I could workaround by granting some privileges directly to user, but I gave this approach up and I put all the code in the APEX form. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"284\" height=\"249\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2023\/01\/Capture-decran-2023-01-20-145616.png\" alt=\"\" class=\"wp-image-5381\"\/><\/figure><\/div>\n\n\n<p>In the <code>process section<\/code>, we remove the default form DML process and replace it by three processes, each dedicated to an action (Update, insert or delete)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>ie: the code for update below: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>BEGIN     \n update PLA_HELP\n     set\n       HELP_TEXT = :P35_HELP_TEXT,\n       CREATED_ON = :P35_CREATED_ON,\n       CREATED_BY  = :P35_CREATED_BY\n     where APP_ID = :P35_APP_ID and\n           PAGE_ID = :P35_PAGE_ID;\n COMMIT;\nEND;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>The new system provides a more flexible solution for providing accurate information to users.<\/p>\n\n\n\n<p>We could imagine to refine our help system by adding multiple levels of reading, depending the user profile.<br>This solution can be improved, as well, by merging additional infos provided later by developper (because of fixing bugs or adding features) with an already existing customized text.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Context and Objectives In an Oracle APEX application, there is possibility to enter Help text at development stage. The help text may be used&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5398,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[150],"class_list":["post-5369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-classe"],"authors":[{"term_id":150,"user_id":1,"is_guest":0,"slug":"admin8700","display_name":"Patrick","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/209d5ed69b74d288390621ab4c1d3773?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/comments?post=5369"}],"version-history":[{"count":22,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5369\/revisions"}],"predecessor-version":[{"id":5396,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5369\/revisions\/5396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/media\/5398"}],"wp:attachment":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/media?parent=5369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/categories?post=5369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/tags?post=5369"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/ppma_author?post=5369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}