Esempio n. 1
0
    def __init__(self, repositoryUrl, username, password, **kwargs):
        """
        This is the entry point to the API. You need to know the
        :param repositoryUrl: The service URL of the CMIS provider
        :param username: Username
        :param password: Password

        >>> client = CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin')
        """

        self.repositoryUrl = repositoryUrl
        self.username = username
        self.password = password
        self.extArgs = kwargs
        if 'binding' in kwargs and (isinstance(kwargs['binding'], Binding)):
            self.binding = kwargs['binding']
        else:
            self.binding = AtomPubBinding(**kwargs)
        self.logger = logging.getLogger('cmislib.model.CmisClient')
        self.logger.info('Creating an instance of CmisClient')
#
# Override these settings with values to match your environment.
#
# CMIS repository's service URL
#REPOSITORY_URL = 'http://cmis.alfresco.com/s/cmis' # Alfresco demo
#REPOSITORY_URL = 'http://localhost:8081/chemistry/atom' # Apache Chemistry AtomPub
#REPOSITORY_URL = 'http://localhost:8081/chemistry/browser' # Apache Chemistry Browser
#REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom'  # Alfresco 4.0 AtomPub
#REPOSITORY_URL = 'http://localhost:8080/alfresco/s/api/cmis'  # Alfresco
REPOSITORY_URL = 'http://localhost:8080/alfresco/api/-default-/cmis/versions/1.0/atom'  # Alfresco 4.2 CMIS 1.0 Atom
#REPOSITORY_URL = 'http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom' # Alfresco 4.2 CMIS 1.1 Atom
#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
#REPOSITORY_URL = 'http://localhost:8080/nuxeo/atom/cmis' # Nuxeo local

# Choose a binding. The AtomPubBinding is the only one you should really be using right now
BINDING = AtomPubBinding()
#BINDING = BrowserBinding()

# CMIS repository credentials
USERNAME = '******'  # Alfresco
PASSWORD = '******'  # Alfresco
#USERNAME = ''
#PASSWORD = ''
#USERNAME = '******'  # Nuxeo
#PASSWORD = '******'  # 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/workspaces/cmislib'  # No trailing slash
TEST_ROOT_PATH = '/cmislib'  # No trailing slash