Author: arielch
Date: Sun Mar 24 13:23:39 2013
New Revision: 1460363

URL: http://svn.apache.org/r1460363
Log:
i121946 - Use enums to identify WebDAV/HTTP methods

Added:
    openoffice/trunk/main/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl
Modified:
    openoffice/trunk/main/extensions/source/update/feed/updatefeed.cxx
    openoffice/trunk/main/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl
    openoffice/trunk/main/offapi/com/sun/star/ucb/makefile.mk
    openoffice/trunk/main/offapi/type_reference/typelibrary_history.txt
    openoffice/trunk/main/offapi/type_reference/types.rdb
    openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
    openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx

Modified: openoffice/trunk/main/extensions/source/update/feed/updatefeed.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/extensions/source/update/feed/updatefeed.cxx?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/extensions/source/update/feed/updatefeed.cxx 
(original)
+++ openoffice/trunk/main/extensions/source/update/feed/updatefeed.cxx Sun Mar 
24 13:23:39 2013
@@ -179,7 +179,7 @@ public:
 
     // XWebDAVCommandEnvironment
     virtual uno::Sequence< beans::StringPair > SAL_CALL getUserRequestHeaders(
-        const rtl::OUString&, const rtl::OUString& )
+        const rtl::OUString&,  ucb::WebDAVHTTPMethod )
         throw ( uno::RuntimeException ) { return m_aRequestHeaderList; };
 
     // XServiceInfo

Added: openoffice/trunk/main/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl?rev=1460363&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl Sun Mar 
24 13:23:39 2013
@@ -0,0 +1,118 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __com_sun_star_ucb_WebDAVHTTPMethod_idl__
+#define __com_sun_star_ucb_WebDAVHTTPMethod_idl__
+
+module com { module sun { module star { module ucb {
+
+
+/** Standard WebDAV/HTTP methods.
+
+    @since Apache OpenOffice 4.0
+*/
+enum WebDAVHTTPMethod
+{
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.3";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    GET,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.4";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    HEAD,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.5";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    POST,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.6";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    PUT,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.7";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    DELETE,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.8";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    TRACE,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.2";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    OPTIONS,
+
+    /** HTTP request method as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc2616#section-9.9";>RFC 2616: Hypertext 
Transfer Protocol -- HTTP/1.1</a>
+     */
+    CONNECT,
+
+    /** HTTP request method as defined in
+        <a target="_blank" href="http://tools.ietf.org/html/rfc5789";>RFC 5789: 
PATCH Method for HTTP</a>
+     */
+    PATCH,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.1";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    PROPFIND,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.2";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    PROPPATCH,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.3";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    MKCOL,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.8";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    COPY,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.9";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    MOVE,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.10";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    LOCK,
+
+    /** WebDAV methods as defined in
+        <a target="_blank" 
href="http://tools.ietf.org/html/rfc4918#section-9.11";>HTTP Extensions for Web 
Distributed Authoring and Versioning (WebDAV)</a>
+     */
+    UNLOCK
+
+};
+
+}; }; }; };
+
+#endif

Modified: 
openoffice/trunk/main/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl 
(original)
+++ openoffice/trunk/main/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl 
Sun Mar 24 13:23:39 2013
@@ -23,6 +23,7 @@
 #define __com_sun_star_ucb_XWebDAVCommandEnvironment_idl__
 
 #include <com/sun/star/ucb/XCommandEnvironment.idl>
