HowTo Integrate

Overview
Database installation

Follow the steps in HowTo Install to install the necessary views and packages in the database.

Application Server/Oracle XE WebDav Installation

This step is optional, but highly recommended, because if you put the files onto the Application Server, the browser can cache the files and doesn't have to load them for each page.

If you don't have access to the Application Server, you can also paste the content of the files into a page 0 region as described below.

  1. On the Application Server go into the parent directory (that's the images directory) of the directory where the htmldb_get.js and htmldb_html_elements.js are located (images/javascript).
    See APEX installation guide for details. For Oracle XE see Dietmar Aust's blog posting about file storage on XE.
  2. Create a new directory called apexlib_2_0 in the images directory.
  3. The version number has been added to the directory name, because the files are cached by the browser and just updating the files isn't always recognized by the browser. A different directory name helps to avoid this problem, so that the end users do not have to clear their browser cache.
  4. Copy the following files from the JavaScript directory into this new directory:
    • ApexLib_Full-min.js
    • ApexLib_Lov-min.js
    • ApexLib.css
    • size_grip.png
  5. After that you can integrate the files into your page templates. For details see Including JavaScript in a .js File Referenced by the Page Template.
    The order has to be ApexLib_Full-min.js and then ApexLib.css

    OR

    If you don't want to touch all your page templates, you can also include the necessary commands into a page 0 region as described below.

Integration into your Application
You have two possibilities to integrate ApexLib into your Application:
  1. Integrate automatically using script ApexLib_integrate_into_application.sql
  2. Do the integration manually with a 14-step Instruction
Reasons you have to integrate manually:
  1. you don't have access to the Application Server
  2. you already modified the page error template
  3. you use subscription algorithm for your templates

Ok, now that you decided to integrate using the script:
  • connect to the database using your Application Schema
  • and execute @ApexLib_integrate_into_application.sql
  • Enter the id of the application you want to integrate ApexLib at.
  • That's all. Now you can use all the features of the ApexLib Framework!

Please double-check if the automatic integration created all parts mentioned in the Manual Instruction.
Very important is the name of your templates message/error-Section, this is case-sensitive. See manual Steps 4 and 11.
Localization
If you want to change or translate the text used by the framework, create the following Text Messages (Shared Components/Text Message)
  • Name: APEXLIB_ITEM_REQUIRED
  • Text:
    %label is required.
  • Name: APEXLIB_ITEM_REQUIRED_INLINE
  • Text:
    Is required
  • Name: APEXLIB_ITEM_INVALID_FORMAT
  • %label doesn't match to the format "%0" (eg %1).
  • Name: APEXLIB_ITEM_INVALID_FORMAT_INLINE
  • Format "%0"<br>Eg %1
  • Name: APEXLIB_ITEM_BETWEEN
  • %label has to be between %0 and %1.
  • Name: APEXLIB_ITEM_BETWEEN_INLINE
  • Has to be between<br>%0 and %1
  • Name: APEXLIB_ITEM_GREATER_OR_EQUAL
  • %label has to be greater or equal to %0.
  • Name: APEXLIB_ITEM_GREATER_OR_EQUAL_INLINE
  • Has to be greater or<br>equal to %0
  • Name: APEXLIB_ITEM_LESS_OR_EQUAL
  • %label has to be less or equal to %0.
  • Name: APEXLIB_ITEM_LESS_OR_EQUAL_INLINE
  • Has to be less or<br>equal to %0
  • Name: APEXLIB_TABFORM_COLUMN_REQUIRED
  • Text:
    %label is required.
  • Name: APEXLIB_TABFORM_INVALID_FORMAT
  • Text:
    %label doesn't match to the format "%0" (eg %1).
  • Name: APEXLIB_TABFORM_BETWEEN
  • Text:
    %label has to be between %0 and %1.
  • Name: APEXLIB_TABFORM_GREATER_OR_EQUAL
  • Text:
    %label has to be greater or equal to %0.
  • Name: APEXLIB_TABFORM_LESS_OR_EQUAL
  • Text:
    %label has to be less or equal to %0.
  • Name: APEXLIB_TABFORM_ROW_PREFIX
  • Text:
    Row %0:
You can enter these Text Messages manually or use the File Scripts\ApexLib_load_apexlib_messages_de.sql (containing german translations) as a template to do your own translation and add them to all applications you want to.
Please remember to connect to your applications parsing schema (e.g. SQLPLUS your_application_user/pwd) and to set a AL32UTF8 characterset (e.g. AMERICAN_AMERICA.AL32UTF8) before applying this scripts.

Windows example:

C:\ApexLib\Scripts> SET NLS_LANG=AMERICAN_AMERICA.AL32UTF8
C:\ApexLib\Scripts> SQLPLUS my_application_user/xxxyyyyxxx@somewhere
SQL> @ApexLib_load_apexlib_messages_de
Documentation

To unleash the full power of ApexLib we highly recommend using the Oracle APEX Build Plugin!
Using the Builder Plugin makes the stuff down here obsolete, you just don't need to care, the Builder Plugin does all the work for you.

Check out the related ApexLib postings for an explanation and examples of the different features.

Also take a look at the package specifications (*.pks) of the different packages. This will show you all the APIs of the framework and they are very well documented (or at least I hope so :-) ).

The behavior of the framework can be changed by adding hints into the comment text or link attributes (for report columns) of the different items. The following hints do exist so far, for an explanation see the postings.

  • $APEXLIB_IGNORE_LOV$
  • $APEXLIB_IGNORE_LOV_NULL$
  • $APEXLIB_ALWAYS_REFRESH$
  • $APEXLIB_IGNORE_VALIDATION$
  • $APEXLIB_REQUIRED$
  • $APEXLIB_UPPERCASE$
  • $APEXLIB_LOWERCASE$
  • $APEXLIB_CAPITALIZE$
  • $APEXLIB_V_RESIZE$
  • $APEXLIB_MAX_LENGTH=length$
    • $APEXLIB_MAX_LENGTH=40$
  • $APEXLIB_MIN_VALUE=fixed value or column/item reference$
    • $APEXLIB_MIN_VALUE=0$ => has to comply to the format mask of the column/item!
    • $APEXLIB_MIN_VALUE=#HIRE_DATE#$ for a Tabular Form Column reference
    • $APEXLIB_MIN_VALUE=&P4_HIRE_DATE.$ for a Page Item or Application Item reference
  • $APEXLIB_MAX_VALUE=fixed value or column/item reference$
    • $APEXLIB_MAX_VALUE=5,000$ => has to comply to the format mask of the column/item!
    • $APEXLIB_MAX_VALUE=#MAX_SALARY#$ for a Tabular Form Column reference
    • $APEXLIB_MAX_VALUE=&P4_MAX_SALARY.$ for a Page Item or Application Item reference
  • $APEXLIB_HIDE_SELECT_ALL$
Problems or Questions

My page item isn't validated by your library!

  • Have you set a format mask for the numeric item?
  • Have you set a date picker?
  • Does the item/region have a condition/authorization?
  • Enable debug mode, there you see why the library isn't validating your item as soon as you press submit

I have tested the library with FireFox 2.0 and IE 6.0, if you have another browser where it doesn't work, let me know.

Should you have problems or questions about the integration. Or want to have a new features, don't hesitate to contact me at apexlib@oracleapex.info!