与其他应用程序集成 > 数字产品追踪能力 > 在 ThingWorx 中配置 Windchill 数字产品追踪能力 (DPT) 扩展 > 先决条件
  
先决条件
已启用 ThingWorx,以允许导入 Windchill 扩展。
默认情况下,在 ThingWorx 中将针对所有用户禁用扩展导入。要启用导入,请配置 platform-settings.json 文件。有关详细信息,请参阅 ThingWorx Platform 帮助中心中的 plateform-settings.json 配置详细信息
1. 打开 platform-settings.json 文件。默认情况下,该文件位于 ThingworxPlatform 文件夹中。
2. 添加以下 ExtensionPackageImportPolicy 参数或将其更新为 true,以允许导入扩展。
* 
默认情况下,所有参数均设置为 false。有关每个参数的详细信息,请参阅 platform-settings.json
"ExtensionPackageImportPolicy": {
"importEnabled": false,
"allowJarResources": false,
"allowJavascriptResources": false,
"allowCSSResources": false,
"allowJSONResources": false,
"allowWebAppResources": false,
"allowEntities": false,
"allowExtensibleEntities": false
},
3. 保存并关闭 platform-settings.json 文件。
如需了解有关配置的最佳做法,请参阅 ThingWorx Platform 帮助中心中的导入扩展
* 
有关支持的 ThingWorx 应用程序版本的说明,请参阅相应文档。
ThingWorx 配置为允许跨源请求。
ThingWorx Flow 服务器添加跨源资源共享 (CORS) 筛选器,以启用跨源请求。此设置将允许外部 OSLC 服务器访问 ThingWorx Flow 服务器中的数据。
完成以下步骤,以使得网站能够对 ThingWorx Flow 进行 REST 调用:
1. 关闭任何正在运行的 Nginx 实例。
2. 从 Nginx 安装目录的下列位置打开 vhost-flow.conf 文件。
Windows:C:/Program Files/nginx-<版本>/conf/conf.d
Linux:/etc/nginx/conf/conf.d
3. vhost-flow.conf 文件中的 location /Thingworx 部分下,找到 proxy_set_header X-Content-Type-Options nosniff; 行,然后添加以下行:
set $cors '';
# Right side of condition can be regular expression:
# if ($http_origin ~ '^https?://(localhost|www\.yourdomain\.com|www\.yourotherdomain\.com)')
if ($http_origin = '<调用_ThingWorx_Flow_的源>') {
set $cors 'true';
}
if ($cors = 'true') {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
}
# OPTIONS indicates a CORS pre-flight request
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '$http_origin';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
4. <调用_ThingWorx_Flow_的源> 替换为尝试访问 ThingWorx Flow 的网站 URL。
5. 重新启动 Nginx 服务。
有关跨源资源共享 (CORS) 设置的详细信息,请参阅 ThingWorx Platform 帮助中心中的从外部网站对 ThingWorx Flow 进行 REST 调用
* 
有关支持的 ThingWorx 应用程序版本的说明,请参阅相应文档。
Windchill 服务器作为安全域添加到 OSLC 服务器的白名单中。
Windchill 作为安全域添加到使用 Windchill RV&SWindchill ModelerIBM Rational Doors NG 配置的 OSLC 服务器中,以启用从 Windchill 访问委派界面的权限。有关如何将应用程序添加为安全域的详细信息,请参阅参考文档网站中的 Windchill RV&S OSLC Server (《Windchill RV&S OSLC 服务器》) 指南 (12.3.0.0 及更高版本)、Windchill Modeler 帮助中心的 OSLC integration with Integrity Modeler 以及 OSLC integration with IBM Rational DOORS Next Generation 主题。
* 
有关支持的 Windchill RV&SWindchill Modeler 应用程序版本的说明,请参阅文档。
Windchill_Digital_Product_Traceability_Bundle zip 文件 (12.0.0.0) 可从 PTC.com 上的 PTC 软件下载页面下载。该压缩文件提供在 Windchill PDMLink 产品系列下,其内容包括:
1. Windchill_Digital_Product_Traceability-extension - Windchill DPT 扩展压缩文件。
2. Windchill_Digital_Product_Traceability_Config_Things - 示例事物 XML 文件的压缩文件。
* 
如果在浏览器中收到证书错误,请使用由受信任的证书颁发机构 (CA) 颁发和验证的标准 SSL 证书。如果您具有自签名证书,请在浏览器中将自签名证书作为受信任证书导入。
有关 ThingWorx 用户配置文件所需权限的信息,请参阅 ThingWorx Platform 实体的权限
有关配置 DPT 扩展的详细信息,请参阅配置 Windchill DPT 扩展