16 Designing Flex Asset Types

As discussed in Chapter 11, "Data Design: The Asset Models," the data model for flex asset types can be thought of in terms of a family of asset types, with each asset type in the family having several database tables.

You create new flex asset types with the Flex Family Maker utility. However, when working with the flex asset model, developers not only create the flex asset types, they also create the individual data structure assets of those types. That is, flex attributes, flex parent definitions, flex definitions, and flex parent assets.

Typically, you design the flex asset types and create the data structure assets on a development system. Then when your data model is ready, you migrate your work from the development system to the management and delivery systems.

This chapter contains the following sections:

16.1 Design Tips for Flex Families

Your job when designing your flex family is to create a data structure that meets the needs of two audiences:

  • The visitors to your online site (that is, the users of your delivery system)

  • The content providers who enter data into the WebCenter Sites database (that is, the users of the management system)

This section contains the following topics:

16.1.1 Visitors on the Delivery System

The experience of the visitors to your online site is based on the following asset types:

  • flex asset

  • flex attribute

Your online site pages display flex assets (assetsets) for the visitors through queries that are based on attribute values (searchstates). For more information see Section 11.4, "Assetsets and Searchstates." You use attribute values as the basis for drill-down searches that can give the appearance of a hierarchy on your online site if that is the look and feel that you want.

16.1.2 Users on the Management System

The users of your management system navigate through a visual hierarchical structure that you create for them with the following flex asset types:

  • flex parent definition

  • flex definition

  • flex parent

Although the organizational structure that you create with these asset types does affect the data, it determines which attribute values are inherited by which flex assets, its biggest impact is on the users of the management system.

You are not required to use flex parents and flex parent definitions, but their inheritance properties make them a valuable tool for users who are maintaining a large amount of data such as an online catalog:

  • Changing an attribute value at the parent level changes that value for all the flex assets who are children of that parent, which means you only have to change the value once.

  • Inherited attribute values are values that aren't subject to user error during data entry, which means less data cleanup is required.

The inheritance tree that you create for your content providers has no bearing on how your site visitors navigate the online site you are designing. For example, if content is entered into your management system through some completely automated process (perhaps it is bulk loaded from an ERP system) you would have no need for parent asset types at all, yet you can still create drill-down searches on your online site.

16.1.3 How Many Attribute Types Should You Create?

As described in Section 11.4, "Assetsets and Searchstates," only the flex assets that share a common attribute type can belong to the same assetset because queries (searchstates) are based on attributes and not on the organizational constructs of parent definitions and flex definitions.

Therefore, when you design your data structure, remember that if you organize your data to use separate types of attributes, you might create a nicely delineated interface on the management system, but that data cannot be synthesized well on the delivery system and that is rarely what you want.

As a general rule, you should create one type of attribute for your system. If you need to, you can create more than one version of the rest of the family members (the flex asset type, flex definition type, flex parent type, and flex parent definition type), but they should still share the same pool of attributes.

For example, if the GE Lighting sample site had been designed such that the product family and the content family shared the same attribute type, you would be able to create assetsets that contained a product and a corresponding article about that product.

16.1.4 Designing Flex Attributes

Before you begin creating attributes, design them on paper. Determine all the attributes you need and decide where they will appear, with flex assets or the flex parents.

Start by planning out the bottom level of your hierarchy (that is, the individual instances of flex asset types like products) and determine the attributes you need for each item at that level. For example, if you plan to create flex filter assets, determine which attributes need to be created and assigned to the definitions as the input and output attributes for your filters.

You must determine all of the flex attributes that you need before you begin creating them because the way you plan to use them creates dependencies that you must account for when you create them.

16.1.4.1 Which Data Types

Assess the data types that are available for attributes and the default input types for those data types. Determine which data types will work best for which attributes. If you want to change the default input style for an attribute, you create an attribute editor for it before you create the attribute. See Chapter 18, "Designing Attribute Editors."

When you create a flex asset that uses an attribute of type blob, the format of the value entered for the attribute on an Inspect form depends on its type. For example, a text file shows the first 200 bytes in the file. An image file appears as a thumbnail image. And some files cannot be displayed at all. In this case, WebCenter Sites displays the message "filename not displayable" but the file location is still successfully recorded.

16.1.4.2 Using Attribute Editors

The default input type for an attribute depends on the data type that you select for it. If you do not want to use the default input type, you can create an attribute editor for the attribute.

Creating flex assets and their attribute editors is an iterative process. You can create the attribute editors first or you can create the attributes first and then go back and assign the attribute editors after you have created them. The process of creating attribute editors is described in Chapter 18, "Designing Attribute Editors."

Attributes of Type Blob

The default input style of an attribute of type blob is a text field with a Browse button. You use the Browse button to locate and select a file and WebCenter Sites uploads it to the default storage directory. You cannot use the WebCenter Sites forms to edit the contents of the file.

If you want to be able to enter content directly into the external file through the WebCenter Sites forms, you must assign an attribute editor to the attribute:

  • If you use an attribute editor that uses the TEXTAREA input style, you can create a field that can hold up to 2,000 characters (entered through the forms); when saved, that content is written to the default storage directory.

  • If you have CKEditor, you can use a CKEDITOR field to edit the contents of the external file that the attribute represents.

Attributes of Type Asset

The default input style for an attribute of type asset is a drop-down list of all the assets of the type specified. An unfiltered drop-down list is not recommended if you have more than 20 assets of that type.

