Annotation of libwww/Library/src/HTDAV.html, revision 1.3
1.3 ! kirschpi 1: <HTML>
! 2: <HEAD>
! 3: <TITLE>W3C Sample Code Library libwww WebDAV Access Methods</TITLE>
! 4: </HEAD>
! 5:
! 6: <BODY>
! 7: <H1>
! 8: W3C Sample Code Library libwww WebDAV Access Methods
! 9: </H1>
! 10: <PRE>
! 11: /*
1.2 kirschpi 12: ** (c) COPYRIGHT MIT 1995.
13: ** Please first read the full copyright statement in the file COPYRIGH.
1.3 ! kirschpi 14: */
! 15: </PRE>
1.1 kirschpi 16:
1.3 ! kirschpi 17: <P>
! 18: This module contains methods for accessing URIs using WebDAV methods. It
! 19: also contains functions for headers definition.
! 20:
! 21: <P>
! 22: This module is implemented by <A HREF"HTDAV.c">HTDAV.c</A> and it is a
! 23: part of the <A HREF"http://www.w3.org/Library/">W3C Sample
! 24: CodeLibrary</A>.
! 25: <PRE>
! 26: #ifndef HTDAV_H
1.1 kirschpi 27: #define HTDAV_H
28:
29: #ifdef HT_DAV
1.3 ! kirschpi 30: </PRE>
1.1 kirschpi 31:
1.3 ! kirschpi 32: <H2>
! 33: WebDAV HEADERS
! 34: </H2>
! 35:
! 36: <P>
! 37: WebDAV extension protocol defines new headers to be used in its requests.
! 38: See <A HREF"http://www.ietf.org/rfc/rfc2518.txt">RFC2518</A> for details.
! 39: <PRE>
! 40: typedef struct _HTDAVHeaders HTDAVHeaders;
1.1 kirschpi 41:
42: extern HTDAVHeaders * HTDAVHeaders_new (void);
43: extern BOOL HTDAVHeaders_delete (HTDAVHeaders *me);
1.3 ! kirschpi 44: </PRE>
1.1 kirschpi 45:
1.3 ! kirschpi 46: <H3>
! 47: If Header
! 48: </H3>
1.1 kirschpi 49:
1.3 ! kirschpi 50: <P>
! 51: Manipulates the "If" header, which describes a series of state lists. The
1.1 kirschpi 52: caller must assure that the parameter "If" is well-formed. Below, you can see
1.3 ! kirschpi 53: a small description of If header format. See section 9.4 of <A
! 54: HREF="http://www.ietf.org/rfc/rfc2518.tx">RFC2518</A> for details.
1.1 kirschpi 55:
1.3 ! kirschpi 56: <P>
! 57: If = "If" ":" ( 1*NOTAGGED | 1*TAGGED )
1.1 kirschpi 58:
1.3 ! kirschpi 59: <P>
! 60: NOTAGGED = LIST
1.1 kirschpi 61:
1.3 ! kirschpi 62: <P>
! 63: TAGGED = CODED-URL 1*LIST
1.1 kirschpi 64:
1.3 ! kirschpi 65: <P>
! 66: LIST = "(" 1*( ["Not"] (STATE-TOKEN | "[" ENTITY-TAG "]" ) ) ")"
1.1 kirschpi 67:
1.3 ! kirschpi 68: <P>
! 69: STATE-TOKEN = CODED-URL
1.1 kirschpi 70:
1.3 ! kirschpi 71: <P>
! 72: CODED-URL = "<" AbsoluteURI ">
1.1 kirschpi 73:
1.3 ! kirschpi 74: <P>
! 75: <STRONG>Note</STRONG>: The caller should free the strings returned by
! 76: HTDAV_ifHeader method.
! 77: <PRE>
! 78: extern BOOL HTDAV_setIfHeader (HTDAVHeaders *me, const char *If);
1.1 kirschpi 79: extern BOOL HTDAV_deleteIfHeader (HTDAVHeaders * me);
80: extern char * HTDAV_ifHeader (HTDAVHeaders *me);
1.3 ! kirschpi 81: </PRE>
1.1 kirschpi 82:
1.3 ! kirschpi 83: <H3>
! 84: Depth Header
! 85: </H3>
1.1 kirschpi 86:
1.3 ! kirschpi 87: <P>
! 88: Manipulates the "Depth" header. Depth header is used with methods executed
1.1 kirschpi 89: on resource which could have internal members (Collections) to indicate
1.3 ! kirschpi 90: whether the method should be applied to the resource children.
1.1 kirschpi 91:
1.3 ! kirschpi 92: <P>
! 93: The caller must assure that the parameter "Depth" is "0", "1" or
1.1 kirschpi 94: "infinity", and that its value can be applied in the used resquest method
1.3 ! kirschpi 95: (for example, LOCK method does not support Depth value 1).
1.1 kirschpi 96:
1.3 ! kirschpi 97: <P>
! 98: <STRONG>Note</STRONG>: The caller should free the string returned by
! 99: HTDAV_DepthHeader method.
! 100: <PRE>
! 101: extern BOOL HTDAV_setDepthHeader (HTDAVHeaders *me, const char *Depth);
1.1 kirschpi 102: extern BOOL HTDAV_deleteDepthHeader (HTDAVHeaders * me);
1.3 ! kirschpi 103: extern char * HTDAV_DepthHeader (HTDAVHeaders *me);
! 104: </PRE>
1.1 kirschpi 105:
1.3 ! kirschpi 106: <H3>
! 107: Lock-Tocken header
! 108: </H3>
1.1 kirschpi 109:
1.3 ! kirschpi 110: <P>
! 111: Manipulates the "LockToken" header. It is used in UNLOCK method to
1.1 kirschpi 112: identify the lock to be removed. The caller must assure that the parameter is
1.3 ! kirschpi 113: a state token well-formed (
! 114: <A HREF="http://www.ietf.org/rfc/rfc2518.txt">RFC2518</A> section 9.5).
1.1 kirschpi 115:
1.3 ! kirschpi 116: <P>
! 117: <STRONG>Note</STRONG>: The caller should free the string returned by
! 118: HTDAV_LockTokenHeader method.
! 119: <PRE>
! 120: extern BOOL HTDAV_setLockTokenHeader (HTDAVHeaders *me, const char *LockToken);
1.1 kirschpi 121: extern BOOL HTDAV_deleteLockTokenHeader (HTDAVHeaders * me);
1.3 ! kirschpi 122: extern char * HTDAV_LockTokenHeader (HTDAVHeaders *me);
! 123: </PRE>
1.1 kirschpi 124:
1.3 ! kirschpi 125: <H3>
! 126: Destination Header
! 127: </H3>
1.1 kirschpi 128:
1.3 ! kirschpi 129: <P>
! 130: Manipulates the "Destination" header. It is used in COPY and MOVE methods
1.1 kirschpi 131: to identify a destination resource. The caller must assure that the parameter
1.3 ! kirschpi 132: is an absolute URI.
1.1 kirschpi 133:
1.3 ! kirschpi 134: <P>
! 135: <STRONG>Note</STRONG>: The caller should free the string returned by
! 136: HTDAV_DestinationHeader method.
! 137: <PRE>
! 138: extern BOOL HTDAV_setDestinationHeader (HTDAVHeaders *me, const char *Destination);
1.1 kirschpi 139: extern BOOL HTDAV_deleteDestinationHeader (HTDAVHeaders * me);
1.3 ! kirschpi 140: extern char * HTDAV_DestinationHeader (HTDAVHeaders *me);
! 141: </PRE>
1.1 kirschpi 142:
1.3 ! kirschpi 143: <H3>
! 144: Timeout Header
! 145: </H3>
1.1 kirschpi 146:
1.3 ! kirschpi 147: <P>
! 148: Manipulates the "Timeout" header. It is used in LOCK requests to indicate
1.1 kirschpi 149: the desired timeout value for the requested lock. However, according to the
1.3 ! kirschpi 150: <A HREF"http://www.ietf.org/rfc/rfc2518.txt">RFC2518</A>, the server is not
! 151: required to honor this value.
1.1 kirschpi 152:
1.3 ! kirschpi 153: <P>
! 154: The caller must assure that the parameter follows the specification in the
! 155: section 9.8 of RFC 2518:
! 156:
! 157: <P>
! 158: Timeout = "Timeout" ":" 1#TIMETYPE
! 159:
! 160: <P>
! 161: TIMETYPE = ( "Second-" VAL | "Infinite" | OTHER )
! 162:
! 163: <P>
! 164: VAL = 1*digit
! 165:
! 166: <P>
! 167: OTHER = "Extend" Field ;
! 168: <A HREF="http://www.ietf.org/rfc/rfc2068.txt">RFC2068</A> - section 4.2
! 169:
! 170: <P>
! 171: <STRONG>Note</STRONG>: The caller should free the string returned by
! 172: HTDAV_TimeoutHeader method.
! 173: <PRE>
! 174: extern BOOL HTDAV_setTimeoutHeader (HTDAVHeaders *me, const char *Timeout);
1.1 kirschpi 175: extern BOOL HTDAV_deleteTimeoutHeader (HTDAVHeaders * me);
176: extern char * HTDAV_TimeoutHeader (HTDAVHeaders *me);
1.3 ! kirschpi 177: </PRE>
1.1 kirschpi 178:
1.3 ! kirschpi 179: <H3>
! 180: Overwrite Header
! 181: </H3>
! 182:
! 183: <P>
! 184: Manipulates the "Overwrite" header. It is used in COPY and MOVE methods to
! 185: specify whether the server should overwrite a destination resource.
! 186: <PRE>
! 187: extern BOOL HTDAV_setOverwriteHeader (HTDAVHeaders *me, BOOL Overwrite);
1.1 kirschpi 188: extern BOOL HTDAV_deleteOverwriteHeader (HTDAVHeaders * me);
189: extern BOOL HTDAV_OverwriteHeader (HTDAVHeaders * me);
1.3 ! kirschpi 190: </PRE>
1.1 kirschpi 191:
1.3 ! kirschpi 192: <H2>
! 193: WebDAV REQUESTS
! 194: </H2>
! 195:
! 196: <P>
! 197: WebDAV extension protocol defines new methods: LOCK, UNLOCK, MOVE, COPY,
! 198: MKCOL, PROPFIND, PROPPATCH (See
! 199: <A HREF="http://www.ietf.org/rfc/rfc2518.txt">RFC2518</A> for details).
! 200:
! 201: <H3>
! 202: LOCK Requests
! 203: </H3>
1.1 kirschpi 204:
1.3 ! kirschpi 205: <P>
! 206: A LOCK request create or refresh a lock over the destiny URI. If it wants
1.1 kirschpi 207: to create a new lock, the request should have a XML body (parameter
208: "xmlbody"), but if it is a refresh request, this body may be NULL and the
1.3 ! kirschpi 209: header "If" should be set in HTDAVHeaders object.
! 210: <PRE>
! 211: extern BOOL HTLOCKDocumentAnchor(HTRequest * request, HTAnchor * dst,
1.1 kirschpi 212: HTParentAnchor *xmlbody, HTDAVHeaders *headers);
213: extern BOOL HTLOCKAnchor (HTRequest * request,HTAnchor * dst,
214: char * xmlbody, HTDAVHeaders * headers);
215: extern BOOL HTLOCKAbsolute (HTRequest * request, const char * uri,
216: char * xmlbody, HTDAVHeaders * headers);
217: extern BOOL HTLOCKRelative (HTRequest * request, const char * relative,
218: HTParentAnchor * base, char * xmlbody,
1.3 ! kirschpi 219: HTDAVHeaders * headers);
! 220: </PRE>
1.1 kirschpi 221:
1.3 ! kirschpi 222: <H3>
! 223: UNLOCK Requests
! 224: </H3>
1.1 kirschpi 225:
1.3 ! kirschpi 226: <P>
! 227: An UNLOCK request removes a lock from the destiny URI. The request must
1.1 kirschpi 228: contain the Lock-Token header set in HTDAVHeaders object (so, the
1.3 ! kirschpi 229: HTDAVHeaders * headers parameter can't be NULL).
! 230: <PRE>
! 231: extern BOOL HTUNLOCKAnchor (HTRequest * request, HTAnchor * dst,
1.1 kirschpi 232: HTDAVHeaders * headers);
233: extern BOOL HTUNLOCKAbsolute (HTRequest * request, const char * uri,
234: HTDAVHeaders * headers);
235: extern BOOL HTUNLOCKRelative (HTRequest * request, const char * relative,
1.3 ! kirschpi 236: HTParentAnchor * base, HTDAVHeaders * headers);
! 237: </PRE>
1.1 kirschpi 238:
1.3 ! kirschpi 239: <H3>
! 240: PROPFIND Requests
! 241: </H3>
1.1 kirschpi 242:
1.3 ! kirschpi 243: <P>
! 244: PROPFIND requests returns properties defined for the resource. The request
1.1 kirschpi 245: may contain xml entity body with a "propfind" element, which may include an
246: "allprop" element (to get all properties), a "propname" element (the name of
247: all properties defined), and a "prop" element containing the desired
1.3 ! kirschpi 248: properties.
! 249: <PRE>
! 250: extern BOOL HTPROPFINDAnchor (HTRequest * request, HTAnchor * dst,
1.1 kirschpi 251: const char * xmlbody, HTDAVHeaders * headers);
252: extern BOOL HTPROPFINDDocumentAnchor (HTRequest * request, HTAnchor * dst,
253: HTParentAnchor * xmlbody, HTDAVHeaders * headers);
254: extern BOOL HTPROPFINDAbsolute (HTRequest * request, const char * uri,
255: const char * xmlbody, HTDAVHeaders * headers);
256: extern BOOL HTPROPFINDRelative (HTRequest * request, const char * relative,
257: HTParentAnchor * base, const char * xmlbody,
1.3 ! kirschpi 258: HTDAVHeaders * headers);
! 259: </PRE>
1.1 kirschpi 260:
1.3 ! kirschpi 261: <H3>
! 262: PROPPATCH Requests
! 263: </H3>
1.1 kirschpi 264:
1.3 ! kirschpi 265: <P>
! 266: PROPPATCH requests sets or removes properties defined for the resource.
1.1 kirschpi 267: The request MUST contain xml message body (parameter xmlbody) with a
268: "propertyupdate" element, which may include a "set" element (to set the
1.3 ! kirschpi 269: properties) or a "remove" element (to remove the properties).
! 270: <PRE>
! 271: extern BOOL HTPROPPATCHAnchor (HTRequest * request, HTAnchor * dst,
1.1 kirschpi 272: const char * xmlbody,HTDAVHeaders * headers);
273: extern BOOL HTPROPPATCHDocumentAnchor (HTRequest * request,HTAnchor * dst,
274: HTParentAnchor * xmlbody,HTDAVHeaders * headers);
275: extern BOOL HTPROPPATCHAbsolute (HTRequest * request, const char * uri,
276: const char * xmlbody, HTDAVHeaders * headers);
277: extern BOOL HTPROPPATCHRelative (HTRequest * request, const char * relative,
278: HTParentAnchor * base, const char * xmlbody,
1.3 ! kirschpi 279: HTDAVHeaders * headers);
! 280: </PRE>
1.1 kirschpi 281:
1.3 ! kirschpi 282: <H3>
! 283: MKCOL Requests
! 284: </H3>
1.1 kirschpi 285:
1.3 ! kirschpi 286: <P>
! 287: MKCOL requests are used to create Collections. The resource indicated by
1.1 kirschpi 288: the Request-URI (parameters HTAnchor *dst or char *absolute/relative) MUST
1.3 ! kirschpi 289: not exist, but all the resource's ancestros MUST exist.
! 290: <PRE>
! 291: extern BOOL HTMKCOLAnchor (HTRequest * request, HTAnchor * dst,
1.1 kirschpi 292: HTDAVHeaders * headers);
293: extern BOOL HTMKCOLAbsolute (HTRequest * request, const char * uri,
294: HTDAVHeaders * headers);
295: extern BOOL HTMKCOLRelative (HTRequest * request, const char * relative,
1.3 ! kirschpi 296: HTParentAnchor * base, HTDAVHeaders * headers);
! 297: </PRE>
1.1 kirschpi 298:
1.3 ! kirschpi 299: <H3>
! 300: COPY Requests
! 301: </H3>
1.1 kirschpi 302:
1.3 ! kirschpi 303: <P>
! 304: COPY requests copies the Request-URI (parameters HTAnchor *src or char
1.1 kirschpi 305: *absolute/relative) to the resource indicated in Destinarion header. The
306: HTDAVHeaders *headers parameter MUST be a non-null object and it MUST have
307: the Destination header set. Other headers may also be used, like Depth (0 or
1.3 ! kirschpi 308: infinity), If and Overwrite headers.
! 309: <PRE>
! 310: extern BOOL HTCOPYAnchor (HTRequest * request, HTAnchor * src,
1.1 kirschpi 311: const char * xmlbody, HTDAVHeaders * headers);
312: extern BOOL HTCOPYDocumentAnchor (HTRequest * request, HTAnchor * src,
313: HTParentAnchor * xmlbody, HTDAVHeaders * headers);
314: extern BOOL HTCOPYAbsolute (HTRequest * request, const char * uri,
315: const char * xmlbody, HTDAVHeaders * headers);
316: extern BOOL HTCOPYRelative (HTRequest * request, const char * relative,
317: HTParentAnchor * base, const char * xmlbody,
1.3 ! kirschpi 318: HTDAVHeaders * headers);
! 319: </PRE>
1.1 kirschpi 320:
1.3 ! kirschpi 321: <H3>
! 322: MOVE Requests
! 323: </H3>
1.1 kirschpi 324:
1.3 ! kirschpi 325: <P>
! 326: MOVE requests moves the Request-URI (parameters HTAnchor *src or char
1.1 kirschpi 327: *absolute/relative) to the resource indicated in Destinarion header. The
328: HTDAVHeaders *headers parameter MUST be a non-null object and it MUST have
329: the Destination header set. Other headers may also be used, like Depth ("0"
330: or "infinity" - if the resource is a Collection, Depth must only be
1.3 ! kirschpi 331: "infinity"), If and Overwrite headers.
! 332: <PRE>
! 333: extern BOOL HTMOVEAnchor (HTRequest * request, HTAnchor * src,
1.1 kirschpi 334: const char * xmlbody, HTDAVHeaders * headers);
335: extern BOOL HTMOVEDocumentAnchor (HTRequest * request, HTAnchor * src,
336: HTParentAnchor * xmlbody, HTDAVHeaders * headers);
337: extern BOOL HTMOVEAbsolute (HTRequest * request, const char * uri,
338: const char * xmlbody, HTDAVHeaders * headers);
339: extern BOOL HTMOVERelative (HTRequest * request, const char * relative,
340: HTParentAnchor * base, const char * xmlbody,
341: HTDAVHeaders * headers);
342:
343: #endif /* HT_DAV */
1.3 ! kirschpi 344: #endif /* HTDAV_H */
! 345: </PRE>
1.1 kirschpi 346:
1.3 ! kirschpi 347: <P>
! 348: <HR>
! 349: <ADDRESS>
! 350: $Id: HTDAV.html,v 1.2 2002/05/30 18:08:56 kirschpi Exp $
! 351: </ADDRESS>
! 352:
! 353: <P>
! 354: </BODY>
! 355: </HTML>
Webmaster