44 Creating a Hierarchical Flex Family

This chapter provides a tutorial to help you create a flex family, a simple three-level hierarchy that is based on single-valued definitions (and for the time being, ignores attributes and their inheritance). When you complete the tutorial, you will have a basic understanding of the flex asset model and how it is used to create hierarchical content in WebCenter Sites. You will also have a model from which to create similar hierarchies.

Section 44.1, "Hierarchical Organization" and Section 44.2, "Flex Family Specifications" describe the flex family that you will be creating. Section 44.3, "Procedures" is a tutorial, where you will be creating a small flex family with generic names for its family members.

This chapter contains the following sections:

44.1 Hierarchical Organization

The flex family that you will be creating in this tutorial consists of three levels:

  • A top-level parent (named Parent 1 [Level 1] in our example).

  • A second-level parent (named Parent 2 [Level 2] in our example).

  • Assets, at the third level. One asset is placed directly under its level 1 parent; another asset is placed directly under its level 2 parent; the third asset is placed under both the level 1 parent and the level 2 parent.

In the WebCenter Sites interface, the hierarchy looks exactly as shown in Figure A of this graphic. The representation is formulaic; Figure B of this graphic shows how it translates to a real-world model, represented by the avisports sample site.

Description of data_model.gif follows
Description of the illustration data_model.gif

On the sample site (Figure B):

  • Parent 1 [Level 1] is named Outdoor Sports Equipment.

  • Parent 2 [Level 2] is named Mountain Climbing a subtype of Outdoor Sports Equipment.

  • Asset 1 is named Our Awesome Catalog, an asset of the type Outdoor Sports Equipment.

  • Asset_12 is named Special Offers. It appears under both Outdoor Sports Equipment and Mountain Climbing.

44.2 Flex Family Specifications

Table 44-1 lists the flex family members that you will be creating in this tutorial. Note that flex filters are optional components; they are not included in this tutorial.

Table 44-1 Flex Family Members

Flex Family Member Name Instances Based on Parent Definition Based on Flex Definition

Flex Attribute Type

My Attribute

Attribute_1Foot 1 

Attribute_2

n/a

n/a

Flex Parent Definition Type

My Parent Definition

Level 1 Def

Level 2 Def

n/a

Level 1 Def

n/a

Flex Definition Type

My Flex Definition

Flex Def 1

Flex Def 2

Flex Def_12

Level 1 Def

Level 2 Def

Level 1 Def and Level 2 Def

n/a

Flex Parent Type

My Parent

Parent 1 [Level 1]

Parent 2 [Level 2]

Level 1 Def

Level 2 Def

n/a

Flex Asset Type

My Asset

Asset 1

Asset 2

Asset_12

n/a

Flex Def 1

Flex Def 1

Flex Def_12

Flex Filter Type

n/a

n/a

n/a

n/a


Footnote 1 Suffixes 1, 2 and _12 refer to levels of the hierarchy ( _12 denotes both levels 1 and 2). For example, Asset 1 denotes an asset that is placed under level 1. Asset_12 denotes an asset that is placed under both levels 1 and 2.

44.3 Procedures

In this tutorial, you will be creating a small flex family with generic names for its family members. This approach will help you visualize the formula for building hierarchies.

At the end of this tutorial, you will change the names of selected family members to real-world names to understand how a formulaic data model translates to a business-related data model. You will also add more parents and assets to the hierarchy, giving them real-world names as you create them.

This section contains the following topics:

44.3.1 Step 1: Create a Flex Family

In this step, you will create a flex family by naming its required members.

