9.2 Add configurations in the Metadata Tables
The report generation system relies on the following metadata tables
- DIGX_CM_TABLE_METADATA- Stores information about each table. - Table 9-1 Field Description - Property - Description - TABLE_CODE- Unique identifier for each table. - SUPPORTED_DOWNLOAD_TYPES- Media types supported for download. Supported values are ‘pdf’ and ‘csv’. - PAGINATION_TYPE- The type of pagination supported. Supported values are ‘S’ and ‘V’. Static (‘S’) refers to a one time fetching of all records. Virtual (‘V’) refers to virtual fetching of records. - ACTION_COMPONENT- The path of the UI component present in channel folder for which gets loaded on click of a row. - TABLE_HEADER- Comma Separated Values for Report and UI Screen Headers. Please note headings are NLS supported. The file name should be <TABLE_CODE>.properties and maintain at location “config/resources/nls/tablemetadata” with the keys and values. - Example: BrandManagement, ManageBrand - Here the BrandMangement header key will be used for reports and ManageBrand will be used for UI screen. - Incase the second value is missing. The UI screen won’t show the header. Example: BrandManagement- TABLE_HEADER- The heading to show on the table. Please note headings are NLS supported. The file name should be <TABLE_CODE>.properties and maintain at location “config/resources/nls/tablemetadata” with the keys and values. - ROW_ID- Unique identifier for each record in a table. - SERIAL_NUMBER_REQUIRED- Flag to enable serial numbers on the user interface. Supported values are ‘Y’ to enable and ‘N’ to disable. - MAX_COLUMNS- Property to limit the number of columns a PDF can show. Default is 6 which can be changed by updating this property. - Example - Insert into DIGX_CM_TABLE_METADATA (TABLE_CODE,SUPPORTED_DOWNLOAD_TYPES,PAGINATION_TYPE,ACTION_COMPONENT,TABLE_HEADER,ROW_ID, SERIAL_NUMBER_REQUIRED,MAX_COLUMNS) values ('ManageBrandBrand','csv,pdf','S','theme-config/review-theme', 'brand,brand','brandId',null,4); 
 Description of the illustration consistent-ui-download3.png
- DIGX_CM_COLUMN_METADATA- Stores information about columns available for a given table. - Table 9-2 Field Description - Property - Description - TABLE_METADATA_ID- Unique identifier for each table. Many to one relationship to DIGX_CM_TABLE_METADATA table and TABLE_CODE column. - NAME- The name of the column with NLS support. Maintain the file with the name "<TABLE_CODE>.properties" at the location "config/resources/nls/tablemetadata" along with the corresponding keys and values. Avoid creating duplicate files, as this file already contains the TABLE_HEADER for the DIGX_CM_TABLE_METADATA table. - COMPONENT_ID- Custom component created for user interface. Used to add custom formatting for specific columns. Default value is ‘null’. - DATATYPE- The supported datatypes are String, Number, Date, Currency and Complex. Similar to COMPONENT_ID, which is purely use for UI rendering; Datatypes is for report generation. - PATH- For value fetching, use the data path. The root path of a record is represented by the dot operator ('.'). Use the root path if the entire data object is required. Alternatively, use specific JSON paths when only specific values are required, example "Person.name", here we read name from the Person object. - FIXED- To view column on some condition, Supported values are ‘Y’ to enable and ‘N’ to disable. - SORTABLE- Flag to enable serial numbers on the user interface. Supported values are ‘Y’ to enable and ‘N’ to disable. - DOWNLOADABLE- The column support for download. Supported values are ‘Y’ to enable and ‘N’ to disable. - MIN_WIDTH- The minimum width of the column. - MAX_WIDTH- The maximum width of the column. - SEQUENCE_NO- The position of the column in the table. - LENGTH- The width of the column. The sum of all column lengths for a table code should be 100 to avoid overflow and underflow of table content. If not mentioned framework will auto size the widths. - Example - Insert into DIGX_CM_TABLE_METADATA (ID,TABLE_METADATA_ID,NAME,COMPONENT_ID,DATATYPE,PATH,FIXED,SORTABLE,DOWNLOADABLE,SEQUENCE_NO,LENGTH) values ('ManageBrandBrandthemeName','ManageBrandBrand','themeName',null,'String','brandName','Y','Y','Y',1,null);Insert into DIGX_CM_TABLE_METADATA (ID,TABLE_METADATA_ID,NAME,COMPONENT_ID,DATATYPE,PATH,FIXED,SORTABLE,DOWNLOADABLE,SEQUENCE_NO,LENGTH) values ('ManageBrandBrandthemeDesc','ManageBrandBrand','themeDesc',null,'String','brandDescription','N','Y','Y',2,null);Insert into DIGX_CM_TABLE_METADATA (ID,TABLE_METADATA_ID,NAME,COMPONENT_ID,DATATYPE,PATH,FIXED,SORTABLE,DOWNLOADABLE,SEQUENCE_NO,LENGTH) values ('ManageBrandBranddateCreated','ManageBrandBrand','dateCreated','formattedDate','Date','creationDate','Y','Y','Y',3,40);Insert into DIGX_CM_TABLE_METADATA (ID,TABLE_METADATA_ID,NAME,COMPONENT_ID,DATATYPE,PATH,FIXED,SORTABLE,DOWNLOADABLE,SEQUENCE_NO,LENGTH) values ('ManageBrandBrandactions','ManageBrandBrand','actions','theme-config/theme-actions','String','brandId','N','Y','Y',4,null); 
 Description of the illustration consistent-ui-download4.png
Parent topic: Consistent UI Download