Main Content

oslc.Client

Client to integrate with OSLC providers

Since R2021a

    Description

    Use an oslc.Client object to integrate with an Open Services for Lifecycle Collaboration (OSLC) service provider. Specify the service provider properties on the object, then use the object functions to set your user name and log in to the server. You can then use oslc.core.CreationFactory and oslc.core.QueryCapability objects to create and query resources in the OSLC service provider.

    Creation

    Description

    myClient = oslc.Client returns an OSLC client object.

    example

    Properties

    expand all

    OSLC service provider name, specified as a character array.

    Service provider configuration context name, specified as a character array.

    Service provider catalog URL, specified as a character array.

    Example: 'https://localhost:9443/qm/oslc_qm/catalog'

    Object Functions

    getConfigurationContextNamesGet configuration context names from OSLC service provider
    getCreationFactoryGet OSLC creation service object
    getCustomLoginProviderGet registered custom authentication callback function name for OSLC client
    getDialogGet user interface dialogs from OSLC service provider
    getQueryServiceGet OSLC query service object
    getServerGet server URL for OSLC client
    getServiceProviderNamesGet service providers for OSLC client
    getUserGet user for OSLC client
    loginLog in to OSLC client
    removeRemove resource from OSLC service provider
    setCatalogPathSet catalog path for OSLC client
    setConfigurationContextSet configuration context for OSLC client
    setConfigurationQueryPathSet configuration query path for OSLC client
    setCustomLoginProviderRegister custom authentication callback function to OSLC client
    setHttpHeaderSet HTTP header for OSLC client
    setHttpOptionsSet HTTP options for OSLC client
    setServerSet server URL for OSLC client
    setServiceProviderSet service provider for OSLC client
    setServiceRootSet service root for OSLC client
    setUserSet user for OSLC client

    Examples

    collapse all

    This example shows how to create an OSLC client in MATLAB® and configure the client to connect to an OSLC service provider for the requirements management domain.

    Create the OSLC client.

    myClient = oslc.Client;

    Set the user and server URL for your service provider. Then set the service root and catalog path for the requirements management domain and the configuration query path.

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

    Log in to the client and enter your credentials when prompted.

    login(myClient);

    Get the available service providers in the specified catalog path and service root. Set the OSLC client to the desired service provider.

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

    setServiceProvider(myClient,'OSLC Plugin');

    If applicable, get the available configuration contexts. Set the OSLC client to the desired configuration context.

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

    setConfigurationContext(myClient,'Initial Development');

    Inspect the client properties.

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

    This example shows how to create an OSLC client in MATLAB and configure the client to connect to an OSLC service provider for the quality management domain.

    Create the OSLC client.

    myClient = oslc.Client;

    Set the user and server URL for your service provider. Set the service root and catalog path for the quality management domain.

    setUser(myClient,'jdoe');
    setServer(myClient,'https://localhost:9443');
    setServiceRoot(myClient,'qm');
    setCatalogPath(myClient,'/oslc_qm/catalog');

    Log in to the client and enter your credentials when prompted.

    login(myClient);

    Get the available service providers in the specified catalog path and service root. Set the OSLC client to the desired service provider.

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

    setServiceProvider(myClient,'OSLC Plugin (Quality Management)');

    If applicable, get the available configuration contexts. Set the OSLC client to the desired configuration context.

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

    setConfigurationContext(myClient,'Initial Development');

    Inspect the client properties.

    myClient
    myClient = 
    
      Client with properties:
    
             ServiceProvider: 'OSLC Plugin (Quality Management)'
        ConfigurationContext: 'Initial Development'
                  CatalogUrl: 'https://localhost:9443/qm/oslc_qm/catalog'

    This example shows how to create an OSLC client in MATLAB and configure the client to connect to an OSLC service provider for the change management domain.

    Create the OSLC client.

    myClient = oslc.Client;

    Set the user and server URL for your service provider. Set the service root and catalog path for the change management domain.

    setUser(myClient,'jdoe');
    setServer(myClient,'https://localhost:9443');
    setServiceRoot(myClient,'ccm');
    setCatalogPath(myClient,'/oslc/workitems/catalog');

    Log in to the client and enter your credentials when prompted.

    login(myClient);

    Get the available service providers in the specified catalog path and service root. Set the OSLC client to the desired service provider.

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

    setServiceProvider(myClient,'OSLC Plugin (Change Management)');

    If applicable, get the available configuration contexts. Set the OSLC client to the desired configuration context.

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

    setConfigurationContext(myClient,'Initial Development');

    Inspect the client properties.

    myClient
    myClient = 
    
      Client with properties:
    
             ServiceProvider: 'OSLC Plugin (Change Management)'
        ConfigurationContext: 'Initial Development'
                  CatalogUrl: 'https://localhost:9443/cm/oslc_cm/catalog'

    Version History

    Introduced in R2021a