In general, whenever you create an attribute of type asset, you should assign it an attribute editor.

  • An attribute editor that uses the PICKASSET style checks to find out whether the tree is toggled on or off in the WebCenter Sites interface. If the tree is on, the user can select an asset from a tab in the tree. If the Tree is toggled off, the attribute editor displays a dialog box that lists the assets from the Bookmarks and History tabs.

  • Another option is to use the PULLDOWN style but to supply a query asset that limits the options that appear in the list.

  • If the number of assets that are valid choices is small, you can also use the CHECKBOXES or the RADIOBUTTONS input style, both of which require a query asset to identify the assets.

16.1.4.3 Where Will Each Attribute Be Used?

After you have determined the list of attributes, determine whether you plan to use them in a flex definition or a flex parent definition. Sort them logically by using the following guidelines:

  • If an attribute's value is unique to an individual flex asset (product, article, image, for example), the attribute belongs at the bottom of the tree, with the flex asset.

  • If an attribute's value is the same for multiple flex assets, the attribute belongs in a parent. (Of course there are always exceptions. For example, even if a toaster costs the same amount as a bowling ball, it is unlikely that they would inherit their prices from a common parent.)

  • Based on that attribute distribution, you can determine how many flex definitions you need and how many parent definitions you need.

Remember that there is both a physical limit (based on your DBMS) and a psychological limit (user satisfaction) as to how many attributes you can or should use in an individual flex asset or flex parent. Someone has to enter all those values. Be sure to create and then assign to the definitions only those attributes that you really plan to use. It is very easy to add attributes in the future if you decide that you need additional ones.

16.1.4.4 Dependencies Imposed by Hierarchy

After you know where an attribute will be used, you can determine whether hierarchical concerns add requirements to the attribute. For example, if an attribute is to used by a flex parent and your data structure allows flex assets to have more than one parent, the attribute must be configured to hold multiple values because a flex asset might inherit more than one value for it.

In general, try not to make the inheritance structure too complex.

16.1.5 How Many Definition Types Should You Create?

The appearance and input of data on the management system is based on the flex asset definitions and the flex parent definitions. Parents and flex assets appear on tabs in the tree in the WebCenter Sites interface based on the hierarchy that you create through the definitions.

In general, it is best to create a separate set of definition types for each flex asset member in a family.

For example, the GE Lighting sample site has two flex asset members in the content family: article (flex) and image (flex). They share parents, parent definitions, and flex definitions. This means that some attributes are left blank for the image assets because they don't apply and some attributes are left blank for the article assets because they don't apply.

It would be better to have article parents, article definitions, and article parent definitions that are different from image parents, image definitions, and image parent definitions. But they should absolutely share the same attribute type, which they do.

16.1.6 Designing Parent Definition and Flex Definition Assets

The hierarchy on the tabs in the tree in the WebCenter Sites interface is created through the flex parent definitions and flex definitions:

  • To set a hierarchy three levels deep, you need at least two parent definitions and at least one flex definition.

  • To specify a hierarchy two levels deep, you need at least one parent definition and at least one flex definition.

Be sure to consider the basic tenets of usability when you set up a structural hierarchy with the flex definitions and flex parent definitions. For example:

  • How deep can the hierarchy go before the content providers feel lost in the tree?

  • How many attribute values can be inherited to alleviate the possibility of user error during input?

  • How many options can be comfortably displayed in a drop-down list?

If you create a system that is overly difficult to use, the content providers will complain.

16.1.6.1 Determining Hierarchical Place

Open WebCenter Sites, log in to the GE Lighting sample site, and examine the form for a new product parent definition or for a new product definition.

In the Parent Definition section of these forms, you determine two things:

  • The hierarchical position of the assets that use this definition and determine

  • The parents that they can inherit attributes from

Remember that although the hierarchical position has meaning only in the Contributor interface on the management system, the attributes that they inherit have meaning both on the management system and on your online site.

The text box named Available lists all the existing parent definitions. You use this section of the form to specify how many parents are possible by selecting parent definitions from the Available list and moving it to the Selected list.

When you create a parent asset or a flex asset, the New form displays a drop-down field for each definition that you selected from the Available list when you created the definition that you are using to create the new parent or flex asset. The drop-down list in the New form displays all the parents that were created with that definition.

If the parent that is selected in the New form has any attribute values, the asset inherits them.

How many possible parents should you allow? In general, it is best to keep this simple. The more parent definitions you select from the Available list, the more fields the content providers have to fill out when they create a new flex asset.

If you do not select a parent definition in the Available list, it means that assets created with this definition are positioned at the top level of the tree on the tab that displays your flex assets.

The best way to understand how parent definitions, flex definitions, parent assets, and flex assets interact is to examine the assets delivered with the GE Lighting sample site.

16.1.6.2 Determining Attribute Inheritance

You configure attribute inheritance in the Attributes section of the parent definition form. You use that section to specify the attributes that define the parents that are created with this definition.

When you create a parent with this definition, the values that are entered for these attributes are passed down to the flex assets that are children of the parent asset.

16.1.6.3 How Many Flex Parent Definition Assets?

The simple answer is "as many as you need." Be sure to consider usability when you decide how many flex parent definition assets you need, and how many parent assets of those definitions that you need.

If you create many parent definitions, it probably means that you will have fewer parents created with each definition, which leads to shorter drop-down lists in the new parent and new flex asset forms. Short drop-down lists make it easier for content providers to select the correct parent from the list.