+#include <com/sun/star/ucb/WebDAVHTTPMethod.idl>
 #include <com/sun/star/beans/StringPair.idl>
 
 module com { module sun { module star { module ucb {
@@ -30,7 +31,7 @@ module com { module sun { module star { 
 /** A command environment that can be used to deal with WebDAV/HTTP specific
     commands.
 */
-published interface XWebDAVCommandEnvironment : XCommandEnvironment
+interface XWebDAVCommandEnvironment : XCommandEnvironment
 {
     /** This method gets called while assembling an WebDAV/HTTP request.
         The returned headername-headervalue pairs will be appended to
@@ -40,15 +41,16 @@ published interface XWebDAVCommandEnviro
     The request URI.
 
     @param aMethod
-    The WebDAV/HTTP method ("GET","PUT","MKCOL",...).
+    The WebDAV/HTTP method ("GET","PUT","MKCOL",...) as defined in
+    <type>WebDAVHTTPMethod</type>.
 
     @return
         A sequence of header name, header value pairs. The header
         names must be the plain names and contain no trailing ":".
     */
     sequence<com::sun::star::beans::StringPair> getUserRequestHeaders(
-        [in] string aURI,
-        [in] string aMethod);
+        [in] string             aURI,
+        [in] WebDAVHTTPMethod   eMethod);
 };
 
 }; }; }; };

Modified: openoffice/trunk/main/offapi/com/sun/star/ucb/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/ucb/makefile.mk?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/ucb/makefile.mk (original)
+++ openoffice/trunk/main/offapi/com/sun/star/ucb/makefile.mk Sun Mar 24 
13:23:39 2013
@@ -205,6 +205,7 @@ IDLFILES=\
        WebDAVContentProvider.idl\
        WebDAVDocumentContent.idl\
        WebDAVFolderContent.idl\
+       WebDAVHTTPMethod.idl \
        WelcomeDynamicResultSetStruct.idl\
        XAnyCompare.idl\
        XAnyCompareFactory.idl\

Modified: openoffice/trunk/main/offapi/type_reference/typelibrary_history.txt
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/type_reference/typelibrary_history.txt?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/type_reference/typelibrary_history.txt 
(original)
+++ openoffice/trunk/main/offapi/type_reference/typelibrary_history.txt Sun Mar 
24 13:23:39 2013
@@ -206,3 +206,5 @@
   css::ucb::XWebDAVCommandEnvironment::getUserRequestHeaders() should return a
   sequence of css::beans::StringPair
 
+23/03/2013 (arielch): TaskID=121946
+  css::ucb::XWebDAVCommandEnvironment: use enums to identify WebDAV/HTTP 
methods

Modified: openoffice/trunk/main/offapi/type_reference/types.rdb
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/type_reference/types.rdb?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx (original)
+++ openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx Sun Mar 
24 13:23:39 2013
@@ -193,8 +193,7 @@ void DAVResourceAccess::PROPFIND(
 
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii(
-                                       "PROPFIND" ),
+                                   ucb::WebDAVHTTPMethod_PROPFIND,
                                    aHeaders );
 
             m_xSession->PROPFIND( getRequestURI(),
@@ -236,8 +235,7 @@ void DAVResourceAccess::PROPFIND(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii(
-                                       "PROPFIND" ),
+                                   ucb::WebDAVHTTPMethod_PROPFIND,
                                    aHeaders );
 
             m_xSession->PROPFIND( getRequestURI(),
@@ -277,8 +275,7 @@ void DAVResourceAccess::PROPPATCH(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii(
-                                       "PROPPATCH" ),
+                                   ucb::WebDAVHTTPMethod_PROPPATCH,
                                    aHeaders );
 
             m_xSession->PROPPATCH( getRequestURI(),
@@ -318,7 +315,7 @@ void DAVResourceAccess::HEAD(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "HEAD" ),
+                                   ucb::WebDAVHTTPMethod_HEAD,
                                    aHeaders );
 
             m_xSession->HEAD( getRequestURI(),
@@ -358,7 +355,7 @@ uno::Reference< io::XInputStream > DAVRe
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "GET" ),
+                                   ucb::WebDAVHTTPMethod_GET,
                                    aHeaders );
 
             xStream = m_xSession->GET( getRequestURI(),
@@ -399,7 +396,7 @@ void DAVResourceAccess::GET(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "GET" ),
+                                   ucb::WebDAVHTTPMethod_GET,
                                    aHeaders );
 
             m_xSession->GET( getRequestURI(),
@@ -440,7 +437,7 @@ uno::Reference< io::XInputStream > DAVRe
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "GET" ),
+                                   ucb::WebDAVHTTPMethod_GET,
                                    aHeaders );
 
             xStream = m_xSession->GET( getRequestURI(),
@@ -485,7 +482,7 @@ uno::Reference< io::XInputStream > DAVRe
         {
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "GET" ),
+                                   ucb::WebDAVHTTPMethod_GET,
                                    rRequestHeaders );
 
             xStream = m_xSession->GET( getRequestURI(),
@@ -530,7 +527,7 @@ void DAVResourceAccess::GET(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "GET" ),
+                                   ucb::WebDAVHTTPMethod_GET,
                                    aHeaders );
 
             m_xSession->GET( getRequestURI(),
@@ -617,7 +614,7 @@ void DAVResourceAccess::PUT(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "PUT" ),
+                                   ucb::WebDAVHTTPMethod_PUT,
                                    aHeaders );
 
             m_xSession->PUT( getRequestURI(),
@@ -669,7 +666,7 @@ uno::Reference< io::XInputStream > DAVRe
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "POST" ),
+                                   ucb::WebDAVHTTPMethod_POST,
                                    aHeaders );
 
             xStream = m_xSession->POST( getRequestURI(),
@@ -732,7 +729,7 @@ void DAVResourceAccess::POST(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "POST" ),
+                                   ucb::WebDAVHTTPMethod_POST,
                                    aHeaders );
 
             m_xSession->POST( getRequestURI(),
@@ -780,7 +777,7 @@ void DAVResourceAccess::MKCOL(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "MKCOL" ),
+                                   ucb::WebDAVHTTPMethod_MKCOL,
                                    aHeaders );
 
             m_xSession->MKCOL( getRequestURI(),
@@ -820,7 +817,7 @@ void DAVResourceAccess::COPY(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "COPY" ),
+                                   ucb::WebDAVHTTPMethod_COPY,
                                    aHeaders );
 
             m_xSession->COPY( rSourcePath,
@@ -862,7 +859,7 @@ void DAVResourceAccess::MOVE(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "MOVE" ),
+                                   ucb::WebDAVHTTPMethod_MOVE,
                                    aHeaders );
 
             m_xSession->MOVE( rSourcePath,
@@ -901,8 +898,7 @@ void DAVResourceAccess::DESTROY(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii(
-                                       "DESTROY" ),
+                                   ucb::WebDAVHTTPMethod_DELETE,
                                    aHeaders );
 
             m_xSession->DESTROY( getRequestURI(),
@@ -941,7 +937,7 @@ void DAVResourceAccess::LOCK(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "LOCK" ),
+                                   ucb::WebDAVHTTPMethod_LOCK,
                                    aHeaders );
 
             m_xSession->LOCK( getRequestURI(),
@@ -983,7 +979,7 @@ sal_Int64 DAVResourceAccess::LOCK(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "LOCK" ),
+                                   ucb::WebDAVHTTPMethod_LOCK,
                                    aHeaders );
 
             nNewTimeout = m_xSession->LOCK( getRequestURI(),
@@ -1025,7 +1021,7 @@ void DAVResourceAccess::UNLOCK(
             DAVRequestHeaders aHeaders;
             getUserRequestHeaders( xEnv,
                                    getRequestURI(),
-                                   rtl::OUString::createFromAscii( "UNLOCK" ),
+                                   ucb::WebDAVHTTPMethod_UNLOCK,
                                    aHeaders );
 
             m_xSession->UNLOCK( getRequestURI(),
@@ -1114,7 +1110,7 @@ const rtl::OUString & DAVResourceAccess:
 void DAVResourceAccess::getUserRequestHeaders(
     const uno::Reference< ucb::XCommandEnvironment > & xEnv,
     const rtl::OUString & rURI,
-    const rtl::OUString & rMethod,
+    ucb::WebDAVHTTPMethod eMethod,
     DAVRequestHeaders & rRequestHeaders )
 {
     if ( !xEnv.is() )
@@ -1127,7 +1123,7 @@ void DAVResourceAccess::getUserRequestHe
         return;
 
     uno::Sequence< beans::StringPair > aRequestHeaders
-        = xDAVEnv->getUserRequestHeaders( rURI, rMethod );
+        = xDAVEnv->getUserRequestHeaders( rURI, eMethod );
 
     for ( sal_Int32 n = 0; n < aRequestHeaders.getLength(); ++n )
     {

Modified: openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx?rev=1460363&r1=1460362&r2=1460363&view=diff
==============================================================================
--- openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx (original)
+++ openoffice/trunk/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx Sun Mar 
24 13:23:39 2013
@@ -32,6 +32,7 @@
 #include <com/sun/star/io/XOutputStream.hpp>
 #include <com/sun/star/ucb/Lock.hpp>
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/WebDAVHTTPMethod.hpp>
 #include "DAVAuthListener.hxx"
 #include "DAVException.hxx"
 #include "DAVSession.hxx"
@@ -229,7 +230,7 @@ public:
         const com::sun::star::uno::Reference<
             com::sun::star::ucb::XCommandEnvironment > & xEnv,
         const rtl::OUString & rURI,
-        const rtl::OUString & rMethod,
+        com::sun::star::ucb::WebDAVHTTPMethod eMethod,
         DAVRequestHeaders & rRequestHeaders );
 
 private:


Reply via email to