<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc-ext parse-xml-in-artwork="yes" ?>
<rfc xmlns:ed="http://greenbytes.de/2002/rfcedit" ipr="full3978" docName="draft-reschke-deltav-compute-checkin-uri-latest" category="info">
	<front>
    	<title abbrev="CHECKIN URI in WebDAV versioning">Computing the CHECKIN URI in WebDAV versioning</title>
			<author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
			<organization abbrev="greenbytes">greenbytes GmbH</organization>
			<address>
        <postal>
          <street>Hafenweg 16</street>
          <city>Muenster</city><region>NW</region><code>48155</code>
          <country>Germany</country>
        </postal>
				<phone>+49 251 2807760</phone>	
				<facsimile>+49 251 2807761</facsimile>	
				<email>julian.reschke@greenbytes.de</email>	
				<uri>http://greenbytes.de/tech/webdav/</uri>	
			</address>
		</author>
    <date month="October" year="2005"/>
<!--		<workgroup>WEBDAV Working Group</workgroup> -->
        <abstract><t>
In many cases, a versioning-aware client might want to display/include the
URI of the version it's editing while it's being edited. For instance, an
editor might include this as meta information, or the author of a 
document might want to know the URI of the version before it's checked in.
A well-known example is the W3C way of referring to document versions in
recommendations: it contains references to "the current version", to "this version"
and to the "previous version". Something like this is currently impossible
with WebDAV versioning <xref target="RFC3253"/>,
as the version URI is determined at the time of CHECKIN.
</t>


		<t>
Distribution of this document is unlimited. Please send comments to the 
WebDAV versioning (delta-V) mailing list at <eref target="mailto:ietf-dav-versioning@w3.org">ietf-dav-versioning@w3.org</eref>,
which may be joined by sending a message with subject 
"subscribe" to <eref target="mailto:ietf-dav-versioning-request@w3.org?subject=subscribe">ietf-dav-versioning-request@w3.org</eref>.
Discussions of the delta-V mailing list are archived at URL: 
<eref target="http://lists.w3.org/Archives/Public/ietf-dav-versioning/">http://lists.w3.org/Archives/Public/ietf-dav-versioning/</eref>.               
       	</t>

</abstract>
	</front>

	<middle>





<section title="Introduction">
<t>
In many cases, a versioning-aware client might want to display/include the
URI of the version it's editing while it's being edited. For instance, an
editor might include this as meta information, or the author of a 
document might want to know the URI of the version before it's checked in.
A well-known example is the W3C way of referring to document versions in
recommendations: it contains references to "the current version", to "this version"
and to the "previous version". Something like this is currently impossible
with WebDAV versioning
 <xref target="RFC3253"/>,
as the version URI is determined at the time of CHECKIN.
</t>
<t>
  This specification builds on the infrastructure provided by 
  the WebDAV Versioning Protocol, adding support 
	for servers willing to compute an "expected version URI" upon CHECKOUT,
  and using this URI at time of CHECKIN.
</t>
<t>
  This document defines an extension element that could ultimately become 
  part of the WebDAV versioning protocol. Being just an individual
  submission, it currently defines it in the proprietary namespace
</t>
<figure>
<artwork>   http://sapportals.com/xmlns/cm/webdav</artwork>
</figure>
<t>
  instead of the "DAV:" namespace. It uses a prefix of "cu:"
  for referring to elements in this namespace. However, WebDAV server and clients
  are free to use any prefix, provided that there is a namespace declaration that
  binds the prefix to the URI of the same namespace.
</t>

</section>



<section title="Notational Conventions">
<t>
	The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 
	"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 
	document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
</section>



<section title="Changes for CHECKOUT method" anchor="METHOD_CHECKOUT">
<t>
	A client may ask for an "expected version URI" upon CHECKOUT (and the
  CHECKIN variant with DAV:keep-checked-out request element).
  This is done by placing cu:compute-expected-version-URI as top-level
  element into the request body.
</t>

<t>
  Additional Marshalling:
  <list>
    <t>
      Presence of the cu:compute-expected-version-URI as top-level
      element in the request body indicates that the server SHOULD compute
      the "expected version URI".  The server
      is free to either ignore the request, or to return it's best guess about what
      the URI for a version resource created upon CHECKIN would be. 
    </t>
<t><figure><artwork>
&lt;!ELEMENT cu:compute-expected-version-URI EMPTY &gt;
</artwork></figure></t>
    <t>
      The client can detect the "expected version URI" by parsing the response
      body for a top-level element called cu:expected-version-URI. Absence of
      this element (or absence of a response body) indicates that the server
      is not able to compute the URI.
    </t>
<t><figure><artwork>
&lt;!ELEMENT cu:expected-version-URI (href) &gt;
</artwork></figure></t>
  </list>
</t>