However, if your data needs require you to have a small number of parent definitions and a large number of parents, create a tab that lists all the parents so the content providers can select the correct parent asset from the tab.

16.1.6.4 How Many Flex Definition Assets?

A general rule is this: create enough flex definitions so that fields (attributes) are not left blank on the New and Edit flex asset forms.

If you create too few definitions, you run the risk of creating long forms with lots of attribute fields, not all of which apply for each asset. When you have long forms with lots of attribute fields, not only do content providers have to sort through the form to determine which attributes apply to the asset they are currently creating, the form takes a long time to be rendered in the user's browser.

16.1.7 Summary

Keep the following rules in mind as you design the data structure with a flex family for your online site:

  • Carefully planned, easy-to-use asset design (data design) makes content providers happy.

  • Usable layout and efficient code makes site visitors happy.

And both user groups need efficient systems that perform well.

16.2 The Flex Family Maker Utility

When you create a flex family with Flex Family Maker, it does the following:

  • Creates several database tables (the number depends on which flex asset types that you create).

  • Writes information about the new flex family to the following tables:

    • FlexAssetTypes, which holds a row for each flex asset member type

    • FlexGrpTmplTypes, which holds a row for each flex parent definition type

    • FlexGrpTypes, which holds a row for each flex parent type

    • FlexTmplTypes, which holds a row for each flex definition type

  • Creates new directories in the ElementCatalog table using the following naming convention:

    OpenMarket/Xcelerate/AssetType/NameOfYourAssetType

  • Copies elements from the ElementCatalog table to the directories in created for your asset types. WebCenter Sites use these elements to format the New, Edit, Inspect, Search, and Search Results forms for assets of that type.

For information about the main database tables for flex assets and flex parent assets, see Section 11.3.6, "Flex Families and the Database." For information about all the database tables in a flex family, see the Oracle Fusion Middleware WebCenter Sites Database Schema Guide.

The Flex Asset Elements

When you create a new flex asset type, Flex Family Maker copies elements to the following location in the ElementCatalog table:

OpenMarket/Xcelerate/AssetType/NameOfAssetType

For example, the GE sample site product asset elements are in:

OpenMarket/Xcelerate/AssetType/Products

It also creates a SQL statement that the search elements use and places it in the SystemSQL table under OpenMarket/Xcelerate/AssetType/NameOfAssetType.

For a description of the elements and the SQL statement that Flex Family Maker copies for you, see Section 15.1.4, "Elements and SQL Statements for the Asset Type." The elements for flex assets are the same as the elements for the basic assets with the exception of the AppendSelectDetailsSE element.

16.3 Creating a Flex Asset Family

When you are using the flex asset data model to represent the content you want to display on your online site, you and the other developers do not create only the flex asset types. You also create the individual data structure assets of those types: flex attributes, flex parent definitions, flex definitions, and flex parent assets.

This section contains the following topics:

16.3.1 Overview of Creating a New Flex Asset Type or Family of Flex Asset Types

Following is an overview of the process for creating a new flex asset type or family of flex asset types. Where you start in the process depends how many asset types you need to design. If you can base your data structure on either of the sample site flex families, you do not have to create an entire flex family, you can create only the new members that you need.

This chapter describes each of the following steps in the process, except as noted:

  1. Create the new flex family (Section 16.3.3, "Step 1: Create a Flex Family").

  2. Create additional flex family members, as necessary (Section 16.3.4, "Step 2: (Optional) Create Additional Flex Family Members").

  3. Enable the new asset types on all the WebCenter Sites sites on the development system (Section 16.3.5, "Step 3: Enable the New Flex Asset Types") and create Start Menu shortcuts for all the new asset types. Also, place the new flex definition, flex parent definition, and attribute types on the Design tab, and create a tab for your new flex parent and flex asset types.

  4. Create the flex attributes and design your attribute editors (Section 16.3.6, "Step 4: Create Flex Attributes"). For more information about attribute editors, see Chapter 18, "Designing Attribute Editors."

  5. (Optional) Create the flex filter assets (Section 16.3.7, "Step 5: (Optional) Create Flex Filter Assets"). For more information about flex filters, see Chapter 17, "Flex Filters."

  6. Create the flex parent definitions (Section 16.3.8, "Step 6: Create Parent Definition Assets").

  7. Create the flex definition assets (Section 16.3.9, "Step 7: Create Flex Definition Assets").

  8. Create the flex parent assets (Section 16.3.10, "Step 8: Create Flex Parent Assets").

  9. Create and assign icons that will represent the members of your flex family in search results lists that are displayed in the Thumbnail view (Section 16.3.11, "Step 9: Create and Assign Asset Type Icons (Contributor Interface Only)").

  10. Create templates for the flex assets, the flex member of the flex family (Section 16.3.12, "Step 10: Code Templates for the Flex Assets").

  11. Test your design by creating enough flex assets to examine the data structure that you have designed (Section 16.3.13, "Step 11: Test Your Design (Create Test Flex Assets)").

  12. (Optional). Create flex asset associations (Section 16.3.14, "Step 12 (Optional): Create Flex Asset Associations").

  13. Move your asset types to other systems (management and delivery; Section 16.3.15, "Step 13: Move the Asset Types to Other Systems"). This step is described in the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.

16.3.2 Before You Begin

