std_liveprop.c revision 71da3cca78eea6010f89b139ecadb79e6d213c4f
b66914021bd429f41311d2909a7e9289866da7fdnd/* Copyright 2000-2004 Apache Software Foundation
9963f91528694fb21e93da8584c31f226c6de97akess * Licensed under the Apache License, Version 2.0 (the "License");
b66914021bd429f41311d2909a7e9289866da7fdnd * you may not use this file except in compliance with the License.
b66914021bd429f41311d2909a7e9289866da7fdnd * You may obtain a copy of the License at
031b91a62d25106ae69d4693475c79618dd5e884fielding * Unless required by applicable law or agreed to in writing, software
031b91a62d25106ae69d4693475c79618dd5e884fielding * distributed under the License is distributed on an "AS IS" BASIS,
031b91a62d25106ae69d4693475c79618dd5e884fielding * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b66914021bd429f41311d2909a7e9289866da7fdnd * See the License for the specific language governing permissions and
b66914021bd429f41311d2909a7e9289866da7fdnd * limitations under the License.
eed2a23d9b5986937f1e2b1c120be97744508a72nd/* forward-declare */
eed2a23d9b5986937f1e2b1c120be97744508a72nd** The namespace URIs that we use. There will only ever be "DAV:".
eed2a23d9b5986937f1e2b1c120be97744508a72ndstatic const char * const dav_core_namespace_uris[] =
eed2a23d9b5986937f1e2b1c120be97744508a72nd** Define each of the core properties that this provider will handle.
eed2a23d9b5986937f1e2b1c120be97744508a72nd** Note that all of them are in the DAV: namespace, which has a
eed2a23d9b5986937f1e2b1c120be97744508a72nd** provider-local index of 0.
eed2a23d9b5986937f1e2b1c120be97744508a72nd { 0, "creator-displayname", DAV_PROPID_creator_displayname, 1 },
eed2a23d9b5986937f1e2b1c120be97744508a72nd { 0 } /* sentinel */
eed2a23d9b5986937f1e2b1c120be97744508a72ndstatic dav_prop_insert dav_core_insert_prop(const dav_resource *resource,
eed2a23d9b5986937f1e2b1c120be97744508a72nd const char *value;
eed2a23d9b5986937f1e2b1c120be97744508a72nd const char *s;
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* fall through */
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd /* ### should we denote lock-null resources? */
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* ### bad juju */
9963f91528694fb21e93da8584c31f226c6de97akess ** This property is known, but not defined as a liveprop. However,
eed2a23d9b5986937f1e2b1c120be97744508a72nd ** it may be a dead property.
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* assert: value != NULL */
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* get the information and global NS index for the property */
8daf1ddf6285e4ded262f7a7a8e2e983a84a3cbdhumbedooh global_ns = dav_get_liveprop_info(propid, &dav_core_liveprop_group, &info);
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* assert: info != NULL && info->name != NULL */
b51bf223f42d43ca6b1b33c95124edcfa5a871a4nd "<D:supported-live-property D:name=\"%s\" "
eed2a23d9b5986937f1e2b1c120be97744508a72nd else if (what == DAV_PROP_INSERT_VALUE && *value != '\0') {
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd s = apr_psprintf(p, "<lp%d:%s/>" DEBUG_CR, global_ns, info->name);
eed2a23d9b5986937f1e2b1c120be97744508a72nd /* we inserted what was asked for */
eed2a23d9b5986937f1e2b1c120be97744508a72ndstatic int dav_core_is_writable(const dav_resource *resource, int propid)
b3027c7641b1104ee50404cca6868e5101a7ca45nd (void) dav_get_liveprop_info(propid, &dav_core_liveprop_group, &info);
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3ndstatic dav_error * dav_core_patch_validate(const dav_resource *resource,
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd /* all of our writable props go in the dead prop database */
return NULL;