This chapter describes the posting elements for the XML-Post utility.
Chapter 20, "Importing Assets of Any Type" presents the core information about using the XMLPost utility. If you are using the flex asset data model, you have more tools for importing your assets. WebCenter Sites provides posting elements for the XMLPost utility and a bulk processing utility named BulkLoader.
This chapter contains the following sections:
This chapter refers to the BulkLoader utility, but for in-depth information about how to run it, see Chapter 22, "Importing Flex Assets with the BulkLoader Utility."
WebCenter Sites provides two methods for importing assets that use the flex data model into the WebCenter Sites database:
XMLPost. WebCenter Sites provides three additional posting elements that work with XMLPost: addData
, modifyData
, and deleteData
.
The BulkLoader utility.
This section contains the following topics:
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. If you are using the BulkLoader utility, the flex parents must also be imported with XMLPost or created.
After you import your data structure asset types, then you can import your flex assets with one of the two import methods, depending on the situation:
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.
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 Chapter 22, "Importing Flex Assets with the BulkLoader Utility."
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.
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, there must be sites created, and so on before you can use XMLPost to import assets.
For information about the basic prerequisites for using XMLPost that apply to all asset types (both asset models), see Section 20.4.1, "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:
Attribute editors are optional, but if you plan to use them you must either import them or create them before you import your flex attributes. The configuration file must instruct XMLPost to call the RemoteContentPost
element. For information, see Section 21.3.1, "Attribute Editors."
Flex attributes. The configuration file must instruct XMLPost to call the RemoteContentPost
element. For information, see Section 21.3.2, "Flex Attributes."
Flex parent definitions. The configuration file must instruct XMLPost to call the RemoteContentPost
element. For information, see Section 21.3.3, "Flex Definitions and Flex Parent Definitions."
Flex definitions. The configuration file must instruct XMLPost to call the RemoteContentPost
element. For information, see Section 21.3.3, "Flex Definitions and Flex Parent Definitions."
Note:
You must import the flex parent definitions in the proper order. That is, if a parent definition refers to another parent definition asset, the referenced asset must already exist in the database. It is typical to import parent definitions one hierarchical level at a time, starting with the top level definitions.
Flex parent assets. Do one of the following:
If you are going to use XMLPost to import the flex assets, you can either import the flex parents individually or you can import them as part of the flex family tree for a flex assets.
If you are going to use the BulkLoader utility to import the flex assets, you must first use XMLPost to import the flex parent assets. 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.
For information, see Section 21.3.4, "Flex Parents."
(Optional) If you plan to use the BulkLoader utility to import flex assets into both the management system and the delivery system, you must 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.
Flex assets. Do one of the following:
Use the BulkLoader utility. See Chapter 22, "Importing Flex Assets with the BulkLoader Utility."
Use XMLPost. See Section 21.4, "Importing Flex Assets with XMLPost."
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 you have attributes of type asset
and a flex parent or flex asset has such an attribute, the asset that you designate as the value of that attribute field must have already 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.
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), you can specify custom delimiters as explained in the following table.
Table 21-1 Custom Data Delimiters
Tag and property | Description |
---|---|
tag:
property:
|
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 2. Use the tag in your XML file to define the custom delimiter. For example, to use the "at" character as a delimiter:
The default delimiter is the colon ( |
tag:
property:
|
Optional. Lets you specify a custom character for delimiting attribute names from their values. To specify a custom delimiter: 1. Set the property to 2. Use the tag in your XML file to define the custom delimiter. For example, to use two equal signs as a delimiter:
The default delimiter is the equal sign ( |
tag:
property:
|
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 2. Use the tag in your XML file to define the custom delimiter. For example, to use a hyphen as a delimiter:
The default delimiter is the semicolon ( |
The XMLPost utility works the same no matter which asset model or WebCenter Sites product you are using. However, WebCenter Sites provides additional processing logic in some of its standard elements for the flex asset types to support XMLPost because flex assets store their data in more than one database table (unlike basic asset types, which have one database table).
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 Chapter 20, "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, the product and product parent types in the GE Lighting sample site).
Depending on the situation, you can use either the posting element addData
to import the flex and flex parent asset types or the posting element RemoteContentPost
. (See Section 21.3.4, "Flex Parents" and Section 21.4, "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 Section 21.1, "Understanding Flex Assets" and supplemented in this chapter), and then invoke the XMLPost utility (as described in Section 20.4, "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 Section 16.3.3, "Step 1: Create a Flex 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. And the internal name for the GE Lighting sample site's article asset type is AArticles
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
All of the information about configuration and source files for basic assets that is presented in Chapter 20, "Importing Assets of Any Type" applies to the configuration and source files for the flex asset types.
Additionally, this section provides example configuration and source files for the structural flex asset types.
This section contains the following topics:
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.
The following table describes the configuration file properties and source file tags that you use with attribute editors:
Table 21-2 Attribute Editor Tag and Properties
Attribute editor tag and property | Description |
---|---|
tag:
property:
|
Required. Name of the attribute editor asset; this is a required value for all asset types. Attribute names are limited to 64 characters and cannot contain spaces. |
tag:
property:
|
Optional. Description of the use or function of the attribute. |
tag: property: |
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. |
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
The following source file is tagged for importing a check box attribute editor, or presentation object, for the GE Lighting sample catalog. It works with the preceding sample configuration file.
<document> <publication>GE Lighting</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>
Flex attributes have several tables but XMLPost writes to only two of them: the main storage table (for example, the PAttributes
table for the GE Lighting sample site) and the attribute asset type's _Extension
table (PAttributes_Extension
, for example).
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 as follows:
Table 21-3 Flex Attribute Tags and Properties
Flex attribute tag and property | Description |
---|---|
tag:
property:
|
Required. Name of the attribute; this is a required value for all asset types. Attribute names are limited to 64 characters and cannot contain spaces. |
tag:
property:
|
Optional. Description of the use or function of the attribute. |
tag:
property: |
Optional. Whether the attribute can hold a single value ( |
tag:
property:
|
Required. The data type of the attribute. Valid options are |
tag: property: |
Required if The name of the asset type that the attribute holds. |
tag:
property:
|
Required if The 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 attribute table by the |
tag: property:
|
Optional. The name of the attribute editor to use, if applicable. |
tag:
property:
|
Optional. If you are using a search engine on your management system, the name of the search engine. |
tag:
property:
|
Optional. The search engine character set to use. By default, it is set to ISO 8859-1. |
tag:
property:
|
Foreign attributes only. Whether a foreign attribute can be edited through the WebCenter Sites forms ( |
tag:
property:
|
Foreign attributes only. Whether the values for a foreign attribute are to be stored in a |
tag:
property:
|
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. |
tag:
property:
|
Foreign attributes only. The name of the column in the foreign table that holds the values for this attribute. |
tag:
property:
|
Foreign attributes only. The name of the foreign table that contains the columns identified by externalid and external column. |
tag:
property:
|
Optional. The names of all the sites that can use this attribute. |
This is sample configuration file for the product attribute asset type from the GE Lighting sample site. 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: 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
This is a sample source file for importing a product attribute named footnotes
for the GE Lighting sample site. It works with the preceding sample configuration file.
<document> <publication>GE Lighting</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. For information, read Section 16.3.6, "Step 4: Create Flex Attributes."
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 contains 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 21-4 Flex Definition and Flex Parent Definition Tags and Properties
Flex definition and flex parent definition tag and property | Description |
---|---|
tag:
property:
|
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:
property:
|
Optional. The description of the use or function of the asset. |
tag:
property:
|
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:
property:
|
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 |
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 Section 16.3.7, "Step 5: (Optional) Create Flex Filter Assets" and Section 16.3.9, "Step 7: Create Flex Definition Assets." |
n/a |
tag:
property:
|
Use this tag to specify any single optional parent definition. |
tag:
property:
|
Use this tag to specify any single required parent definition. |
tag:
property:
|
Use this tag to specify more than one required parent definitions. |
tag:
property:
|
Use this tag to specify more than one 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 Section 16.3.7, "Step 5: (Optional) Create Flex Filter Assets" and Section 16.3.9, "Step 7: Create Flex Definition Assets." |
n/a |
tag:
property:
|
The list of attributes that are required for the flex parents or the flex assets that use the definition. |
tag:
property:
|
The list of attributes that are optional for the flex parents or the flex assets that use the definition. |
tag:
property:
|
The order in which all attributes, be they required or optional, should appear in the New, Edit, Inspect, and similar forms. If you use this tag, it 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.
The following example is a configuration file used to import product definitions for the GE Lighting sample site. 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
The following source file, lighting.xml
, is the source for a product definition named Lighting for the GE Lighting sample site. It works with the preceding sample configuration file.
<document> <publication>GE Lighting</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 list of attributes, above. When you include multiple values in a tag, separate them from each other with a semicolon (;).
Note that while GE Lighting uses the optional/multiple parent model, there are these other possible configurations:
<OptionalSingleParentList>flexparentdefinition</OptionalSingleParentList> <RequiredSingleParentList>flexparentdefinition</RequiredSingleParentList> <RequiredMultipleParentList>flexparentdefinition</RequiredMultipleParentList>
Supplying a List of Ordered Attributes
If you want to use the <OrderedAttrList>
tag because the attributes need 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 the desired 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>
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. If you plan to use the BulkLoader utility, you must first import the flex parent assets with XMLPost in this way.
As part of the flex family tree for a flex asset. If you are using XMLPost to import your flex assets (rather than the BulkLoader), you can 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 section describes the source and configuration file for importing them individually. For information about importing them with the flex assets, see Section 21.4, "Importing Flex Assets with XMLPost."
This section contains the following topics:
Section 21.3.4.1, "Sample Configuration File: Individual Flex Parent"
Section 21.3.4.2, "Sample Source File: Individual Flex Parent"
The following example is a configuration file used to import product parents for the GE Lighting sample site. 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
The following source file creates a product parent (flex parent) named Halogen for the GE Lighting sample. It works with the preceding sample configuration file.
<document> <publication>GE Lighting</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.
Before you can use XMLPost to import flex assets, you must have already imported the structural asset types (attributes, flex definitions, and flex parent definitions).
There are two posting elements that you can use for flex assets, RemoteContentPost
or addData
:
The addData
posting element creates parent assets for the flex asset if they do not yet exist. For example, if you are not using the BulkLoader utility, you use this posting element for the initial import of your flex assets.
When you use the addData
posting element, the source file must specify the entire family tree for the flex asset. You need a separate source file for each flex asset, 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 already exist. For example, if you plan to use BulkLoader once, just for the initial import and will use XMLPost from then on, you might want to use this posting element.
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, if you need to create a new flex parent for the new flex asset, you must use the addData
posting element and specify the entire family tree in the source file.
This section contains the following topics:
Section 21.4.1, "Configuration File Properties and Source File Tags for Flex Assets"
Section 21.4.2, "Sample Flex Asset Configuration File for addData"
Section 21.4.3, "Configuration File Properties and Attributes of Type Blob (or URL)"
Section 21.4.5, "Sample Flex Asset Configuration File for RemoteContentPost"
Section 21.4.6, "Sample Flex Asset Source File for RemoteContentPost"
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 need 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 contains the following topics:
Section 21.4.1.2, "For the RemoteContentPost Posting Element"
Section 21.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 addData
posting element. Note that they are case-sensitive.
Table 21-5 addData Posting Element
Tag and property | Description |
---|---|
tag:
property:
|
Required. The internal name of the asset type. For example, the internal asset type names of the GE Lighting sample site flex assets are |
tag:
property:
|
Required. The name of the flex definition that this flex asset is using. |
tag:
property:
|
Required. The name of the asset. |
tag:
property:
|
Optional. The description of the asset. |
property:
|
Optional. The flex asset's parents. The configuration file must include a tag for each possible parent definition. For example, if your flex assets could have parents that use either of two parent definitions named Division and Department, the configuration file needs two properties that define a tag for each:
See Section 21.4.4.4, "Specifying the Parents of a Flex Asset" for more information about using this tag and property. |
tag:
property:
|
Optional. If the parent that you are designating is new, you can also include the description of the parent definition. |
tag:
property:
|
Optional. The name of the Template asset for the flex asset. |
tag:
property:
|
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 need to supply a value for each required attribute and any optional ones that apply to that asset. For example, if there were an attribute named SKU, you would include a property called
|
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 21-6 RemoteContentPost Posting Element
Tag and property | Description |
---|---|
tag:
property:
|
Required. The name of the flex definition that this flex asset is using. (Note that |
tag:
property:
|
Required. The name of the asset. |
tag:
property:
|
Optional. The description of the asset. |
property:
|
Optional. The flex asset's immediate parents. |
tag:
property:
|
Optional. The name of the Template asset for the flex asset. (Note that |
tag:
property:
|
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 need to supply a value for each required attribute and any optional ones that apply to that asset. For example, if there were an attribute named SKU, you would include a property called
|
This is a sample configuration file for the product asset type from the GE Lighting sample site. It invokes the addData
posting element and works with the source file example immediately following this example file.
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
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
).
Attribute of Type Blob (or URL) as an Upload Field
There are no attributes of type blob in the GE Lighting sample site. However, lets say that there is an attribute of type blob
named footnotes.
It is an upload field with a Browse button for finding the file rather than a text field that you enter text in to. 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.
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>
This following source file works with the example flex asset configuration file preceding this section.
This section contains the following topics:
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>GE Lighting</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.
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.
If your source file includes attribute values that contains any of the special characters listed in the following table, be sure to replace all instances of that character with its corresponding URL encoding sequence, found in Section 4.8, "Values for Special Characters."
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:
Determines which parent definitions are legal for an asset using this flex definition.
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.
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. In the GE Lighting sample site, a product asset has a parent and a grandparent. In addition to specifying the parent for the lightbulb (Blacklight), you need to specify the grandparent. For example:
<_GROUP_subcategory>Blacklights</_GROUP_subcategory>
<_GROUP_category>Fluorescent</_GROUP_category>
How does XMLPost know which parent the attribute values belong to? It does not. If an attribute can belong to more than one parent, you must specify which parent it belongs to. 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>
All of the tags that configure parents and the tags that specify attributes (as long as 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.
You use a similar syntax when you want 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 more than one value for the attribute (Incandescent=E;K:Halogen=T
).
And, as mentioned, you can specify descriptions for the parents that you identify in the same tag, too. For example:
<_GROUPDESCRIPTIONS> Incandescent=From Detroit:Halogen=From Chicago </_GROUPDESCRIPTIONS>
This is a sample configuration file for the product asset type from the GE Lighting sample site. It works with the source file example immediately following this example file.
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
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>GE Lighting</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 already exist.
You can edit the following information for flex assets and flex parent assets with XMLPost:
The value of an attribute
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.
This section contains the following topics:
There are two differences in the configuration file for editing a flex asset: the pagename argument and an additional tag and property.
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.
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.
The source file for an edited flex asset does not need to include all the information for that asset, you only need to provide the information that you want to change. Any attributes that you do not specify are not modified in any way.
This section contains the following topics:
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 GE Lighting product named 10004 that was defined in Section 21.4.4, "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>
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>
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>
This line of code clears the bulbsize for the All-Weather Lamps parent:
<bulbsize>All-Weather Lamps=_EMPTY_:Appliance Lamps=8</bulbsize>
Alternatively, you could just use this line of code, without repeating the value for Appliance Lamps:
<bulbsize>All-Weather Lamps=_EMPTY_</bulbsize>
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 do 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.
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>
If you want 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.
<_REMOVE_Processor>Appliance Lamps</_REMOVE_Processor>
You can use XMLPost to delete any asset of any type. There are two requirements:
Your configuration file must instruct XMLPost to call the deleteData
element.
For example:
xmlpost.argname1: pagename xmlpost.argvalue1: OpenMarket/Gator/XMLPost/deleteData
There are two required 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).
This section contains the following topics:
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.
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).