5
XXDM_ISM_SUPP_CONTACTS_B Column Name ID Pk Null ? Data Type Defaul t CONTACT_ID 1 1 N NUMBER (15) SUPPLIER_EMAIL_ID 2 Y VARCHAR2 (240 Byte) CREATED_BY 3 Y NUMBER (15) CREATION_DATE 4 Y DATE LAST_UPDATED_BY 5 Y NUMBER (15) LAST_UPDATE_DATE 6 Y DATE LAST_UPDATE_LOGIN 7 Y NUMBER (15) XXDM_ISM_SUPP_CONTACTS_TL Column Name ID Pk Null ? Data Type Defaul t CONTACT_ID 1 1 N NUMBER (15) SUPPLIER_NAME 2 Y VARCHAR2 (240 Byte) LANGUAGE 3 2 N VARCHAR2 (30 Byte) NOTES 4 Y VARCHAR2 (240 Byte) CREATED_BY 5 Y NUMBER (15) CREATION_DATE 6 Y DATE LAST_UPDATED_BY 7 Y NUMBER (15) LAST_UPDATE_DATE 8 Y DATE LAST_UPDATE_LOGIN 9 Y NUMBER (15) SOURCE_LANG 10 N VARCHAR2 (4 Byte) XXDM_ISM_SUPP_CONTACTS_VL DROP VIEW APPS . XXDM_ISM_SUPP_CONTACTS_VL ; CREATE OR REPLACE FORCE VIEW apps . xxdm_ism_supp_contacts_vl ( row_id , contact_id , supplier_email_id , supplier_name , notes , created_by , creation_date , 1

Multi Language Page Creation

Embed Size (px)

Citation preview

Page 1: Multi Language Page Creation

XXDM_ISM_SUPP_CONTACTS_B

Column Name ID Pk Null? Data Type DefaultCONTACT_ID 1 1 N NUMBER (15)SUPPLIER_EMAIL_ID 2 Y VARCHAR2 (240 Byte)CREATED_BY 3 Y NUMBER (15)CREATION_DATE 4 Y DATELAST_UPDATED_BY 5 Y NUMBER (15)LAST_UPDATE_DATE 6 Y DATELAST_UPDATE_LOGIN 7 Y NUMBER (15)

XXDM_ISM_SUPP_CONTACTS_TL

Column Name ID Pk Null? Data Type DefaultCONTACT_ID 1 1 N NUMBER (15)SUPPLIER_NAME 2 Y VARCHAR2 (240 Byte)LANGUAGE 3 2 N VARCHAR2 (30 Byte)NOTES 4 Y VARCHAR2 (240 Byte)CREATED_BY 5 Y NUMBER (15)CREATION_DATE 6 Y DATELAST_UPDATED_BY 7 Y NUMBER (15)LAST_UPDATE_DATE 8 Y DATELAST_UPDATE_LOGIN 9 Y NUMBER (15)SOURCE_LANG 10 N VARCHAR2 (4 Byte)

XXDM_ISM_SUPP_CONTACTS_VL

DROP VIEW APPS.XXDM_ISM_SUPP_CONTACTS_VL;

CREATE OR REPLACE FORCE VIEW apps.xxdm_ism_supp_contacts_vl (row_id,

contact_id, supplier_email_id,

supplier_name, notes, created_by, creation_date,

last_update_date,last_update_login,last_updated_by )

ASSELECT b.ROWID row_id, b.contact_id, b.supplier_email_id,

t.supplier_name, t.notes, b.created_by, b.creation_date, b.last_update_date,

b.last_update_login, b.last_updated_by FROM xxdm.xxdm_ism_supp_contacts b, xxdm.xxdm_ism_supp_contacts_tl t WHERE b.contact_id = t.contact_id AND t.LANGUAGE = USERENV ('LANG');

1

Page 2: Multi Language Page Creation

Entity Objects for Transalatable (_TL) Tables

To create entity objects for your translatable (_TL tables), follow these instructions:

Step 1: Create an entity object for your _TL table (NOT the _VL view) following these rules:

o Name it <Entity>TLEO.

For example, for the table

XXDM_ISM_SUPP_CONTACTS_TL we created an entity

object named XxdmIsmSuppContactsTLEO.

o Include all the table's attributes. Make sure the attribute for the LANGUAGE

column is named Language, and the attribute for the SOURCE_LANG column

is named SourceLang.

o Identify the table's primary keys including the LANGUAGE column.

o Verify that this extends OAEntityImpl like any other OAF entity object.

o Add whatever validation logic you need for this entity and its attributes (the

translatable values are unlikely to need any special validation).

o By default, all the attributes in the _TL table will be considered translatable if:

Not a primary key attribute and

Not an entity accessor and

One of the following types: VARCHAR, CHAR, FIXED_CHAR,

LONGVARCHAR, CLOB

o If you need to override this default behavior, create a custom BC4J attribute-

level property named OA_TRANSLATABLE and set its value as follows:

If the property value is set to true, the attribute will be considered

translatable attribute.

If the property value is set to false, the attribute will not be considered

translatable.

Step 2: Create an entity object for your _VL view following these rules.

Use the regular entity object naming convention.

2

Page 3: Multi Language Page Creation

o For example, for the XXDM_ISM_SUPP_CONTACTS_VL view , the

corresponding entity object is named XxdmIsmSuppContactsVlEO.

Do not include the RowId pseudo-column. Include all the other columns in the view.

Identify your primary keys as you normally would.

Create an entity-level custom BC4J property named OA_BASE_TABLE with a value

naming the true base table of your translatable entity (in this example, this value would

be set to XXDM_ISM_SUPP_CONTACTS_B).

Behind the scenes, the OA Framework will automatically override the entity's doDML method

to ensure that all inserts, updates and deletes are actually performed on the base table identified

this property. All reads will be done against the _VL view.

Step 3: Create an association between the _VL (source) and _TL (destination) entity objects

following these rules:

Follow the standard association object naming convention that describes the entity

relationships.

o For example: SuppContactsToTlAO.

The association should be designated as a composition with 1:* cardinality (be sure to

deselect the Cascade Delete checkbox that is enabled when you choose the composition

option). The base entity should be selected as the source, and the _TL entity as the

destination.

Change the Accessor Name in the destination entity to OA_TL_ENTITIES.

Step 4: Create views objects that use your translatable entities

When creating view objects to access your translatable entities, always use the entity object

created for the _VL view (for example, XxdmIsmSuppContactsVlEO). Do not use the _TL

entity object (XxdmIsmSuppContactsTLEO) directly. For the purposes of any code that

needs to access your translatable entity, you should treat the base EO as the only entity object

(coordination between the base and _TL entities is handled for you automatically, and the _TL

entity should remain "invisible"). Otherwise, you can treat your base EO like any other EO.

3

Page 4: Multi Language Page Creation

_TL Table with no Corresponding _B Table

For those rare cases where you have a _TL table and _VL view and no _B table because all of

the attributes are translatable, you can still define the base entity on the database view _VL, set

the OA_BASE_TABLE

Create Page using VLVO alone and do all DML

4