Main Content

本页采用了机器翻译。点击此处可查看英文原文。

setServiceRoot

为 OSLC 客户端设置服务根

自 R2021a 起

    说明

    示例

    setServiceRoot(myClient,root) 将 OSLC 客户端 myClient 设置为 root 指定的服务根。

    示例

    全部折叠

    此示例显示如何在 MATLAB® 中创建 OSLC 客户端并配置该客户端以连接到需求管理域的 OSLC 服务提供商。

    创建 OSLC 客户端。

    myClient = oslc.Client;

    为您的服务提供商设置用户和服务器 URL。然后设置需求管理域的服务根和目录路径以及配置查询路径。

    setUser(myClient,'jdoe');
    setServer(myClient,'https://localhost:9443');
    setServiceRoot(myClient,'rm');
    setCatalogPath(myClient,'/oslc_rm/catalog');
    setConfigurationQueryPath(myClient,'gc/oslc-query/configurations');
    myClient

    登录客户端并在提示时输入您的凭据。

    login(myClient);

    获取指定目录路径和服务根目录中可用的服务提供商。将 OSLC 客户端设置为所需的服务提供商。

    providers = getServiceProviderNames(myClient)
    providers =
    
      4×1 cell array
    
        {'OSLC Plugin'                                  }
        {'Model Based Design with OSLC'                 }
        {'OSLC4RM'                                      }
        {'Interactive Testing (Requirements Management)'}

    setServiceProvider(myClient,'OSLC Plugin');

    如果适用,获取可用的配置上下文。将 OSLC 客户端设置为所需的配置上下文。

    configurations = getConfigurationContextNames(myClient)
    configurations =
    
      2×1 cell array
    
        {'Initial Development'}
        {'Initial Baseline'   }

    setConfigurationContext(myClient,'Initial Development');

    检查客户端属性。

    myClient
    myClient = 
    
      Client with properties:
    
             ServiceProvider: 'OSLC Plugin'
        ConfigurationContext: 'Initial Development'
                  CatalogUrl: 'https://localhost:9443/rm/oslc_rm/catalog'

    输入参数

    全部折叠

    OSLC 客户端,指定为 oslc.Client 对象。

    OSLC 服务根,指定为字符向量。

    版本历史记录

    在 R2021a 中推出