<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc-ext parse-xml-in-artwork="yes" ?>
<rfc ipr="full2026" docName="draft-reschke-deltav-compute-checkin-uri-01">
	<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>Salzmannstrasse 152</street>
          <city>Muenster</city><region>NW</region><code>48159</code>
          <country>Germany</country>
        </postal>
				<phone>+49 251 2807760</phone>	
				<facsimile>+49 251 2807761</facsimile>	
				<email>julian.reschke@greenbytes.de</email>	
				<uri>http://www.greenbytes.de/tech/webdav/</uri>	
			</address>
		</author>
    <date month="March" year="2002" />
<!--		<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 deltaV <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) working group 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>.
		</t><t>
Discussions of the delta-V working group 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="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="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 deltaV <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 deltaV 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="Changes for CHECKOUT method (when applied to a version-controlled resource)" anchor="METHOD_CHECKOUT">
<t>
	A client may ask for an "expected version URI" upon CHECKOUT.
  This is done by placing cu:compute-expected-version-URI as top-level
  element into the request body.
  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>
  The client can detect the "expected version URI" by parsing the response
  body for a top-level element called cu:expected-version-URI.
</t>

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

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

<?xml version="1.0" encoding="utf-8" ?>
<D:checkout-response xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav">
  <cu:expected-version-URI
  >http://repo.webdav.org/his/23/ver/32</cu:expected-version-URI>
</D:checkout-response>
]]></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>>>Request</preamble>
<artwork><![CDATA[
CHECKOUT /foo.html HTTP/1.1 
Host: www.webdav.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<D:checkout xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav">
  <cu:compute-expected-version-URI />
</D:checkout>
]]></artwork></figure>
<figure>
<preamble>>>Response</preamble>
<artwork><![CDATA[
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>>>Response</preamble>
<artwork><![CDATA[
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<D:checkout-response xmlns:D="DAV:">
    ...other content...
</D:checkout-response>
]]></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.
  A server may
  <list style="symbols">
    <t>simply ignore the presence of this information or</t>
    <t>use the information and try to checkin the resource using
    the "expected version URI" as location for the version resource.
    A failure to create a version resource at the "expected version URI"
    MUST cause the operation to fail with a status code of 403 (forbidden)
    and a response body containing the top-level element
    cu:cannot-assign-expected-version-URI.
    In addition, a server MAY return a new
    "expected version URI" in it's response body.
    </t>
  </list>
</t>

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

<?xml version="1.0" encoding="utf-8" ?>
<D:checkin xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav">
  <cu:expected-version-URI
  >http://repo.webdav.org/his/23/ver/32</cu:expected-version-URI>
</D:checkin>
]]></artwork></figure>
<figure>
<preamble>>>Response</preamble>
<artwork><![CDATA[
HTTP/1.1 201 Created
Location: http://repo.webdav.org/his/23/ver/32
Cache-Control: no-cache
]]></artwork></figure>
<t>
  Note that the client can not rely on the server signaling an error if the
  expected version URI could not be applied. It will have to compare the
  URI returned in the HTTP "Location" header with the requested version URI,
  and in the case of mismatch it MAY have to report the situation to the user. 
</t>
</section>

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

<?xml version="1.0" encoding="utf-8" ?>
<D:checkin xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav">
  <cu:expected-version-URI
  >http://repo.webdav.org/his/23/ver/32</cu:expected-version-URI>
</D:checkin>
]]></artwork></figure>
<figure>
<preamble>>>Response</preamble>
<artwork><![CDATA[
HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<D:error xmlns:D="DAV:"
  xmlns:cu="http://sapportals.com/xmlns/cm/webdav">
  <cu:cannot-assign-expected-version-URI />
  <cu:expected-version-URI
  >http://repo.webdav.org/his/23/ver/33</cu:expected-version-URI>
</D:error>
]]></artwork></figure>
</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>

<section title="Copyright">
<t>
To be supplied by the RFC Editor.
</t>
</section>

<section title="Intellectual Property">
<t>
To be supplied by the RFC Editor.
</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'></date>
<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 &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
  NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and
  &quot;OPTIONAL&quot; 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'></date></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'></date></front>

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

<section title="Change Log">
<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>


    </back>
</rfc>
