Main Content

setResourceUrl

Set resource URL for local OSLC resource object

Since R2021a

    Description

    setResourceUrl(resource,URL) sets the ResourceUrl property of the resource specified by resource to the existing resource URL specified by URL.

    example

    Examples

    collapse all

    This example shows how to associate an Open Services for Lifecycle Collaboration (OSLC) requirement resource object in MATLAB® with an existing OSLC requirement resource in the service provider.

    After you have created and configured the OSLC client myClient as described in Create and Configure an OSLC Client for the Requirements Management Domain, create a new requirement resource by creating an instance of the oslc.rm.Requirement class.

    myReq = oslc.rm.Requirement
    myReq = 
      Requirement with properties:
    
        ResourceUrl: ''
              Dirty: 0
          IsFetched: 0
              Title: ''
         Identifier: ''
    

    In the OSLC service provider, locate the requirement resource that you want to associate with the object in MATLAB. Identify the resource URL, then create a variable URL and set the value of the variable to the resource URL.

    URL = 'https://localhost:9443/rm/resources/_oJNtgWrqEeup0a6t';

    Set the resource URL for the requirement object myReq. Inspect the requirement.

    setResourceUrl(myReq,URL);
    myReq
    myReq = 
    
      Requirement with properties:
    
        ResourceUrl: 'https://localhost:9443/rm/resources/_oJNtgWrqEeup0a6t'
              Dirty: 1
          IsFetched: 0
              Title: ''
         Identifier: ''

    Retrieve the full resource data from the service provider for the requirement resource and inspect the resource.

    fetch(myReq,myClient);
    myReq
    myReq = 
    
      Requirement with properties:
    
        ResourceUrl: 'https://localhost:9443/rm/resources/_oJNtgWrqEeup0a6t'
              Dirty: 0
          IsFetched: 1
              Title: '[SAFe] Lightweight Business Case Template'
         Identifier: '1172'

    Open the requirement resource in the system browser.

    show(newReq)

    Input Arguments

    collapse all

    Existing resource URL, specified as a character vector.

    Tips

    • Use this function when you have the resource URL for an OSLC resource and want to access the properties or links of the resource in MATLAB.

    Version History

    Introduced in R2021a