Annotation of libwww/Library/src/HTDAV.html, revision 1.4

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

Webmaster