<section title="Example for successful CHECKOUT with computed version URI">
<figure>
<preamble>&gt;&gt;Request</preamble>
<artwork>
CHECKOUT /foo.html HTTP/1.1 
Host: www.example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkout xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:compute-expected-version-URI /&gt;
&lt;/D:checkout&gt;
</artwork></figure>
<figure>
<preamble>&gt;&gt;Response</preamble>
<artwork>
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkout-response xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:expected-version-URI&gt;
    &lt;D:href&gt;http://repo.example.org/his/23/ver/32&lt;/D:href&gt;
  &lt;/cu:expected-version-URI&gt;
&lt;/D:checkout-response&gt;
</artwork></figure>
<t>
  In this example, the server was able to compute the "expected version URI"
  and returned it in the cu:expected-version-URI element.
</t>
</section>

<section title="Example for successful CHECKOUT without computed version URI">
<figure>
<preamble>&gt;&gt;Request</preamble>
<artwork>
CHECKOUT /foo.html HTTP/1.1 
Host: www.example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkout xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:compute-expected-version-URI /&gt;
&lt;/D:checkout&gt;
</artwork></figure>
<figure>
<preamble>&gt;&gt;Response</preamble>
<artwork>
HTTP/1.1 200 OK
Cache-Control: no-cache
</artwork></figure>
<t>
  In this case, no response body was returned, and thus no "expected version URI"
  is available. Simarily, the server may also return
</t>
<figure>
<preamble>&gt;&gt;Response</preamble>
<artwork>
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkout-response xmlns:D="DAV:"&gt;
    ...other content...
&lt;/D:checkout-response&gt;
</artwork></figure>
<t>
  where a response body is available, but it doesn't contain the cu:expected-version-URI
  element.
</t>
</section>


</section>

<section title="Changes for CHECKIN method (when applied to a version-controlled resource)" anchor="METHOD_CHECKIN">

<t>
  A client may submit the "expected version URI" (obtained during CHECKOUT)
  upon a CHECKIN by placing it into a top-level cu:expected-version-URI
  element in the request body.


</t>

<t>
  Additional Marshalling:
  <list>
    <t>
      A top-level element cu:expected-version-URI, when present, indicates the
      client's expectation about the URI of the version that will be created
      by the CHECKIN operation.
    </t>
    <t>
      Upon failure, the server MAY return a new "expected version URI" in
      the DAV:error response body using the element cu:expected-version-URI.
    </t>
  </list>  
</t>
<t>
  Additional Preconditions:
  <list>
    <t>
      (cu:can-assign-expected-version-URI): 
      if the server does support the cu:compute-expected-version-URI extension
      upon CHECKOUT, it MUST create the new version at the URI specified in the cu:expected-version-URI
      or otherwise fail the request.
    </t>
  </list>  
</t>


<section title="Example for successful CHECKIN with computed version URI">
<figure>
<preamble>&gt;&gt;Request</preamble>
<artwork>
CHECKIN /foo.html HTTP/1.1 
Host: www.example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkin xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:expected-version-URI&gt;
    &lt;D:href&gt;http://repo.example.org/his/23/ver/32&lt;/D:href&gt;
  &lt;/cu:expected-version-URI&gt;
&lt;/D:checkin&gt;
</artwork></figure>
<figure>
<preamble>&gt;&gt;Response</preamble>
<artwork>
HTTP/1.1 201 Created
Location: http://repo.example.org/his/23/ver/32
Cache-Control: no-cache
</artwork></figure>

</section>

<section title="Example for failed CHECKIN with computed version URI">
<figure>
<preamble>&gt;&gt;Request</preamble>
<artwork>
CHECKIN /foo.html HTTP/1.1 
Host: www.example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:checkin xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:expected-version-URI&gt;
    &lt;D:href&gt;http://repo.example.org/his/23/ver/32&lt;/D:href&gt;
  &lt;/cu:expected-version-URI&gt;
&lt;/D:checkin&gt;
</artwork></figure>


<figure>
<preamble>&gt;&gt;Response</preamble>
<artwork>
HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;D:error xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav"&gt;
  &lt;cu:can-assign-expected-version-URI /&gt;
  &lt;cu:expected-version-URI&gt;
    &lt;D:href&gt;http://repo.example.org/his/23/ver/33&lt;/D:href&gt;
  &lt;/cu:expected-version-URI&gt;
&lt;/D:error&gt;
</artwork></figure>
<t>
  Note that 403 (Forbidden) is returned because subsequent request with the
  same expected version URI will always fail.
</t>


</section>


</section>

<section title="Compatibility Considerations">
<t>
  This specification does introduce new protocol elements for the request
  and response bodies for CHECKIN and CHECKOUT.
</t>
<t>
  Clients not aware of this specification will never submit the new
  protocol elements in a request and therefore never will see the new
  response elements.
</t>
<t>
  Servers not aware of this specification will ignore the additional
  two request body elements which is legal behaviour according to this
  protocol (indicating that the protocol extension is not available).
</t>
</section>

<section title="Internationalization Considerations">
<t>
   This proposal builds on <xref target="RFC3253"/>, and inherits its 
   internationalizability.
</t>
</section>

<section title="IANA Considerations">
<t>
   This proposal does not introduce any new IANA considerations, since 
   it does not specify any new namespaces (in the general sense), but 
   merely uses existing ones.
</t>
</section>





    </middle>
	<back>



<references>
	

<reference anchor="RFC2119">

<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>+1 617 495 3864</phone>
<email>sob@harvard.edu</email>
</address></author>
<date month="March" year="1997"/>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
  In many standards track documents several words are used to signify
  the requirements in the specification.  These words are often
  capitalized.  This document defines these words as they should be
  interpreted in IETF documents.  Authors who follow these guidelines
  should incorporate this phrase near the beginning of their document:
<list>
<t>
  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
  "OPTIONAL" in this document are to be interpreted as described in
  RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>


<reference anchor="RFC2518">

<front>
<title>HTTP Extensions for Distributed Authoring -- WEBDAV</title>
<author initials="Y." surname="Goland" fullname="Y. Goland">
  <organization>Microsoft Corporation</organization>
  <address><email>yarong@microsoft.com</email></address>
</author>
<author initials="E." surname="Whitehead" fullname="E. J. Whitehead, Jr.">
  <organization abbrev="UC Irvine">Dept. Of Information and Computer Science, University of California, Irvine</organization>
	<address><email>ejw@ics.uci.edu</email></address>
</author>
<author initials="A." surname="Faizi" fullname="A. Faizi">
  <organization abbrev="Netscape">Netscape</organization>
  <address><email>asad@netscape.com</email></address>
</author>
<author initials="S.R." surname="Carter" fullname="S. R. Carter">
  <organization abbrev="Novell">Novell</organization>
  <address><email>srcarter@novell.com</email></address>
</author>
<author initials="D." surname="Jensen" fullname="D. Jensen">
  <organization abbrev="Novell">Novell</organization>
  <address><email>dcjensen@novell.com</email></address>
</author>
<date month="February" year="1999"/></front>

<seriesInfo name="RFC" value="2518"/>
</reference>

<reference anchor="RFC3253">

<front>
<title>Versioning Extensions to WebDAV</title>
<author initials="G." surname="Clemm" fullname="G. Clemm">
  <organization>Rational Software</organization>
  <address><email>geoffrey.clemm@rational.com</email></address>
</author>
<author initials="J." surname="Amsden" fullname="J. Amsden">
  <organization>IBM</organization>
  <address><email>jamsden@us.ibm.com</email></address>
</author>
<author initials="T." surname="Ellison" fullname="T. Ellison">
  <organization>IBM</organization>
  <address><email>tim_ellison@uk.ibm.com</email></address>
</author>
<author initials="C." surname="Kaler" fullname="C. Kaler">
  <organization>Microsoft</organization>
  <address><email>ckaler@microsoft.com</email></address>
</author>
<author initials="J." surname="Whitehead" fullname="J. Whitehead">
  <organization>UC Santa Cruz, Dept. of Computer Science</organization>
  <address><email>ejw@cse.ucsc.edu</email></address>
</author>
<date month="March" year="2002"/></front>

<seriesInfo name="RFC" value="3253"/>
</reference>
</references>

<section title="Change Log (to be removed by RFC Editor before publication)">
<section title="Since 'draft-reschke-deltav-compute-checkin-uri-00'">
<t>
  Made the document element for responses upon failed CHECKIN DAV:error rather
  than DAV:checkin-response.<vspace/>
  Updated reference to <xref target="RFC3253"/>.<vspace/>
  Moved extension elements out of DAV: namespace.<vspace/>
  Changed examples to explicitly use utf-8 encoding for HTTP content type and
  XML encoding.<vspace/>
  Globally replaced the term "CHECKIN URI" by "version URI"<vspace/>
  Added note about how to discover whether the server actually applied
  the expected version URI.<vspace/>
  Made sure artwork (figures) fits into 72 columns.
</t>
</section>
<section title="Since 'draft-reschke-deltav-compute-checkin-uri-01'">
<t>
  Updated abstract not to refer to DeltaV WG anymore. Use "WebDAV versioning"
  instead of "deltaV".<vspace/>
  Changed descriptions to use RFC3253's Marshalling/Precondition format. Changed
  name of cu:cannot-assign-expected-version-URI to cu:can-assign-expected-version-URI
  as this is a precondition.
</t>
</section>
<section title="Since 'draft-reschke-deltav-compute-checkin-uri-02'">
<t>
  Update marshalling to use DAV:href as container for URIs.<vspace/>
  Clarify that the extension applies to CHECKOUT on version resources and
  to CHECKIN/DAV:keep-checked-out as well.
</t>
</section>
<section title="Since 'draft-reschke-deltav-compute-checkin-uri-03'">
<t>
  Replaced domain names in examples according to RFC2606: "webdav.org" by
  "example.org".
</t>
</section>


<section title="Since 'draft-reschke-deltav-compute-checkin-uri-04'">
<t>
  Remove superfluous IP and copyright sections. Swap "Introduction" and
  "Notation" sections. Require server to support both extensions to
  make behaviour more predictable.
</t>
</section>


</section>


    </back>
</rfc>