43 Importing Flex Assets

WebCenter Sites provides the XMLPost utility and a bulk processing utility named BulkLoader to import flex assets.

For information about importing flex assets using the XMLPost utility, see these topics:

For an in-depth information about using the BulkLoader utility, see Importing Flex Assets with the BulkLoader Utility.

43.1 About Importing Flex Assets

WebCenter Sites provides two utilities for importing assets that use the flex data model into the WebCenter Sites database, XMLPost and BulkLoader. XMLPost. WebCenter Sites provides three additional posting elements that work with XMLPost: addData, modifyData, and deleteData

See these topics:

43.1.1 Before You Begin Importing the Data Structure Flex Asset Types

Before you can use either method, you must first create or import the data design or structural asset types into your flex families with XMLPost and the standard posting element, RemoteContentPost, provided by the WebCenter Sites product. That is, first you create or import the attribute editors, flex attributes, flex definitions, and flex parent definitions with the standard XMLPost posting element.

To use the BulkLoader utility, the flex parents must also be imported with XMLPost or created.

43.1.2 About Importing the Flex Assets

After importing your data structure asset types, import your flex assets using one of the two import methods:

  • Use BulkLoader to import a large number (thousands or hundreds of thousands) of flex assets.

  • Use the posting element to load a moderate number (hundreds) of flex and flex parent assets.

43.1.2.1 When to Use BulkLoader

When working within the basic asset model, it is typical to use XMLPost to import assets into the database on the management system and then publish those assets to the delivery system. This methodology changes with flex assets because the volume of data involved in a flex asset data model tends to be much greater than that in a basic asset model.

You use the BulkLoader utility during the initial setup of your WebCenter Sites system. See Importing Flex Assets with the BulkLoader Utility.

43.1.2.2 When to Use XMLPost

For regular or incremental updates after the initial setup of your WebCenter Sites system, perhaps some or all of your data originates in an ERP system, for example, you use the XMLPost utility and the addData posting element.

43.1.3 Overview of the Process to Import Flex Assets

Because assets using the flex model have dependencies on each other, flex asset types must be imported in a specific sequence. And, as with basic assets, the asset types must exist, sites must be created, and so on before you use XMLPost to import assets.

For information about the basic prerequisites for using XMLPost that apply to all asset types (both asset models), see Before You Begin.

After those basic requirements are met, you must import your flex asset types into the WebCenter Sites database on the management system in the following sequence:

  1. Attribute editors are optional. To use attribute editors, either import them or create them before you import your flex attributes. The configuration file must instruct XMLPost to call the RemoteContentPost element. See Attribute Editors.

  2. Flex attributes. The configuration file must instruct XMLPost to call the RemoteContentPost element. See Flex Attributes.

  3. Flex parent definitions. The configuration file must instruct XMLPost to call the RemoteContentPost element. See Flex Definitions and Flex Parent Definitions: Sample Files.

    Note:

    You must import the flex parent definitions in the proper order. A parent definition asset referred by another parent definition must exist in the database.

    It is typical to import parent definitions one hierarchical level at a time, starting with the top level definitions.

  4. Flex definitions. The configuration file must instruct XMLPost to call the RemoteContentPost element. See Flex Definitions and Flex Parent Definitions: Sample Files.

  5. Flex parent assets. Do one of the following:

    • Import the flex parents individually or as part of the flex family tree for a flex assets using XMLPost.

    • To import the flex assets using the BulkLoader utility, first import the flex parent assets using XMLPost. The configuration file must instruct XMLPost to call the RemoteContentPost element. The file cannot specify the addData element because you are importing the parents without the entire family tree for the flex assets.

    See Flex Parents.

  6. (Optional) First approve and publish all of the structural assets (attribute editors, flex attributes, flex definitions, parent definitions, and flex parents) from the management system to the delivery system, and then import flex assets into both the systems using the BulkLoader utility.

  7. Flex assets. Do one of the following:

You must follow the sequence outlined in the preceding steps because there are dependencies built in to the data structure of a flex asset family. Additionally, note the following dependencies:

  • If a flex parent or flex asset has an attribute of type asset, the asset that you designate as the value of that attribute field must have been created or imported.

  • An asset that you set as the value for an attribute of type asset must be of the correct asset type.

  • When you are using XMLPost to create an asset that has an asset attribute of Type asset, you must use the unique name of the asset for this attribute value. Non-unique value for this attribute is not supported.

43.1.4 About Custom Data Delimiters

Custom data delimiters are used when an out of the box delimiter is used in the content. If the data you are importing, editing, or deleting via XMLPost uses a different data delimiting schema than the WebCenter Sites default schema (see the table below for CS‐default delimiter characters), specify custom delimiters as explained in the following table.

Table 43-1 Custom Data Delimiters

Tag Property Description

<_xmlnamevaldelim_>

post_xmlnamevaldelim_

Optional.

Lets you specify a custom character for delimiting name/value pairs from one another.

To specify a custom delimiter:

1. Set the property to y in the configuration file.

2. Use the tag in your XML file to define the custom delimiter. For example, to use the "at" character as a delimiter:

<_xmlnamevaldelim_>@</_xmlnamevaldelim_>

The default delimiter is the colon ( : ).

<_xmlpostequaldelim_>

post_xmlpostequaldelim_

Optional.

Lets you specify a custom character for delimiting attribute names from their values.

To specify a custom delimiter:

1. Set the property to y in the configuration file.

2. Use the tag in your XML file to define the custom delimiter. For example, to use two equal signs as a delimiter:

<_xmlpostequaldelim_>==</_xmlpostequaldelim_>

The default delimiter is the equal sign ( = ).

<_xmlpostmulvaldelim_>

post_xmlpostmulvaldelim_

Optional.

Lets you specify a custom character for delimiting the values of a multivalued attribute from one another.

To specify a custom delimiter:

1. Set the property to y in the configuration file.

