11.4 Querying Registered Tables using DQL for Value Assistance

Create a new attribute cust_news_display_order and fill in the General tab as shown in figure 11.29.

11.4 Querying Registered Tables using DQL for Value Assistance

Figure 11.29: cust_news_display_order Attribute General tab

This attribute needs to show the drop-down values: 1, 3, 5, 7 if the value of the attribute cust_news_is_press_rel is true and the values: 0, 2, 4, 6 if the value of the attribute cust_news_is_press_rel is false.

This can be achieved by conditional value assistance and using registered tables as follows:

  1. Create a table in the underlying RDBMS as per the following design:
    • Table name: cust_values_table
    • Column 1 (int): cust_odd_values
    • Column 2 (int): cust_even_values

      Insert values for both the columns as shown in figure 11.30:

    11.4 Querying Registered Tables using DQL for Value Assistance

    Figure 11.30: cust_values_table database table

  2. Log in to Documentum Administrator as an administrator and register the RDBMS table cust_values_table via the following DQL queries:
    register table dm_dbo.cust_values_table (cust_odd_values int,cust_even_values int)
    update dm_registered object set owner_table_permit=15 where object_name='cust_values_table'
    update dm_registered object set group_table_permit=15 where object_name='cust_values_table'
    update dm_registered object set world_table_permit=15 where object_name='cust_values_table'
    

    Note that here dm_dbo is an alias for the Docbase owner and permit level 15 is for select, insert, update, and delete rights.

    Now issue the following SELECT query in Documentum Administrator via the DQL query editor to find out if the values in the registered table are returned or not:

    select cust_odd_values, cust_even_values from dm_dbo.cust_values_table
    
    11.4 Querying Registered Tables using DQL for Value Assistance

    Figure 11.31: Results shown when querying a registered table via DQL

    The results shown in figure 11.31 prove that the registered table has been set up correctly and can be accessed through the Query option in Value Assistance Clause within Application Builder.

  3. Go to the Value Assistance tab and click the Add Default button to enter the default set of values to be shown for the attribute.

    Select the Query radio button and enter the following DQL query in the textbox Please enter query… (refer to figure 11.32):

    select cust_odd_values, cust_even_values from dm_dbo.cust_values_table
    

    This will evaluate the values available in the registered table at run time and return the result set to the client applications. Note that Documentum internally queries the actual underlying RDBMS table at run time and not the registered table object.

    Within the Query attribute… textbox provide the registered table column name that will be used to populate the dropdown. We have set it to cust_odd_values, so that if no conditions/clauses are met, the cust_news_display_order attribute will display the following values in the dropdown: 1, 3, 5, 7.

    11.4 Querying Registered Tables using DQL for Value Assistance

    Figure 11.32: Default Value Assistance via Query option

    • After filling in the Default Value Assistance, click on the Add Conditional button and enter the conditional clauses as shown in figure 11.33. As listed in the Attribute Design table 11.15, the cust_news_display_order attribute will show the dropdown values: 1, 3, 5, 7 if the value of the attribute cust_news_is_press_rel is true and the values: 0, 2, 4, 6 if the value of the attribute cust_news_is_press_rel is false.
      • Condition/Clause: cust_news_is_press_rel = true
      • Query attribute providing data for display: cust_odd_values
      • Condition/Clause: cust_news_is_press_rel = false
      • Query attribute providing data for display:cust_even_values
    11.4 Querying Registered Tables using DQL for Value Assistance

    Figure 11.33: Value Assistance Clause popup using Query option

  4. After you have filled in the relevant data in all the necessary tabs, right-click on the object type cust_newsarticle (in the left tree pane) and choose the option Check in selected object(s) to check-in the object type (along with its attributes) in Docbase. Doing so makes the newly created attribute cust_news_display_order available in the Docbase for applications.

    The newly added attributes cust_news_summary, cust_news_is_press_rel, cust_news_ display_order, and cust_news_edit_approvers can be added in the new content properties page by customizing the default new content page. Figure 11.34 shows how the new attributes would look in the actual scenario. The necessary code changes needed to accomplish this customization are beyond the scope of this chapter. We will, however, look into this when we discuss WDK configurations in Chapter 24.

11.4 Querying Registered Tables using DQL for Value Assistance

Figure 11.34: Newly added attributes shown in properties page

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.158.177