Set up your development system and get access to it, as follows:

  • Create the appropriate WebCenter Sites sites.

  • Create a user name for yourself that has administrator rights, and enable that user name on all of the sites on your development system. Note that without administrator rights, you do not have access to the Admin tab, which means that you cannot perform some of the procedures in this chapter.

    For the sake of convenience, assign the Designer and GeneralAdmin roles to your user name. That way you will have access to all the tabs in the WebCenter Sites interface and all of the existing Start Menu shortcuts for the assets in the sample site. (Be sure that the TableEditor ACL is assigned to your user name.)

For information about these tasks, see the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.

16.3.3 Step 1: Create a Flex Family

To create a new flex family

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Admin interface.

  4. Select the Admin tab.

  5. Expand Flex Family Maker and click Add New Family.

    The Add New Flex Family form appears:

    Description of l_flex_family_small.png follows
    Description of the illustration l_flex_family_small.png

  6. For Flex Attribute, enter the name of the new flex attribute asset type.

    The name you enter in this field is the internal name of the new attribute asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  7. For Flex Parent Definition, enter the name of the new flex parent definition asset type.

    The name you enter in this field is the internal name of the new parent definition asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  8. For Flex Definition, enter the name of the new flex definition asset type.

    The name you enter in this field is the internal name of the new flex definition asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  9. For Flex Parent, enter the name of the new flex parent asset type.

    The name you enter in this field is the internal name of the new parent asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  10. For Flex Asset, enter the name of the new flex asset type.

    The name you enter in this field is the internal name of the new flex asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  11. For Flex Filter, enter the name of the new flex filter asset type.

    The name you enter in this field is the internal name of the new flex filter asset type. It becomes the name of the core table for this asset type and the prefix for all its auxiliary tables.

  12. Click Continue.

    Flex Family Maker displays the following form:

    Description of l_family_next_small.png follows
    Description of the illustration l_family_next_small.png

  13. For each new member of the family, click in the Description field and enter the external name of the asset type, that is, the name of the asset type when it is displayed in WebCenter Sites. This is the name that appears on the forms (New, Edit, Inspect, and so on).

  14. For each new member of the family, click in the Plural field and enter the plural version of its name. This version is used in status messages and so on when appropriate.

  15. Click Add New Flex Family.

    Flex Family Maker creates the database tables that will store assets of these types. For information about these tables, see Section 11.3.6, "Flex Families and the Database."

    It also copies elements that format the forms for assets of these types to a directory with the name of the asset type in the ElementCatalog and SystemSQL tables.

16.3.4 Step 2: (Optional) Create Additional Flex Family Members

If you need to create additional flex family members (for example, if you need more than one flex asset type per member category), do the following:

  1. In the Admin tab, expand the flex family you just created.

  2. Drill down the flex family tree until you reach the category (flex parent for example) for which you want to create another member.

  3. Under the desired member category, double-click Add New Member Category Asset Type.

  4. WebCenter Sites displays the New Member Category Asset Type form.

  5. In the form, fill out the required fields and click Save.

    WebCenter Sites displays a message confirming that the asset type was created.

  6. Repeat this procedure for each additional flex family member you want to create.

16.3.5 Step 3: Enable the New Flex Asset Types

Before you can start creating assets (attributes, flex parent definitions, and so on), you must complete some steps on the Admin tab so that you have access to them. Note that your login must grant you administrator rights in order for you to have access to the Admin tab.

Complete the following steps:

  1. On the Admin tab, click the Sites icon and complete the following steps:

    1. Select the site that you are going to use to work with this asset type.

    2. Under that site, select Asset Type and then Enable Asset Types.

    3. Select your new asset types from the list and click Enable Asset Types.

    4. WebCenter Sites can automatically create a New Start Menu Item and/or a Search Start Menu Item for the Asset Types you are enabling. Check the box next to any available Start Menu Item that you would like WebCenter Sites to create.

      Description of l_asset_types_small.png follows
      Description of the illustration l_asset_types_small.png

      If you choose not to generate these menu items at this time, you or your site administrator must manually create them later (no one can create assets of the enabled asset types until Start Menu items are created for them).

    5. Repeat steps a through d for each appropriate site.

  2. Click Enable Asset Types.

  3. The asset types are now enabled for the site(s). If you did not use WebCenter Sites to generate start menu items, you or your site administrator must now manually create them. As the developer of the asset types and the designer of the online site, your responsibility is to let the administrator know enough about your asset and site design that the site administrator can configure meaningful Start Menu items.

    You (the developers) must let the site and system administrators know which fields are used by the queries, collections, or other design elements for your online site so that they can create meaningful Start Menu items for the content providers. For more information about creating Start Menu items, see the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.

After you or your administrator has created Start Menu items for your new asset types, you can create assets of these types. Note that even if you add your asset types to a tab, you will not be able to create new assets until you have created Start Menu shortcuts for them.

16.3.6 Step 4: Create Flex Attributes

Because the steps that you follow can differ significantly based on the data type that you select for your attribute, this section presents several procedures:

  • A basic procedure for creating attributes of most data types

  • Creating attributes of type blob

  • Creating attributes of type asset

  • Creating foreign attributes (that is, attributes that are stored in a foreign table). You must register the foreign table that contains the data you wish to use as a flex attribute. For information, see Section 12.3.4, "Registering a Foreign Table."