2. Use the tag in your XML file to define the custom delimiter. For example, to use a hyphen as a delimiter:

<_xmlpostmulvaldelim_>-</_xmlpostmulvaldelim_>

The default delimiter is the semicolon ( ; ).

43.2 Understanding XMLPost and the Flex Asset Model

The XMLPost utility works the same no matter which asset model or WebCenter Sites product you are using. However, for flex assets that store their data in multiple database tables, WebCenter Sites provides additional processing logic in some standard elements. This processing logic enables the flex asset types to support XMLPost.

Additionally, WebCenter Sites provides both a posting element that enables you to use XMLPost to edit flex assets (modifyData) and a posting element that enables you to use XMLPost to delete assets of any type (deleteData).

This chapter provides additional information about creating configuration and source files specifically for the asset types in a flex family (and attribute editors). Be sure to also read Importing Assets of Any Type for basic information that pertains to all XMLPost configuration and source files.

In the flex asset model, you specify a different posting element based on the following categories of asset types:

  • Structural asset types that give the flex asset type and flex parent asset type their data structure. That is, attribute editors, attributes, flex definitions, and flex parent definitions.

    Use the standard WebCenter Sites posting element RemoteContentPost to import the structural asset types. (You cannot use the addData element with assets of these types.)

  • Flex and flex parent asset type (for example, product and product parent types).

    Depending on the situation, either use the posting element addData to import the flex and flex parent asset types or the posting element RemoteContentPost. (See Flex Parents and Importing Flex Assets with XMLPost for information about which posting element to use.)

In both cases, you create configuration files and source files (as described in About Importing Flex Assets and supplemented in this chapter), and then invoke the XMLPost utility (as described in Using the XMLPost Utility).

Note:

For reference, sample XMLPost code is provided in the WebCenter Sites installer package, in the /Xcelerate/Samples/XMLPost directory. The same folder contains the readme.txt file that describes the sample files.

Internal Names vs. External Names

When you create your flex family of asset types (see Creating a Flex Family in Creating a Flex Asset Family), you specify both an internal and an external name for your asset types.

The internal name is used for the primary storage table in the database. The external name is used in the New, Edit, and Inspect forms, in search results list, and so on. For example, the internal name for the attribute editor asset type is AttrTypes, but that name is not used in the user interface.

Because XMLPost communicates with the database, you must always use the internal name of the asset type in the configuration files and source files. For example, in a configuration file for attribute editors, you would specify the following:

postargname2: AssetType
postargvalue2: AttrTypes

43.3 About Importing the Structural Asset Types in the Flex Model

The configuration and source files for the flex asset types are similar to those for basic assets. Let's take a look at sample configuration and source files for the structural flex asset types.

For information about configuration and source files, see Importing Assets of Any Type.

See these topics:

43.3.1 Attribute Editors

Attribute editors store their data in one table, named AttrTypes. AttrTypes is the internal name of the attribute editor asset type. Be sure to use this name in your configuration file for attribute editors.

This table describes the configuration file properties and source file tags that you use with attribute editors:

Table 43-2 Attribute Editor Tag and Properties

Tag Property Description

<name>

postname

Required for all asset types.

Name of the attribute editor asset. Attribute names are limited to 64 characters and cannot contain spaces.

<description>

postdescription

Optional.

Description of the use or function of the attribute.

<AttrTypeText>

postAttrTypeText

Required.

Either the name of the file with the attribute editor XML code, or the actual code.

This tag corresponds to the XML in file field and Browse button and the XML field in the New and Edit attribute editor forms in the WebCenter Sites interface.

43.3.1.1 Sample Configuration File: Attribute Editor

This is a sample configuration file for the attribute editor asset type. It works with the sample source file immediately following this example.

xmlpost.xmlfilenamefilter: .xml
xmlpost.url: http://izod19/servlet/ContentServer
xmlpost.numargs: 6
xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Xcelerate/Actions/RemoteContentPost
xmlpost.argname2: AssetType
xmlpost.argvalue2: AttrTypes
# notice that you use the internal name of the asset type

xmlpost.argname3: authusername
xmlpost.argvalue3: user_editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: user
xmlpost.argname5: inifile
xmlpost.argvalue5: futuretense.ini
xmlpost.argname6: startmenu
xmlpost.argvalue6: New Attribute Editor

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: attreditorpostlog.txt

xmlpost.deletefile: y

postpublication: y

postname: y
postdescription: y
postAttrTypeText: y

43.3.1.2 Sample Source File: Attribute Editor

The following source file is tagged for importing a check box attribute editor, or presentation object. It works with the preceding sample configuration file.

<document>
<publication>AA Illumination</publication>
<name>Editor4-CheckBoxes</name>
<description>Attribute Type Four Check Box</description>
<AttrTypeText>
  <![CDATA[
    <?XML VERSION="1.0"?>
    <!DOCTYPE PRESENTATIONOBJECT SYSTEM "presentationobject.dtd">
    <PRESENTATIONOBJECT NAME="CheckBoxTest">
      <CHECKBOXES LAYOUT="VERTICAL">
        <ITEM>Red</ITEM>
        <ITEM>Green</ITEM>
        <ITEM>Blue</ITEM>
      </CHECKBOXES>
    </PRESENTATIONOBJECT>
  ]]>
</AttrTypeText>
</document>

43.3.2 Flex Attributes

Flex attributes have several tables, but XMLPost writes to only two of them: the main storage table and the attribute asset type's _Extension table.

This means that the source file section of the configuration file must specify and the source file itself must use tags that represent columns in both tables. Those source file tags and configuration file properties are shown in the following table:

Table 43-3 Flex Attribute Tags and Properties

Tag Property Description

<name>

postname

Required for all asset types.

Name of the attribute. Attribute names are limited to 64 characters and cannot contain spaces.

<description>

postdescription

Optional.

