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:
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.
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.
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.
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:
Section 44.3.3, "Step 3: Add a Flex Family Tab to WebCenter Sites's Tree"
Section 44.3.8, "Step 9: Translate the Formulaic Data Model into a Real-World Data Model"
In this step, you will create a flex family by naming its required members.
Launch the WebCenter Sites Admin interface.
On the Admin tab, expand Flex Family Maker and double-click Add New Family.
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 |
Click Continue.
In the next form, fill in the fields for each new member of the family as follows:
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.
Click in the Plural field and enter the plural form of the name used in the preceding step.
Click Add New Flex Family.
Wait for WebCenter Sites to create the flex family and return the message indicating that the flex family members (asset types) were successfully installed.
Go to the next step.
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
On the Admin tab, expand the Sites node and complete the following steps:
Expand avisports (the sample site where the flex family will be enabled), or a site of your choice.
Under that site, expand Asset Types and double-click Enable.
From the list, select the asset types that you just created (MyAsset, MyAttribute, MyFlexDefinition, MyParent, MyParentDefinition).
Click Enable Asset Types.
In the Enable Asset Types form:
Make sure that all Start Menu options are selected (so that, later, you can create and search for instances of the family members.)
Click Enable Asset Types.
Wait for WebCenter Sites to display the message indicating that the asset types have been enabled for the site.
Go to the next step.
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.
On the Admin tab, double-click the Tree node.
In the Tree Tabs form, scroll to the bottom and click Add New Tree Tab.
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 |
Click Save.
Refresh the screen.
Click the Sample Flex Family tab and make sure its contents are identical to the display below:
Go to the next step.
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
In the menu bar, click New.
From the list of options that appears, select New My Parent Definition.
In the next form:
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. |
Click the Save icon.
To create the second parent definition asset
In the menu bar, click New.
From the list of options that appears, select New My Parent Definition.
In the next form:
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. |
Click the Save icon.
Refresh the screen.
Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:
Go to the next step.
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
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Parent.
In the form that appears, fill in the fields as follows:
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. |
On top of the form, click the Save icon.
To create the second-level parent of the hierarchy
From the Content menu, choose New, then New My Parent.
In the form that appears, fill in the fields as follows:
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 |
Click the Save icon.
On the Content Tree, expand Sample Flex Family to make sure its contents are identical to the display below:
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
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
Switch to the Admin interface by clicking the Admin icon, located in the applications bar.
In the menu bar, click New.
From the list of options that appears, select New My Flex Definition.
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. |
Click the Save icon.
To create the second flex definition asset
From the button bar, click New.
From the list of options that appears, select New My Flex Definition.
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. |
Click the Save icon.
To create the third flex definition asset
From the button bar, click New.
From the list of options that appears, select New My Flex Definition.
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. |
Click the Save icon.
Refresh the screen.
Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:
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.
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
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Asset.
In the form that appears, fill in the fields as follows:
Click the Save icon.
To create the second flex asset
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Asset.
In the form that appears, fill in the fields as follows:
In the next form, click Save.
To create the third flex asset
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Asset.
In the form that appears, fill in the fields as follows:
In the next form, click the Save icon.
Refresh the screen.
Click the Sample Flex Family tab and expand its contents to make sure they are identical to the display below:
Note:
The next figure summarizes how the objects that you created, assets, relate to the flex definitions they are based upon.
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:
To create the real-world model
Rename the parent definitions as follows:
Open the Admin application.
In the Sample Flex Family Tree, right-click Level 1 Def and select Edit from the context menu.
Replace the parent's name with Level 1 Def (Type of Sports Equipment), and click the Save icon.
In the same manner, replace the name of Level 2 Def with Level 2 Def (Sport).
Rename the parents as follows:
Switch to the Contributor application.
Click Content Tree to display its contents.
In the Sample Flex Family Tree, right-click Parent 1 [Level 1] and select Edit from the context menu.
Replace the parent's name with Outdoor Sports Equipment, and click the Save icon.
In the same manner, replace the name of Parent 2 [Level 2] with Mountain Climbing. The Sample Flex Family Tree should look like this:
Rename the assets as follows:
In the Sample Flex Family Tree, expand Outdoor Sports Equipment.
Right-click Asset 1 and select Edit.
Replace the asset's name with Our Awesome Catalog, then click the Save icon.
In the same manner, expand Mountain Climbing and replace the name of Asset 2 with High Altitude Gear.
Replace the name of Asset_12 with Special Orders. The assets you renamed should look like this:
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.
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:
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Parent.
In the form that appears, fill in the fields as follows:
Click the Save icon.
Switch to the Contributor application by clicking the Contributor icon on the top.
From the Content menu, choose New, then New My Asset.
In the form that appears, fill in the fields as follows:
From the Level 2 Def drop-down, select White Watering.
Click the Save icon.
Refresh the screen and display the Sample Flex Family tree tab. Its content should be identical to the display below:
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."