This wiki is locked. Future workgroup activity and specification development must take place at our new wiki. For more information, see this blog post about the new governance model and this post about changes to the website.

Scenario: Create a new Architecture Resource

This scenario assumes that the service provider permits the creation of new Architecture resources, and that the user has sufficient previledges to do so.

This scenario requires that the client has already discovered the AM Resource URI via the service provider catalog.

The typical behavoir of a sucessfull HTTP POST to create the new resources and return an entity which describes the status of the request and newly created resource (RFC 2616 Section 10.2.2). The server SHOULD return the ETag in a header, and include the URI of the new resource in the Location header.

Example 1. Create new UML Class

1. The client obtains the Resource Factory URL from the discover documents and POSTs a new resource to the service provider AM resource factory URL. The content type MUST be the content type of the resource and NOT the OSLC AM content type.

2.The client POSTs a resource to AMR Resource Factory URI ( https://am.acme.com/resources/project1). Successful creation will result in a 201 Created response. The ETag, and Location headers MUST be returned.

Request
POST https://am.acme.com/resources/project1
Content-Type: application/x-acme-uml+xml

<uml:Class xmlns:uml="http://acme.com/uml/1.0#">
   <uml:name>Class1</uml:name>
   <uml:abstract>true</uml:abstract>
</uml:Class>  
Response
201 Created
Location: https://am.acme.com/resources/res991
ETag: "_siemvnshyu2746sakalfuy"
Content-Type: application/x-oslc-am-resource+xml
 
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/terms/" 
   xmlns:oslc_am="http://open-services.net/xmlns/am/1.0/"
   rdf:about="https://acme.com/resources/res1">

    <oslc_am:Resource>
      <dc:title>Class1</dc:title>
      <dc:type rdf:resource="http://acme.com/uml/1.0#Class" />
      <dc:format>application/x-acme-uml+xml</dc:format>
    </oslc_am:resource> 

</rdf:RDF> 

Example 2. Failed attempt to create new UML Class

1.The client POSTs a resource to AMR Resource Factory URI ( https://am.acme.com/resources/project1). The service provider does not permit the creation of new resources.

Request
POST https://am.acme.com/resources/project1
Content-Type: application/x-acme-uml+xml

<uml:Class xmlns:uml="http://acme.com/uml/1.0#">
   <uml:name>Class1</uml:name>
   <uml:abstract>true</uml:abstract>
</uml:Class>  
Response
403 Forbidden
Content-Type: application/rdf+xml


<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/xmlns/common/1.0/">
    <oslc:Error>
        <oslc:statusCode>403</oslc:statusCode>
        <oslc:message>The server does not permit the creation of new resources.</oslc:message>
    </oslc:Error>
</rdf:RDF> 
 
Edit | Attach | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 18 Jan 2010 - 17:34:06 - JimConallen
 
This site is powered by the TWiki collaboration platform Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding this site? Send feedback