Main Content

fetch

Retrieve full resource data from OSLC service provider

Since R2021a

    Description

    status = fetch(resource,myClient) retrieves the XML/RDF data from the ResourceUrl associated with resource from the service provider associated with myClient. The function stores the XML/RDF data in the Open Services for Lifecycle Collaboration (OSLC) resource object resource and returns the retrieval success status. For more information about RDF/XML, see RDF 1.1 XML Syntax on the World Wide Web Consortium website.

    example

    Examples

    collapse all

    This example shows how to submit a query request for requirement resources with a configured OSLC client, edit an existing requirement resource, and commit the changes to 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 query capability for the requirement resource type.

    myQueryCapability = getQueryService(myClient,'Requirement');

    Submit a query request to the service provider for the available requirement resources.

    reqs = queryRequirements(myQueryCapability)
    reqs = 
    
      1×30 Requirement array with properties:
    
        ResourceUrl
        Dirty
        IsFetched
        Title
        Identifier

    Assign a requirement resource to the variable myReq. Retrieve the full resource data from the service provider for the requirement resource. Examine the Title property.

    myReq = reqs(1);
    status = fetch(myReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK
    title = myReq.Title
    title =
    
        'Requirement 1'
    

    Edit the requirement title and commit the change to the service provider.

    myReq.Title = 'My New Requirement Title';
    status = commit(myReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK

    Open the requirement resource in the system browser by using the show function.

    show(myReq)

    Input Arguments

    collapse all

    OSLC client, specified as an oslc.Client object.

    Output Arguments

    collapse all

    Retrieval success status, returned as a matlab.net.http.StatusCode object.

    Version History

    Introduced in R2021a