Network Working Group J. Reschke Request for Comments: 4709 greenbytes Category: Informational October 2006
Network Working Group J. Reschke Request for Comments: 4709 greenbytes Category: Informational October 2006
Mounting Web Distributed Authoring and Versioning (WebDAV) Servers
装载Web分布式创作和版本控制(WebDAV)服务器
Status of This Memo
关于下段备忘
This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited.
本备忘录为互联网社区提供信息。它没有规定任何类型的互联网标准。本备忘录的分发不受限制。
Copyright Notice
版权公告
Copyright (C) The Internet Society (2006).
版权所有(C)互联网协会(2006年)。
Abstract
摘要
In current Web browsers, there is no uniform way to specify that a user clicking on a link will be presented with an editable view of a Web Distinguished Authoring and Versioning (WebDAV) server. For example, it is frequently desirable to be able to click on a link and have this link open a window that can handle drag-and-drop interaction with the resources of a WebDAV server.
在当前的Web浏览器中,没有统一的方法来指定用户单击链接时将显示Web杰出创作和版本控制(WebDAV)服务器的可编辑视图。例如,通常希望能够单击一个链接并使该链接打开一个窗口,该窗口可以处理与WebDAV服务器资源的拖放交互。
This document specifies a mechanism and a document format that enables WebDAV servers to send "mounting" information to a WebDAV client. The mechanism is designed to work on any platform and with any combination of browser and WebDAV client, relying solely on the well-understood dispatch of documents through their MIME type.
本文档指定了一种机制和文档格式,使WebDAV服务器能够向WebDAV客户端发送“装载”信息。该机制设计为在任何平台上以及浏览器和WebDAV客户端的任何组合上工作,完全依赖于通过MIME类型发送的文档。
Table of Contents
目录
1. Introduction ....................................................2 2. Terminology .....................................................3 3. Format ..........................................................3 3.1. dm:mount ...................................................4 3.2. dm:url .....................................................4 3.3. dm:open ....................................................4 3.4. dm:username ................................................4 4. Example .........................................................4 5. Internationalization Considerations .............................5 6. IANA Considerations .............................................6 6.1. MIME Type Registration .....................................6 7. Security Considerations .........................................8 8. Acknowledgements ................................................8 9. References ......................................................9 9.1. Normative References .......................................9 9.2. Informative References .....................................9 Appendix A. Alternative Approaches ...............................10 A.1. ...Through HTML/CSS Extensions ............................10 A.2. ...Through Custom URI Schemes .............................10 Appendix B. Implementations ......................................10 B.1. Example Implementation for Webfolder Client ...............10 B.2. Xythos ....................................................14
1. Introduction ....................................................2 2. Terminology .....................................................3 3. Format ..........................................................3 3.1. dm:mount ...................................................4 3.2. dm:url .....................................................4 3.3. dm:open ....................................................4 3.4. dm:username ................................................4 4. Example .........................................................4 5. Internationalization Considerations .............................5 6. IANA Considerations .............................................6 6.1. MIME Type Registration .....................................6 7. Security Considerations .........................................8 8. Acknowledgements ................................................8 9. References ......................................................9 9.1. Normative References .......................................9 9.2. Informative References .....................................9 Appendix A. Alternative Approaches ...............................10 A.1. ...Through HTML/CSS Extensions ............................10 A.2. ...Through Custom URI Schemes .............................10 Appendix B. Implementations ......................................10 B.1. Example Implementation for Webfolder Client ...............10 B.2. Xythos ....................................................14
By definition, a Web Distributed Authoring and Versioning (WebDAV) server ([RFC2518]) is an HTTP server as well ([RFC2616]). Most WebDAV servers can be (at least partly) operated from an HTML-based user interface in a web browser. However, it is frequently desirable to be able to switch from an HTML-based view to a presentation provided by a native WebDAV client, directly supporting the authoring features defined in WebDAV and related specifications.
根据定义,Web分布式创作和版本控制(WebDAV)服务器([RFC2518])也是HTTP服务器([RFC2616])。大多数WebDAV服务器可以(至少部分)通过web浏览器中基于HTML的用户界面进行操作。但是,通常希望能够从基于HTML的视图切换到本机WebDAV客户端提供的演示文稿,直接支持WebDAV和相关规范中定义的创作功能。
This document specifies a platform-neutral mechanism based on the dispatch of documents through their MIME type. For completeness, Appendix A lists other approaches that have been implemented in existing clients.
本文档指定了一种平台无关机制,该机制基于通过MIME类型分派文档。为完整起见,附录A列出了已在现有客户中实施的其他方法。
For example, many educational institutions use WebDAV servers as a mechanism for sharing documents among students. Each student owns a separate collection structure on a WebDAV server, often called his/ her "locker". Ideally, when users click on a link in an HTML page provided by the university (perhaps by their university Web portal), an editable view of their locker will appear.
例如,许多教育机构使用WebDAV服务器作为学生之间共享文档的机制。每个学生在WebDAV服务器上拥有一个单独的集合结构,通常称为他/她的“储物柜”。理想情况下,当用户单击大学(可能是他们的大学门户网站)提供的HTML页面中的链接时,将显示他们的储物柜的可编辑视图。
The terminology used here follows that in the WebDAV Distributed Authoring Protocol specification [RFC2518].
这里使用的术语遵循WebDAV分布式创作协议规范[RFC2518]中的术语。
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。
This document uses XML DTD fragments ([XML]) as a purely notational convention. In particular:
本文档使用XML DTD片段([XML])作为纯粹的符号约定。特别地:
o Element names use the namespace "http://purl.org/NET/webdav/mount". When an XML element type in this namespace is referenced in this document outside of the context of an XML fragment, the string "dm:" will be prefixed to the element name.
o 元素名称使用名称空间“http://purl.org/NET/webdav/mount". 当此命名空间中的XML元素类型在XML片段上下文之外的文档中被引用时,字符串“dm:”将作为元素名称的前缀。
o Element ordering is irrelevant.
o 元素排序是不相关的。
o Extension elements/attributes (elements/attributes not already defined as valid child elements) may be added anywhere, except when explicitly stated otherwise.
o 扩展元素/属性(尚未定义为有效子元素的元素/属性)可以添加到任何位置,除非另有明确说明。
A WebDAV mount request is encoded in a specific XML format ([XML]) with a well-defined MIME type (see Section 6.1). The MIME type allows user agents to dispatch the content to a handler specific to the system's WebDAV client.
WebDAV装载请求以特定的XML格式([XML])和定义良好的MIME类型进行编码(参见第6.1节)。MIME类型允许用户代理将内容分派给特定于系统WebDAV客户端的处理程序。
The elements defined below use the namespace "http://purl.org/NET/webdav/mount".
下面定义的元素使用名称空间“http://purl.org/NET/webdav/mount".
<!ELEMENT mount (url, open?, username?) >
<!ELEMENT mount (url, open?, username?) >
<!ELEMENT url (#PCDATA) > <!-- PCDATA value: scheme ":" hier-part, as defined in Section 3 of [RFC3986] -->
<!ELEMENT url (#PCDATA) > <!-- PCDATA value: scheme ":" hier-part, as defined in Section 3 of [RFC3986] -->
<!ELEMENT open (#PCDATA) > <!-- PCDATA value: path, as defined in Section 3 of [RFC3986] -->
<!ELEMENT open (#PCDATA) > <!-- PCDATA value: path, as defined in Section 3 of [RFC3986] -->
<!ELEMENT username (#PCDATA) >
<!ELEMENT username (#PCDATA) >
The <dm:mount> element acts as a container for all the remaining elements defined by this protocol.
<dm:mount>元素充当此协议定义的所有剩余元素的容器。
The mandatory <dm:url> element provides the HTTP URL of the WebDAV collection that should be mounted by the client.
必需的<dm:url>元素提供应由客户端装载的WebDAV集合的HTTP url。
The optional <dm:open> element instructs the client to display the specified child collection; its URL is computed by concatenating this element's value with the URL obtained from the <dm:url> (Section 3.2) element (see Section 7 for a discussion about why this element only supports displaying collections rather than opening arbitrary documents).
可选的<dm:open>元素指示客户端显示指定的子集合;它的URL是通过将此元素的值与从<dm:URL>(第3.2节)元素获得的URL连接起来计算的(有关此元素为什么只支持显示集合而不支持打开任意文档的讨论,请参见第7节)。
The server can use the optional <dm:username> element to specify the name of the currently authenticated principal. A client can use this value to select a matching mount point (different users may have mounted the URL with different credentials under different local mount points) or to provide a meaningful default for authentication against the server. It is common that a browser and WebDAV client do not share HTTP connections, so including this information in the mount document increases usability.
服务器可以使用可选的<dm:username>元素指定当前经过身份验证的主体的名称。客户机可以使用此值选择匹配的装入点(不同的用户可能已在不同的本地装入点下使用不同的凭据装入URL),或者为针对服务器的身份验证提供有意义的默认值。浏览器和WebDAV客户端通常不共享HTTP连接,因此在装载文档中包含此信息可以提高可用性。
Implementation Note: If a <dm:username> element is present, public caching of the document should be disallowed. Thus, appropriate 'Vary' or 'Cache-Control' headers are needed in the server response.
实现说明:如果存在<dm:username>元素,则不允许对文档进行公共缓存。因此,服务器响应中需要适当的“Vary”或“Cache Control”头。
In the example below, the client first retrieves a representation of a WebDAV collection using a generic Web browser (1). The returned HTML content contains a hyperlink that identifies the "davmount" document in the format defined in Section 3 (2). The user follows this link (3), which causes the server to return the "davmount" document to the user's browser (4). The browser in turn passes the content to the application that was registered to handle the "application/davmount+xml" MIME type, usually the default WebDAV client on the client's system.
在下面的示例中,客户端首先使用通用Web浏览器(1)检索WebDAV集合的表示形式。返回的HTML内容包含一个超链接,该超链接以第3(2)节中定义的格式标识“davmount”文档。用户遵循此链接(3),这会导致服务器将“davmount”文档返回到用户的浏览器(4)。浏览器依次将内容传递给注册用于处理“application/davmount+xml”MIME类型的应用程序,该MIME类型通常是客户端系统上的默认WebDAV客户端。
(1) Client retrieves representation of WebDAV collection "/user42/ inbox/".
(1) 客户端检索WebDAV集合“/user42/inbox/”的表示形式。
GET /user42/inbox/ HTTP/1.1 Host: www.example.com
GET /user42/inbox/ HTTP/1.1 Host: www.example.com
(2) Server returns representation.
(2) 服务器返回表示。
HTTP/1.1 200 OK Content-Type: text/html Content-Length: xxx
HTTP/1.1 200 OK Content-Type: text/html Content-Length: xxx
.. <a href="?action=davmount">View this collection in your WebDAV client</a> ..
.. <a href=“?action=davmount”>在您的WebDAV客户端中查看此集合。。
(note that the example shows only that part of the HTML page that contains the relevant link)
(请注意,该示例仅显示HTML页面中包含相关链接的部分)
(3) Client follows link to "davmount" document
(3) 客户机遵循“davmount”文档的链接
GET /user42/inbox/?action=davmount HTTP/1.1 Host: www.example.com
GET /user42/inbox/?action=davmount HTTP/1.1 Host: www.example.com
(4) Server returns "davmount" document
(4) 服务器返回“davmount”文档
HTTP/1.1 200 OK Content-Type: application/davmount+xml Content-Length: xxx Cache-Control: private
HTTP/1.1 200 OK Content-Type: application/davmount+xml Content-Length: xxx Cache-Control: private
<dm:mount xmlns:dm="http://purl.org/NET/webdav/mount"> <dm:url>http://www.example.com/user42/</dm:url> <dm:open>inbox/</dm:open> </dm:mount>
<dm:mount xmlns:dm="http://purl.org/NET/webdav/mount"> <dm:url>http://www.example.com/user42/</dm:url> <dm:open>inbox/</dm:open> </dm:mount>
This document does not introduce any new internationalization considerations beyond those discussed in [RFC2518], Section 16.
除[RFC2518]第16节中讨论的内容外,本文件不引入任何新的国际化注意事项。
Type name:
类型名称:
application
应用
Subtype name:
子类型名称:
davmount+xml
davmount+xml
Required parameters:
所需参数:
none
没有一个
Optional parameters:
可选参数:
"charset": This parameter has identical semantics to the charset parameter of the "application/xml" media type as specified in [RFC3023].
“charset”:此参数与[RFC3023]中指定的“application/xml”媒体类型的charset参数具有相同的语义。
Encoding considerations:
编码注意事项:
Identical to those of "application/xml" as described in [RFC3023], Section 3.2.
与[RFC3023]第3.2节所述的“应用程序/xml”相同。
Security considerations:
安全考虑:
As defined in this specification. In addition, as this media type uses the "+xml" convention, it shares the same security considerations as described in [RFC3023], Section 10.
如本规范所定义。此外,由于该媒体类型使用“+xml”约定,因此它具有与[RFC3023]第10节所述相同的安全注意事项。
Interoperability considerations:
互操作性注意事项:
There are no known interoperability issues.
没有已知的互操作性问题。
Published specification:
已发布的规范:
This specification.
本规范。
Applications that use this media type:
使用此媒体类型的应用程序:
SAP Netweaver Knowledge Management, Xythos Drive.
SAP Netweaver知识管理,Xythos硬盘。
Additional information:
其他信息:
Magic number(s):
幻数:
As specified for "application/xml" in [RFC3023], Section 3.2.
按照[RFC3023]第3.2节中“应用程序/xml”的规定。
File extension(s):
文件扩展名:
.davmount
达夫蒙特先生
Fragment identifiers:
片段标识符:
As specified for "application/xml" in [RFC3023], Section 5.
如[RFC3023]第5节中“应用程序/xml”所述。
Base URI:
基本URI:
As specified in [RFC3023], Section 6.
按照[RFC3023]第6节的规定。
Macintosh file type code(s):
Macintosh文件类型代码:
TEXT
文本
Person & email address to contact for further information:
联系人和电子邮件地址,以获取更多信息:
Julian Reschke <julian.reschke@greenbytes.de>
Julian Reschke <julian.reschke@greenbytes.de>
Intended usage:
预期用途:
COMMON
常见的
Restrictions on usage:
使用限制:
None.
没有一个
Author:
作者:
Julian Reschke
朱利安·雷什克
Change controller:
更改控制器:
IESG
IESG
All security considerations connected to HTTP/WebDAV and XML apply for this specification as well, namely, [RFC2518] (Section 17) and [RFC3470] (Section 7).
与HTTP/WebDAV和XML相关的所有安全注意事项也适用于本规范,即[RFC2518](第17节)和[RFC3470](第7节)。
In addition, client implementers must be careful when implementing the <dm:open> element (see Section 3.3). It MUST NOT be used to initiate any action beyond displaying the contents of a WebDAV collection (supporting "opening" documents could be abused to trick a user into letting the operating system's shell execute arbitrary content, possibly running it as an executable program).
此外,客户机实现者在实现<dm:open>元素时必须小心(参见第3.3节)。除了显示WebDAV集合的内容外,它不能用于启动任何操作(支持“打开”文档可能会被滥用,诱骗用户让操作系统的shell执行任意内容,可能会将其作为可执行程序运行)。
The OPTIONAL <dm:username> element defined in Section 3.4 allows the inclusion of user names into mount documents. However in some cases, user name information is considered to be security sensitive. Should this be the case, parties generating mount documents are advised to either not to include user names, or to use access control to restrict access to the information as desired.
第3.4节中定义的可选<dm:username>元素允许在装载文档中包含用户名。但是,在某些情况下,用户名信息被认为是安全敏感的。在这种情况下,建议生成装载文档的各方不要包含用户名,或者根据需要使用访问控制来限制对信息的访问。
This document has benefited from thoughtful discussion by Emile Baizel, Spencer Dawkins, Lisa Dusseault, Stefan Eissing, Joe Gregorio, Michal Gregr, Russ Housley, Jim Luther, Jaroslav Mazanec, and Jim Whitehead.
本文件得益于Emile Baizel、Spencer Dawkins、Lisa Dusseault、Stefan Eissing、Joe Gregorio、Michal Gregr、Russ Housley、Jim Luther、Jaroslav Mazanic和Jim Whitehead的深思熟虑的讨论。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。
[RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S., and D. Jensen, "HTTP Extensions for Distributed Authoring -- WEBDAV", RFC 2518, February 1999.
[RFC2518]Goland,Y.,Whitehead,E.,Faizi,A.,Carter,S.,和D.Jensen,“分布式创作的HTTP扩展——WEBDAV”,RFC25181999年2月。
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。
[RFC3023] Murata, M., St.Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001.
[RFC3023]Murata,M.,St.Laurent,S.,和D.Kohn,“XML媒体类型”,RFC 3023,2001年1月。
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.
[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。
[XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C REC-xml-20060816, August 2006, <http://www.w3.org/TR/2006/REC-xml-20060816>.
[XML]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,和F.Yergeau,“可扩展标记语言(XML)1.0(第四版)”,W3C REC-XML-20060816,2006年8月<http://www.w3.org/TR/2006/REC-xml-20060816>.
[RFC3470] Hollenbeck, S., Rose, M., and L. Masinter, "Guidelines for the Use of Extensible Markup Language (XML) within IETF Protocols", RFC 3470, BCP 70, January 2003.
[RFC3470]Hollenbeck,S.,Rose,M.,和L.Masinter,“IETF协议中可扩展标记语言(XML)的使用指南”,RFC 3470,BCP 70,2003年1月。
[WEBARCH] Walsh, N. and I. Jacobs, "Architecture of the World Wide Web, Volume One", W3C REC-webarch-20041215, December 2004, <http://www.w3.org/TR/2004/REC-webarch-20041215/>.
[WEBARCH]Walsh,N.和I.Jacobs,“万维网的体系结构,第一卷”,W3C REC-WEBARCH-20041215,2004年12月<http://www.w3.org/TR/2004/REC-webarch-20041215/>.
Microsoft Internet Explorer implements a Cascading Style Sheet (CSS) extension that allows switching to its own WebDAV client ("Webfolder", see <http://msdn.microsoft.com/workshop/author/ behaviors/reference/behaviors/anchor.asp>). However, at the time of this writing, this extension was not implemented by any other user agent.
Microsoft Internet Explorer实现了一个级联样式表(CSS)扩展,允许切换到自己的WebDAV客户端(“Webfolder”),请参阅<http://msdn.microsoft.com/workshop/author/ 行为/reference/behaviors/anchor.asp>)。但是,在撰写本文时,此扩展没有由任何其他用户代理实现。
The "kio" library of the "K Desktop Enviroment" (<http://www.kde.org/>) uses the URI scheme "webdav" to dispatch to the system's WebDAV client. This URI scheme is not registered, nor is it supported on other platforms. Furthermore, the W3C's "Architecture of the World Wide Web, Volume One" explicitly advises against defining new schemes when existing schemes can be used:
“K桌面环境”的“kio”库(<http://www.kde.org/>)使用URI方案“webdav”分派到系统的webdav客户端。此URI方案未注册,在其他平台上也不受支持。此外,W3C的“万维网体系结构第一卷”明确建议,当现有方案可以使用时,不要定义新方案:
A specification SHOULD reuse an existing URI scheme (rather than create a new one) when it provides the desired properties of identifiers and their relation to resources.
当规范提供所需的标识符属性及其与资源的关系时,它应该重用现有的URI方案(而不是创建新的URI方案)。
(See [WEBARCH], Section 2.4.)
(见[WEBARCH],第2.4节。)
The figure below shows a sample implementation of a dispatcher for the application/davmount+xml datatype, suited for Win32 systems and the Microsoft "Webfolder" client.
下图显示了适用于Win32系统和Microsoft“Webfolder”客户端的application/davmount+xml数据类型的dispatcher的示例实现。
// sample implementation of application/davmount+xml // dispatcher for Windows Webfolder client // // to install/uninstall: // wscript davmount.js // // to open the webfolder: // wscript davmount.js filename // (where filename refers to an XML document with MIME type // application/davmount+xml)
// sample implementation of application/davmount+xml // dispatcher for Windows Webfolder client // // to install/uninstall: // wscript davmount.js // // to open the webfolder: // wscript davmount.js filename // (where filename refers to an XML document with MIME type // application/davmount+xml)
var EXTENSION = ".davmount"; var MIMETYPE = "application/davmount+xml"; var REGKW = "WebDAV.mount";
var EXTENSION = ".davmount"; var MIMETYPE = "application/davmount+xml"; var REGKW = "WebDAV.mount";
var NS = "xmlns:m='http://purl.org/NET/webdav/mount";
var NS = "xmlns:m='http://purl.org/NET/webdav/mount";
// remove keys/entries from the registry
// remove keys/entries from the registry
function regdel(shell, key) { try { var x = shell.RegRead(key); try { shell.RegDelete(key); } catch(e) { WScript.Echo("Error removing key " + key + ": " + e); } } catch(e) { // entry not present } }
function regdel(shell, key) { try { var x = shell.RegRead(key); try { shell.RegDelete(key); } catch(e) { WScript.Echo("Error removing key " + key + ": " + e); } } catch(e) { // entry not present } }
// methods for registering/unregistering the handler
// methods for registering/unregistering the handler
function install() {
函数安装(){
var WshShell = new ActiveXObject("WScript.Shell"); if (WshShell == null) { WScript.Echo("Couldn't instantiate WScript.Shell object"); return 2; }
var WshShell = new ActiveXObject("WScript.Shell"); if (WshShell == null) { WScript.Echo("Couldn't instantiate WScript.Shell object"); return 2; }
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var RegExt = "HKCR\\" + EXTENSION + "\\"; var RegMimeType = "HKCR\\MIME\\DataBase\\Content Type\\" + MIMETYPE + "\\"; var RegKw = "HKCR\\" + REGKW + "\\";
var RegExt = "HKCR\\" + EXTENSION + "\\"; var RegMimeType = "HKCR\\MIME\\DataBase\\Content Type\\" + MIMETYPE + "\\"; var RegKw = "HKCR\\" + REGKW + "\\";
var extension = null; try { extension = WshShell.RegRead(RegMimeType + "Extension"); } catch (e) { }
var extension = null; try { extension = WshShell.RegRead(RegMimeType + "Extension"); } catch (e) { }
if (extension == null) { var but = WshShell.popup("Install the dispatcher for mime type " + MIMETYPE + "?", 0, MIMETYPE + " installation", 4);
if (extension == null) { var but = WshShell.popup("Install the dispatcher for mime type " + MIMETYPE + "?", 0, MIMETYPE + " installation", 4);
if (but == 6) { try { WshShell.RegWrite(RegExt, REGKW); WshShell.RegWrite(RegExt + "Content Type", MIMETYPE); WshShell.RegWrite(RegMimeType + "Extension", EXTENSION); WshShell.RegWrite(RegKw, "WebDAV Mount Request"); WshShell.RegWrite(RegKw + "DefaultIcon\\", "shell32.dll,103"); var path = fso.getAbsolutePathName("davmount.js"); WshShell.RegWrite(RegKw + "shell\\open\\command\\", "%SystemRoot%\\system32\\wscript.exe /nologo \"" + path + "\" \"%1\"", "REG_EXPAND_SZ"); } catch (e) { WScript.Echo("Error writing to registry"); return 1; }
if (but == 6) { try { WshShell.RegWrite(RegExt, REGKW); WshShell.RegWrite(RegExt + "Content Type", MIMETYPE); WshShell.RegWrite(RegMimeType + "Extension", EXTENSION); WshShell.RegWrite(RegKw, "WebDAV Mount Request"); WshShell.RegWrite(RegKw + "DefaultIcon\\", "shell32.dll,103"); var path = fso.getAbsolutePathName("davmount.js"); WshShell.RegWrite(RegKw + "shell\\open\\command\\", "%SystemRoot%\\system32\\wscript.exe /nologo \"" + path + "\" \"%1\"", "REG_EXPAND_SZ"); } catch (e) { WScript.Echo("Error writing to registry"); return 1; }
return 0; } else { return 1; } } else { var but = WshShell.popup("Remove the dispatcher for mime type " + MIMETYPE + "?", 0, MIMETYPE + " installation", 4);
return 0; } else { return 1; } } else { var but = WshShell.popup("Remove the dispatcher for mime type " + MIMETYPE + "?", 0, MIMETYPE + " installation", 4);
if (but == 6) { regdel(WshShell, RegExt + "Content Type"); regdel(WshShell, RegExt); regdel(WshShell, RegKw + "shell\\open\\command\\"); regdel(WshShell, RegKw + "DefaultIcon\\"); regdel(WshShell, RegKw); regdel(WshShell, RegMimeType + "Extension"); regdel(WshShell, RegMimeType); return 0; } else { return 1; } } }
if (but == 6) { regdel(WshShell, RegExt + "Content Type"); regdel(WshShell, RegExt); regdel(WshShell, RegKw + "shell\\open\\command\\"); regdel(WshShell, RegKw + "DefaultIcon\\"); regdel(WshShell, RegKw); regdel(WshShell, RegMimeType + "Extension"); regdel(WshShell, RegMimeType); return 0; } else { return 1; } } }
if (WScript.Arguments.length == 0) { // install/uninstall WScript.Quit(install());
if (WScript.Arguments.length == 0) { // install/uninstall WScript.Quit(install());
} else { // try to invoke Webfolder
} else { // try to invoke Webfolder
var inp = new ActiveXObject("MSXML2.DOMDocument"); var furi = encodeURI(WScript.Arguments(0)); if (! inp.load(furi)) { WScript.Echo("Can't read from '" + WScript.Arguments(0) + "'!"); WScript.Quit(2); }
var inp = new ActiveXObject("MSXML2.DOMDocument"); var furi = encodeURI(WScript.Arguments(0)); if (! inp.load(furi)) { WScript.Echo("Can't read from '" + WScript.Arguments(0) + "'!"); WScript.Quit(2); }
inp.setProperty("SelectionLanguage", "XPath"); inp.setProperty("SelectionNamespaces", "xmlns:m='http://purl.org/NET/webdav/mount'");
inp.setProperty("SelectionLanguage", "XPath"); inp.setProperty("SelectionNamespaces", "xmlns:m='http://purl.org/NET/webdav/mount'");
var n1 = inp.selectSingleNode("/m:mount/m:url"); var n2 = inp.selectSingleNode("/m:mount/m:open");
var n1 = inp.selectSingleNode("/m:mount/m:url"); var n2 = inp.selectSingleNode("/m:mount/m:open");
if (n1 == null) { WScript.Echo("<url> element missing."); WScript.Quit(2); }
if (n1 == null) { WScript.Echo("<url> element missing."); WScript.Quit(2); }
var ie = new ActiveXObject("InternetExplorer.Application");
var ie = new ActiveXObject("InternetExplorer.Application");
ie.Navigate("about:blank"); var doc = ie.Document;
ie.Navigate("about:blank"); var doc = ie.Document;
var folder = doc.createElement("span"); folder.addBehavior("#default#httpFolder");
var folder = doc.createElement("span"); folder.addBehavior("#default#httpFolder");
var result = folder.navigate(n1.text + (n2 == null ? "" : n2.text));
var result = folder.navigate(n1.text + (n2 == null ? "" : n2.text));
// close the window again when there was no <open> element if (n2 == null) ie.Quit();
// close the window again when there was no <open> element if (n2 == null) ie.Quit();
if (result != "OK") { if (result == "PROTOCOL_NOT_SUPPORTED") { WScript.Echo("This site doesn't seem to support WebDAV."); WScript.Quit(1); } else { WScript.Echo("Unexpected status: " + result); WScript.Quit(2); } }
if (result != "OK") { if (result == "PROTOCOL_NOT_SUPPORTED") { WScript.Echo("This site doesn't seem to support WebDAV."); WScript.Quit(1); } else { WScript.Echo("Unexpected status: " + result); WScript.Quit(2); } }
}
}
The "Xythos Drive" WebDAV client for WebDAV supports this specification starting with version 4.4.
WebDAV的“Xythos驱动器”WebDAV客户端从版本4.4开始支持此规范。
Author's Address
作者地址
Julian F. Reschke greenbytes GmbH Hafenweg 16 Muenster, NW 48155 Germany
Julian F.Reschke greenbytes GmbH Hafenweg 16 Muenster,西北48155德国
Phone: +49 251 2807760 Fax: +49 251 2807761 EMail: julian.reschke@greenbytes.de URI: http://greenbytes.de/tech/webdav/
Phone: +49 251 2807760 Fax: +49 251 2807761 EMail: julian.reschke@greenbytes.de URI: http://greenbytes.de/tech/webdav/
Full Copyright Statement
完整版权声明
Copyright (C) The Internet Society (2006).
版权所有(C)互联网协会(2006年)。
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
本文件及其包含的信息是按“原样”提供的,贡献者、他/她所代表或赞助的组织(如有)、互联网协会和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。
Intellectual Property
知识产权
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.
Acknowledgement
确认
Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA).
RFC编辑器功能的资金由IETF行政支持活动(IASA)提供。