Lines Matching defs:propdb

62 **   that are in use by the properties in the given propdb. Each entry
161 ** operations. For GET, it would be "expensive" to look for a propdb,
225 static int dav_find_liveprop_provider(dav_propdb *propdb,
240 propid = dav_run_find_liveprop(propdb->resource, ns_uri, propname,
260 static void dav_find_liveprop(dav_propdb *propdb, apr_xml_elem *elem)
272 ns_uri = APR_XML_GET_URI_ITEM(propdb->ns_xlate, elem->ns);
274 priv->propid = dav_find_liveprop_provider(propdb, ns_uri, elem->name,
284 static int dav_rw_liveprop(dav_propdb *propdb, dav_elem_private *priv)
292 return (*priv->provider->is_writable)(propdb->resource, propid);
322 static void dav_do_prop_subreq(dav_propdb *propdb)
326 const char *e_uri = ap_escape_uri(propdb->resource->pool,
327 propdb->resource->uri);
331 propdb->subreq = ap_sub_req_lookup_uri(e_uri, propdb->r, NULL);
334 static dav_error * dav_insert_coreprop(dav_propdb *propdb,
352 if (propdb->lockdb != NULL) {
355 if ((err = dav_lock_query(propdb->lockdb, propdb->resource,
357 return dav_push_error(propdb->p, err->status, 0,
373 value = dav_lock_get_activelock(propdb->r, locks,
374 &propdb->wb_lock);
377 value = apr_pstrdup(propdb->p, propdb->wb_lock.buf);
383 if (propdb->lockdb != NULL) {
384 value = (*propdb->lockdb->hooks->get_supportedlock)(propdb->resource);
389 if (propdb->subreq == NULL) {
390 dav_do_prop_subreq(propdb);
392 if (propdb->subreq->content_type != NULL) {
393 value = propdb->subreq->content_type;
401 if (propdb->subreq == NULL) {
402 dav_do_prop_subreq(propdb);
404 if ((lang = apr_table_get(propdb->subreq->headers_out,
424 s = apr_psprintf(propdb->p,
430 s = apr_psprintf(propdb->p, "<D:%s>%s</D:%s>" DEBUG_CR,
435 s = apr_psprintf(propdb->p, "<D:%s/>" DEBUG_CR, name);
437 apr_text_append(propdb->p, phdr, s);
445 static dav_error * dav_insert_liveprop(dav_propdb *propdb,
457 return dav_insert_coreprop(propdb, priv->propid, elem->name,
462 *inserted = (*priv->provider->insert_prop)(propdb->resource, priv->propid,
495 static dav_error *dav_really_open_db(dav_propdb *propdb, int ro)
500 propdb->deferred = 0;
503 err = (*propdb->db_hooks->open)(propdb->p, propdb->resource, ro,
504 &propdb->db);
506 return dav_push_error(propdb->p, HTTP_INTERNAL_SERVER_ERROR,
513 ** NOTE: propdb->db could be NULL if we attempted to open a readonly
527 dav_propdb *propdb = apr_pcalloc(r->pool, sizeof(*propdb));
539 propdb->r = r;
540 apr_pool_create(&propdb->p, r->pool);
541 propdb->resource = resource;
542 propdb->ns_xlate = ns_xlate;
544 propdb->db_hooks = DAV_GET_HOOKS_PROPDB(r);
546 propdb->lockdb = lockdb;
551 propdb->deferred = 1;
553 /* ### what to do about closing the propdb on server failure? */
555 *p_propdb = propdb;
559 DAV_DECLARE(void) dav_close_propdb(dav_propdb *propdb)
561 if (propdb->db != NULL) {
562 (*propdb->db_hooks->close)(propdb->db);
567 apr_pool_destroy(propdb->p);
572 DAV_DECLARE(dav_get_props_result) dav_get_allprops(dav_propdb *propdb,
575 const dav_hooks_db *db_hooks = propdb->db_hooks;
587 if (propdb->deferred) {
589 (void) dav_really_open_db(propdb, 1 /*ro*/);
593 apr_text_append(propdb->p, &hdr,
598 if (propdb->db != NULL) {
599 dav_xmlns_info *xi = dav_xmlns_create(propdb->p);
604 (void) (*db_hooks->define_namespaces)(propdb->db, xi);
607 err = (*db_hooks->first_name)(propdb->db, &name);
629 if ((err = (*db_hooks->output_value)(propdb->db, &name,
641 dav_output_prop_name(propdb->p, &name, xi, &hdr);
645 err = (*db_hooks->next_name)(propdb->db, &name);
652 } /* propdb->db != NULL */
655 dav_add_all_liveprop_xmlns(propdb->p, &hdr_ns);
659 dav_run_insert_all_liveprops(propdb->r, propdb->resource, what, &hdr);
663 (void)dav_insert_coreprop(propdb,
666 (void)dav_insert_coreprop(propdb,
673 (void)dav_insert_coreprop(propdb,
680 (void)dav_insert_coreprop(propdb,
689 apr_text_append(propdb->p, &hdr,
700 DAV_DECLARE(dav_get_props_result) dav_get_props(dav_propdb *propdb,
703 const dav_hooks_db *db_hooks = propdb->db_hooks;
718 apr_text_append(propdb->p, &hdr_good,
727 marks_liveprop = apr_pcalloc(propdb->p, dav_get_liveprop_ns_count() + 1);
729 xi = dav_xmlns_create(propdb->p);
739 ** the property, then try looking it up in the propdb.
743 elem->priv = apr_pcalloc(propdb->p, sizeof(*priv));
749 dav_find_liveprop(propdb, elem);
754 if ((err = dav_insert_liveprop(propdb, elem, DAV_PROP_INSERT_VALUE,
779 dav_insert_xmlns(propdb->p, "lp", ns, *scan_ns_uri,
795 return dav_new_error(propdb->p, HTTP_INTERNAL_SERVER_ERROR, 0,
807 /* make sure propdb is really open */
808 if (propdb->deferred) {
810 (void) dav_really_open_db(propdb, 1 /*ro*/);
816 name.ns = APR_XML_GET_URI_ITEM(propdb->ns_xlate, elem->ns);
820 if (propdb->db != NULL) {
823 if ((err = (*db_hooks->output_value)(propdb->db, &name,
835 (void) (*db_hooks->define_namespaces)(propdb->db, xi);
847 apr_text_append(propdb->p, &hdr_bad,
853 dav_output_prop_name(propdb->p, &name, xi, &hdr_bad);
856 apr_text_append(propdb->p, &hdr_good,
867 apr_text_append(propdb->p, &hdr_bad,
889 DAV_DECLARE(void) dav_get_liveprop_supported(dav_propdb *propdb,
897 propid = dav_find_liveprop_provider(propdb, ns_uri, propname, &hooks);
903 dav_insert_coreprop(propdb, propid, propname,
907 (*hooks->insert_prop)(propdb->resource, propid,
915 dav_propdb *propdb = ctx->propdb;
919 priv = ctx->prop->priv = apr_pcalloc(propdb->p, sizeof(*priv));
929 dav_find_liveprop(propdb, prop);
938 if (!dav_rw_liveprop(propdb, priv)) {
939 ctx->err = dav_new_error(propdb->p, HTTP_CONFLICT,
948 ctx->err = (*priv->provider->patch_validate)(propdb->resource,
963 if (propdb->deferred
964 && (ctx->err = dav_really_open_db(propdb, 0 /* ro */)) != NULL) {
974 if (propdb->db == NULL) {
975 ctx->err = dav_new_error(propdb->p, HTTP_INTERNAL_SERVER_ERROR,
985 ** Prep the element => propdb namespace index mapping, inserting
986 ** namespace URIs into the propdb that don't exist.
988 (void) (*propdb->db_hooks->map_namespaces)(propdb->db,
989 propdb->ns_xlate,
990 &propdb->mapping);
1006 dav_propdb *propdb = ctx->propdb;
1010 ctx->rollback = apr_pcalloc(propdb->p, sizeof(*ctx->rollback));
1013 err = (*priv->provider->patch_exec)(propdb->resource,
1024 name.ns = APR_XML_GET_URI_ITEM(propdb->ns_xlate, ctx->prop->ns);
1028 if ((err = (*propdb->db_hooks
1029 ->get_rollback)(propdb->db, &name,
1035 /* Note: propdb->mapping was set in dav_prop_validate() */
1036 err = (*propdb->db_hooks->store)(propdb->db, &name, ctx->prop,
1037 propdb->mapping);
1057 (void) (*propdb->db_hooks->remove)(propdb->db, &name);
1068 ctx->err = dav_push_error(propdb->p, HTTP_INTERNAL_SERVER_ERROR,
1084 (*priv->provider->patch_commit)(ctx->propdb->resource,
1107 err = (*priv->provider->patch_rollback)(ctx->propdb->resource,
1113 err = (*ctx->propdb->db_hooks
1114 ->apply_rollback)(ctx->propdb->db, ctx->rollback->deadprop);