Description of the use or function of the attribute.

<valuestyle>

postvaluestyle

Optional.

Whether the attribute can hold a single value (S) or multiple values (M). If no, this tag is not used, the attribute is set to hold a single value by default.

<type>

posttype

Required.

The data type of the attribute. Valid options are asset, date, float, int, money, string, text, or blob.

<assettypename>

postassettypename

Required if <type> is set to asset.

The name of the asset type that the attribute holds.

<upload>

postupload

Required if <type> is set to blob.

The path to the directory in which you want to store the attribute values. Note that the value that you enter in this field is appended to the value set as the default storage directory (defdir) for the attribute table by the cc.urlattrpath property in the wcs_properties.json file.

<attributetype>

postattributetype

Optional.

The name of the attribute editor to use, if applicable.

<enginename>

postenginename

Optional.

The name of the search engine you may be using on your management system.

<charsetname>

postcharsetname

Optional.

The search engine character set to use. By default, it is set to ISO 8859-1.

<editing>

postediting

Foreign attributes only.

Whether a foreign attribute can be edited through the WebCenter Sites forms (L), or edited externally using a third-party tool (R). L is the default.

<storage>

poststorage

Foreign attributes only.

Whether the values for a foreign attribute are to be stored in a _Mungo table in the WebCenter Sites database (L) or in a foreign table (R). L is the default.

<externalid>

postexternalid

Foreign attributes only.

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.

<externalcolumn>

postexternalcolumn

Foreign attributes only.

The name of the column in the foreign table that holds the values for this attribute.

<externaltable>

postexternaltable

Foreign attributes only.

The name of the foreign table that contains the columns identified by externalid and external column.

<publication>

postpublication

Optional.

The names of all the sites that can use this attribute.

43.3.2.1 Sample Configuration File: Flex Attribute

This is a sample configuration file for a product attribute asset type works with the sample source file immediately following this example:

xmlpost.xmlfilenamefilter: .xml

xmlpost.url: http://izod19/servlet/ContentServer
xmlpost.numargs: 6
xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Xcelerate/Actions/RemoteContentPost
xmlpost.argname2: AssetType
xmlpost.argvalue2: PAttributes
# Notice that this is the internal name of the asset 
# type. The external name of this asset type is
# Product Attribute.

xmlpost.argname3: authusername
xmlpost.argvalue3: user_editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: user
xmlpost.argname5: inifile
xmlpost.argvalue5: futuretense.ini
xmlpost.argname6: startmenu
xmlpost.argvalue6: New Product Attribute

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: attributespostlog.txt

xmlpost.deletefile: y

postpublication: y
postname: y
postattributetype: y
postdescription: y
postvaluestyle: y
posttype: y
postediting: y
poststorage: y
postenginename: y
poststatus: y
postassettypename: y
postupload: y
postexternalid: y
postexternalcolumn: y
postexternaltable: y
postcharsetname: y

43.3.2.2 Sample Source File: Attribute

This is a sample source file for importing a product attribute named footnotes. It works with the preceding sample configuration file.

<document>
  <publication>AA Illumination</publication>
  <name>footnotes</name>
  <description>Footnotes</description>
  <valuestyle>S</valuestyle>
  <type>URL</type>
  <editing>L</editing>
  <storage>L</storage>
</document>

Note:

Remember that all the dependencies and restrictions concerning the data type of a flex attribute apply whether you are creating an attribute through the WebCenter Sites interface (the New or Edit flex attribute forms) or through XMLPost. See Create Flex Attributes in Creating a Flex Asset Family.

43.3.3 Flex Definitions and Flex Parent Definitions: Sample Files

The flex definition and flex parent definition asset types are very similar and you code their configuration and source files in nearly the same way. They require several of the same tags in their source files and the same properties in their configuration files. Each has one additional property/tag.

This section includes the following topics:

The source file tags and configuration file properties for flex definitions and flex parent definitions are listed in the following table. Note that they are case-sensitive.

Table 43-4 Flex Definition and Flex Parent Definition Tags and Properties

Flex definition and flex parent definition tag and property Description

tag:

<internalname>

property:

postinternalname

Required.

The name of the asset; this is a required value for all asset types. Flex definition and flex parent definition names are limited to 64 characters and they cannot contain spaces.

tag:

<internaldescription>

property:

postinternaldescription

Optional.

The description of the use or function of the asset.

tag:

<renderid>

property:

postrenderid

Optional. For flex definitions only.

The ID of the Template asset that is to be assigned to all the flex assets that are created with this flex definition.

tag:

<parentselectstyle>

property:

postparentselectstyle

Optional. For flex parent definitions only.

Defines how flex parents are to be selected when a user creates a flex asset using the definition.

This property/tag represents the Parent Select Style field in the New and Edit parent definition forms.

When using the tag in the source file, the options are treepick and selectboxes.

The next four tags and properties perform the same function as the buttons and fields in the Product Parent Definition section on the New and Edit forms for parent definitions and flex definitions. See (Conditional) Creating Flex Filter Assets and Creating Flex Definition Assets in Creating a Flex Asset Family.

n/a

tag:

<OptionalSingleParentList>

property:

postOptionalSingleParentList

Use this tag to specify any single optional parent definition.

tag:

<RequiredSingleParentList>

property:

postRequiredSingleParentList

Use this tag to specify any single required parent definition.

tag:

<RequiredMultipleParentList>

property:

postRequiredMultipleParentList

Use this tag to specify multiple required parent definitions.

tag:

<OptionalMultipleParentList>

property:

postOptionalMultipleParentList

Use this tag to specify multiple optional parent definition.

The next three tags and properties perform the same functions as the buttons and fields in the Attributes section on the New and Edit forms for flex definitions and flex parent definitions. See (Conditional) Creating Flex Filter Assets and Creating Flex Definition Assets in Creating a Flex Asset Family.

n/a

tag:

<RequiredAttrList>

property:

postRequiredAttrList

The list of attributes that are required for the flex parents or the flex assets that use the definition.

tag:

<OptionalAttrList>

property:

postOptionalAttrList

The list of attributes that are optional for the flex parents or the flex assets that use the definition.

tag:

<OrderedAttrList>

property:

postOrderedAttrList

The order in which all attributes, be they required or optional, should appear in the New, Edit, Inspect, and similar forms.

This tag replaces the other attribute tags. The example source file in this section shows an example of how to use this tag in a source file.

A configuration file must include all the properties that could be used by any one of the assets of the type that the configuration file works with. The individual source files include only the tags that are needed to define those individual assets.

43.3.3.1 Sample Configuration File: Flex Definition

The following example is a configuration file for importing product definitions. It works with the sample source file immediately following this example.

xmlpost.url: http://izod19/servlet/ContentServer
xmlpost.numargs: 6
xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Xcelerate/Actions/RemoteContentPost
xmlpost.argname2: AssetType
xmlpost.argvalue2: ProductTmpls
# Notice that this is the internal name of the asset type.
# The external name of this asset type is 
# Product Definition.

xmlpost.argname3: authusername
xmlpost.argvalue3: user_editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: user
xmlpost.argname5: inifile
xmlpost.argvalue5: futuretense.ini
xmlpost.argname6: startmenu
xmlpost.argvalue6: New Product Definition

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: productdefpostlog.txt
xmlpost.deletefile: y

postpublication: y
postinternalname: y
postinternaldescription: y

postparentselectstyle: y

postOptionalSingleParentList: y
postRequiredSingleParentList: y
postRequiredMultipleParentList: y
postOptionalMultipleParentList: y

postRequiredAttrList: y
postOptionalAttrList: y
postOrderedAttrList: y

postrenderid: y

43.3.3.2 Sample Source File: Flex Definition

The following source file, lighting.xml, is for a product definition named Lighting. It works with the preceding sample configuration file.

<document>
<publication>AA Illumination</publication>
<internalname>Lighting</internalname>
<internaldescription>Generic Lighting Template</internaldescription>
<RequiredAttrList>sku</RequiredAttrList>
  <OptionalAttrList>
    productdesc;caseqty;bulbshape;bulbsize;basetype;
    colortemp;meanlength;lightcenterlength;reducedwattage;beamspread;
    fixturetype;ballasttype;colorrenderingindex;minstarttemp;powerfactor;
    totalharmonicdist;spreadbeam10h;spreadbeam10v;spreadbeam50h;
    spreadbeam50v;halogen;operatingposition;filamenttype;bulbimage;
    baseimage;filamentimage;footnotes;price;life;voltage;wattage
  </OptionalAttrList>
<parentselectstyle>treepick</parentselectstyle>
<OptionalMultipleParentList>SubCategory</OptionalMultipleParentList>
</document>

Examine the preceding list of attributes. When you include multiple values in a tag, separate them from each other with a semicolon (;).

Note that while the optional/multiple parent model is used, there are other possible configurations:

<OptionalSingleParentList>flexparentdefinition</OptionalSingleParentList>
<RequiredSingleParentList>flexparentdefinition</RequiredSingleParentList>
<RequiredMultipleParentList>flexparentdefinition</RequiredMultipleParentList>

Supplying a List of Ordered Attributes

To use the <OrderedAttrList> tag because the attributes have to be displayed in a specific order, do not also include the <RequiredAttrList> and <OptionalAttrList> tags. In the string contained in the <OrderedAttrList> tag, specify which attributes are required and which are optional, as follows:

  • For required attributes, precede the attribute name with R (required)

  • For optional attributes, precede the attribute name with or O (optional)

  • Be sure to list the attributes in order.

  • Be sure to use a semicolon (;) to separate the values.

For example:

<OrderedAttrList>Rsku;Oproductdesc;Ocaseqty;Obulbshape;Obulbsize;Obasetype;Ocolortemp;Omeanlength;Olightcenterlength;Oreducedwattage;<OrderedAttrList>

43.3.4 Flex Parents

You can use XMLPost to import flex parent assets in two ways:

  • Individually. You code a separate XMLPost source file for each flex parent and an XMLPost configuration file that identifies the asset type and the pagename for the standard RemoteContentPost posting element. To use the BulkLoader utility, first import the flex parent assets with XMLPost in this way.

  • As part of the flex family tree for a flex asset. To import your flex assets (rather than the BulkLoader) using XMLPost, combine the flex parents with the flex assets and import the flex parents as a part of a flex family tree, within the context of a specific flex asset. You code a separate XMLPost source file for each flex asset and identify all the parents for that flex asset in that source file. XMLPost then creates the variables for one flex asset and multiple flex parents (if they do not yet exist) when it parses the source file.

This topic describes the source and configuration file for importing them individually. For information about importing them with the flex assets, see Importing Flex Assets with XMLPost.

This topic includes the following topics:

43.3.4.1 Sample Configuration File: Individual Flex Parent

The following example is a configuration file for importing product parents. It works with the sample source file immediately following this example.

xmlpost.xmlfilenamefilter: .xml

xmlpost.url: http://izod19/servlet/ContentServer
xmlpost.numargs: 6
xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Xcelerate/Actions/RemoteContentPost
xmlpost.argname2: AssetType
xmlpost.argvalue2: ProductGroups
# notice that you use the internal name of the asset type

xmlpost.argname3: authusername
xmlpost.argvalue3: user_editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: user
xmlpost.argname5: inifile
xmlpost.argvalue5: futuretense.ini
xmlpost.argname6: startmenu
xmlpost.argvalue6: New Product Parent

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: productdefpostlog.txt
xmlpost.deletefile: y

postpublication: y
postinternalname: y
postinternaldescription: y
postflexgrouptemplateid: y
postfgrouptemplatename: y
postParentList: y
postcat1: y
postcat2: y