16.3.6.1 Creating Flex Attributes: Basic Procedure

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

    Select the Admin interface.

  3. Click New and select the name of your attribute type from the list of shortcuts. For example, New Product Attribute. If the workflow associate with this asset requires you to select assignees, select at least one user from each role and click Set Assignees.

    The new attribute form displays.

    Description of l_attribute_small.png follows
    Description of the illustration l_attribute_small.png

  4. Click in the Name field and enter a name of up to 64 characters, excluding spaces.

  5. Click in the Description field and enter a short, descriptive phrase that describes the use or function of the attribute.

  6. Click in the Value Type field and select a data type for this attribute.

    If you need help deciding which data type is appropriate for your attribute, see Section 11.3.3.1, "Data Types for Attributes."

  7. Click in the Number of Values field and select either single or multiple from the drop-down list, as appropriate for the data type that you selected in the Value Type field.

    If this attribute is to be used by a flex parent and your data structure allows multiple flex parents for a flex asset, you must select multiple because the flex assets that inherit values for this attribute might inherit a value from more than one parent.

    Note:

    When an attribute is configured to accept multiple values, it appears on the flex parent and flex asset forms as a field with an Add Another attribute name button.

    If you want the attribute to accept multiple values for inheritance reasons but you do not want content providers to select more than one value for the attribute for individual parents or flex assets, assign the attribute an attribute editor that presents it as a single-value field (but select multiple in the Value Type field).

    WebCenter Sites does not allow attributes of type text to have multiple values, due to the way these attributes are stored in the database. A message denoting this restriction appears if you attempt to save an attribute configured in such a way.

  8. (Optional) If you do not want to use the default input type for this attribute (which is based on the data type that you selected in the Value Type field), click in the Attribute Editor field and select one from the drop-down list.

    If you need more information:

    For a list of the default input types (so you can determine whether you want to use an attribute editor instead), see Section 11.3.3.2, "Default Input Styles for Attributes."

    For information about creating attribute editors, see Chapter 18, "Designing Attribute Editors."

    For information about which attribute editors are appropriate for the data type of this attribute, see Section 18.1.2, "The Attribute Editor Asset."

  9. (Optional) If you need to override the default ISO character set (ISO 8859-1), click in the ISO Character Set field and enter the one you want to use for this attribute.

  10. Click Save.

16.3.6.2 Creating Flex Attributes of Type Blob (Upload Field)

To create an attribute of type blob

  1. Complete steps 1 through 4 in Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

  2. Click in the Value Type field and select blob.

  3. (Optional) Click in the Folder field and enter a path to the directory that you want to store the attribute values in. Note that the value that you enter in this field is appended to the value set as the default storage directory (defdir) for the MungoBlobs table.

  4. Click in the Number of Values field and select single or multiple, as appropriate. For more information about this field, see Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

  5. (Optional) If you do not want to use the default input type (a Browse button), click in the Attribute Editor field and select one of the following:

    • An attribute editor that specifies the TEXTAREA input style. For information about attribute editors, see Section 18.1.2, "The Attribute Editor Asset."

    • If your system is configured to use CKEditor, an attribute editor that specifies the CKEDITOR input style.

  6. Complete steps 8 and 9 of Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

16.3.6.3 Creating Flex Attributes of Type Asset

To create an attribute of type asset

  1. Complete steps 1 through 4in Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

  2. Click in the Value Type field and select asset.

  3. Click in the Asset Type field and select an option from the drop-down list.

  4. Click in the Mirror Dependency Type field and select a dependency type.

  5. Click in the Number of Values field and select either single or multiple from the drop-down list, as appropriate for the data type that you selected in the Value Type field.

    If this attribute is to be used by a flex parent and your data structure allows flex assets to have more than one flex parent, you must select multiple because the flex assets who inherit values for this attribute might inherit a value from more than one parent.

  6. (Optional) If the number of assets of the type you selected in the Number of Values field is more than 20, click in the Attribute Editor field and select one. See Section 16.1.4.2, "Using Attribute Editors" for information about appropriate attribute editors.

  7. Complete steps 8 and 9 of Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

16.3.6.4 Creating Foreign Flex Attributes

If you keep data in another system (a price list, for example) that you also want to use for your flex assets, you can create a foreign attribute that points to the column in the foreign table whose data you want to use as a flex attribute.

To create a foreign attribute

  1. Register the foreign table that contains the data you wish to use as a flex attribute. For information, see Section 12.3.4, "Registering a Foreign Table."

  2. Complete steps 1 through 6 in Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure." Note that you cannot select either asset or blob (or url) in the Value Type field.

  3. (Optional) If you plan to use WebCenter Sites flex asset forms to enter values for the attribute into the foreign table and you do not want to use the default input type for the data type that you selected in the Value Type field, click in the Attribute Editor field and select an appropriate option.

  4. Click in the Editing Style field and do one of the following:

    • If you want to use WebCenter Sites forms to enter values into this attribute's fields for the flex assets that use it, select local.

    • If you do not want users to be able to write values to this table through WebCenter Sites forms, select external.

  5. Click in the Storage Style field and select external from the drop-down list.

  6. Click in the External ID field and specify the name of the column that serves as the primary key for the table that holds this foreign attribute, that is, the column that uniquely identifies the attribute.

  7. Click in the External Table field and enter the name of the table that stores this attribute.

  8. Click in the External Column and enter the name of the column in the table specified in the External Table that holds the values for this attribute.

  9. Complete steps 8 and 9 of Section 16.3.6.1, "Creating Flex Attributes: Basic Procedure."

16.3.7 Step 5: (Optional) Create Flex Filter Assets

This section contains general instructions for creating a flex filter asset whose functionality is defined by one of the default WebCenter Sites filter classes. For information about flex filter classes, and detailed instructions on creating flex filter assets, see Chapter 17, "Flex Filters."

