<docbook><section><title>OATDOCdav</title><para> </para>
<title> dav.js</title> dav.js
<para>Displays a <ulink url="WebDavBrowser">WebDavBrowser</ulink> window for file picking/opening/saving.
 Optionally prompts for auth credentials.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Functions</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.WebDav.init(options)</bridgehead>
<para>Creates <ulink url="WebDAVBrowser">WebDAVBrowser</ulink> window and sets various configurationoptions, if needed.
 All possible options:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>user</emphasis> - username </listitem>
<listitem><emphasis>pass</emphasis> - username </listitem>
<listitem><emphasis>path</emphasis> - path which should be opened </listitem>
<listitem><emphasis>file</emphasis> - default preselected file name </listitem>
<listitem><emphasis>silentStart</emphasis> - do not display connection setup dialog on <ulink url="WebDAVinitialization">WebDAVinitialization</ulink> </listitem>
<listitem><emphasis>extension</emphasis> - ID of default file type extension to be selected </listitem>
<listitem><emphasis>pathFallback</emphasis> - this is a failsafe path which will be offered when HTTP errors prohibit changing to requested path </listitem>
<listitem><emphasis>imagePath</emphasis> - path to images, with trailing slash </listitem>
<listitem><emphasis>imageExt</emphasis> - image files extension </listitem>
<listitem><emphasis>isDav</emphasis> - whether the server is DAV.
 For non-DAV HTTP servers, a minimal &#39;prompt&#39; will be used instead of full Browser When no user/pass is passed in options or silent Setupis set to false, user will be prompted for credentials through connection settings dialog.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.WebDav.openDialog(options)</bridgehead>
<para>Opens the Browser in file browse mode.
 User can select a file, which will be passed back to application.
 All options passed to OAT.WebDav.init can be used here.
 Additional specific options:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>callback</emphasis> - function to be executed when user selects a file.
 This will be called with 3 arguments:path,file name and contents.
</listitem>
<listitem><emphasis>extensionFilters</emphasis> - array of file type extensions.
 Each item consists of 4 values:arbitrary unique ID,extension,description, and optional content type</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.WebDav.saveDialog(options)</bridgehead>
<para>Opens the Browser in file save mode.
 User can select a new/existing file, the Browser will then save specified data to that file.
 All options passed to OAT.WebDav.init can be used here.
 Additional specific options: </para>
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>callback</emphasis> - same as inOAT.WebDav.openDialog </listitem>
<listitem><emphasis>extensionFilters</emphasis> - same as inOAT.WebDav.openDialog </listitem>
<listitem><emphasis>confirmOverwrite</emphasis> - bool, should we ask for a confirmation when overwriting existing file? </listitem>
<listitem><emphasis>dataCallback</emphasis> - function which provides data to be saved.
 Will be executed with two arguments:selected file name and used extension ID.
 If set to false, nothing will be saved.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Examples</bridgehead>
<programlisting>var options = {
        user:&quot;demo&quot;,
        pass:&quot;demo&quot;,
        path:&quot;/DAV/home/demo/&quot;,
        isDav:true,
        extensionFilters:[
                [&quot;all&quot;,         &quot;*&quot;,   &quot;All files&quot;,     &quot;text/plain&quot;],
                [&quot;xmldoc&quot;,      &quot;xml&quot;, &quot;XML Documents&quot;, &quot;text/xml&quot;],
                [&quot;xmltemplate&quot;, &quot;xml&quot;, &quot;XML Templates&quot;, &quot;application/xml&quot;]
        ]
}

OAT.WebDav.init(options);

function showContents(path, file, data) {
        alert(path+file+&#39; contains:\n\n&#39;+data);
}

OAT.WebDav.openDialog({callback:showContents});
</programlisting><para> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryOAT">CategoryOAT</ulink> <ulink url="CategoryOpenSource">CategoryOpenSource</ulink></para>
</section></docbook>