创建、编辑和删除分发目标
要通过 Windchill UI 创建、编辑和管理分发目标,请参阅管理分发目标
创建或更新分发目标的另一种方法是使用 Windchill 加载程序。此方法支持在数据库中创建或更新多个分发目标。
* 
要创建、编辑或删除 ERP Connector 目标,您需要先成为“ESI 管理员”组和“站点管理员”组的成员才可以。
此方法只能用于创建或更新分发目标。不能通过 Windchill 加载程序删除分发目标。
通过 Windchill 加载程序创建或更新分发目标
要通过 Windchill 加载程序创建或更新分发目标,请执行以下步骤:
1. 根据下面给出的示例,创建 XML 文件:
<?xml version="1.0" ?>
<!DOCTYPE NmLoader SYSTEM "standard13_0.dtd">
<!-- Please refer to the Javadoc for more details about the load method for distribution targets -->
<!-- Creating or Updating File DT -->
<NmLoader>
<csvBeginESITarget handler="com.ptc.windchill.esi.load.LoadESI.beginCreateUpdateESITarget">
<csvtypedef>com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt.ESIFileTarget</csvtypedef>
<csvnumber>TEST_FILEDT</csvnumber>
<csvname>TEST_FILEDT</csvname>
<csvdescription>TEST_FILEDT</csvdescription>
<csvtaskURI>com/ptc/windchill/esi/export/ExportToFile_01.xml</csvtaskURI>
<csvdefaultForContext>True</csvdefaultForContext>
<csvstatus>ACTIVE</csvstatus>
<csvresponseMetaInfoPath>$CODEBASE$/com/ptc/windchill/esi/ESIResponseMetaInfo_copy1.xml</csvresponseMetaInfoPath>
<csvmoveToParentContext>True</csvmoveToParentContext>
</csvBeginESITarget>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>ESITargetStorageType</csvdefinition>
<csvvalue1>ESI_NFS_STORAGE_TYPE</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>Path</csvdefinition>
<csvvalue1>$WT_HOME$/FileDTResponse200</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvEndESITarget handler="com.ptc.windchill.esi.load.LoadESI.endCreateUpdateESITarget" />

<!-- Creating or Updating FTP DT -->
<csvBeginESITarget handler="com.ptc.windchill.esi.load.LoadESI.beginCreateUpdateESITarget">
<csvtypedef>com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt.ESIFTPTarget</csvtypedef>
<csvnumber>TEST_FTPDT</csvnumber>
<csvname>FTPDT</csvname>
<csvdescription>FTPDT</csvdescription>
<csvtaskURI>com/ptc/windchill/esi/export/ExportToFTP_02.xml</csvtaskURI>
<csvdefaultForContext>False</csvdefaultForContext>
<csvstatus>ACTIVE</csvstatus>
<csvresponseMetaInfoPath>$CODEBASE$/com/ptc/windchill/esi/ESIResponseMetaInfo_copy.xml</csvresponseMetaInfoPath>
<csvmoveToParentContext></csvmoveToParentContext>
<csvmoveToSiteContext>True</csvmoveToSiteContext>
</csvBeginESITarget>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Host</csvdefinition>
<csvvalue1>ptcsupport.com</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Path</csvdefinition>
<csvvalue1>D:\Response</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Port</csvdefinition>
<csvvalue1>21</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvEndESITarget handler="com.ptc.windchill.esi.load.LoadESI.endCreateUpdateESITarget" />

