1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_dav_api_add">
<refmeta>
<refentrytitle>DAV add & update functions</refentrytitle>
<refmiscinfo>ws</refmiscinfo>
</refmeta>
<refnamediv>
<refname>DAV_COL_CREATE</refname>
<refname>DAV_RES_UPLOAD</refname>
<refname>DAV_DELETE</refname>
<refpurpose>functions for adding, updating, deleting of DAV collections or resources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_dav_col_create">
<funcprototype id="fproto_dav_col_create">
<funcdef>integer <function>DAV_COL_CREATE</function></funcdef>
<paramdef>in <parameter>path</parameter> varchar</paramdef>
<paramdef>in <parameter>permissions</parameter> varchar</paramdef>
<paramdef>in <parameter>uname</parameter> varchar</paramdef>
<paramdef>in <parameter>gname</parameter> varchar</paramdef>
<paramdef>in <parameter>auth_uname</parameter> varchar</paramdef>
<paramdef>in <parameter>auth_pwd</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis id="fsyn_dav_res_upload">
<funcprototype id="fproto_dav_res_upload">
<funcdef>varchar <function>DAV_RES_UPLOAD</function></funcdef>
<paramdef>in <parameter>path</parameter> varchar</paramdef>
<paramdef>in <parameter>content</parameter> any</paramdef>
<paramdef>in <parameter>type</parameter> varchar</paramdef>
<paramdef>in <parameter>permissions</parameter> varchar</paramdef>
<paramdef>in <parameter>uname</parameter> varchar</paramdef>
<paramdef>in <parameter>gname</parameter> varchar</paramdef>
<paramdef>in <parameter>auth_uname</parameter> varchar</paramdef>
<paramdef>in <parameter>auth_pwd</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis id="fsyn_dav_delete">
<funcprototype id="fproto_dav_delete">
<funcdef>integer <function>DAV_DELETE</function></funcdef>
<paramdef>in <parameter>path</parameter> varchar</paramdef>
<paramdef>in <parameter>silent</parameter> integer</paramdef>
<paramdef>in <parameter>auth_uname</parameter> varchar</paramdef>
<paramdef>in <parameter>auth_pwd</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_dav_col_create"><title>Description</title>
<para><function>DAV_COL_CREATE</function> creates a new collection on path, with supplied security permissions,
returning a collection id (COL_ID) upon success.</para>
<para><function>DAV_RES_UPLOAD</function> creates or replaces an existing resource on path with content, mime type and supplied security permissions. Returns a resource id (RES_ID) on success.</para>
<para><function>DAV_DELETE</function> Removes an existing collection/resource.
If <parameter>silent</parameter> is set to a nonzero value, no errors codes will be returned.
returns 1 on success.</para>
</refsect1>
<refsect1 id="params_dav_api_add"><title>Parameters</title>
<refsect2><title>path</title>
<para>Collection (directory) path and name of destination of upload.</para>
</refsect2>
<refsect2><title>content</title>
<para>The resource data to upload.</para>
</refsect2>
<refsect2><title>type</title>
<para>Mime type of the uploaded resource.
Defaults to '' if not supplied.</para>
</refsect2>
<refsect2><title>permissions</title>
<para>Access permission string of Dav collection or resource.
Defaults to '110100000R' if not supplied.</para>
</refsect2>
<refsect2><title>silent</title>
<para>If non-zero, no errors will be returned.
Default is 0, meaning errors are returned.</para>
</refsect2>
<refsect2><title>uname</title>
<para>Owner user name. Default is 'dav'.</para>
</refsect2>
<refsect2><title>group name</title>
<para>Owner group name. Default is 'dav'.</para>
</refsect2>
<refsect2><title>auth_uname</title>
<para>Name of administration user capable of performing the operation.
default is null.</para>
</refsect2>
<refsect2><title>auth_pwd</title>
<para>Administrator password. Default is null.</para>
</refsect2>
</refsect1>
<refsect1 id="errors_dav_api_add"><title>Errors</title>
<table><title>Errors signalled by DAV_* functions</title>
<tgroup cols="2">
<thead><row><entry>Error Code</entry><entry>Description</entry></row></thead>
<tbody>
<row><entry><errorcode>>=0</errorcode></entry>
<entry><errorname>success</errorname></entry></row>
<row><entry><errorcode>-1</errorcode></entry>
<entry><errorname>The path (target of operation) is not valid</errorname></entry></row>
<row><entry><errorcode>-2</errorcode></entry>
<entry><errorname>The destination (path) is not valid</errorname></entry></row>
<row><entry><errorcode>-3</errorcode></entry>
<entry><errorname>Overwrite flag is not set and destination exists</errorname></entry></row>
<row><entry><errorcode>-4</errorcode></entry>
<entry><errorname>The target is resource, but source is collection (in copy move operations)</errorname></entry></row>
<row><entry><errorcode>-5</errorcode></entry>
<entry><errorname>Permissions are not valid</errorname></entry></row>
<row><entry><errorcode>-6</errorcode></entry>
<entry><errorname>uid is not valid</errorname></entry></row>
<row><entry><errorcode>-7</errorcode></entry>
<entry><errorname>gid is not valid</errorname></entry></row>
<row><entry><errorcode>-8</errorcode></entry>
<entry><errorname>Target is locked</errorname></entry></row>
<row><entry><errorcode>-9</errorcode></entry>
<entry><errorname>Destination is locked</errorname></entry></row>
<row><entry><errorcode>-10</errorcode></entry>
<entry><errorname>Property name is reserved (protected or private)</errorname></entry></row>
<row><entry><errorcode>-11</errorcode></entry>
<entry><errorname>Property does not exist</errorname></entry></row>
<row><entry><errorcode>-12</errorcode></entry>
<entry><errorname>Authentication failed</errorname></entry></row>
<row><entry><errorcode>-13</errorcode></entry>
<entry><errorname>Operation is forbidden (the authenticated user do not have a permissions for the action)</errorname></entry></row>
<row><entry><errorcode>-14</errorcode></entry>
<entry><errorname>the target type is not valid</errorname></entry></row>
<row><entry><errorcode>-15</errorcode></entry>
<entry><errorname>The umask is not valid</errorname></entry></row>
<row><entry><errorcode>-16</errorcode></entry>
<entry><errorname>The property already exists</errorname></entry></row>
<row><entry><errorcode>-17</errorcode></entry>
<entry><errorname>Invalid property value</errorname></entry></row>
<row><entry><errorcode>-18</errorcode></entry>
<entry><errorname>no such user</errorname></entry></row>
<row><entry><errorcode>-19</errorcode></entry>
<entry><errorname>no home directory</errorname></entry></row>
</tbody>
</tgroup>
</table>
</refsect1>
<refsect1 id="examples_dav_api_add"><title>Examples</title>
<example id="ex_dav_api_add_1"><title>Creating a resource and collection</title>
<para>The following example shows collection creation, resource upload and removal.
This sequence of commands would leave a resource A.txt in
<computeroutput>http://[host:port]/DAV/user/A/</computeroutput></para>
<screen>
SQL> select DB.DBA.DAV_COL_CREATE ('/DAV/user/','110100000R', 'dav','dav','dav','dav');
SQL> select DB.DBA.DAV_COL_CREATE ('/DAV/user/A/','110100000R','dav','dav','dav','dav');
SQL> select DB.DBA.DAV_RES_UPLOAD ('/DAV/user/A/A.txt','this is a test','text/plain','110100000R','dav','dav','dav','dav');
SQL> select DB.DBA.DAV_RES_UPLOAD ('/DAV/user/A/B.txt','this is a second test','text/plain','110100000R','dav','dav','dav','dav');
SQL> select DB.DBA.DAV_DELETE ('/DAV/user/A/B.txt', 0, 'dav', 'dav');
</screen>
</example>
</refsect1>
<refsect1 id="seealso_dav_api_add"><title>See Also</title>
<para><link linkend="fn_dav_api_change">DAV content manipulation functions</link></para>
<para><link linkend="fn_dav_api_lock">DAV lock manipulation functions</link></para>
<para><link linkend="fn_dav_api_search">DAV search functions</link></para>
<para><link linkend="fn_dav_api_user">DAV user management functions</link></para>
</refsect1>
</refentry>
|