To create the flex family

  1. Launch the WebCenter Sites Admin interface.

  2. On the Admin tab, expand Flex Family Maker and double-click Add New Family.

  3. In the Flex Family Maker form, fill in the fields exactly as shown below:

    Table 44-2 Flex Family Maker Form

    Field Name Enter Comments

    Flex Attribute

    MyAttribute

    In this step, you are naming the database tables that WebCenter Sites will create for the flex family. The names must not contain spaces.

    Flex Parent Definition

    MyParentDefinition

    n/a

    Flex Definition

    MyFlexDefinition

    n/a

    Flex Parent

    MyParent

    n/a

    Flex Asset

    MyAsset

    n/a

    Flex Filter

    n/a

    n/a


  4. Click Continue.

  5. In the next form, fill in the fields for each new member of the family as follows:

    1. Click in the Description field and enter the same name as in step 3, but separate the words in the name with spaces.

      The name that you enter will be used throughout the WebCenter Sites interface to identify the asset type.

    2. Click in the Plural field and enter the plural form of the name used in the preceding step.

    3. Click Add New Flex Family.

  6. Wait for WebCenter Sites to create the flex family and return the message indicating that the flex family members (asset types) were successfully installed.

  7. Go to the next step.

44.3.2 Step 2: Enable the New Flex Asset Types

In this step, you will enable the flex family members for the avisports sample site. You will also create start menu items for the members, so that you can create and search for their instances in subsequent steps.

Note:

If the avisports sample site is not installed on your system, you can enable the flex family for a site of your choice.

To enable the new flex asset types

  1. On the Admin tab, expand the Sites node and complete the following steps:

    1. Expand avisports (the sample site where the flex family will be enabled), or a site of your choice.

    2. Under that site, expand Asset Types and double-click Enable.

      1. From the list, select the asset types that you just created (MyAsset, MyAttribute, MyFlexDefinition, MyParent, MyParentDefinition).

      2. Click Enable Asset Types.

    3. In the Enable Asset Types form:

      1. Make sure that all Start Menu options are selected (so that, later, you can create and search for instances of the family members.)

      2. Click Enable Asset Types.

  2. Wait for WebCenter Sites to display the message indicating that the asset types have been enabled for the site.

  3. Go to the next step.

44.3.3 Step 3: Add a Flex Family Tab to WebCenter Sites's Tree

In this step, you will add a tab that tracks the creation of your flex family. You will set up this tab to display selected members of the flex family as you finish creating them.

To add the tree tab

  1. On the Admin tab, double-click the Tree node.

  2. In the Tree Tabs form, scroll to the bottom and click Add New Tree Tab.

  3. In the Add New Tree Tab form, fill in the fields as follows:

    Table 44-3 Add New Tree Tab Form

    Field Name Enter or Select Comments

    Title

    Sample Flex Family

    Name of the tab.

    Tooltip

    Sample Flex Family

    Description of the tab.

    Sites

    avisports (or the site you chose in Section 44.3.2, "Step 2: Enable the New Flex Asset Types")

    Site on which to enable the flex family.

    Required Roles

    Any

    n/a

    Tab Contents

    My Parent Definition

    My Parent

    My Flex DefinitionMy Asset

    Note: Click Add Selected Items and use the Display Order arrow to arrange the members in the order shown above.

    n/a


  4. Click Save.

  5. Refresh the screen.

  6. Click the Sample Flex Family tab and make sure its contents are identical to the display below:

    Description of hierarch-tree-tab.png follows
    Description of the illustration hierarch-tree-tab.png

  7. Go to the next step.

44.3.4 Step 5: Create Parent Definition Assets

In this step, you will create two parent definitions. The first parent definition establishes the top level of the hierarchy; the second parent definition establishes the second level.

To create the first parent definition asset

  1. In the menu bar, click New.

  2. From the list of options that appears, select New My Parent Definition.

  3. In the next form:

    1. Fill in the fields as follows:

      Table 44-4 New My Parent Definition Form

      Field Name Enter or Select Comments

      Name

      Level 1 Def

      This is our name for the definition of the first level of the hierarchy.

      Description

      Level 1 Def

      n/a

      Parent Select Style

      Select Box

      n/a

      My Parent Definitions

      n/a

      No parent definitions are selected (or available) in this field. Therefore, this parent definition establishes the first level of the hierarchy.


    2. Click the Save icon.

