Servigistics InService 部署 > 高级配置 > 加载用户、配置文件和服务商
  
加载用户、配置文件和服务商
可在初始设置和配置 Servigistics InService 时从文件加载用户、配置文件和服务商,而不必用管理主页上的实用工具逐一创建。这可以通过 LoadFromFile 命令行实用工具完成。
加载到 Servigistics InService 之后,可以通过管理主页上的实用程序查看和管理这些用户、配置文件和服务商。
LoadFromFile 语法如下:
windchill wt.load.LoadFromFile -d <数据文件名称> -u <用户名> -p <密码>
,其中:
<数据文件名称> 是包含要加载对象的文件的名称。此自变量是必需的。
<用户名><密码>Servigistics InService 管理员的登录凭据。这些参数是可选项,如果不在命令中输入,实用工具在运行时会提示输入。
例如,要从名为 Users.xml 的文件加载用户,请完成以下步骤:
1. <InS_HOME>\InService\InS_SW\SW\Applications\Windchill.ear\bin 打开命令提示符
2. 打开 Windchill shell。
3. 运行以下命令:
windchill wt.load.LoadFromFile -d Users.xml
4. 当提示进行身份验证时,提供 Servigistics InService 管理员的登录凭据。
以下部分分别包括加载用户、配置文件和服务商的示例加载文件:
加载用户
加载配置文件
加载服务商
加载用户
来自配置有 Servigistics InService 的外部企业标识管理系统 (通常为 LDAP) 的用户,以及内部用户,都可以批量加载到 Servigistics InService。内部用户是指在用作内部系统的 Servigistics InService 中创建的用户,这些用户不存在于外部企业标识管理系统。有关详细信息,请参阅 Servigistics InService 管理帮助中心 中的“用户”。
要加载 SampleUsers.xml 文件,请从 Windchill shell 运行以下命令:wt.load.LoadFromFile -d SampleUsers.xml
以下 SampleUsers.xml 文件显示用于加载用户的加载文件格式。
<?xml version="1.0"?>
<!DOCTYPE NmLoader SYSTEM "standardX26.dtd">
<NmLoader>
<csvUser handler="orgLoadPrincipal.createUser">
<csvuser></csvuser>
<csvnewUser>mkangas</csvnewUser>
<csvwebServerID>mkangas</csvwebServerID>
<csvfullName>Mike Kangas</csvfullName>
<csvLast></csvLast>
<csvLocale></csvLocale>
<csvEmail></csvEmail>
<csvDescription></csvDescription>
<csvTitle></csvTitle>
<csvOrganization></csvOrganization>
<csvStreet1></csvStreet1>
<csvStreet2></csvStreet2>
<csvCity></csvCity>
<csvState></csvState>
<csvCountry></csvCountry>
<csvZipCode></csvZipCode>
<csvignore></csvignore>
<csvpassword></csvpassword>
<csvDirectoryService>com.ptc.ldap-web</csvDirectoryService>
</csvUser>
<csvUser handler="orgLoadPrincipal.createUser">
<csvuser></csvuser>
<csvnewUser>sampleUser</csvnewUser>
<csvwebServerID>sampleUser</csvwebServerID>
<csvfullName>Sample User</csvfullName>
<csvLast></csvLast>
<csvLocale></csvLocale>
<csvEmail>[email protected]</csvEmail>
<csvDescription></csvDescription>
<csvTitle></csvTitle>
<csvOrganization></csvOrganization>
<csvStreet1></csvStreet1>
<csvStreet2></csvStreet2>
<csvCity></csvCity>
<csvState></csvState>
<csvCountry></csvCountry>
<csvZipCode></csvZipCode>
<csvignore></csvignore>
<csvpassword>sampleUser</csvpassword>
<csvDirectoryService></csvDirectoryService>
</csvUser>
</NmLoader>
请注意以下事项:
虽然加载程序不要求提供 csvLast (用户姓氏) 元素,但最佳做法是提供该元素。
csvDirectoryService 元素是可选项。如果未提供,则用户作为内部用户添加到 InService。如果必须将用户添加到配置有 Servigistics InService 的外部企业标识管理系统 (通常为 LDAP),则必须为 csvDirectoryService 元素指定相应的值。
加载配置文件
以下 SampleProfiles.xml 文件显示用于加载配置文件的加载文件格式。
<?xml version="1.0"?>
<!DOCTYPE InSObjects SYSTEM "standardX26.dtd">
<InSObjects>
<SCProfile>
<name>P2</name>
<description>Demo profile P2 from loader</description>
<objectContainerPath>/</objectContainerPath>
<PHNode>
<name>0000016616</name>
<value>SN_SedanHybrid_Engine V4</value>
<path>V=1~{"rId":"0000022202","op":["0000022202","0000015163","0000016604", "0000016607","0000022145","0000022144","0000016616"], "nn":289,"ts":1438844494106}
</path>
</PHNode>
<PHNode>
<name>0000022202</name>
<value>SEDAN</value>
<path>V=1~{&quot;rId&quot;:&quot;0000022202&quot;,&quot;op&quot;: [&quot;0000022202&quot;,&quot;0000014982&quot;]}</path>
</PHNode>
<IENode>
<name>Parts List</name>
<value>partsList</value>
<path>infoType</path>
</IENode>
<user>u1</user>
<user>u2</user>
<user>u3</user>
<privilege>Activation</privilege>
<privilege>Updation</privilege>
<enterpriseAttributes>
<name>faxNumber</name>
<value>340985034</value>
</enterpriseAttributes>
<enterpriseAttributes>
<name>email</name>
<value>[email protected]</value>
</enterpriseAttributes>
</SCProfile>
<SCProfile>
<name>P1</name>
<description>Demo profile P1 from loader</description>
<objectContainerPath>/</objectContainerPath>
<allPHNode>true</allPHNode>
<allIENode>true</allIENode>
<user>u1</user>
<user>u2</user>
<user>u3</user>
<privilege>Activation</privilege>
<privilege>Updation</privilege>
<enterpriseAttributes>
<name>faxNumber</name>
<value>340985034</value>
</enterpriseAttributes>
<enterpriseAttributes>
<name>email</name>
<value>[email protected]</value>
</enterpriseAttributes>
</SCProfile>
</InSObjects>
请注意以下事项:
对于每个 PHNode 元素 (产品层次结构),都必须指定 namevaluepath 值。这些值可在 InService 系统中找到,如下所示:
value - 使用痕迹导航中产品层次结构级别的名称。
path - 按照以下步骤确定 path 值:
1. Servigistics InService 用户界面中,导航到要包括在配置文件中的产品层次结构级别。请勿再向下浏览信息结构层次级别,以确保仅包括产品层次结构级别的相对访问路径 ID。
2. 复制浏览器 URL 中 Product:: 之后的字符串。例如:Vj0xfnsicklkIjoiMDAwMDAyMjIwMiIsIm9wIjpbIjAwMDAwMjIyMDIiLCIwMDAwMDE0OTgyIiwiMDAwMDAxNjYwMSIsIjAwMDAwMTY2MTAiXSwibm4iOjQ5NCwidHMiOjE0NTk3NzExMjUwNzF9
3. 使用开源解码器 (如 https://www.base64decode.org/) 获取所需的访问路径输出。对于步骤 2 中的 URL 字符串,这一必需的访问路径输出是:V=1~{"rId":"0000022202","op":["0000022202","0000014982","0000016601","0000016610"],"nn":494,"ts":1459771125071}
name - 使用步骤 3 中访问路径输出的 “op”:[] 部分中的最后一个 ID 号。
加载服务商
以下 SampleServiceGroups.xml 文件可显示用于加载服务商的加载文件格式。
* 
服务商不能批量加载,但可以单独加载。
<?xml version="1.0"?>
<!DOCTYPE Dealership SYSTEM "standardX26.dtd">
<Dealership>
<name>Dealer D1</name>
<description>This is dealer d1</description>
<isLoader>true</isLoader>
<user>user1</user>
<user>user2</user>
<administrator>admin1</administrator>
<logo>
<fileName>tn_MN</fileName>
<fileLocation>codebase.war/wt/icons/tn_MN.jpg</fileLocation>
</logo>
</Dealership>
请注意以下事项:
加载服务商时,isLoader 元素的值必须是 true
对应于服务商徽标的 fileLocation 元素的值必须是 Windchill.ear 的相对位置。