43.3.4.2 Sample Source File: Individual Flex Parent

The following source file creates a product parent (flex parent) named Halogen. It works with the preceding sample configuration file.

<document>
<publication>AA Illumination</publication>
<internalname>Halogen</internalname>
<fgrouptemplatename>Category</fgrouptemplatename>
<cat1>Halogen</cat1>
</document>

Remember that when you use the RemoteContentPost posting element, you must provide one source file for each parent asset.

43.4 Importing Flex Assets with XMLPost

Remember to import the structural asset types (attributes, flex definitions, and flex parent definitions) before you import flex assets with XMLPost.

Use RemoteContentPost or addData posting elements for flex assets:

  • The addData posting element creates parent assets for the flex asset if they do not yet exist. For example, use this posting element for the initial import of your flex assets if you are not using the BulkLoader utility.

    When you use the addData posting element, the source file must specify the entire family tree for the flex asset. Each flex asset requires a separate source file, but you can specify any number of parents for that flex asset in that source file and XMLPost creates the flex asset and its parents (if they do not yet exist).

  • The RemoteContentPost element creates flex assets and sets values for their parents. Those parents must exist. For example, use this posting element if you wish to perform the initial import using BulkLoader and then on use XMLPost.

    When you use RemoteContentPost to import a flex asset, the source file must specify only the asset's immediate parents (which requires you to include fewer lines of code). However, to create a new flex parent for the new flex asset, use the addData posting element and specify the entire family tree in the source file.

This section includes the following topics:

43.4.1 Configuration File Properties and Source File Tags for Flex Assets

As with the structural asset types, you must use the internal name of the flex and flex parent asset types in your configuration and source files. However, unlike the structural asset types, you do not have to include an argument for the asset type in the configuration file. Source files for flex assets have a required tag that identifies the asset type so you do not have to repeat this information in the configuration file.

This section includes the following topics:

43.4.1.1 For the addData Posting Element

The following table lists the source file tags and configuration file properties for flex assets (and their flex parents) when you are using the addData posting element. Note that they are case sensitive.

Table 43-5 addData Posting Element

Tag Property Description

<_ASSET_>

post_ASSET_

Required.

The internal name of the asset type. For example, Products, AArticles, and AImages.

<_TYPE_>

post_TYPE_

Required.

The name of the flex definition that this flex asset is using.

<_ITEMNAME_>

post_ITEMNAME_

Required.

The name of the asset.

<_ITEMDESCRIPTION_>

post_ITEMDESCRIPTION_

Optional.

The description of the asset.

<_GROUP_parentDefinitionName>

post_GROUP_parentDefinitionName

Optional.

The flex asset's parents. The configuration file must include a tag for each possible parent definition. For example, if flex assets have parents that use either of two parent definitions named Division and Department, the following two properties to define a tag for each are required in the configuration file:

post_Group_Department

post_Group_Division

See Specifying the Parents of a Flex Asset.

<_GROUPDESCRIPTIONS_>

post_GROUPDESCRIPTIONS_

Optional.

When designating a new parent include the description of the parent definition.

<displaytype>

postdisplaytype

Optional.

The name of the Template asset for the flex asset.

<AttributeName>

postAttributeName

Include a property in the configuration file for each attribute that assets of the type can have (both required and optional). The source files then have to supply a value for each required attribute and any optional ones that apply to that asset.

For example, for an attribute named SKU, include a property called postSKU in the source files and lines of code like this:

<SKU>123445</SKU>

43.4.1.2 For the RemoteContentPost Posting Element

The following table lists the source file tags and configuration file properties for flex assets (and their flex parents) when you are using the RemoteContentPost posting element. Note that they are case-sensitive.

Table 43-6 RemoteContentPost Posting Element

Tag Property Description

<_DEFINITION_>

post_DEFINITION_

Required.

The name of the flex definition that this flex asset is using.

(Note that post_TYPE will also work.)

<_ITEMNAME_>

post_ITEMNAME_

Required.

The name of the asset.

<_ITEMDESCRIPTION_>

post_ITEMDESCRIPTION_

Optional.

The description of the asset.

<ParentList>

post_ParentList

Optional.

The flex asset's immediate parents.

<template>

posttemplate

Optional.

The name of the Template asset for the flex asset.

(Note that postdisplaytype will also work.)

<AttributeName>

postAttributeName

Include a property in the configuration file for each attribute that assets of the type can have (both required and optional). The source files then have to supply a value for each required attribute and any optional ones that apply to that asset.

For example, for an attribute named SKU, include a property called postSKU in the source files and lines of code like this:

<SKU>123445</SKU>

43.4.2 Sample Flex Asset Configuration File for addData

This is a sample configuration file for a product asset type. The file invokes the addData posting element and works with the source file example immediately following this example:

xmlpost.xmlfilenamefilter: .xml

#xmlpost.proxyhost: Future
#xmlpost.proxyport: 80

xmlpost.url: http://wally9:80/servlet/ContentServer

# notice that it uses addData 
# rather than RemoteContentPost
xmlpost.numargs: 5

xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Gator/XMLPost/addData

# Notice that you do not need to provide
# the name of the asset type because that information
# is required in the source files for flex assets.

xmlpost.argname2: inifile
xmlpost.argvalue2: futuretense.ini
xmlpost.argname3: authusername
xmlpost.argvalue3: editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: xceleditor
xmlpost.argname5: startmenu
xmlpost.argvalue5: New Product

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: productdatalog.txt

xmlpost.postdeletefile: y