To create the second parent definition asset

  1. In the menu bar, click New.

  2. From the list of options that appears, select New My Parent Definition.

  3. In the next form:

    1. Fill in the fields as follows:

      Table 44-5 New My Parent Definition Form

      Field Name Enter or Select Comments

      Name

      Level 2 Def

      This is our name for the definition of the second level of the hierarchy.

      Description

      Level 2 Def

      n/a

      Parent Select Style

      Select Box

      n/a

      My Parent Definitions

      Level 1 Def

      Note: Under Single Value, click the Required arrow to move your selection to the Selected list.

      Choosing Level 1 Def subordinates the current parent definition to Level 1 Def. Chaining definitions in this manner establishes Level 2 Def as the second level.

      When parents are created and based on the current parent definition (Level 2 Def), they are subordinated to parents that are based on Level 1 Def.


    2. Click the Save icon.

  4. Refresh the screen.

  5. Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:

    Description of hierarch-parent-defs.png follows
    Description of the illustration hierarch-parent-defs.png

  6. Go to the next step.

44.3.5 Step 6: Create Flex Parent Assets

In this step, you will create two flex parent assets, and base them on the flex parent definitions that you created in the previous step. The first parent asset will occupy the top level of the hierarchy. The second parent asset will occupy the second level of the hierarchy.

To create the top-level parent of the hierarchy

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Parent.

  3. In the form that appears, fill in the fields as follows:

    Table 44-6 New My Parent Form

    Field Name Enter or Select Comments

    Name

    Parent 1 [Level 1]

    This is our name for a level 1 parent in the hierarchy (in our example, the name is genericized simply to help you identify the level).

    Note: At the end of this tutorial, you will change the name to a business-specific name (Outdoor Sports Equipment, in our example, which describes the inventory of a company dealing with sports gear.)

    My Parent Definition

    Level 1 Def

    Choosing Level 1 Def places the parent you are creating at the top level of the hierarchy.


  4. On top of the form, click the Save icon.

To create the second-level parent of the hierarchy

  1. From the Content menu, choose New, then New My Parent.

  2. In the form that appears, fill in the fields as follows:

    Table 44-7 New My Parent Form

    Field Name Enter or Select Comments

    Name

    Parent 2 [Level 2]

    This is our name for a level 2 parent in the hierarchy (in our example, the name is genericized simply to help you identify the level).

    Note: At the end of this tutorial, you will change the name to a business-specific name, Mountain Climbing in our example (an appropriate name given that Parent 1 [Level 1] is Sports Equipment).

    My Parent Definition

    Level 2 Def

    Selecting Level 2 Def places the parent you are creating at the second level of the hierarchy.

    Level 1 Def

    Parent 1 [Level 1] is selected by default.

    n/a


  3. Click the Save icon.

  4. On the Content Tree, expand Sample Flex Family to make sure its contents are identical to the display below:

    Description of hierarch-parents.png follows
    Description of the illustration hierarch-parents.png

    Note:

    Before going to the next step, review Figure 44-1. The figure summarizes how the objects that you created, parent definitions and parents based on the definitions, relate to each other.

    Figure 44-1 Parents and Parent Definitions

    Description of Figure 44-1 follows
    Description of "Figure 44-1 Parents and Parent Definitions"

44.3.6 Step 7: Create Flex Definition Assets

In this step, you will create three flex definition assets:

  • The first flex definition asset will be used to place assets under Parent 1 [Level 1].

  • The second flex definition asset will be used to place assets under Parent 2 [Level 2].

  • The third flex definition asset will be used to place the asset under both levels of the hierarchy.

To create the first flex definition asset

  1. Switch to the Admin interface by clicking the Admin icon, located in the applications bar.

  2. In the menu bar, click New.

  3. From the list of options that appears, select New My Flex Definition.

  4. In the form that appears, fill in the fields as follows:

    Table 44-8 New My Flex Definition Form

    Field Name Enter or Select Comments

    Name

    Flex Def 1

    n/a

    My Parent Definitions

    Level 1 Def

    Note: Under Single Value, click the Required arrow.

    Choosing Level 1 Def and Single Value means that when you use the current flex definition to create flex assets, the assets can be placed under only one parent that use Level 1 Def as its parent definition. In our example, the asset will be placed under Parent 1 [Level 1].

    Note: Selecting a Multiple Values option would allow you to place the asset under any and all parents that use Level 1 Def as their parent definition.


  5. Click the Save icon.

