Knowledge Repository Document
BROADVISION Learning
(Application Development, Deployment and Performance Tuning)
Knowledge Item Name
Understanding Content Table Creation with / without Multivalve tables
Knowledge Repository Document No. :
Sr. #
1 2 3 4 5
KRID-001
Section / Page #
NA NA NA NA NA
Knowledge Item Name
BV Content Mandatory field name Simple and multi-value attributes SRC file required Information BV data type Command Used to create table
Reference
NA NA NA NA NA
Update By
Rahul Kushwaha
Description of Update
Understanding Content Table Creation with / Multivalve tables without
Date of Update
11/05/2012
HCL Infosystems
Page 1 of 8
Knowledge Repository Document
1. Main Introduction of Topic :Two kinds of Information in a BV system, that are stored & organized in a series of tables in BV schema Profile Information contains all the attributes for site visitors such as demographics, preferences, buying patterns. Content Information consists of all the information that can be presented on the site.
BV Content Each BV content requires the following six fields:
OID - Unique BV generated ID - Number(28) STORE_ID - to Identify the Store CREATION_TIME - A date field populated by BV STATUS - whether the content is on-off line. DELETED - Flags, When deleted with DCC and a DBA can remove it. LAST_MOD_TIME - BV will update automatically
2. Details about Topic :1. Understand the design of DATA MODEL EXTENSION for content table What are attributes ?
Attributes are properties of Visitor or Content. You can add attributes to the existing BV table. To maintain the multi-value attributes BV provides related attributes list These are child tables in a one-to-many relationship. The content or visitor is a parent. Explicitly insert and update should be done to the table. You need to maintain referential integrity.
2. Implementing a Data Model Extension for content table
Once the Single Attributes or Multivalue attributes are decided for you application. You must first have the required fields as NEGOTIATION_ID and six other fields (at least). These fields are written in Source File (.SRC)
Source File (.SRC)
Structured text file that describe the parts of BV database Used to define content and visitor profiles tables. Each SRC file defines one or more BV database tables. A parsing process will register the Content Type and generate SQL that can be applied to the
HCL Infosystems
Page 2 of 8
Knowledge Repository Document
database Required Information CLASS - identifies a unique name for the content and will be used inside of BV. STORE - Which store will access this or ALL_STORE CONTENT - The string used to refer to this from application code. CONTENT_KIND - Name that will be visible to the users of DCC. TABLE - name used for CREATE TABLE statement The Content and table name are same above but need not be same. Optional #include statement allows inclusion of custom data types ie.#include cnt_type.src OID does not appear in the SRC File - BV will update automatically.
Multi-value attributes tables
Defined as a LIST_TABLE in the SRC with a table name Attributes are simply listed under the LIST_TABLE statement Parent Key is implied by the list table. Define a column as key if required a composite key.
BV Data Types
Numeric LONG, Double, MONEY Character STRING, TEXT (varchar(2000) DATETIME Enumeration - Integer or strings Boolean - enumeration or a long Can be NOT_NULL No blobs and no images.
Attribute Kind
KEY - identifies primary key REQ_ATTR - Will ensure user enters value when editing in DCC. READ_ONLY - makes the attribute read only in DCC HIDDEN - will prevent the data from being displayed in DCC. Column - Native database column definition.
Example: Content table SRC
/* AUTHOR : Rahul CREATED ON : 31-Jan-2012 DESCRIPTION : This is used to records the NEGOTIATION data. Content Table : CT_NEGOTIATION_MST (Parent Table) */ #include "cnt_type.src" <CLASS_SECTION> CLASS: CT_NEGOTIATION_MST
HCL Infosystems Page 3 of 8
Knowledge Repository Document
STORE: IREPS /* DEFAULT */ CONTENT: CT_NEGOTIATION_MST "CT_NEGOTIATION_MST" TABLE: CT_NEGOTIATION_MST /* table name */ /* ATTRIBUTE: OID will be generated automatically */ ATTRIBUTE: NEGOTIATION_ID TYPE: STRING NOT_NULL ATTR_KIND: REQ_ATTR FRIENDLY_NAME: NEGOTIATION_ID SEMANTICS: NEGOTIATION_ID ATTRIBUTE: STORE_ID TYPE: LONG NOT_NULL ATTR_KIND: REQ_ATTR, RONLY, HIDDEN FRIENDLY_NAME: Service ID SEMANTICS: Service ID ATTRIBUTE: CREATION_TIME TYPE: DATETIME NOT_NULL ATTR_KIND: REQ_ATTR, RONLY FRIENDLY_NAME: Creation Time SEMANTICS: Creation Time ATTRIBUTE: STATUS TYPE: STATUS_TYPE NOT_NULL ATTR_KIND: REQ_ATTR FRIENDLY_NAME: Status SEMANTICS: Status ATTRIBUTE: DELETED TYPE: LONG NOT_NULL ATTR_KIND: REQ_ATTR, RONLY, HIDDEN FRIENDLY_NAME: Deleted Status SEMANTICS: Deleted Status ATTRIBUTE: LAST_MOD_TIME TYPE: DATETIME NOT_NULL ATTR_KIND: REQ_ATTR, RONLY FRIENDLY_NAME: Last Modified Time SEMANTICS: Last Modified Time ATTRIBUTE: TCR_ID TYPE: LONG NOT_NULL ATTR_KIND: KEY,REQ_ATTR FRIENDLY_NAME: TCR_ID SEMANTICS: TCR_ID ATTRIBUTE: TENDER_OID TYPE: LONG
HCL Infosystems Page 4 of 8
Knowledge Repository Document
FRIENDLY_NAME: TENDER_OID SEMANTICS: TENDER_OID ATTRIBUTE: REFERENCE_NUMBER TYPE: STRING COLUMN: varchar(100) FRIENDLY_NAME: REFERENCE_NUMBER SEMANTICS: REFERENCE_NUMBER ATTRIBUTE: PL_NUMBER TYPE: STRING COLUMN: varchar(50) FRIENDLY_NAME: PL_NUMBER SEMANTICS: PL_NUMBER
Multivalue content table Creation
#include "cnt_type.src" <CLASS_SECTION> CLASS: CT_PO_MASTER STORE: IREPS /* DEFAULT */ CONTENT: CT_PO_MASTER "CT_PO_MASTER" TABLE: CT_PO_MASTER /* table name */ /* ATTRIBUTE: OID will be generated automatically */ ATTRIBUTE: PO_ID TYPE: LONG NOT_NULL ATTR_KIND: KEY,REQ_ATTR FRIENDLY_NAME:PO_ID SEMANTICS: PO_ID ATTRIBUTE: STORE_ID TYPE: LONG NOT_NULL ATTR_KIND: REQ_ATTR, RONLY, HIDDEN FRIENDLY_NAME: STORE_ID SEMANTICS: STORE_ID ATTRIBUTE: CREATION_TIME TYPE: DATETIME NOT_NULL ATTR_KIND: REQ_ATTR, RONLY FRIENDLY_NAME: CREATION_TIME SEMANTICS: CREATION_TIME ATTRIBUTE: STATUS TYPE: STATUS_TYPE NOT_NULL ATTR_KIND: REQ_ATTR FRIENDLY_NAME: Status
HCL Infosystems Page 5 of 8
Knowledge Repository Document
SEMANTICS: Status ATTRIBUTE: DELETED TYPE: LONG NOT_NULL ATTR_KIND: REQ_ATTR, RONLY, HIDDEN FRIENDLY_NAME: Deleted Status SEMANTICS: Deleted Status ATTRIBUTE: LAST_MOD_TIME TYPE: DATETIME NOT_NULL ATTR_KIND: REQ_ATTR, RONLY FRIENDLY_NAME: Last Modified Time SEMANTICS: Last Modified Time ATTRIBUTE: TENDER_OID TYPE: LONG NOT_NULL ATTR_KIND: KEY,REQ_ATTR FRIENDLY_NAME: TENDER_OID SEMANTICS: TENDER_OID ATTRIBUTE: TENDER_NUMBER TYPE: STRING COLUMN: varchar(30) FRIENDLY_NAME: TENDER_NUMBER SEMANTICS: TENDER_NUMBER ATTRIBUTE: TENDER_OPEN_DATE TYPE: DATETIME NOT_NULL FRIENDLY_NAME: TENDER_OPEN_DATE SEMANTICS: TENDER_OPEN_DATE LIST_TABLE: CT_PO_ITEMS "CT_PO_ITEMS" ATTRIBUTE: PO_ITEM_ID TYPE: LONG NOT_NULL ATTR_KIND: KEY FRIENDLY_NAME: PO_ITEM_ID SEMANTICS: PO_ITEM_ID ATTRIBUTE: PO_ID_1 TYPE: LONG NOT_NULL ATTR_KIND: KEY FRIENDLY_NAME: PO_ID_1 SEMANTICS: PO_ID_1 ATTRIBUTE: CONSIGNEE TYPE: STRING COLUMN: varchar(50) FRIENDLY_NAME: CONSIGNEE SEMANTICS: CONSIGNEE
HCL Infosystems Page 6 of 8
Knowledge Repository Document
ATTRIBUTE: PL_NUMBER TYPE: STRING COLUMN: varchar(50) FRIENDLY_NAME: PL_NUMBER SEMANTICS: PL_NUMBER LIST_TABLE: CT_PO_ATTACH_DOCS "CT_PO_ATTACH_DOCS" ATTRIBUTE: PO_ID_2 TYPE: LONG NOT_NULL ATTR_KIND: KEY FRIENDLY_NAME: PO_ID_2 SEMANTICS: PO_ID_2 ATTRIBUTE: ATTACH_DOC_ID TYPE: LONG NOT_NULL ATTR_KIND: KEY FRIENDLY_NAME: ATTACH_DOC_ID SEMANTICS: ATTACH_DOC_ID ATTRIBUTE: FILE_NAME TYPE: STRING COLUMN: varchar(100) FRIENDLY_NAME: FILE_NAME SEMANTICS: FILE_NAME
Command Used to create table
To create SRC file to SQL file schema_gen -i <srcname>.src -o <sqlname>.sql -c content with your own .src and .sql file names. as $ schema_gen -i CT_NEGOTIATION_MST.src -o CT_NEGOTIATION_MST.sql -c content to execute SQL file apply_sql <database name> <database service name> <user_id> <password> sqlname.sql as $ apply_sql orcl orcl bv1to1 bv1to1 CT_NEGOTIATION_MST.sql
3. Important Learnings in this Topic :
Difference between simple content table and multivlaue content table DATA TYPE use in BV all available value of attribute type DDL for BV
4 Suggestion Points what to Explore More :Other available data type Explore needed on one one many table structure
HCL Infosystems Page 7 of 8
Knowledge Repository Document
HCL Infosystems
Page 8 of 8