post_ASSET_: y
post_ITEMNAME_: y
post_TYPE_: y
post_GROUP_Category: y
post_GROUP_SubCategory: y
postpublication: y
postsku: y
postproductdesc: y
postcaseqty: y
postbulbshape: y
postbulbsize: y
postbasetype: y
postcolortemp: y
postmeanlength: y
postlightcenterlength: y
postreducedwattage: y
postbeamspread: y
postfixturetype: y
postballasttype: y
postcolorrenderingindex: y
postminstarttemp: y
postpowerfactor: y
posttotalharmonicdist: y
postspreadbeam10h: y
postspreadbeam10v: y
postspreadbeam50h: y
postspreadbeam50v: y
posthalogen: y
postoperatingposition: y
postfilamenttype: y
postbulbimage: y
postbaseimage: y
postfilamentimage: y
postfootnotes: y
postcat1: y
postcat2: y
postprice: y
postvoltage: y
postwattage: y
postlife: y

43.4.3 Configuration File Properties and Attributes of Type Blob (or URL)

If the asset type has an attribute of type blob (or url), the configuration file needs two entries for the tag that references the attribute: one to identify the attribute and one to identify the file name of either the file that holds the content for the attribute (an upload field) or the name that you want WebCenter Sites to give the file that it creates from text entered directly into a text field (a text field of type blob or URL).

43.4.3.1 Attribute of Type Blob (or URL) As an Upload Field

An attribute of type blob can be an upload field. For example, a blob attribute named footnotes is an upload field with a Browse button for finding the file rather than a text field that you enter text into. Therefore, it has two properties:

  • posttag, which in this scenario is postfootnotes: y

  • filetag, which in this scenario is filefootnotes: y

When you include a value for this attribute in a source file, you use the following convention:

<footnotes>FileName.txt</footnotes>

Note that when you are importing an asset that has this kind of field (attribute), the file that holds the text that you want to store as the attribute value for the flex asset must be located in the same directory as the source file for the asset.

43.4.3.2 Attribute of Type Blob (or URL) As a Text Field

If the fictitious footnotes attribute is a field that takes text directly rather than a file, the configuration file requires the following properties:

  • postfootnotes: y

  • postfootnotes_file: y

Then, when you include a value for the attribute in the source file, you use the following convention:

<footnotes>lots and lots of text</footnotes>
<footnotes_file>FileNameYouWantUsed.txt</footnotes_file>

43.4.4 Sample Flex Asset Source File for addData

The following source file works with the example flex asset configuration file preceding this section.

This section includes the following topics:

43.4.4.1 Sample File

This source file creates a lightbulb product named 10004 from the product definition named Lighting:

<document>

# the first three tags are required
<_ASSET_>Products</_ASSET_>
<_ITEMNAME_>10004</_ITEMNAME_>
<_TYPE_>Lighting</_TYPE_>

# This tag is required because the publication is
# not set in the configuration file
<publication>AA Illumination</publication>

# This tag assigns a Template asset to the product
<displaytype>Lighting Detail</displaytype>

# The rest of these tags set flex attribute values for the product
<price>5</price>
<sku>10004</sku>
<productdesc>F4T5/CW</productdesc>
<caseqty>24</caseqty>
<bulbshape>T</bulbshape>
<bulbsize>5</bulbsize>
<basetype>Miniature Bipin (G5)</basetype>
<colortemp>4100</colortemp>
<meanlength></meanlength>
<lightcenterlength></lightcenterlength>
<reducedwattage></reducedwattage>
<beamspread></beamspread>
<fixturetype></fixturetype>
<ballasttype></ballasttype>
<colorrenderingindex>60</colorrenderingindex>
<minstarttemp></minstarttemp>
<powerfactor></powerfactor>
<totalharmonicdist></totalharmonicdist>
<spreadbeam10h></spreadbeam10h>
<spreadbeam10v></spreadbeam10v>
<spreadbeam50h></spreadbeam50h>
<spreadbeam50v></spreadbeam50v>
<halogen></halogen>
<operatingposition></operatingposition>
<filamenttype></filamenttype>
<bulbimage>BLB-260.gif</bulbimage>
<baseimage>BLB-250.gif</baseimage>
<filamentimage></filamentimage>
<footnotes>
</footnotes>
<life>6000</life>
<voltage></voltage>
<wattage>4</wattage>
<cat1>Fluorescent</cat1>
<cat2>Preheat Lamps</cat2>

<!-- GROUP tags that specify the parents. Remember that you have to
specify the entire family tree for the flex asset when using the addData posting element-->

<_GROUP_Category>Fluorescent</_GROUP_Category>
<_GROUP_SubCategory>Preheat Lamps</_GROUP_SubCategory>
</document>

The preceding source file set the product's parent to Preheat Lamps and the parent of Preheat Lamps to Fluorescent.

43.4.4.2 Handling Special Characters

XMLPost uses the HTTP POST protocol, which means that it sends data in an HTTP stream. Therefore, certain characters are considered to be special characters and must be encoded because they are included in URLs.

In your source file, if any attribute values contains any special character, replace all its instances with its corresponding URL encoding sequence, found in About Values for Special Characters.

43.4.4.3 Flex Assets and Their Parents

The GROUP tags specify the parents in the family tree. When XMLPost uses the addData posting element and parses the GROUP section of the source file, it does the following:

  1. Determines which parent definitions are legal for an asset using this flex definition.

  2. For each legal parent definition, it verifies whether the source file specifies a parent of that definition:

    • If yes, it sets the parent. And if the parent does not yet exist, it creates the parent.

    • If no, it does not set the parent. However, if a parent of that definition is required, it returns an error.

43.4.4.4 Specifying the Parents of a Flex Asset

To specify the parents of a flex asset, you provide the name of the parents nested in the <_GROUP_parentDefinitionName> tag. For example:

<_GROUP_subcategory>Blacklights</_GROUP_subcategory>

Where subcategory is the name of the parent definition for the Blacklights parent (product parent).

Remember that you must specify the entire family tree for the flex asset. For example, in addition to specifying the parent for the lightbulb (Blacklights), you specify the grandparent:

<_GROUP_subcategory>Blacklights</_GROUP_subcategory>

