特定管理 > 生命週期協同作業開放服務 (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 Authorization。配置 Windchill 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. 欲配置使 OSLC 型錄能夠匿名存取 Apache 組態,請將下列項目新增至 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>
這是否有幫助?