Create an XML file describing columns to import and export
About this task
For each entity that you want to export and import, create an XML file that describes the columns to export and import.
Procedure
-
Create a new XML file that describes the fields to
export from and import into the entity. Name the file
EntityNameFlow.xml and save it
in
in Studio.
Use the CPLocationFlow.xml and CPBuildingFlow.xml files as a model for creating additional
EntityInfoXML files. -
Add the following root element to
the file:
<EntityInfo EntityTypeName="entity.EntityName" ParentEntityTypeName="entity.parentEntityName" ParentEntityColumnPath="EntityName.ID">Attribute
Required?
Description
EntityTypeNameRequired
The name of the entity preceded by:
entity.ParentEntityTypeNameOptional
If the parent entity is also to be imported and exported, the name of the parent entity preceded by:
entity.ParentEntityColumnPathOptional
The path that identifies the unique ID column of the parent entity, if a parent entity is specified.
-
Within the
EntityInfoelement, add a collection ofColumnInfochild elements. EachColumnInfoelement specifies one column to be exported to and imported from the spreadsheet. The order of theColumnInfoelements determines the order of the columns in the exported spreadsheet.<ColumnInfo ColumnType="pathTypeName" ExcludeFromTemplate="true|false" FlagsAction="true|false" FlagsEntityId="true|false" Header="displayKeyPath" id="columnName" Locked="true|false" Path="beanPathToColumnValue" RequiredForImport="true|false">Attribute
Required?
Description
ColumnTypeOptional
The full path type name of the column’s data value. If the column type cannot be handled by one of the predefined data column resolvers, you must define a new data column resolver for each such type. Then adjust the ColumnDataResolverFactory class to select the new type when appropriate. Default:
String.ExcludeFromTemplateOptional
Whether to exclude the column when exporting a template. Default:
false.FlagsActionOptional
Whether the column specifies the action for the spreadsheet row. Only one column can have this attribute set to true, and this is the Action column, typically exported as the first column in the spreadsheet. All other attributes except
Headerare ignored. Default:false.FlagsEntityIdOptional
Whether the column uniquely identifies the entity. Default:
false.HeaderRequired
The display key path that contains the string that is output as the column header. Using a display key enables the column headers to be localized. Specify the
Headervalue for the Action column asExport.Action.PolicyCenter writes the column display keys under , though a display key for that name may already exist at some other location. You can quickly look at all exported column data under the
Exportnode.IdOptional
The name identifier of the column upon which other columns are dependent. Used only when another
ColumnInfospecifies aRequiredelement with thisColumnInfoas its target. For more information, see Create an XML file describing columns to import and export.LockedOptional
Whether the column value cannot be modified. Locked columns are set to read-only and shaded gray in the exported spreadsheet. Default:
False.PathOptional
Required except when
FlagsActionistrue. The bean path that accesses the column value of the entity.RequiredForImportOptional
Whether the column value must be specified when the spreadsheet is imported. Default:
false. -
If the entity you are defining is a child of another entity that is to be exported and imported, add a
Parentelement within theEntityInfoelement. Within theParentelement, add a map of the parent’sColumnInfoelements.For example:<EntityInfo ...> . . . <Parent> <ColumnInfo Path="CPLocation.PublicID" Header="Export.CPBuilding.LocationID" Locked="true" ColumnType="java.lang.String" /> <ColumnInfo Path="CPLocation.Location.LocationName" Header="Export.CPBuilding.LocationName" ColumnType="java.lang.String" /> ... </Parent> . . . </EntityInfo> -
Optionally, add dependent elements.
A
ColumnInfoelement can also contain an optional map ofDependentchild elements, each of which specifies another column on which the containingColumnInfois dependent. EachDependentelement takes a single attribute, purpose, that is a key to the id of aColumnInfoon which the containingColumnInfois dependent. For example:<!-- Column that can have dependent columns because it has an id attribute --> <ColumnInfo Path="CPLocation.Location.State" Header="Export.CPBuilding.State" ColumnType="typekey.State" id="stateColumn" RequiredForImport="true" /> . . . <!-- Column that depends on another column --> <ColumnInfo Path="ClassCode" Header="Export.CPBuilding.ClassCode" ColumnType="entity.CPClassCode" RequiredForImport="true" > <Dependent purpose="State">stateColumn</Dependent> </ColumnInfo>
