chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpo...@apache.org
Subject svn commit: r1211210 - in /chemistry/cmislib/trunk/src: cmislib/model.py cmislib/net.py tests/settings.py
Date Tue, 06 Dec 2011 22:31:13 GMT
Author: jpotts
Date: Tue Dec  6 22:31:13 2011
New Revision: 1211210

URL: http://svn.apache.org/viewvc?rev=1211210&view=rev
Log:
Changing how paths are encoded. Now using %20 instead of '+'. Tested fine against FileNet,
Nuxeo, Alfresco, Chemistry InMemory. Fixes CMIS-479. Also cleaned up the test settings.py.

Modified:
    chemistry/cmislib/trunk/src/cmislib/model.py
    chemistry/cmislib/trunk/src/cmislib/net.py
    chemistry/cmislib/trunk/src/tests/settings.py

Modified: chemistry/cmislib/trunk/src/cmislib/model.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/cmislib/model.py?rev=1211210&r1=1211209&r2=1211210&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/cmislib/model.py (original)
+++ chemistry/cmislib/trunk/src/cmislib/model.py Tue Dec  6 22:31:13 2011
@@ -26,7 +26,7 @@ from exceptions import CmisException, Ru
     UpdateConflictException
 import messages
 
-from urllib import quote_plus
+from urllib import quote
 from urllib2 import HTTPError
 from urlparse import urlparse, urlunparse
 import re
@@ -941,7 +941,7 @@ class Repository(object):
 
         # fill in the template with the path provided
         params = {
-              '{path}': quote_plus(path, '/'),
+              '{path}': quote(path, '/'),
               '{filter}': '',
               '{includeAllowableActions}': 'false',
               '{includePolicyIds}': 'false',

Modified: chemistry/cmislib/trunk/src/cmislib/net.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/cmislib/net.py?rev=1211210&r1=1211209&r2=1211210&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/cmislib/net.py (original)
+++ chemistry/cmislib/trunk/src/cmislib/net.py Tue Dec  6 22:31:13 2011
@@ -29,6 +29,7 @@ from urllib2 import HTTPBasicAuthHandler
                     Request, \
                     build_opener, \
                     AbstractBasicAuthHandler
+import logging
 
 
 class SmartRedirectHandler(HTTPRedirectHandler):
@@ -101,6 +102,7 @@ class RESTService(object):
 
     def __init__(self):
         self.user_agent = 'cmislib/%s +http://chemistry.apache.org/'
+        self.logger = logging.getLogger('cmislib.net.RESTService')
 
     def get(self,
             url,
@@ -116,6 +118,8 @@ class RESTService(object):
             else:
                 url = url + '?' + urlencode(kwargs)
 
+        self.logger.debug('About to do a GET on:' + url)
+
         request = RESTRequest(url, method='GET')
 
         # add a user-agent
@@ -141,6 +145,8 @@ class RESTService(object):
             else:
                 url = url + '?' + urlencode(kwargs)
 
+        self.logger.debug('About to do a DELETE on:' + url)
+
         request = RESTRequest(url, method='DELETE')
 
         # add a user-agent
@@ -182,6 +188,8 @@ class RESTService(object):
             else:
                 url = url + '?' + urlencode(kwargs)
 
+        self.logger.debug('About to do a PUT on:' + url)
+
         request = RESTRequest(url, payload, method='PUT')
 
         # set the content type header
@@ -219,6 +227,8 @@ class RESTService(object):
             else:
                 url = url + '?' + urlencode(kwargs)
 
+        self.logger.debug('About to do a POST on:' + url)
+
         request = RESTRequest(url, payload, method='POST')
 
         # set the content type header

Modified: chemistry/cmislib/trunk/src/tests/settings.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/tests/settings.py?rev=1211210&r1=1211209&r2=1211210&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/tests/settings.py (original)
+++ chemistry/cmislib/trunk/src/tests/settings.py Tue Dec  6 22:31:13 2011
@@ -21,33 +21,26 @@
 # Override these settings with values to match your environment.
 #
 # CMIS repository's service URL
-#REPOSITORY_URL = 'http://cmis.alfresco.com/s/cmis'
+#REPOSITORY_URL = 'http://cmis.alfresco.com/s/cmis' # Alfresco demo
 #REPOSITORY_URL = 'http://localhost:8081/chemistry/atom' # Apache Chemistry
-#REPOSITORY_URL = 'http://cmis.dnsdojo.com:8080/p8cmis/resources/DaphneA/Service'
-#REPOSITORY_URL = 'http://cmis.dnsdojo.com:8080/p8cmis/'
-REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom'  # Alfresco 4.0
+#REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom'  # Alfresco 4.0
 #REPOSITORY_URL = 'http://localhost:8080/alfresco/s/api/cmis'  # Alfresco
-#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
+REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
 #REPOSITORY_URL = 'http://localhost:8080/nuxeo/atom/cmis' # Nuxeo local
-#REPOSITORY_URL = 'http://localhost:8080/opencmis/atom'  # OpenCMIS from the OpenText guys
-#REPOSITORY_URL = 'http://ec2-174-129-218-67.compute-1.amazonaws.com/cmis/atom' #OpenText
on Amazon
-#REPOSITORY_URL = 'http://localhost:8080/opencmis-inmemory/atom'  # Apache Chemistry OpenCMIS
 
 # CMIS repository credentials
-USERNAME = 'admin'
-PASSWORD = 'admin'
-#USERNAME = 'Administrator'  # Nuxeo
-#PASSWORD = 'Administrator'  # Nuxeo
+#USERNAME = 'admin' # Alfresco
+#PASSWORD = 'admin' # Alfresco
 #USERNAME = ''
 #PASSWORD = ''
-#USERNAME = 'cmisuser'
-#PASSWORD = 'otcmis'
+USERNAME = 'Administrator'  # Nuxeo
+PASSWORD = 'Administrator'  # Nuxeo
 EXT_ARGS = {}
 #EXT_ARGS = {'alf_ticket': 'TICKET_cef29079d8d5341338bf372b08278bc30ec89380'}
 # Absolute path to a directory where test folders can be created, including
 # the trailing slash.
-#TEST_ROOT_PATH = '/default-domain/jeff test'  # No trailing slash
-TEST_ROOT_PATH = '/cmislib'  # No trailing slash
+TEST_ROOT_PATH = '/default-domain/workspaces/cmislib'  # No trailing slash
+#TEST_ROOT_PATH = '/cmislib'  # No trailing slash
 #TEST_ROOT_PATH = '/'
 # Binary test files. Assumed to exist in the same dir as this python script
 TEST_BINARY_1 = '250px-Cmis_logo.png'



Mime
View raw message