To create the second flex definition asset

  1. From the button bar, click New.

  2. From the list of options that appears, select New My Flex Definition.

  3. In the form that appears, fill in the fields as follows:

    Table 44-9 New My Flex Definition Form

    Field Name Enter or Select Comments

    Name

    Flex Def 2

    n/a

    My Parent Definitions

    Level 2 Def

    Note: Under Single Value, click the Required arrow.

    Choosing Level 2 Def and Single Value means that when you use the current flex definition to create flex assets, the assets can be placed under only one parent that uses Level 2 Def as its parent definition. In our example, the asset will be placed under Parent 2 [Level 2].

    Note: Selecting a Multiple Values option would allow you to place the asset under any and all parents that use Level 2 Def as their parent definition.


  4. Click the Save icon.

To create the third flex definition asset

  1. From the button bar, click New.

  2. From the list of options that appears, select New My Flex Definition.

  3. In the form that appears, fill in the fields as follows:

    Table 44-10 New My Flex Definition Form

    Field Name Enter or Select Comments

    Name

    Flex Def_12

    n/a

    Parent Definitions

    Level 1 Def

    Level 2 Def

    Note: Under Single Value, click the Required arrow.

    Choosing Level 1 Def and Level 2 Def and Single Value means that when you use the current flex definition to create flex assets, the assets will be placed under only one parent that uses Level 1 Def and under only one parent that uses Level 2 Def as parent definitions.

    In our example, the assets will be placed under Parent 1 [Level 1] and Parent 2 [Level 2]).

    Parent Definitions (continued)

    n/a

    Note: Selecting a Multiple Values option would allow you to place the asset under any and all parents that use Level 1 Def and Level 2 Def as their parent definitions.


  4. Click the Save icon.

  5. Refresh the screen.

  6. Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:

    Description of hierarch-asset-defs1.png follows
    Description of the illustration hierarch-asset-defs1.png

    Note:

    Before going to the next step, review Figure 44-2, which depicts the Sample Flex Family structure as it appears in the Contributor application. This figure summarizes how the objects that you created, flex definitions, relate to the parent definitions they are based upon.

44.3.7 Step 8: Create Flex Assets

In this step, you will complete the flex family by adding the third level of the hierarchy; the flex assets. You will create three assets:

  • The first asset you will place under Parent 1 [Level 1].

  • The second asset you will place under Parent 2 [Level 2].

  • The third asset you will place under both Parent 1 [Level 1] and Parent 2 [Level 2].

To create the first flex asset

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Asset.

  3. In the form that appears, fill in the fields as follows:

    Table 44-11 New My Asset Form

    Field Name Enter or Select Comments

    Name

    Asset 1

    n/a

    My Flex Definition

    Flex Def 1

    Choosing Flex Def 1 will place the asset you are creating under Parent 1 (Level 1].


  4. Click the Save icon.

To create the second flex asset

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Asset.

  3. In the form that appears, fill in the fields as follows:

    Table 44-12 New My Asset Form

    Field Name Enter or Select Comments

    Name

    Asset 2

    n/a

    My Flex Definition

    Flex Def 2

    Choosing Flex Def 2 will place the asset you are creating under Parent [Level 2].


  4. In the next form, click Save.

To create the third flex asset

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Asset.

  3. In the form that appears, fill in the fields as follows:

    Table 44-13 New My Asset Form

    Field Name Enter or Select Comments

    Name

    Asset_12

    n/a

    Flex Definition

    Flex Def_12

    Choosing Flex Def_12 will place the asset you are creating under both Parent [Level 1] and Parent [Level 2].


  4. In the next form, click the Save icon.

  5. Refresh the screen.

  6. Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:

    Figure 44-2 Sample Flex Family Structure

    Description of Figure 44-2 follows
    Description of "Figure 44-2 Sample Flex Family Structure"

    Note:

    The next figure summarizes how the objects that you created, assets, relate to the flex definitions they are based upon.

    Description of flex_def.gif follows
    Description of the illustration flex_def.gif

44.3.8 Step 9: Translate the Formulaic Data Model into a Real-World Data Model

In this step, you will rename the parent definitions, parents, and assets in order to translate the formulaic data model you just created into a real-world model. (In practice, instead of renaming flex family members, you would name them directly in their business context, as you create them.)

In our example, the real-world model describes a business that deals with sports gear. The flex parents and assets, after you finish renaming them, will be listed in your Content Tree tab as shown in the figures below:

Description of hierarch-realworld1.png follows
Description of the illustration hierarch-realworld1.png

To create the real-world model

  1. Rename the parent definitions as follows:

    1. Open the Admin application.

    2. In the Sample Flex Family Tree, right-click Level 1 Def and select Edit from the context menu.

    3. Replace the parent's name with Level 1 Def (Type of Sports Equipment), and click the Save icon.

    4. In the same manner, replace the name of Level 2 Def with Level 2 Def (Sport).

  2. Rename the parents as follows:

    1. Switch to the Contributor application.

    2. Click Content Tree to display its contents.

    3. In the Sample Flex Family Tree, right-click Parent 1 [Level 1] and select Edit from the context menu.

    4. Replace the parent's name with Outdoor Sports Equipment, and click the Save icon.

    5. In the same manner, replace the name of Parent 2 [Level 2] with Mountain Climbing. The Sample Flex Family Tree should look like this:

      Description of l_h_rename-parents.png follows
      Description of the illustration l_h_rename-parents.png

  3. Rename the assets as follows:

    1. In the Sample Flex Family Tree, expand Outdoor Sports Equipment.

    2. Right-click Asset 1 and select Edit.

    3. Replace the asset's name with Our Awesome Catalog, then click the Save icon.

    4. In the same manner, expand Mountain Climbing and replace the name of Asset 2 with High Altitude Gear.

    5. Replace the name of Asset_12 with Special Orders. The assets you renamed should look like this:

      Description of l_h_rename-assets.png follows
      Description of the illustration l_h_rename-assets.png

44.3.9 Step 10: Develop Your Real-World Model

In this step, you will develop your data model by creating a new parent and its asset, giving each a real-world name. You will do the following:

  • Create a second level-2 parent and name it White Watering.

  • Create the parent's asset (a catalog) and name it Rafts, Canoes, and Kayaks. Expand White Watering to display its asset.

    Description of l_h_realworld_final.png follows
    Description of the illustration l_h_realworld_final.png

    Note:

    At the conclusion of this procedure are suggestions for further developing the real-world model, using advanced techniques. Our example illustrates the creation of n:1 parent-child relationships through the use of multi-valued parent and flex definitions. Guidelines, rather than step-by-step instructions are provided to help you through the development process and let you test your understanding of the process.

If you need instructions for developing your model, follow the steps below:

To create the level-2 parent:

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Parent.

  3. In the form that appears, fill in the fields as follows:

    Table 44-14 New My Parent Form

    Field Name Value

    Name

    White Watering

    My Parent Definition

    Level 2 Def (Sports)


  4. Click the Save icon.

To create the parent's asset:

  1. Switch to the Contributor application by clicking the Contributor icon on the top.

  2. From the Content menu, choose New, then New My Asset.

  3. In the form that appears, fill in the fields as follows:

    Table 44-15 New My Asset Form

    Field Name Value

    Name

    Rafts, Canoes, and Kayaks

    My Flex Definition

    Flex Def 2


  4. From the Level 2 Def drop-down, select White Watering.

  5. Click the Save icon.

  6. Refresh the screen and display the Sample Flex Family tree tab. Its content should be identical to the display below:

    Description of l_h_realworld_final.png follows
    Description of the illustration l_h_realworld_final.png

44.4 Next Steps

At this point you have created a rudimentary data model. From here, you can expand the data model by creating additional parents to occupy a given level, creating additional levels (by chaining flex parent definitions), and so on. You can also create associations among assets, write template code to format the assets, and test the publishing options that display the assets to site visitors. For information on these operations, see Chapter 16, "Designing Flex Asset Types."