summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-11-23 20:53:38 +0200
committerP. Christeas <p_christ@hol.gr>2010-11-23 20:53:38 +0200
commit8f2e8ff36fc3eb03b8cd28d5fc43be2dd69d6e76 (patch)
treecdbae68493f18e3d6656aedbebea891d0abfe41a
parent0b77e833d5d6dc6788a6781778ac7d852091e078 (diff)
http-well-known: merge into the document_webdav module
Since both "well-known" urls are about webdav[1], we can safely assume that the webdav module is needed when well-known uris are used. The code is much similar, too. http://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml bzr revid: p_christ@hol.gr-20101123185338-az85yl7pbc9gf76z
-rw-r--r--addons/document_webdav/__openerp__.py5
-rw-r--r--addons/document_webdav/doc/well-known.rst (renamed from addons/http_well_known/doc/well-known.rst)0
-rw-r--r--addons/document_webdav/redirect.py (renamed from addons/http_well_known/redirect.py)0
-rw-r--r--addons/document_webdav/webdav_server.py25
-rw-r--r--addons/http_well_known/__init__.py46
-rw-r--r--addons/http_well_known/__openerp__.py44
6 files changed, 27 insertions, 93 deletions
diff --git a/addons/document_webdav/__openerp__.py b/addons/document_webdav/__openerp__.py
index 6c1e24d1e96..0fd21a41a17 100644
--- a/addons/document_webdav/__openerp__.py
+++ b/addons/document_webdav/__openerp__.py
@@ -30,7 +30,7 @@
{
"name" : "WebDAV server for Document Management",
- "version" : "2.2",
+ "version" : "2.3",
"author" : "OpenERP SA",
"category" : "Generic Modules/Others",
"website": "http://www.openerp.com",
@@ -49,6 +49,9 @@
; since the messages are routed to the python logging, with
; levels "debug" and "debug_rpc" respectively, you can leave
; these options on
+
+ Also implements IETF RFC 5785 for services discovery on a http server,
+ which needs explicit configuration in openerp-server.conf, too.
""",
"depends" : ["base", "document"],
"init_xml" : [],
diff --git a/addons/http_well_known/doc/well-known.rst b/addons/document_webdav/doc/well-known.rst
index ce7dbd7c9cf..ce7dbd7c9cf 100644
--- a/addons/http_well_known/doc/well-known.rst
+++ b/addons/document_webdav/doc/well-known.rst
diff --git a/addons/http_well_known/redirect.py b/addons/document_webdav/redirect.py
index 71af3271ab7..71af3271ab7 100644
--- a/addons/http_well_known/redirect.py
+++ b/addons/document_webdav/redirect.py
diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py
index 5810978a6d5..f2a230858bf 100644
--- a/addons/document_webdav/webdav_server.py
+++ b/addons/document_webdav/webdav_server.py
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
-
+############################################################################9
#
# Copyright P. Christeas <p_christ@hol.gr> 2008,2009
# Copyright OpenERP SA, 2010 (http://www.openerp.com )
@@ -14,7 +14,7 @@
#
# This program 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; either version 2
+# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -43,6 +43,7 @@ import addons
from DAV.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
from DAV.propfind import PROPFIND
# from DAV.constants import DAV_VERSION_1, DAV_VERSION_2
+from redirect import RedirectHTTPHandler
khtml_re = re.compile(r' KHTML/([0-9\.]+) ')
@@ -453,6 +454,26 @@ except Exception, e:
logger = netsvc.Logger()
logger.notifyChannel('webdav', netsvc.LOG_ERROR, 'Cannot launch webdav: %s' % e)
+
+def init_well_known():
+ reps = RedirectHTTPHandler.redirect_paths
+
+ num_svcs = config.get_misc('http-well-known', 'num_services', '0')
+
+ for nsv in range(1, int(num_svcs)+1):
+ uri = config.get_misc('http-well-known', 'service_%d' % nsv, False)
+ path = config.get_misc('http-well-known', 'path_%d' % nsv, False)
+ if not (uri and path):
+ continue
+ reps['/'+uri] = path
+
+ if int(num_svcs):
+ if http_server.reg_http_service(HTTPDir('/.well-known', RedirectHTTPHandler)):
+ logging.getLogger("web-services").info("Registered HTTP redirect handler at /.well-known" )
+
+
+init_well_known()
+
#eof
diff --git a/addons/http_well_known/__init__.py b/addons/http_well_known/__init__.py
deleted file mode 100644
index 45c4efee2e1..00000000000
--- a/addons/http_well_known/__init__.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import logging
-import tools
-from service.websrv_lib import HTTPDir
-from service.http_server import reg_http_service
-from redirect import RedirectHTTPHandler
-
-def init_well_known():
- reps = RedirectHTTPHandler.redirect_paths
-
- num_svcs = tools.config.get_misc('http-well-known', 'num_services', '0')
-
- for nsv in range(1, int(num_svcs)+1):
- uri = tools.config.get_misc('http-well-known', 'service_%d' % nsv, False)
- path = tools.config.get_misc('http-well-known', 'path_%d' % nsv, False)
- if not (uri and path):
- continue
- reps['/'+uri] = path
-
- if reg_http_service(HTTPDir('/.well-known', RedirectHTTPHandler)):
- logging.getLogger("web-services").info("Registered HTTP redirect handler at /.well-known" )
-
-
-init_well_known()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/http_well_known/__openerp__.py b/addons/http_well_known/__openerp__.py
deleted file mode 100644
index 090b9a5ee01..00000000000
--- a/addons/http_well_known/__openerp__.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-{
- "name" : "Publish well-known http URIs",
- "version" : "0.1",
- "depends" : [ "base", ],
- 'description': """
- Implements IETF RFC 5785 for services discovery on a http server.
-
- May help some CalDAV clients bootstrap from the OpenERP server.
-
- Note that it needs explicit configuration in openerp-server.conf .
-""",
- "author" : "OpenERP SA",
- 'category': 'Generic Modules/Others',
- 'website': 'http://www.openerp.com',
- "init_xml" : [ ],
- "demo_xml" : [],
- "update_xml" : [ ],
- "installable" : True,
- "active" : False,
-}
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: