专业化管理 > 生命周期协作开放服务 (OSLC) 服务器
生命周期协作开放服务 (OSLC) 服务器
生命周期协作开放服务 (OSLC) 服务用于简化生命周期管理工具之间的集成。默认情况下,Windchill 支持 OSLC 规范,并允许 OSLC 客户端通过这些服务与 Windchill 集成。
Windchill OSLC API 允许 OSLC 客户端根据 OSLC 规范查询 Windchill 部件并与其建立链接。Windchill 支持以下 OSLC 规范:
Configuration Management 1.0 (用于展开 Windchill 部件)
Windchill OSLC 服务负责将 Windchill 对象映射到相应的 OSLC 资源,并以所请求的格式提供针对这些资源的响应。以下是受支持的格式:
rdf+xml (默认格式)
text/turtle
* 
Windchill OSLC 服务只能由 OSLC 客户端使用;而非 OSLC 客户端则必须使用 Windchill (OData) REST Services (WRS)。
OSLC 目录
可通过 http(s)://<server>:<port>/Windchill/oslc/catalog 访问 OSLC 目录,以了解有关所有可用服务、资源和术语的详细信息。
配置 OAuth 授权
Windchill OSLC 服务的默认授权为基本授权。启用 OAuth 授权时还需要其他配置步骤。有关将 Windchill 配置为使用 OAuth 的步骤,请参阅 Configure OAuth Delegated AuthorizationWindchill OAuth 配置完成后,请设置以下 Windchill 特性:
特性名称
说明
oslc.authorizationURI
用于获取 OAuth 授权的 URI
oslc.oauthAccessTokenURI
用于获取 OAuth 访问令牌的 URI
oslc.oauthRequestTokenURI
用于获取 OAuth 请求令牌的 URI
配置 OSLC OAuth 特性时,Windchill OSLC 目录中将包含 OAuthConfiguration 特性,该特性能够让 OSLC 客户端发现它们应该使用 OAuth 授权。
* 
使用 OAuth 授权时,请确保对 OSLC 端点的所有请求都以配置的 SpringSecurityFilterChain url 模式作为前缀。例如,如果 SpringSecurityFilterChain 配置为 /oauth/* url 模式,则所有 OSLC 端点都必须具有 /oauth/oslc/* url 模式。
Windchill 更新后所需的配置
要在从 Windchill 的先前版本更新后启用 Windchill OSLC 服务,请执行以下步骤:
1. 将以下条目添加到 %WT_HOME%/codebase/WEB_INF/web.xml
<servlet-mapping>
<servlet-name>OSLCServlet</servlet-name>
<url-pattern>/oslc/*</url-pattern>
</servlet-mapping>
2. 要将 OSLC 路径添加到 Apache 配置,请将以下条目添加至 HTTPServer/conf/conf.d/30-app-Windchill-AJP.conf
JkMount /Windchill/oslc/* ajpWorker
3. 要在 Apache 配置中配置可供匿名访问的 OSLC 目录,请将以下条目添加至 HTTPServer/conf/conf.d/30-app-Windchill-Auth.conf
<LocationMatch ^/+Windchill/+oslc/catalog(;.*)?>
Require all granted
</LocationMatch>
内容安全策略的配置
要允许其他站点的客户端站点查看 OSLC 预览,请更新 web.xml 文件,使其包含以下 OSLC 内容安全 servlet 筛选器配置:
<filter>
<filter-name>OSLCContentSecurityFilter</filter-name>
<description>Servlet request filter to set the Content Security Policy for previews</description>
<filter-class>com.ptc.oslc.windchill.filter.OSLCHttpHeaderSecurityFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>https://site1.domain.com,https://site2.domain.com </param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>OSLCContentSecurityFilter</filter-name>
<url-pattern>/oslc/*</url-pattern>
</filter-mapping>
OSLC 跨域资源共享 (CORS) 的配置
* 
为实现更安全的配置,请仅对跨域 OSLC 配置使用 CORS 筛选器。
* 
当配置 Windchill 以与其他 PTC OSLC 客户端应用程序共享 OSLC 资源时,请在同一域中本地安装这些应用程序。
要允许其他站点的客户端站点查看 OSLC 服务,请更新 web.xml 文件,使其包含以下 servlet 筛选器配置:
<filter>
<filter-name>ContentCorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>[ALLOWED_ORIGINS]</param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,OPTIONS</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.headers</param-name>
<param-value>Content-Type,X-Requested-With</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ContentCorsFilter</filter-name>
<url-pattern>/oslc/preview/*</url-pattern>
<url-pattern>/oslc/config/*</url-pattern>
</filter-mapping>
这对您有帮助吗?