<_GROUP_category>Fluorescent</_GROUP_category>

43.4.4.5 Setting Attribute Values for Parents

If an attribute can belong to multiple parents, in XMLPost specify to which parent the attribute belongs. For example, let's say that the bulbshape attribute is assigned to parents rather than products. In this case, you would include a line of code such as this:

<bulbshape>Halogen=T</bulbshape>

43.4.4.6 Setting Multiple Values in a Flex Source File

All of the tags that configure parents and the tags that specify attributes (while the attribute is configured to accept multiple values) can handle multiple values. Those tags are as follows:

  • _GROUP_parentDefinitionName

  • _GROUPDESCRIPTIONS_

  • the attribute tags

When you have multiple parents from the same definition for a flex asset, you provide all of the names of the parents in the same _GROUP_parentDefinitionName tag and you use a semicolon (;) to separate the parent names.

For example:

<_GROUP_Cateogry>Incandescent;Halogen</_GROUP_Category>

When XMLPost imports this asset, it sets its parents as Incandescent and Halogen, which are both of the Category parent definition. If Incandescent and Halogen do not exist yet, XMLPost creates them.

Use a similar syntax to set multiple attribute values for the multiple parents. Once again, let's say that the Category definition requires that parents of that definition have a value for the bulbshape attribute. You can set the value of the bulbshape attribute for both of the parents that were specified by the <_GROUP_Category> tag as follows:

<bulbshape>Incandescent=E;K:Halogen=T</bulbshape>

Note the following about this syntax:

  • You use parentName=attributeValue pairs to set the attribute value (Halogen=T).

  • You use a colon to separate the parents from each other. (Incandescent=S:Halogen=T).

  • You use a semicolon to separate the attribute values for a parent when that parent has multiple values for the attribute (Incandescent=E;K:Halogen=T).

And, as mentioned, specify descriptions for the parents that you identify in the same tag, too. For example:

<_GROUPDESCRIPTIONS>
Incandescent=From Detroit:Halogen=From Chicago
</_GROUPDESCRIPTIONS>

43.4.5 Sample Flex Asset Configuration File for RemoteContentPost

This is a sample configuration file for a product asset type. It works with the source file example immediately following this example.

xmlpost.xmlfilenamefilter: .xml

#xmlpost.proxyhost: Future
#xmlpost.proxyport: 80

xmlpost.url: http://wally9:80/servlet/ContentServer
xmlpost.numargs: 5

xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Xcelerate/Actions/RemoteContentPost

# Notice that you do not need to provide
# the name of the asset type because that information
# is required in the source files for flex assets.

xmlpost.argname2: inifile
xmlpost.argvalue2: futuretense.ini
xmlpost.argname3: authusername
xmlpost.argvalue3: editor
xmlpost.argname4: authpassword
xmlpost.argvalue4: xceleditor
xmlpost.argname5: startmenu
xmlpost.argvalue5: New Product

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: productdatalog.txt

xmlpost.postdeletefile: y

postpublication: y

post_ASSET_: y
post_ITEMNAME_: y
post_DEFINITION_: y
posttemplate: y

postsku: y
postproductdesc: y
postcaseqty: y
postbulbshape: y
postbulbsize: y
postbasetype: y
postcolortemp: y
postmeanlength: y
postlightcenterlength: y
postreducedwattage: y
postbeamspread: y
postfixturetype: y
postballasttype: y
postcolorrenderingindex: y
postminstarttemp: y
postpowerfactor: y
posttotalharmonicdist: y
postspreadbeam10h: y
postspreadbeam10v: y
postspreadbeam50h: y
postspreadbeam50v: y
posthalogen: y
postoperatingposition: y
postfilamenttype: y
postbulbimage: y
postbaseimage: y
postfilamentimage: y
postfootnotes: y
postcat1: y
postcat2: y
postprice: y
postvoltage: y
postwattage: y
postlife: y

postParentList: y

43.4.6 Sample Flex Asset Source File for RemoteContentPost

This following source file works with the example configuration file immediately preceding this section. This source file creates a lightbulb product named 10004 from the product definition named Lighting:

<document>

# the first three tags are required
<_ASSET_>Products</_ASSET_>
<_ITEMNAME_>10004</_ITEMNAME_>
<_DEFINITION_>Lighting</_DEFINITION_>

# This tag is required because the publication is
# not set in the configuration file
<publication>AA Illumination</publication>

# This tag assigns a Template asset to the product
<template>Lighting_Detail</template>

# The rest of these tags set flex attribute values for the product
<price>5</price>
<sku>10004</sku>
<productdesc>F4T5/CW</productdesc>
<caseqty>24</caseqty>
<bulbshape>T</bulbshape>
<bulbsize>5</bulbsize>
<basetype>Miniature Bipin (G5)</basetype>
<colortemp>4100</colortemp>
<colorrenderingindex>60</colorrenderingindex>
<bulbimage>BLB-260.gif</bulbimage>
<baseimage>BLB-250.gif</baseimage>
<filamentimage></filamentimage>
<life>6000</life>
<voltage></voltage>
<wattage>4</wattage>
<cat1>Fluorescent</cat1>
<cat2>Preheat Lamps</cat2>

# this tag sets the immediate parents only
<ParentList>Preheat Lamps</ParentList>

</document>

The preceding source file sets several attribute values for the product and sets its immediate parent to Preheat Lamps. This parent must exist.

43.5 Editing Flex Assets with XMLPost

With XMLPost, you can edit the value of an attribute and the asset's parents (either the flex asset's parents or the parent's parents).

You cannot edit attribute assets, flex definition assets, or flex parent definition assets with XMLPost.

To edit the attribute value for a flex asset, the source file needs to include only the name of the asset and the attribute that you want to change.

To edit the attribute value for a flex parent, you must provide the context of a flex asset. The source file must name the flex asset and can then reference just parent and the parent attribute that you want to change. But you must specify a flex asset for XMLPost to start with so that it can work its way through the family tree.