Before you can create flex filter assets, the flex attributes that you plan to use as the input and output attributes must already be created. If the appropriate flex attributes do not exist yet, create them. Note the following requirements:

  • For flex filters that use the Document Transformation filter type, the input and output attributes must be of type blob.

  • For any flex filter, the input attribute, output attribute, and flex filter asset must all belong to the same flex family.

To create a flex filter asset

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Admin interface.

  4. From the start menu options, click New.

  5. In the list of asset types, select the type of filter you wish to create. For example, New Media Filter. If the workflow associated with this asset requires you to select assignees, select at least one user from each role and click Set Assignees.

    The new filter form appears:

    Description of l_newflexasset_small.png follows
    Description of the illustration l_newflexasset_small.png

  6. In the New form, fill in the following fields:

    • Name: Enter a unique name for this filter asset.

    • Description: Enter a brief description summarizing the filter's function.

    • Filters: Select the filter class that will define the functionality of the flex filter asset you are creating. By default, the filter options are Doc-Type, Document Transformation, FieldCopier, and ThumbnailCreator.

      Note:

      If custom filter classes have been created for your system, they will also appear in this list. If you wish to create a custom flex filter class, see Section 17.2, "Defining a Flex Filter Class and Creating a Flex Filter Asset."

  7. Click Get Arguments. In the Arguments field, specify the input and output arguments for the flex filter asset. Click Add to add the arguments to the filter.

  8. Click Save.

16.3.8 Step 6: Create Parent Definition Assets

Complete the following steps:

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Admin interface.

  4. From the start menu options, click New.

  5. Select the name of your product definition asset from the list of shortcuts. For example, New Product Parent Definition. If the workflow associated with this asset requires you to select assignees, select at least one user from each role and click Set Assignees.

    The new form appears:

    Description of e_add_parent_def.png follows
    Description of the illustration e_add_parent_def.png

  6. Click in the Name field and enter a name of up to 64 characters.

  7. Click in the Description field and enter a short, descriptive phrase that describes the parent definition.

  8. Click in the Parent Select Style field and determine how flex parents that use this definition will be selected on the parent asset forms. Do one of the following:

    • If the number of parents of this type will be small, choose Select Boxes. Then, all the parents of this type will be displayed as options in a drop-down field on the flex asset forms.

    • If the number of parents of this type will be large, choose Pick From Tree. Then, when you select a parent of this type on the flex asset form, you select it from the tree on the tab that displays your catalog data. For example, on the GE Sample site, the catalog data is displayed in a tree on the Catalog tab.

  9. Select a parent definition from the Available list. For information about selecting parent definitions, see Section 16.1.6.1, "Determining Hierarchical Place."

  10. Click the appropriate arrow, as described in this table:

Table 16-1 Buttons in Parent Definition Form

Button in parent definition form Creates a field in the New parent form that does the following:

Single Value (Required)

Forces you to select one parent for the field.

Single Value (Optional)

Lets you select only one parent for the field.

Multiple Value, (Required)

Forces you to select at least one parent asset for the field.

Multiple Value (Optional)

Lets you select more than one parent asset for the field.


WebCenter Sites moves the parent definition from the Available list to the Selected list.

  1. Repeat steps 6 and 7 as many times as necessary. Remember that the corresponding New parent form will include a field for each item that you select in the Available list on this parent definition form.

  2. In the Attributes section, select the appropriate attributes. Note that if you are going to assign a flex filter asset to this parent definition, you must include the input and output attributes that the flex filter uses.

  3. Do one of the following:

    • Click the Required button to specify that the attribute is required, that is, all flex parents created with this definition must have a value for this attribute.

    • Click the Optional button to specify that the attribute is optional.

  4. (Optional) If you did not select the attributes in the order in which you want them to appear on the parent form for parents of this type, use the arrows to the right of the Selected box to order them.

  5. (Optional) In the Filters section, select any flex filter assets that are appropriate for this parent definition.

  6. Click Save.

  7. Repeat this procedure for each parent definition asset that you need to create.

16.3.9 Step 7: Create Flex Definition Assets

Complete the following steps:

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Admin interface.

  4. From the start menu options, click New.

  5. Select the name of your flex definition asset type from the list of shortcuts. For example, New Product Definition. If the workflow associated with this asset requires you to select assignees, select at least one user from each role and click Set Assignees.

    The new form appears:

    Description of e_add_def.png follows
    Description of the illustration e_add_def.png

  6. Click in the Name field and enter a name of up to 64 characters.

  7. Click in the Description field and enter a short, descriptive phrase that describes the parent definition.

  8. Select a parent definition from the Available list. For information about selecting parent definitions, see Section 16.1.6.1, "Determining Hierarchical Place."

  9. Click the appropriate arrow, as described in the following table:

Table 16-2 Buttons in Flex Definition Form

Button in flex definition form Creates a field in the New flex asset form that does the following:

Single Value (Required)

Forces you to select only one parent in the field.

Single Value (Optional)

Lets you select only one parent in the field.

Multiple Value (Required)

Forces you to select at least one parent asset in the field.

Multiple Value (Optional)

Lets you select more than one parent asset in the field.