<!-- Creating File DT -->
<csvBeginESITarget handler="com.ptc.windchill.esi.load.LoadESI.beginCreateUpdateESITarget">
<csvtypedef>com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt.ESIFileTarget</csvtypedef>
<csvnumber>TEST_FILEDT_02</csvnumber>
<csvname>TEST_FILEDT_02</csvname>
<csvdescription>TEST_FILEDT_02</csvdescription>
<csvtaskURI>com/ptc/windchill/esi/export/ExportToFile_01.xml</csvtaskURI>
<csvdefaultForContext>True</csvdefaultForContext>
<csvstatus>ACTIVE</csvstatus>
<csvresponseMetaInfoPath>$CODEBASE$/com/ptc/windchill/esi/ESIResponseMetaInfo_copy1.xml</csvresponseMetaInfoPath>
<csvmoveToParentContext></csvmoveToParentContext>
<csvmoveToSiteContext></csvmoveToSiteContext>
</csvBeginESITarget>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>ESITargetStorageType</csvdefinition>
<csvvalue1>ESI_NFS_STORAGE_TYPE</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>Path</csvdefinition>
<csvvalue1>$WT_HOME$/FileDTResponse200</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvEndESITarget handler="com.ptc.windchill.esi.load.LoadESI.endCreateUpdateESITarget" />
</NmLoader>
2. 根据要更新的分发目标更新 <csvtypedef>
3. <csvIBAValue> 下添加要更新的必需分发目标属性,并根据要更新的属性更新 <csvdefinition>
* 
<csvnumber> 是分发目标的唯一标识号。不支持更新 <csvnumber>
4. 要将分发目标移动到父项上下文,需将 <csvmoveToParentContext> 设置为 True
5. 要将分发目标移动到“站点”上下文,需将 <csvmoveToSiteContext> 设置为 True
6. 将 XML 文件复制到安装所在的文件夹中,例如,<Windchill>/loadFiles/esi/esiCust/<XMLfile>
7. 打开 Windchill shell 并执行以下命令:
windchill wt.load.LoadFromFile -d <Windchill>/loadFiles/esi/esiCust/<XMLfile> -u adminUsername -p adminPassword
也可使用以下加载程序 (先前用于创建或更新分发目标)。
通过 Windchill 加载程序创建分发目标 
要通过 Windchill 加载程序创建分发目标,请执行以下步骤:
1. 安装时,根据 <Windchill>/loadFiles/esi/esiCust/DistributionTargets.xml 文件中的备注编辑该文件。
2. 打开 Windchill shell 并执行以下命令:
java wt.load.LoadFromFile -d %WT_HOME%\loadfiles\esi\esiCust\DistributionTargets.xml
通过 Windchill 加载程序更新分发目标 
要通过 Windchill 加载程序更新分发目标,请执行以下步骤:
1. 根据下面给出的示例,创建 XML 文件:
<?xml version="1.0" ?>
<!DOCTYPE NmLoader SYSTEM "standard13_0.dtd">
<!-- Please refer to the Javadoc for more details about the load method for distribution targets -->
<!-- Updating File DT -->
<NmLoader>
<csvBeginESITarget handler="com.ptc.windchill.esi.load.LoadESI.beginUpdateESITarget">
<csvtypedef>com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt.ESIFileTarget</csvtypedef>
<csvnumber>TEST_FILEDT_200</csvnumber>
<csvname>TEST_FILEDT_700</csvname>
<csvdescription>Updating File DT200</csvdescription>
<csvtaskURI>com/ptc/windchill/esi/export/ExportToFile_01.xml</csvtaskURI>
<csvdefaultForContext>True</csvdefaultForContext>
<csvstatus>ACTIVE</csvstatus>
<csvresponseMetaInfoPath>$CODEBASE$/com/ptc/windchill/esi/ESIResponseMetaInfo_copy1.xml</csvresponseMetaInfoPath>
<csvmoveToParentContext>True</csvmoveToParentContext>
</csvBeginESITarget>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>ESITargetStorageType</csvdefinition>
<csvvalue1>ESI_NFS_STORAGE_TYPE</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>Path</csvdefinition>
<csvvalue1>$WT_HOME$/FileDTResponse200</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvEndESITarget handler="com.ptc.windchill.esi.load.LoadESI.endUpdateESITarget" />

<!-- Updating FTP DT -->
<csvBeginESITarget handler="com.ptc.windchill.esi.load.LoadESI.beginUpdateESITarget">
<csvtypedef>com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt.ESIFTPTarget</csvtypedef>
<csvnumber>TEST_FTPDT_100</csvnumber>
<csvname>FTPDT_2000</csvname>
<csvdescription>Updating FTP DT123</csvdescription>
<csvtaskURI>com/ptc/windchill/esi/export/ExportToFTP_02.xml</csvtaskURI>
<csvdefaultForContext>False</csvdefaultForContext>
<csvstatus>ACTIVE</csvstatus>
<csvresponseMetaInfoPath>$CODEBASE$/com/ptc/windchill/esi/ESIResponseMetaInfo_copy.xml</csvresponseMetaInfoPath>
<csvmoveToParentContext>False</csvmoveToParentContext>
<csvmoveToSiteContext>False</csvmoveToSiteContext>
</csvBeginESITarget>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Host</csvdefinition>
<csvvalue1>ptcsupport.com</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Path</csvdefinition>
<csvvalue1>D:\Response</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvIBAValue handler="wt.iba.value.service.LoadValue.createOrUpdateIBAValue">
<csvdefinition>FTP_Port</csvdefinition>
<csvvalue1>21</csvvalue1>
<csvvalue2/>
<csvdependency_id/>
</csvIBAValue>
<csvEndESITarget handler="com.ptc.windchill.esi.load.LoadESI.endUpdateESITarget" />
</NmLoader>
2. 根据要更新的分发目标更新 <csvtypedef>
3. <csvIBAValue> 下添加要更新的必需分发目标属性,并根据要更新的属性更新 <csvdefinition>
* 
<csvnumber> 是分发目标的唯一标识号。不支持更新 <csvnumber>
4. 要将分发目标移动到父项上下文,需将 <csvmoveToParentContext> 设置为 True
5. 要将分发目标移动到“站点”上下文,需将 <csvmoveToSiteContext> 设置为 True
6. 将 XML 文件复制到安装所在的文件夹中,例如,<Windchill>/loadFiles/esi/esiCust/<XMLfile>
7. 打开 Windchill shell 并执行以下命令:
windchill wt.load.LoadFromFile -d <Windchill>/loadFiles/esi/esiCust/<XMLfile> -u adminUsername -p adminPassword
* 
<csvmoveToSiteContext><csvmoveToParentContext> 是可选属性,可以为每个分发目标单独设置。
创建分发目标时不支持 <csvmoveToParentContext><csvmoveToParentContext>
如果将 <csvmoveToSiteContext> 设置为 True,则现有分发目标的上下文将更新为“站点”上下文。
如果将 <csvmoveToParentContext> 设置为 True,则现有分发目标的上下文将更新为其父项上下文。
如果分发目标的 <csvmoveToParentContext><csvmoveToSiteContext> 的值均设置为 True,则 <csvmoveToSiteContext> 优先。
这对您有帮助吗?