See these topics:

43.5.1 Configuration Files for Editing Flex Assets

There are two differences in the configuration file for editing a flex asset: the pagename argument and an additional tag and property.

Pagename Argument

The pagename argument must be set to: OpenMarket/Gator/XMLPost/modifyData.

For example:

xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Gator/XMLPost/modifyData

You invoke XMLPost from the command line as usual, identifying the configuration file and the source files.

Additional Tag/Property

You can use the following optional tag and property when you are editing a flex asset:

  • tag: <_REMOVE_parentDefinitionName>

  • property: post_REMOVE_parentDefinitionName

It removes a parent from the flex asset.

You can use the following optional tag and property to identify the asset to be modified when there are other assets with the same name (_ITEMNAME_), the same asset type (_ASSET_), and the same subtype (_TYPE_) in the same site:
  • tag: <_ID_>

  • property:post_ID_

43.5.2 Source Files for Editing Flex Assets

The source file for an edited flex asset does not have to include all the information for that asset, you only have to provide the information that you want to change. Any attributes that you do not specify are not modified in any way.

This section includes the following topics:

43.5.2.1 Changing the Value of an Attribute

To change the value of an attribute, you specify the new attribute value in the source file. When XMLPost runs the import, it writes over the old value with the value provided in the source file.

The following sample source file changes two attribute values (bulbshape and bulbsize) for the product named 10004 that was defined in Sample Flex Asset Source File for addData:

<document>
<!-- predefined xml tags (required) -->
<_ASSET_>Products</_ASSET_> 
<_ITEMNAME_>10004</_ITEMNAME_>
<_TYPE_>Lighting</_TYPE_>
<!-- attribute xml tags -->
<bulbshape>E</bulbshape> 
<bulbsize>9</bulbsize> 
</document>

43.5.2.2 Removing an Attribute Value

  • To remove an attribute value and leave it blank, code a line that names the attribute and specify _EMPTY_ as the attribute's value.

    For example:

    <bulbsize>_EMPTY_</bulbsize>
    

Note:

To empty a multivalued attribute, in place of _EMPTY_ , set the multivalue delimiter which, by default, is the ; char.  For example: <someattribute>;</someattribute>.

You can also edit attribute values for parents. Let's say that the bulbsize attribute is set at the parent level. If that were the case, the following lines of code would set two parents and provide a value for bulbsize for each:

<_GROUP_SubCategory>All-Weather Lamps;Appliance Lamps
</GROUP_SubCategory>
<bulbsize>All-Weather Lamps=10:Appliance Lamps=8</bulbsize>

Option 1

This line of code clears the bulbsize for the All-Weather Lamps parent:

<bulbsize>All-Weather Lamps=_EMPTY_:Appliance Lamps=8</bulbsize>

Option 2

Alternatively, you could just use this line of code, without repeating the value for Appliance Lamps:

<bulbsize>All-Weather Lamps=_EMPTY_</bulbsize>

43.5.2.3 Editing Parent Relationships

You can use XMLPost to make the following edits to the parent relationships for a flex asset:

  • Add another parent to the existing parents.

  • Change a parent from one parent to another.

The GROUP_parentDefinitionName tag works differently than the attribute tags:

  • When you use an attribute tag, XMLPost writes the new value over the old value.

  • When you use a GROUP_parentDefinitionName tag, XMLPost does not overwrite an old parent with a new parent, even when the parent definition name is the same. It adds the new parent to the list of parents that the asset has, which may not be what you want.

  1. To add another parent to the list of existing parents, include the line of code in the source file. For example:
    <_GROUP_SubCategory>Blacklights</_GROUP_SubCategory>
    
    
  2. To remove a parent, use the <_REMOVE _> tag. Note that you must be careful not to remove a required parent unless you are replacing it. For example:
    <_REMOVE_Processor>Appliance Lamps</_REMOVE_Processor>
    

43.6 Deleting Assets with XMLPost

You can delete any asset of any type using XMLPost. Read this to know how:

  • Your configuration file must instruct XMLPost to call the deleteData element.

    For example:

    xmlpost.argname1: pagename
    xmlpost.argvalue1: OpenMarket/Gator/XMLPost/deleteData
    
  • You also need these source file tags and configuration file properties:

    <_ASSET_>/post_ASSET_ which identifies the asset type of the asset you want to delete.

    <_ITEMNAME>/post_ITEMNAME_ which identifies the asset you want to delete.

When XMLPost uses this posting element, it changes the value in the Status column for that asset to VO for void. (It does not physically remove it from the database).

See these topics:

43.6.1 Configuration Files for Deleting Assets

Here is an example configuration file:

xmlpost.xmlfilenamefilter: .xml

xmlpost.url: http://izod19/servlet/ContentServer
xmlpost.numargs: 4
xmlpost.argname1: pagename
xmlpost.argvalue1: OpenMarket/Gator/XMLPost/deleteData
xmlpost.argname2: authusername
xmlpost.argvalue2: user_editor
xmlpost.argname3: authpassword
xmlpost.argvalue3: user
xmlpost.argname4: inifile
xmlpost.argvalue4: futuretense.ini

xmlpost.success: Success
xmlpost.failure: Error
xmlpost.logfile: productdefpostlog.txt
xmlpost.deletefile: y

postpublication: y
post_ASSET_: y
post_ITEMNAME_: y

You invoke XMLPost from the command line as usual.

43.6.2 Source Files for Deleting Assets

The source files for deleting assets are short and simple. For example:

<document> 
<_ASSET_>Products</_ASSET_> 
<_ITEMNAME_>Pentium 90</_ITEMNAME_> 
<publication>my publication</publication>
</document>

This code instructs XMLPost to delete a product asset named Pentium 90 (it changes the status of Pentium 90 to VO, for void).