Dictionary¶
The information stored in the Dictionary is very important and is used in the development tools as well as in the run-time environment for Foundation1. There are several places where the information within the Dictionary is used, one example is in Framework Services such as History Logging. This section describes some of the key information stored in the dictionary. A more detailed description of each is given in the next section.
Below is a description of the basic overview of the relationship between Component, Entity, PL/SQL package, Views found in the application.
All meta information related to the entity are stored in the Dictionary. Some association information regarding relationship among entities are stored in the Dictionary as well. Dictionary meta data is exposed through system service Dictionary_SYS.
Development Guidelines¶
Entity modeling affects the Dictionary. The generated files will contain package global constants, view and column comments that will be used to build the Dictionary. The dictionary is built either using Solution Manager or by executing the PL/SQL code below. The code changes must be deployed into the database before building the dictionary.
The method Dictionary_SYS.Rebuild_Dictionary_Storage_
is used to refresh the Dictionary cache. It can be done in different modes;
- PARTIAL - Partially rebuild the dictionary, which only refresh the cache related to the database objects which was deployed after the last dictionary cache refresh.
- FULL - Removes all dictionary information and rebuilds it.
- COMPUTE - Analyses the database and decide what sort of dictionary cache refresh is required.
DECLARE
output_ VARCHAR2(32767);
BEGIN
Dictionary_SYS.Rebuild_Dictionary_Storage_(output_, 0,'PARTIAL');
COMMIT;
dbms_output.put_line(output_);
END;
Check the output to see if there are any warnings. If there are, then fix them before continuing development.
Meta Data Storage¶
Dictionary meta data is stored at different locations depending on it's type. The four different storage locations from which dictionary information are extracted are: PL/SQL package global constants, view and column comments, Oracle Server dictionary and the PL/SQL package code. The information extracted from these places are then stored in IFS Dictionary tables. This is done by the cache refresh process.
PL/SQL package global constants¶
Some dictionary information can be extracted from reading package global variables. In the following example the module which this entity belongs to, the logical unit/entity name(lu_name) and the type of the logical unit are defined as package global constants.
This information is automatically generated into the PL/SQL code by the code generator by reading information on the model.
View and Column Comments¶
View and column comments also contains meta data which is used as dictionary information.
In the view comment (example below) information related to the overall logical unit is stored. The comment states which logical unit this view belongs to (LU=), the view prompt (PROMPT=), the module (MODULE=), the base table (TABLE=) where the logical unit's data is store (optional).
In addition meta data is also stored as column comments. The column comments contains information related to attributes of the logical unit, and other derived attributes. For example the FLAGS= states the attribute's properties. PROMPT= defines the column prompt related to the attributes and REF= defines any reference the attribute has to other entities.
Oracle Server dictionary¶
The IFS Cloud Dictionary cache also uses some Oracle server dictionary views like USER_PROCEDURES to build dictionary meta data.
PL/SQL package code¶
Actual PL/SQL code is also used to build up dictionary information. This is done by querying the code using Oracle dictionary view USER_SOURCE and then parsing the code to get information.
All of this information is then stored in the IFS dictionary tables for easy access.
Dictionary Storage Tables and Views¶
Views and Tables belonging to the dictionary are usually prefixed with dictionary_sys. Here is a brief description on the main dictionary views and tables.
Table Name | View Name | Description |
---|---|---|
MODULE_TAB | MODULE | Contains information on module/components in IFS Applications. This can be both installed modules and modules not installed (version = ?). |
DICTIONARY_SYS_TAB | DICTIONARY_SYS_LU | Contains information on logical units/entities in IFS Applications |
DICTIONARY_SYS_VIEW_TAB | DICTIONARY_SYS_VIEW | Contains information on views belonging to IFS Applications. Also specifies which entity/logical unit a particular view belongs to. |
DICTIONARY_SYS_VIEW_COLUMN_TAB | DICTIONARY_SYS_VIEW_COLUMN | Contains information related to view columns. It also contains FLAG information specified in the column prompt like whether a column is a key, parent key attribute (type_flag), whether the column in updatable, insertable and whether the column value is mandatory. |
DBA_TABLES (Oracle) | DICTIONARY_SYS_TABLES | Shows information related to tables belonging to the Application Owner. |
DBA_TAB_COLUMNS (Oracle) | DICTIONARY_SYS_TAB_COLUMNS | Shows information related to table columns. |
DICTIONARY_SYS_METHOD_TAB | DICTIONARY_SYS_METHOD / DICTIONARY_SYS_METHOD_LOV |
Contains information related to PL/SQL package methods, this is built up using Oracle dictionary view USER_PROCEDURES. |
DICTIONARY_SYS_ARGUMENT_TAB | DICTIONARY_SYS_ARGUMENT | Contains PL/SQL method arguments/parameter information. Built up using Oracle dictionary view USER_ARGUMENTS. |
DICTIONARY_SYS_DOMAIN_TAB | DICTIONARY_SYS_DOMAIN | Contains Enumeration/Domain information like Entity/Logical Unit name, the Enumeration package name, DB_VALUE value, CLIENT_VALUE value (not translated). |
DICTIONARY_SYS_STATE_TAB | DICTIONARY_SYS_STATE | Contains state information related to entities including Entity and package which has the state, DB_STATE value and CLIENT_STATE value (not translated). |
Using Dictionary¶
Access to dictionary is done by a set of API methods exposed in the Dictionary_SYS system service. This can be useful when business logic needs to validate information against the dictionary or if certain information needs to be read from the dictionary in order to provide more functionality.
Below is a brief description on a few use cases of the dictionary.
Getting Information on Logical Units¶
Dictionary_SYS exposes some methods which can be used to get information about an entity.
- Get_Base_View - Returns the base view of the entity. This is the main view which is related to the entity. An entity may have other views, but only one base view.
- Get_Base_Table_Name - Returns the base table of the entity. This is the main table of the logical unit which data is stored. There can only be one base table per entity.
- Get_Base_Package - Returns the name of the main PL/SQL package belonging to the logical unit.
- Get_Logical_Unit_Type - Returns the type of the logical unit.
- Has_Custom_Objects - Checks whether the given entity has the specified custom object type deployed.
Checking if Database Objects exists¶
The following APIs can be used to check whether a database object exists. These methods uses the IFS Dictionary instead of Oracle's Dictionary.
- Method_Is_Installed - Check whether the given method exists in the database.
- Package_Is_Installed - Check whether the given package exists in the database.
- View_Is_Installed - Check whether the given view exists in the database.
Some other methods¶
- Get_Table_Column_Impl - Returns the corresponding table column name, when given the view name and the column name (useful when view and table column names are not the same).
- Get_Enumeration_Lu - When given a view name and the column name, returns the enumeration referenced by the column, or NULL if it does not reference an enumeration.