Lines Matching defs:resource
624 /* did the target resource already exist? */
694 /* resolve a request URI to a resource descriptor.
700 * the resource identified by the DAV:checked-in property of the resource
724 /* resolve the resource */
730 "Could not fetch resource information.", err);
740 "resource for %s.",
819 dav_resource *resource;
823 /* This method should only be called when the resource is not
824 * visible to Apache. We will fetch the resource from the repository,
828 &resource);
832 if (!resource->exists) {
838 if ((err = (*resource->hooks->set_headers)(r, resource)) != NULL) {
856 if ((err = (*resource->hooks->deliver)(resource,
867 /* validate resource/locks on POST, then pass to the default handler */
870 dav_resource *resource;
873 /* Ask repository module to resolve the resource */
875 &resource);
880 if ((err = dav_validate_request(r, resource, 0, NULL, NULL,
892 dav_resource *resource;
906 /* Ask repository module to resolve the resource */
908 &resource);
912 /* If not a file or collection resource, PUT not allowed */
913 if (resource->type != DAV_RESOURCE_TYPE_REGULAR
914 && resource->type != DAV_RESOURCE_TYPE_WORKING) {
916 "Cannot create resource %s with PUT.",
922 if (resource->collection) {
928 resource_state = dav_get_resource_state(r, resource);
935 * If the resource does not exist (DAV_RESOURCE_NULL), then we must
936 * check the resource *and* its parent. If the resource exists or is
937 * a locknull resource, then we check only the resource.
939 if ((err = dav_validate_request(r, resource, 0, NULL, &multi_response,
963 /* make sure the resource can be modified (if versioning repository) */
964 if ((err = dav_auto_checkout(r, resource,
972 if ((err = (*resource->hooks->open_stream)(resource, mode,
989 err = (*resource->hooks->seek_stream)(stream, range_start);
1052 err = (*resource->hooks->write_stream)(stream, data, len);
1061 err2 = (*resource->hooks->close_stream)(stream,
1067 * Ensure that we think the resource exists now.
1069 * ### then the resource might NOT exist (e.g. dav_fs_repos.c)
1072 resource->exists = 1;
1076 err2 = dav_auto_checkin(r, resource, err != NULL /* undo if error */,
1090 "the resource or its parent collection.",
1111 /* notify lock system that we have created/replaced a resource */
1112 err = dav_notify_created(r, lockdb, resource, resource_state, 0);
1144 resp.href = wres->resource->uri;
1162 resp->href = apr_pstrdup(wres->pool, wres->resource->uri);
1176 dav_resource *resource;
1189 /* Ask repository module to resolve the resource */
1191 &resource);
1194 if (!resource->exists) {
1204 if (resource->collection && depth != DAV_INFINITY) {
1211 if (!resource->collection && depth == 1) {
1223 ** Note that a failure on the resource itself does not generate a
1226 if ((err = dav_validate_request(r, resource, depth, NULL,
1242 if ((result = dav_unlock(r, resource, NULL)) != OK) {
1246 /* if versioned resource, make sure parent is checked out */
1247 if ((err = dav_auto_checkout(r, resource, 1 /* parent_only */,
1253 /* try to remove the resource */
1254 err = (*resource->hooks->remove_resource)(resource, &multi_response);
1354 const dav_resource *resource,
1374 /* open the property database (readonly) for the resource */
1375 if ((err = dav_open_propdb(r, lockdb, resource, 1, NULL,
1443 const dav_resource *resource,
1459 if ((err = (*vsn_hooks->avail_reports)(resource, &reports)) != NULL) {
1463 "available reports for this resource.",
1539 dav_resource *resource;
1547 /* This method should only be called when the resource is not
1548 * visible to Apache. We will fetch the resource from the repository,
1552 &resource);
1556 if (!resource->exists) {
1562 if ((err = (*resource->hooks->set_headers)(r, resource)) != NULL) {
1597 dav_resource *resource;
1618 /* resolve the resource */
1620 &resource);
1657 options->dav_header(r, resource, &hoptions);
1698 * Determine which methods are allowed on the resource.
1699 * Three cases: resource is null (3), is lock-null (7.4), or exists.
1709 /* ### take into account resource type */
1710 switch (dav_get_resource_state(r, resource))
1713 /* resource exists */
1724 if (!resource->collection)
1735 /* resource is lock-null. */
1748 /* resource is null. */
1764 if (!resource->exists) {
1765 if ((*vsn_hooks->versionable)(resource))
1769 && (*vsn_hooks->can_be_workspace)(resource))
1773 && (*vsn_hooks->can_be_activity)(resource))
1776 else if (!resource->versioned) {
1777 if ((*vsn_hooks->versionable)(resource))
1780 else if (resource->working) {
1795 /* If there is a bindings provider, see if resource is bindable */
1797 && (*binding_hooks->is_bindable)(resource)) {
1817 options->dav_method(r, resource, &hoptions);
1889 err = dav_gen_supported_live_props(r, resource, elem, &body);
1893 err = dav_gen_supported_reports(r, resource, elem, vsn_hooks, &body);
1903 if ((err = (*vsn_hooks->get_option)(resource, elem, &body))
1968 ** the resource, however, since we are opening readonly.
1970 err = dav_open_propdb(ctx->r, ctx->w.lockdb, wres->resource, 1,
1978 /* some props were expected on this collection/resource */
1984 /* no props on this collection/resource */
2018 dav_resource *resource;
2026 /* Ask repository module to resolve the resource */
2028 &resource);
2032 if (dav_get_resource_state(r, resource) == DAV_RESOURCE_NULL) {
2043 if (depth == DAV_INFINITY && resource->collection) {
2097 ctx.w.root = resource;
2129 /* Have the provider walk the resource. */
2130 err = (*resource->hooks->walk)(&ctx.w, depth, &multi_status);
2137 /* If an error occurred during the resource walk, there's
2290 dav_resource *resource;
2302 /* Ask repository module to resolve the resource */
2304 &resource);
2307 if (!resource->exists) {
2327 if ((err = dav_validate_request(r, resource, 0, NULL, NULL,
2333 /* make sure the resource can be modified (if versioning repository) */
2334 if ((err = dav_auto_checkout(r, resource,
2341 if ((err = dav_open_propdb(r, NULL, resource, 0, doc->namespaces,
2344 dav_auto_checkin(r, resource, 1 /*undo*/, 0 /*unlock*/, &av_info);
2379 dav_auto_checkin(r, resource, 1 /*undo*/, 0 /*unlock*/, &av_info);
2427 dav_auto_checkin(r, resource, failure, 0 /*unlock*/, &av_info);
2432 resp.href = resource->uri;
2502 dav_resource *resource;
2517 /* Ask repository module to resolve the resource */
2519 &resource);
2523 if (resource->exists) {
2531 resource_state = dav_get_resource_state(r, resource);
2540 * If the resource does not exist (DAV_RESOURCE_NULL), then we must
2541 * check the resource *and* its parent. If the resource exists or is
2542 * a locknull resource, then we check only the resource.
2544 if ((err = dav_validate_request(r, resource, 0, NULL, &multi_status,
2552 /* if versioned resource, make sure parent is checked out */
2553 if ((err = dav_auto_checkout(r, resource, 1 /* parent_only */,
2560 resource->collection = 1;
2561 err = (*resource->hooks->create_collection)(resource);
2595 /* notify lock system that we have created/replaced a resource */
2596 err = dav_notify_created(r, lockdb, resource, resource_state, 0);
2618 dav_resource *resource;
2637 /* Ask repository module to resolve the resource */
2639 0 /* use_checked_in */, &resource);
2643 if (!resource->exists) {
2648 /* If not a file or collection resource, COPY/MOVE not allowed */
2649 /* ### allow COPY/MOVE of DeltaV resource types */
2650 if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
2652 "Cannot COPY/MOVE resource %s.",
2703 /* Resolve destination resource */
2710 if (resource->hooks != resnew->hooks) {
2735 if ((*resource->hooks->is_same_resource)(resource, resnew)) {
2742 is_dir = resource->collection;
2764 * Check If-Headers and existing locks for each resource in the source.
2767 * resource that fails the validation.
2769 * We check the parent resource, too, if this is a MOVE. Moving the
2770 * resource effectively removes it from the parent collection, so we
2776 if ((err = dav_validate_request(r, resource, depth, NULL,
2820 && (*resource->hooks->is_parent_resource)(resource, resnew)) {
2828 && (*resnew->hooks->is_parent_resource)(resnew, resource)) {
2865 (void)dav_unlock(r, resource, NULL);
2870 if ((err = dav_auto_checkout(r, resource, 1 /* parent_only */,
2888 * control, and is the same resource type as the source,
2894 else if (is_move || !resource->versioned)
2896 else if (resource->type != resnew->type)
2898 else if ((resource->collection == 0) != (resnew->collection == 0))
2926 * use the same resource object, so status updates to one are reflected
2939 * (we know Ovewrite must be TRUE). Then try to copy/move the resource.
2946 err = (*resource->hooks->move_resource)(resource, resnew,
2949 err = (*resource->hooks->copy_resource)(resource, resnew, depth,
3000 /* notify lock system that we have created/replaced a resource */
3027 dav_resource *resource;
3054 /* Ask repository module to resolve the resource */
3056 &resource);
3061 if ((err = resource->hooks->get_parent_resource(resource, &parent)) != NULL) {
3068 "The parent resource of %s does not "
3084 if ((err = dav_lock_parse_lockinfo(r, resource, lockdb, doc,
3094 resource_state = dav_get_resource_state(r, resource);
3099 * If this will create a locknull resource, then the LOCK will affect
3101 * validate the parent resource's conditions.
3103 if ((err = dav_validate_request(r, resource, depth, NULL, &multi_response,
3124 * ### Assumption: We can renew multiple locks on the same resource
3126 * ### the If header. Then modify the lock entries for this resource
3142 if ((err = (*locks_hooks->refresh_locks)(lockdb, resource, ltl,
3161 err = dav_add_lock(r, resource, lockdb, lock, &multi_response);
3206 dav_resource *resource;
3253 /* Ask repository module to resolve the resource */
3255 &resource);
3259 resource_state = dav_get_resource_state(r, resource);
3268 * If the resource is a locknull resource, then the UNLOCK will affect
3270 * validate the parent resource's conditions.
3272 if ((err = dav_validate_request(r, resource, 0, locktoken,
3281 /* ### RFC 2518 s. 8.11: If this resource is locked by locktoken,
3283 * resource has to be the root of an infinte lock. Thus, an UNLOCK
3287 * we must actually perform an UNLOCK on the direct lock for this resource.
3289 if ((result = dav_unlock(r, resource, locktoken)) != OK) {
3298 dav_resource *resource;
3312 /* ask repository module to resolve the resource */
3314 &resource);
3318 /* remember the pre-creation resource state */
3319 resource_state = dav_get_resource_state(r, resource);
3369 /* if not versioning existing resource, must specify version to select */
3370 if (!resource->exists && target == NULL) {
3375 else if (resource->exists) {
3376 /* cannot add resource to existing version history */
3383 /* resource must be unversioned and versionable, or version selector */
3384 if (resource->type != DAV_RESOURCE_TYPE_REGULAR
3385 || (!resource->versioned && !(vsn_hooks->versionable)(resource))) {
3391 /* the DeltaV spec says if resource is a version selector,
3394 if (resource->versioned) {
3407 if ((err = dav_validate_request(r, resource, 0, NULL, NULL,
3415 if ((err = dav_auto_checkout(r, resource, 1 /* parent_only */,
3420 /* attempt to version-control the resource */
3421 if ((err = (*vsn_hooks->vsn_control)(resource, target)) != NULL) {
3422 dav_auto_checkin(r, resource, 1 /*undo*/, 0 /*unlock*/, &av_info);
3425 "Could not VERSION-CONTROL resource %s.",
3432 err = dav_auto_checkin(r, resource, 0 /*undo*/, 0 /*unlock*/, &av_info);
3443 /* if the resource is lockable, let lock system know of new resource */
3445 && (*locks_hooks->get_supportedlock)(resource) != NULL) {
3449 /* The resource creation was successful, but the locking failed. */
3459 /* notify lock system that we have created/replaced a resource */
3460 err = dav_notify_created(r, lockdb, resource, resource_state, 0);
3479 return dav_created(r, resource->uri, "Version selector", 0 /*replaced*/);
3485 dav_resource *resource;
3566 /* Ask repository module to resolve the resource */
3567 err = dav_get_resource(r, 1 /*label_allowed*/, apply_to_vsn, &resource);
3571 if (!resource->exists) {
3576 /* Check the state of the resource: must be a file or collection,
3579 if (resource->type != DAV_RESOURCE_TYPE_REGULAR
3580 && resource->type != DAV_RESOURCE_TYPE_VERSION) {
3582 "Cannot checkout this type of resource.");
3585 if (!resource->versioned) {
3587 "Cannot checkout unversioned resource.");
3590 if (resource->working) {
3592 "The resource is already checked out to the workspace.");
3598 if ((err = (*vsn_hooks->checkout)(resource, 0 /*auto_checkout*/,
3604 "Could not CHECKOUT resource %s.",
3613 /* if no working resource created, return OK,
3614 * else return CREATED with working resource URL in Location header
3622 return dav_created(r, working_resource->uri, "Checked-out resource", 0);
3628 dav_resource *resource;
3641 /* Ask repository module to resolve the resource */
3643 &resource);
3647 if (!resource->exists) {
3652 /* Check the state of the resource: must be a file or collection,
3655 if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
3657 "Cannot uncheckout this type of resource.");
3660 if (!resource->versioned) {
3662 "Cannot uncheckout unversioned resource.");
3665 if (!resource->working) {
3667 "The resource is not checked out to the workspace.");
3673 if ((err = (*vsn_hooks->uncheckout)(resource)) != NULL) {
3676 "Could not UNCHECKOUT resource %s.",
3691 dav_resource *resource;
3718 /* Ask repository module to resolve the resource */
3720 &resource);
3724 if (!resource->exists) {
3729 /* Check the state of the resource: must be a file or collection,
3732 if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
3734 "Cannot checkin this type of resource.");
3737 if (!resource->versioned) {
3739 "Cannot checkin unversioned resource.");
3742 if (!resource->working) {
3744 "The resource is not checked out.");
3750 if ((err = (*vsn_hooks->checkin)(resource, keep_checked_out, &new_version))
3754 "Could not CHECKIN resource %s.",
3765 dav_resource *resource;
3839 /* Ask repository module to resolve the resource */
3841 &resource);
3845 if (!resource->exists) {
3853 if (resource->type != DAV_RESOURCE_TYPE_REGULAR
3854 || !resource->versioned || resource->working) {
3856 "<DAV:must-be-checked-in-version-controlled-resource>");
3859 /* if target is a version, resolve the version resource */
3882 /* resolve version resource */
3888 /* NULL out target, since we're using a version resource */
3893 err = (*vsn_hooks->update)(resource, version, target, depth, &multi_response);
3938 /* Check the state of the resource: must be a version or
3944 if (wres->resource->type != DAV_RESOURCE_TYPE_VERSION &&
3945 (wres->resource->type != DAV_RESOURCE_TYPE_REGULAR
3946 || !wres->resource->versioned)) {
3950 else if (wres->resource->working) {
3957 err = (*ctx->vsn_hooks->remove_label)(wres->resource, ctx->label);
3959 err = (*ctx->vsn_hooks->add_label)(wres->resource, ctx->label,
3974 dav_resource *resource;
3990 /* Ask repository module to resolve the resource */
3992 &resource);
3995 if (!resource->exists) {
4058 ctx.w.root = resource;
4061 err = (*resource->hooks->walk)(&ctx.w, depth, &multi_status);
4100 dav_resource *resource;
4120 /* Ask repository module to resolve the resource.
4126 &resource);
4130 if (!resource->exists) {
4140 if ((err = (*vsn_hooks->deliver_report)(r, resource, doc,
4165 dav_resource *resource;
4177 /* ask repository module to resolve the resource */
4179 &resource);
4202 /* resource must not already exist */
4203 if (resource->exists) {
4205 "<DAV:resource-must-be-null/>");
4212 if ((err = (*vsn_hooks->make_workspace)(resource, doc)) != NULL) {
4225 return dav_created(r, resource->uri, "Workspace", 0 /*replaced*/);
4230 dav_resource *resource;
4241 /* ask repository module to resolve the resource */
4243 &resource);
4258 /* resource must not already exist */
4259 if (resource->exists) {
4261 "<DAV:resource-must-be-null/>");
4265 /* the provider must say whether the resource can be created as
4268 && !(*vsn_hooks->can_be_activity)(resource)) {
4277 if ((err = (*vsn_hooks->make_activity)(resource)) != NULL) {
4290 return dav_created(r, resource->uri, "Activity", 0 /*replaced*/);
4301 dav_resource *resource;
4384 /* Ask repository module to resolve the resource */
4386 &resource);
4389 if (!resource->exists) {
4413 if ((err = (*vsn_hooks->merge)(resource, source_resource,
4420 "Could not MERGE resource \"%s\" "
4435 dav_resource *resource;
4450 /* Ask repository module to resolve the resource */
4452 &resource);
4456 if (!resource->exists) {
4500 /* resolve binding resource */
4507 if (resource->hooks != binding->hooks) {
4530 if ((*resource->hooks->is_same_resource)(resource, binding)) {
4560 if (resource->collection
4561 && (*resource->hooks->is_parent_resource)(resource, binding)) {
4565 if (resource->collection
4566 && (*resource->hooks->is_parent_resource)(binding, resource)) {
4586 * Then try to bind to the resource.
4589 err = (*resource->hooks->remove_resource)(binding, &multi_response);
4592 err = (*binding_hooks->bind_resource)(resource, binding);
4857 /* We are going to be handling the response for this resource. */
4924 (const dav_resource *resource,
4927 (resource, ns_uri, name, hooks), 0)
4930 (request_rec *r, const dav_resource *resource,
4932 (r, resource, what, phdr))