WebCenter Sites moves the parent definition from the Available list to the Selected list.

  1. Repeat steps 5 and 6 as many times as is necessary. Remember that the corresponding New flex asset form will include a field for each item that you select in the Available list on this flex definition form.

  2. In the Attributes section, select an attribute. Note that if you are going to assign a flex filter asset to this flex definition, you must include the input and output attributes that the flex filter uses.

  3. Do one of the following:

    • Click the Required button to specify that the attribute is required; that is, that all flex assets created with this definition must have a value for this attribute.

    • Click the Optional button to specify that the attribute is optional.

  4. (Optional) If you did not select the attributes in the order in which you want them to appear on the New and Edit forms for flex assets created with this definition, use the arrows to the right of the Selected box to order them.

  5. (Optional) In the Filters section, select any flex filter assets that are appropriate for this flex definition.

  6. Click Save.

  7. Repeat this procedure for each flex definition that you need to create.

16.3.10 Step 8: Create Flex Parent Assets

To create flex parent assets

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Contributor interface.

  4. In the menu bar, select Content, then New, and then type of flex parent asset you wish to create.

    A tab opens displaying the Create view of the flex parent asset you wish to create.

    Description of e_add_parent_small.png follows
    Description of the illustration e_add_parent_small.png

  5. In the Name field, enter a name of up to 64 characters.

  6. In the Parent Definition field, select the desired parent definition from the drop-down list. The definition you select formats the next sections of the form (the sections you fill out to define this parent asset).

    The Content section of the form is displayed:

    Description of l_def_content_small.png follows
    Description of the illustration l_def_content_small.png

  7. Fill in the fields in the Content section of the form.

    Note the following about the kinds of fields that might appear in this section:

    • If there is an asterisk (*) next to the field, then the field is required.

    • In this example, the field in which you designate a parent asset is called FSIIProductTopLevel. The parent that you drag and drop into this field becomes the grandparent of any flex assets you designate as children of the parent you are creating in this procedure. If this field is not required, and you do not select any parents (grandparents), the parent you are creating will be a top-level parent in the Content Tree.

    • To determine whether the field is single or multi-valued, point to the drop zone associated with the field. A tooltip is displayed showing the type of assets this field accepts along with information about whether the field is single or multi-valued.

  8. Use the form section selector to switch to the next sections of the form (Marketing and Metadata sections). If a field has an asterisk (*) next to it, it is a required field.

    The fields displayed in these sections are based on the parent definition you chose for this parent. The values that you enter into these fields are inherited by any flex assets that have this parent asset as their parents.

  9. In the asset's toolbar, click the Save icon.

    WebCenter Sites writes the new parent to the database. All the information other than the attribute values are written to the FlexParent, FlexParent_AMap, and FlexParent_Extension tables, where FlexParent represents the internal name of your flex parents. The attribute values are written to the FlexParent_Mungo table.

16.3.11 Step 9: Create and Assign Asset Type Icons (Contributor Interface Only)

When a user performs a search in the Contributor interface and displays the results of the search in the Thumbnail view, each asset in the search results list is represented by a thumbnail image. By default, the name, asset type, modification date, and locale of the assets in the search results list are displayed below the thumbnail image representing the asset or the asset's type. Images can either be assigned per asset or per asset type. The focus of this section is to assign a thumbnail image for each asset type.

You must create and assign images that uniquely identify the members of your new flex family by completing the steps below.

  1. For each flex family member, do the following:

    1. Create two image files of type JPG, one to be displayed in the docked search results list, and the other to be displayed in the undocked search results list. The standard size of the image that will be displayed in the docked search results list is 96x96 pixels. The standard size of the image that will be displayed in the undocked search results list is 170x170 pixels.

    2. Name the image files as follows:

      • To name the image that will be displayed for the asset type in the docked search results list, use the syntax assetType.jpg.

      • To name the image that will be displayed for the asset type in the undocked search results list, use the syntax assetType_large.jpg.

        You must save the images as JPGs. The file name determines the asset type for which the icon will be displayed. The name is case-sensitive.

    3. Place the image files in the appropriate directory:

      <cs_app_dir>/images/search

      where <cs_app_dir> is the directory of the deployed WebCenter Sites application on your application server.

  2. Restart your application server for the icons to appear in the Thumbnail view of the search results list in the Contributor interface.

16.3.12 Step 10: Code Templates for the Flex Assets

Creating your flex asset definitions and coding the templates for the flex assets that use those definitions is an iterative process. Although you need to create definitions and flex assets before you can create templates for your flex assets, it is likely that you will discover areas that need refinement in your data design only after you have coded a template and tested the code.

For information about coding elements for your templates, see Chapter 23, "Creating Template, CSElement, and SiteEntry Assets" and Chapter 28, "Coding Elements for Templates and CSElements."

16.3.13 Step 11: Test Your Design (Create Test Flex Assets)

To thoroughly test your design, you must create some flex assets so that you can examine where they appear on the tree, what their forms look like, how long it takes to load their forms, and so on.

16.3.14 Step 12 (Optional): Create Flex Asset Associations

In most cases, you should use a flex asset's attributes to form associations. In the rare case that your associations must work across flex definitions, create associations between flex assets by completing the following steps:

  1. Log in to WebCenter Sites as an administrator.

  2. Select the site in which you want to work.

  3. Select the Admin interface.

  4. On the Admin tab of the tree, click the Asset Types node.

  5. Click on the plus sign next to asset type you wish to create an association for.

  6. Click on the plus sign for the Asset Associations node.

  7. Click Add New. The following screen appears:

    Description of l_association_small.png follows
    Description of the illustration l_association_small.png

  8. Click in the Name field and enter a name.

  9. Click in the Description field and enter a description of the association.

  10. Select a child asset to associate with this asset using the Child Asset drop-down select box.

  11. Select one or more sub-types using the Subtypes field.

  12. Choose a dependency type for the associated flex asset using the Mirror Dependency Type options.

  13. Click Add New Association to associate the flex asset types.

16.3.15 Step 13: Move the Asset Types to Other Systems

When you have finished creating your flex family, which includes creating the new flex asset types with Flex Family Maker, creating the data structure assets (including attribute editors), and coding templates for the flex asset type, you move them to the management and delivery systems.

Then, the system administrators configure the asset types for the management system. They enable revision tracking where appropriate, create workflow processes, create Start Menu shortcuts, and so on.

For information about moving your asset types to the management and delivery systems, see the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.

16.4 Editing Flex Attributes, Parents, and Definitions

Editing most of the flex asset types requires careful planning because certain edits cause schema changes and schema changes cause data loss.

This section presents tips and advice about editing flex family asset types and contains the following topics:

16.4.1 Editing Attributes

Note the following when editing a flex attribute:

  • You can change the Name without causing a schema change. However, if you are using XMLPost to import flex assets into your WebCenter Sites database, you must edit your XMLPost files if you change the name of an attribute.

  • You can change the Description without causing data loss.

  • If you change the data type in the Value Type field, you lose all data associated with the attribute in the _Mungo table(s) that use this attribute type.

  • If the attribute's data type is asset and you change the asset type, all existing data for the attribute is invalid.

  • If you change the Folder field for a blob attribute, WebCenter Sites will no longer be able to find any existing data for that attribute. If you absolutely must change this value, you need to move the file system to match the new value that you set.

  • You can change the Number of Values from single to multiple without causing data loss or complications.

  • If you change the Number of Values from multiple to single, WebCenter Sites cannot determine which of the values in any existing rows are the values to keep.

  • You can change the Search Engine and ISO Character Set without causing data loss.

16.4.2 Editing Parent Definitions and Flex Definitions

Note the following when editing a parent definition or a flex definition:

  • You can change the Name without causing a schema change. However, if you are using XMLPost to import flex assets into your WebCenter Sites database, you must edit your XMLPost files if you change the name of a parent definition.

  • You can change the Description and the Parent Select Style fields without causing data loss.

  • If you change the parent selections:

    • Adding parents is allowed

    • Removing parents can cause assets to no longer have valid data.

    • Changing parents from optional to required can cause problems because parents or flex assets who do not have one of the newly required parents are no longer valid.

    • Changing parents from required to optional is allowed.

    • Changing parents from single value to multiple value is allowed.

    • Changing parents from multiple value to single value causes unpredictable results because WebCenter Sites can not determine which of the previously acceptable multiple values is the one to keep and which ones to remove.

  • If you change the attribute selections:

    • Adding optional attributes is allowed.

    • Adding required attributes causes existing parents or flex assets without them to be invalid.

    • Removing attributes causes existing parents or flex assets with such an attribute value to be invalid.

16.4.3 Editing Parents and Flex Assets

Note the following when editing a flex or parent asset:

  • You can change the Name without causing a schema change. However, if you are using XMLPost to import flex assets into your WebCenter Sites database, you must edit your XMLPost files if you change the name of a parent definition.

  • You can change the Description without causing data loss.

  • If you change parents, WebCenter Sites corrects all the inherited attribute values.

  • You cannot change the definition that you used to create the parent or flex asset.

  • Changing the value of an attribute is allowed. If you change the value of an attribute for a parent, WebCenter Sites corrects that attribute for all the assets that inherited it from this parent. Changing the attribute value for a flex asset is allowed.

16.5 Using Product Sets

When you are using WebCenter Sites to manage an online catalog, there is a special feature that you can use with product assets called a product set. Product sets allow you to group products that are actually the same product except that they are packaged and sold differently.

This section contains the following topics:

16.5.1 What Is a Product Set?

For example, a book is the same book whether it is the paperback version or the hard-cover version. And a soft drink is the same soft drink whether it is sold in individual cans, as a six-pack, in a 2-liter bottle, or a case.

Product sets allow you to group products like these together so that they can be displayed together (in the same form) on the management system, yet remain individual saleable units, identified as such by their SKUs.

The model for the product set feature is as follows:

  • The product set is a product parent that takes on the characteristics of a product asset. The product set (parent) has all of the attributes that define the core product.

  • The product assets are SKUs. That is, they have only those attributes that describe the packaging or are the unique identifiers for members of the set: the SKU, the bottle size, and so on.

  • The product set (parent) has an attribute that marks it as a product set and the value of this attribute is unique among all the product sets. This attribute is called GAProductSet and is a reserved name. The products in the set inherit this attribute and, by this inheritance, are marked as members of that product set (that is, children of that product parent).

16.5.2 Creating Product Sets

To create a product set

  1. Create a product attribute named GAProductSet. This is a reserved name and your attribute name must match it exactly.

  2. Create a new product parent definition and select the GAProductSet attribute.

  3. Create a new product definition and designate that the parents created with the definition that you created in step 2 can be parents of products created with this product definition.

  4. Create a new product parent from the definition you created in step 2.

  5. Using the product definition that you created in step 3, create the products in the set and designate that the parent that you created in step 4 is their product parent.

Now, when you inspect or edit the product set (product parent), each product (SKU) in the set is listed on the Product Parent form, presenting a representation of the product set relationship.

There can be only one GAProductSet attribute in the WebCenter Sites database. If you have more than one WebCenter Sites site and you want to create product sets in more than one site, you must share the GAProductSet attribute to the sites that you want to use it in.