add python-cmislib_0.5.1+dfsg.orig.tar.gz files
This commit is contained in:
commit
5b75648e1b
|
@ -0,0 +1,68 @@
|
|||
This file contains the PGP keys of various developers.
|
||||
|
||||
Users: pgp < KEYS
|
||||
gpg --import KEYS
|
||||
Developers:
|
||||
gpg --list-key <your email> and append it to this file.
|
||||
gpg -a --export <your email> and append it to this file.
|
||||
|
||||
(gpg --list-key <your email>
|
||||
&& gpg --armor --export <your email>) >> this file.
|
||||
|
||||
|
||||
pub 4096R/99E3E187 2010-11-23
|
||||
uid Jeff Potts (CODE SIGNING KEY) <jpotts@apache.org>
|
||||
sub 4096R/2A6CD560 2010-11-23
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.11 (Darwin)
|
||||
|
||||
mQINBEzsQscBEACoDu6kafUBujuic9JtpGXQdVA4HKRvSAANbgAX8o4fU4wr2c97
|
||||
l/OD9SlZMzIkJNBYkQ+NoSIJKTYTJ2hJd7qFAcx0zEwFMhwRVvH/2sZ8xFKaZWjJ
|
||||
s26hgnNNPG0tKeV19jmIncFzSgRZsIL7UOcWGrcjhczgRiWIGPfkSjtWSvlQ/mnI
|
||||
1dIsw0/IeiN+7ieIoQ7p+Z7rV3/K+aGtchkqoXHQ8tUB+DsmfJNBRONH/Ht/EzeC
|
||||
Ih2mAfaK+r5jnA6YhbUt4FRl4AlvMPid48o7UuCJQK05PJWewVDBnw3XoVFyVCXf
|
||||
y8jmTJEc1W/EcQiY+lr/gYDM+P08GVgz8ItllvCTCVAe6WihExw6+ESN+ygEtdRQ
|
||||
MpPfzY9XUkqr9clzyxFAEzUpfKmd/RSLbzbRCfVK/d8JMwoSmj1guTgt+eeeNNNE
|
||||
b9sBZOYm/JdPq539A4tLoWHLMBRvALuuc6Wd6iOka/Kh+Y8Pg/rLrKBHXtVP4kqZ
|
||||
jdXasVgsuxdrZW7h9jAAKiX5tAoJlHZuTanwzrQwPCCA32dKS8r0lbIKAZTMUPX9
|
||||
sgSi0hcjy81wKtoLzgOzouQ9i+i+tlenyKf18nc7p+X4vSpQdFRF8B5sQXCvn6o8
|
||||
s4mUwe6K7GWrX0DH5pEyIGNOkLqq7YLRQTb4Y9FNpfeFx5ESEzujpEjRxQARAQAB
|
||||
tDFKZWZmIFBvdHRzIChDT0RFIFNJR05JTkcgS0VZKSA8anBvdHRzQGFwYWNoZS5v
|
||||
cmc+iQI3BBMBCgAhBQJM7ELHAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJ
|
||||
EL6eLsWZ4+GHFf0P/i3QdYjD3SsQf4HgwAFuptbyast+dUayutMA4NCx9nVwimZD
|
||||
wFu+vqj4Ru8pZbnf+WdMmEQ6RQcrpaGdRZxAMDSk0MV261qdqL2G/NvuhYzyTcj9
|
||||
iq09/gkYLgtP/TwziZPQ+eQZAxd1gwWaZmoDUEmLqzdK8zsJUmb7gTnKRsr1NOjV
|
||||
+4OepFp4qYUjHhMNshnmf/o6cB8uAaK9owPzu06anrDNIcFKDidppHeIrDnaW6IR
|
||||
SzjN9966lK9OQCknq3Ni2GrbFHAH22pt4bgb44APBZe3xj6SCn/fQoomzQYRY/1a
|
||||
KppZRTl8R9c0upGSysJhUjtRpsQvDW1h7zY89wH6M3s0E5RGPXFc6OAKwmyx6vrG
|
||||
//UwR0SjlXN6bGaSrvnAzReEjEi3XYZdrM7Y6EJYEbTteDXL/iHUjH/tT8wm1NMI
|
||||
w2uP7KgvHWzI9VuEChWwfXrGUq/XlzOVWa7vir68AWnCR4up5W8yhdLhdEAeyt1R
|
||||
0macdsLG5ixU9nvoDJ+3QhfmEv2RSDh5eB4npCUENT/snwTF2Bn82wbwIcvaZxOZ
|
||||
Cr6wUrgc+rIMJt2eTYzpl3wiGtAcKUuDhBucaYZo3xV2VHzwz89SLi9HS0tNQEiX
|
||||
zwVeL7td9GPLhjZBYGHkENBCt7gIT9oSI9xGSJla5xqEqrorMkdYBwaJzmrouQIN
|
||||
BEzsQscBEADoK1emxgR16Eebcean9pccsrqWqb9yOKkGZ/tXKX4OKKG40zIy+f4a
|
||||
mU2U9RbkcPBln9JSbpjYg5e9HKJs32hQVbL/XDc6cIyTGdAsokegSZkL7efKgVGC
|
||||
AeTwg/UiQIHbRM05tP3c6LiGk829Tp8k/UZG+kW2Xe50MY4KKr2jKZrOYXjuvzVC
|
||||
0TMd4ByNHBvwdDIryPVOxljFmTqjL7X5SAyafAQoD13lWZF5j2is8tsi+4reQePa
|
||||
jZrdLDXkJwSs1yf+ddCp+f+7fuCWWQKSHFfFe9LM/1cshVgon5YJL6hhinTosGpR
|
||||
diH/VjIUHU7KSKfpR4C1ML6/OelSWBw8CS51xWu8vli2xyE0gytkgztxv+Ba8AxQ
|
||||
7MaZLQN5O7YMgj5XhNbD05EDk7VL2BsI91qhT6uxVav7QitUvB8ap3GF7x+l9Zdb
|
||||
yo9zQU8DFzV+OrqQGtJFVHukwGJMZvBaAxYrYON9wuzunVFMaQgG470MRauVl1J/
|
||||
xZwKrD55GHYKBpQb3oayugYDRwHXPR6X52+3PwDPTY/oyvS0ZbPdekiKc6nBEEGL
|
||||
Gll/vd3Nc3+bZT8epQGoKCmy0vvfc8ubovfRKJS0nDq9imVfijNMriLbR/1G/r+K
|
||||
ulJq/jMnVahwSDP3FlZarYzR3UL6ojd0Ts/+sliJz+E6P/82OkpyGwARAQABiQIf
|
||||
BBgBCgAJBQJM7ELHAhsMAAoJEL6eLsWZ4+GHoWEP/25CVVcbaqf/uTUlvBYUDH4M
|
||||
bEmUZUN1VPeOlfl0oc5Vhq7xgK+3ObJm4X+nXoG15hjeWUqTEhi0Ls35l70TXufp
|
||||
RhvJsxuZKjApc1Z7pNOcuxAlrE+zdQsVSijsef4qiHk/28gNR6SaoKvpCvj0ReKG
|
||||
M1fDZ4I7f+LUkfogtwbA6ZQnT1u8xLuW90NU0u7BXx8FLz2D2a6gCSKMzdT9S/rk
|
||||
LUp7bKVMxGBd6FJS22w2gS1qxjB9RCVX8oPV79MKPQiX11VV0Dv4VEs5MWmcpAAF
|
||||
5/J0l7BWLiCAj/eu3VmAyxzuKHY2BYAm5jsS4qcySgoojLEEnXsw6WAuvPc4S4tY
|
||||
A3GBtc2/09uhQ6Yk4oSbcZo6CtSbpoeZX5nUKlM4Mj8vecyQhQzhcsxqwx0bMbLM
|
||||
VgFmH0rVk3PQXU22TRtxNoN4g1ecNWdaIlpQignq8YvI4HRURRfqiBBVKdHdC/LS
|
||||
HCP+sQyt7Xv8zPH0vpjDYiG0gqyAN1dyqMDRRxQEq4VVpqy9iu3vyobu+21nCThQ
|
||||
5qe9Jd5IWKO/NBT2vLXZvfDGUmEX8wq/IyQRV/oDR9fd1oz5rj8dcw6nNnRX3eAm
|
||||
osX3n9cWHgCIkMOS+NbH0XS1bBTHddSVJogisVBuVC+tXwR3XU0YmegELx3TJ7QA
|
||||
KGHdnl8nHylVQIVfHSIW
|
||||
=e5dc
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
recursive-include src/doc/build *
|
||||
prune src/doc/build/.doctrees
|
||||
exclude src/doc/build/.buildinfo
|
||||
exclude .*project
|
||||
include LICENSE.txt
|
||||
include NOTICE.txt
|
|
@ -0,0 +1,5 @@
|
|||
Apache Chemistry
|
||||
Copyright 2010-2013 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
|
@ -0,0 +1,43 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: cmislib
|
||||
Version: 0.5.1
|
||||
Summary: Apache Chemistry CMIS client library for Python
|
||||
Home-page: http://chemistry.apache.org/
|
||||
Author: Apache Chemistry Project
|
||||
Author-email: dev@chemistry.apache.org
|
||||
License: Apache License (2.0)
|
||||
Description: ABOUT
|
||||
|
||||
Thanks for using cmislib, the CMIS client library for Python.
|
||||
|
||||
The goal of this library is to provide an interoperable API to CMIS
|
||||
repositories such as Alfresco, Nuxeo, KnowledgeTree, MS SharePoint,
|
||||
EMC Documentum, and any other content repository that is CMIS-compliant.
|
||||
|
||||
More info on CMIS can be found at:
|
||||
http://www.oasis-open.org/committees/cmis
|
||||
|
||||
SOURCE
|
||||
|
||||
The source code for this project lives at http://chemistry.apache.org/
|
||||
|
||||
TESTS
|
||||
|
||||
There are unit tests available in the tests directory. They require access
|
||||
to a CMIS provider. There are many freely-available CMIS repositories
|
||||
available to run locally or that are hosted.
|
||||
|
||||
DOC
|
||||
|
||||
Documentation that tells you what this is all about can be found in the doc
|
||||
directory. Please see the doc for dependencies, required CMIS version level,
|
||||
required Python version, etc.
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 4 - Beta
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: Apache Software License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Topic :: Software Development :: Libraries
|
|
@ -0,0 +1,27 @@
|
|||
ABOUT
|
||||
|
||||
Thanks for using cmislib, the CMIS client library for Python.
|
||||
|
||||
The goal of this library is to provide an interoperable API to CMIS
|
||||
repositories such as Alfresco, Nuxeo, KnowledgeTree, MS SharePoint,
|
||||
EMC Documentum, and any other content repository that is CMIS-compliant.
|
||||
|
||||
More info on CMIS can be found at:
|
||||
http://www.oasis-open.org/committees/cmis
|
||||
|
||||
SOURCE
|
||||
|
||||
The source code for this project lives at http://chemistry.apache.org/
|
||||
|
||||
TESTS
|
||||
|
||||
There are unit tests available in the tests directory. They require access
|
||||
to a CMIS provider. There are many freely-available CMIS repositories
|
||||
available to run locally or that are hosted.
|
||||
|
||||
DOC
|
||||
|
||||
Documentation that tells you what this is all about can be found in the doc
|
||||
directory. Please see the doc for dependencies, required CMIS version level,
|
||||
required Python version, etc.
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
#!/bin/sh
|
||||
# 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.
|
||||
#
|
||||
# hash-sign.sh : hash and sign the specified files
|
||||
#
|
||||
# USAGE: hash-sign.sh file1 file2 ...
|
||||
#
|
||||
|
||||
user=""
|
||||
case "$1" in
|
||||
-u)
|
||||
shift
|
||||
user="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
allfiles=$*
|
||||
|
||||
|
||||
split="---------------------------------------------------------------------"
|
||||
|
||||
echo $split
|
||||
echo ""
|
||||
echo "Generating MD5/SHA1 checksum files ..."
|
||||
echo ""
|
||||
|
||||
# check for executables
|
||||
gpg="`which gpg 2> /dev/null | head -1`"
|
||||
pgp="`which pgp 2> /dev/null | head -1`"
|
||||
openssl="`which openssl 2> /dev/null | head -1`"
|
||||
md5sum="`which md5sum 2> /dev/null | head -1`"
|
||||
sha1sum="`which sha1sum 2> /dev/null | head -1`"
|
||||
md5="`which md5 2> /dev/null | head -1`"
|
||||
sha1="`which sha1 2> /dev/null | head -1`"
|
||||
|
||||
# if found we use openssl for generating the checksums
|
||||
# and convert the results into machine-readable format.
|
||||
if test -x "${openssl}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "openssl: creating md5 checksum file for ${file} ..."
|
||||
${openssl} md5 ${file} |\
|
||||
sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
|
||||
echo "openssl: creating sha1 checksum file for ${file} ..."
|
||||
${openssl} sha1 ${file} |\
|
||||
sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
|
||||
fi
|
||||
done
|
||||
# no openssl found - check if we have gpg
|
||||
elif test -x "${gpg}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "gpg: creating md5 checksum file for ${file} ..."
|
||||
${gpg} --print-md md5 ${file} |\
|
||||
sed -e '{N;s#\n##;}' |\
|
||||
sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
|
||||
-e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5
|
||||
echo "gpg: creating sha1 checksum file for ${file} ..."
|
||||
${gpg} --print-md sha1 ${file} |\
|
||||
sed -e '{N;s#\n##;}' |\
|
||||
sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
|
||||
-e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
|
||||
fi
|
||||
done
|
||||
else
|
||||
# no openssl or gpg found - check for md5sum
|
||||
if test -x "${md5sum}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "md5sum: creating md5 checksum file for ${file} ..."
|
||||
${md5sum} -b ${file} > ${file}.md5
|
||||
fi
|
||||
done
|
||||
# no openssl or gpg found - check for md5
|
||||
elif test -x "${md5}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "md5: creating md5 checksum file for ${file} ..."
|
||||
${md5} -r ${file} | sed -e 's# # *#' > ${file}.md5
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# no openssl or gpg found - check for sha1sum
|
||||
if test -x "${sha1sum}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "sha1sum: creating sha1 checksum file for ${file} ..."
|
||||
${sha1sum} -b ${file} > ${file}.sha1
|
||||
fi
|
||||
done
|
||||
# no openssl or gpg found - check for sha1
|
||||
elif test -x "${sha1}"; then
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "sha1: creating sha1 checksum file for ${file} ..."
|
||||
${sha1} -r ${file} | sed -e 's# # *#' > ${file}.sha1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $split
|
||||
echo ""
|
||||
echo "Signing the files ..."
|
||||
echo ""
|
||||
|
||||
# if found we use pgp for signing the files
|
||||
if test -x "${pgp}"; then
|
||||
if test -n "${user}"; then
|
||||
args="-u ${user}"
|
||||
fi
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "pgp: creating asc signature file for ${file} ..."
|
||||
${pgp} -sba ${file} ${args}
|
||||
fi
|
||||
done
|
||||
# no pgp found - check for gpg
|
||||
elif test -x "${gpg}"; then
|
||||
if test -z "${user}"; then
|
||||
args="--default-key ${args}"
|
||||
else
|
||||
args="-u ${user} ${args}"
|
||||
fi
|
||||
for file in ${allfiles}; do
|
||||
if test -f "${file}"; then
|
||||
echo "gpg: creating asc signature file for ${file} ..."
|
||||
${gpg} --armor ${args} --detach-sign ${file}
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "PGP or GnuPG not found! Not signing release!"
|
||||
fi
|
|
@ -0,0 +1,54 @@
|
|||
#!/bin/sh
|
||||
# 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.
|
||||
|
||||
set -e
|
||||
|
||||
# Did they give a user to sign with?
|
||||
user=""
|
||||
case "$1" in
|
||||
-u)
|
||||
shift
|
||||
user="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "${user}"; then
|
||||
# Do they have a default user already set?
|
||||
gpg_file=$HOME/.gnupg/gpg.conf
|
||||
if test -f $gpg_file; then
|
||||
if grep -q '^default-key' $gpg_file; then
|
||||
user=`grep '^default-key' $gpg_file | awk '{print $2}'`
|
||||
echo "Selected GPG default user of $user"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "${user}"; then
|
||||
echo "must pass -u with a gpg id"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
python setup.py sdist --formats=gztar,zip
|
||||
python setup.py bdist_egg
|
||||
|
||||
cd dist
|
||||
|
||||
./hash-sign.sh -u ${user} *.tar.gz *.zip
|
||||
./hash-sign.sh -u ${user} *.egg
|
||||
./hash-sign.sh -u ${user} *.asc
|
|
@ -0,0 +1,5 @@
|
|||
[egg_info]
|
||||
tag_build =
|
||||
tag_date = 0
|
||||
tag_svn_revision = 0
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
import os
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
version = '0.5.1'
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
setup(
|
||||
name = "cmislib",
|
||||
description = 'Apache Chemistry CMIS client library for Python',
|
||||
version = version,
|
||||
install_requires = [
|
||||
'iso8601'
|
||||
],
|
||||
author = 'Apache Chemistry Project',
|
||||
author_email = 'dev@chemistry.apache.org',
|
||||
license = 'Apache License (2.0)',
|
||||
url = 'http://chemistry.apache.org/',
|
||||
package_dir = {'':'src'},
|
||||
packages = find_packages('src', exclude=['tests']),
|
||||
#include_package_data = True,
|
||||
exclude_package_data = {'':['tests']},
|
||||
long_description = read('README.txt'),
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: Apache Software License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Topic :: Software Development :: Libraries",
|
||||
],
|
||||
)
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
"""
|
||||
Define package contents so that they are easy to import.
|
||||
"""
|
||||
|
||||
from model import CmisClient, Repository, Folder
|
||||
|
||||
__all__ = ["CmisClient", "Repository", "Folder"]
|
|
@ -0,0 +1,121 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
class CmisException(Exception):
|
||||
|
||||
"""
|
||||
Common base class for all exceptions.
|
||||
"""
|
||||
|
||||
def __init__(self, status=None, url=None):
|
||||
Exception.__init__(self, "Error %s at %s" % (status, url))
|
||||
self.status = status
|
||||
self.url = url
|
||||
|
||||
|
||||
class InvalidArgumentException(CmisException):
|
||||
|
||||
""" InvalidArgumentException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ObjectNotFoundException(CmisException):
|
||||
|
||||
""" ObjectNotFoundException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NotSupportedException(CmisException):
|
||||
|
||||
""" NotSupportedException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class PermissionDeniedException(CmisException):
|
||||
|
||||
""" PermissionDeniedException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class RuntimeException(CmisException):
|
||||
|
||||
""" RuntimeException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ConstraintException(CmisException):
|
||||
|
||||
""" ConstraintException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ContentAlreadyExistsException(CmisException):
|
||||
|
||||
"""ContentAlreadyExistsException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class FilterNotValidException(CmisException):
|
||||
|
||||
"""FilterNotValidException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NameConstraintViolationException(CmisException):
|
||||
|
||||
"""NameConstraintViolationException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class StorageException(CmisException):
|
||||
|
||||
"""StorageException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class StreamNotSupportedException(CmisException):
|
||||
|
||||
""" StreamNotSupportedException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class UpdateConflictException(CmisException):
|
||||
|
||||
""" UpdateConflictException """
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class VersioningException(CmisException):
|
||||
|
||||
""" VersioningException """
|
||||
|
||||
pass
|
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
NO_ACL_SUPPORT = 'This repository does not support ACLs'
|
||||
NO_CHANGE_LOG_SUPPORT = 'This repository does not support change logs'
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,308 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
'''
|
||||
Module that knows how to connect to the AtomPub Binding of a CMIS repo
|
||||
'''
|
||||
|
||||
from urllib import urlencode
|
||||
from urllib2 import HTTPBasicAuthHandler, \
|
||||
HTTPPasswordMgrWithDefaultRealm, \
|
||||
HTTPRedirectHandler, \
|
||||
HTTPDefaultErrorHandler, \
|
||||
HTTPError, \
|
||||
Request, \
|
||||
build_opener, \
|
||||
AbstractBasicAuthHandler
|
||||
import logging
|
||||
|
||||
|
||||
class SmartRedirectHandler(HTTPRedirectHandler):
|
||||
|
||||
""" Handles 301 and 302 redirects """
|
||||
|
||||
def http_error_301(self, req, fp, code, msg, headers):
|
||||
""" Handle a 301 error """
|
||||
result = HTTPRedirectHandler.http_error_301(
|
||||
self, req, fp, code, msg, headers)
|
||||
result.status = code
|
||||
return result
|
||||
|
||||
def http_error_302(self, req, fp, code, msg, headers):
|
||||
""" Handle a 302 error """
|
||||
result = HTTPRedirectHandler.http_error_302(
|
||||
self, req, fp, code, msg, headers)
|
||||
result.status = code
|
||||
return result
|
||||
|
||||
|
||||
class DefaultErrorHandler(HTTPDefaultErrorHandler):
|
||||
|
||||
""" Default error handler """
|
||||
|
||||
def http_error_default(self, req, fp, code, msg, headers):
|
||||
"""Provide an implementation for the default handler"""
|
||||
result = HTTPError(
|
||||
req.get_full_url(), code, msg, headers, fp)
|
||||
result.status = code
|
||||
return result
|
||||
|
||||
|
||||
class ContextualBasicAuthHandler(HTTPBasicAuthHandler):
|
||||
|
||||
"""
|
||||
Handles 401 errors without recursing indefinitely. The recursing
|
||||
behaviour has been introduced in Python 2.6.5 to handle 401 redirects
|
||||
used by some architectures of authentication.
|
||||
"""
|
||||
|
||||
def __init__(self, password_mgr):
|
||||
HTTPBasicAuthHandler.__init__(self, password_mgr)
|
||||
self.authContext = set([])
|
||||
|
||||
def http_error_401(self, req, fp, code, msg, headers):
|
||||
"""Override the default autoretry behaviour"""
|
||||
url = req.get_full_url()
|
||||
hdrs = req.header_items()
|
||||
hdrs = ', '.join(['%s: %s' % (key, value)
|
||||
for key, value in sorted(hdrs)])
|
||||
context = (url, hdrs)
|
||||
if context in self.authContext:
|
||||
self.authContext.clear()
|
||||
result = HTTPError(
|
||||
req.get_full_url(), code, msg, headers, fp)
|
||||
result.status = code
|
||||
return result
|
||||
self.authContext.add(context)
|
||||
return self.http_error_auth_reqed('www-authenticate',
|
||||
url, req, headers)
|
||||
|
||||
|
||||
class RESTService(object):
|
||||
|
||||
"""
|
||||
Generic service for interacting with an HTTP end point. Sets headers
|
||||
such as the USER_AGENT and builds the basic auth handler.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.user_agent = 'cmislib/%s +http://chemistry.apache.org/'
|
||||
self.logger = logging.getLogger('cmislib.net.RESTService')
|
||||
|
||||
def get(self,
|
||||
url,
|
||||
username=None,
|
||||
password=None,
|
||||
**kwargs):
|
||||
|
||||
""" Makes a get request to the URL specified."""
|
||||
|
||||
headers = None
|
||||
if kwargs:
|
||||
if 'headers' in kwargs:
|
||||
headers = kwargs['headers']
|
||||
del(kwargs['headers'])
|
||||
self.logger.debug('Headers passed in:%s' % headers)
|
||||
if url.find('?') >= 0:
|
||||
url = url + '&' + urlencode(kwargs)
|
||||
else:
|
||||
url = url + '?' + urlencode(kwargs)
|
||||
|
||||
self.logger.debug('About to do a GET on:' + url)
|
||||
|
||||
request = RESTRequest(url, method='GET')
|
||||
|
||||
# add a user-agent
|
||||
request.add_header('User-Agent', self.user_agent)
|
||||
if headers:
|
||||
for k, v in headers.items():
|
||||
self.logger.debug('Adding header:%s:%s' % (k, v))
|
||||
request.add_header(k, v)
|
||||
|
||||
# create a password manager
|
||||
passwordManager = HTTPPasswordMgrWithDefaultRealm()
|
||||
passwordManager.add_password(None, url, username, password)
|
||||
|
||||
opener = build_opener(SmartRedirectHandler(),
|
||||
DefaultErrorHandler(),
|
||||
ContextualBasicAuthHandler(passwordManager))
|
||||
|
||||
return opener.open(request)
|
||||
|
||||
def delete(self, url, username=None, password=None, **kwargs):
|
||||
|
||||
""" Makes a delete request to the URL specified. """
|
||||
|
||||
headers = None
|
||||
if kwargs:
|
||||
if 'headers' in kwargs:
|
||||
headers = kwargs['headers']
|
||||
del(kwargs['headers'])
|
||||
self.logger.debug('Headers passed in:%s' % headers)
|
||||
if url.find('?') >= 0:
|
||||
url = url + '&' + urlencode(kwargs)
|
||||
else:
|
||||
url = url + '?' + urlencode(kwargs)
|
||||
|
||||
self.logger.debug('About to do a DELETE on:' + url)
|
||||
|
||||
request = RESTRequest(url, method='DELETE')
|
||||
|
||||
# add a user-agent
|
||||
request.add_header('User-Agent', self.user_agent)
|
||||
if headers:
|
||||
for k, v in headers.items():
|
||||
self.logger.debug('Adding header:%s:%s' % (k, v))
|
||||
request.add_header(k, v)
|
||||
|
||||
# create a password manager
|
||||
passwordManager = HTTPPasswordMgrWithDefaultRealm()
|
||||
passwordManager.add_password(None, url, username, password)
|
||||
|
||||
opener = build_opener(SmartRedirectHandler(),
|
||||
DefaultErrorHandler(),
|
||||
ContextualBasicAuthHandler(passwordManager))
|
||||
|
||||
#try:
|
||||
# opener.open(request)
|
||||
#except urllib2.HTTPError, e:
|
||||
# if e.code is not 204:
|
||||
# raise e
|
||||
#return None
|
||||
return opener.open(request)
|
||||
|
||||
def put(self,
|
||||
url,
|
||||
payload,
|
||||
contentType,
|
||||
username=None,
|
||||
password=None,
|
||||
**kwargs):
|
||||
|
||||
"""
|
||||
Makes a PUT request to the URL specified and includes the payload
|
||||
that gets passed in. The content type header gets set to the
|
||||
specified content type.
|
||||
"""
|
||||
|
||||
headers = None
|
||||
if kwargs:
|
||||
if 'headers' in kwargs:
|
||||
headers = kwargs['headers']
|
||||
del(kwargs['headers'])
|
||||
self.logger.debug('Headers passed in:%s' % headers)
|
||||
if url.find('?') >= 0:
|
||||
url = url + '&' + urlencode(kwargs)
|
||||
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
|
||||
request.add_header('Content-Type', contentType)
|
||||
|
||||
# add a user-agent
|
||||
request.add_header('User-Agent', self.user_agent)
|
||||
if headers:
|
||||
for k, v in headers.items():
|
||||
self.logger.debug('Adding header:%s:%s' % (k, v))
|
||||
request.add_header(k, v)
|
||||
|
||||
# create a password manager
|
||||
passwordManager = HTTPPasswordMgrWithDefaultRealm()
|
||||
passwordManager.add_password(None, url, username, password)
|
||||
|
||||
opener = build_opener(SmartRedirectHandler(),
|
||||
DefaultErrorHandler(),
|
||||
ContextualBasicAuthHandler(passwordManager))
|
||||
|
||||
return opener.open(request)
|
||||
|
||||
def post(self,
|
||||
url,
|
||||
payload,
|
||||
contentType,
|
||||
username=None,
|
||||
password=None,
|
||||
**kwargs):
|
||||
|
||||
"""
|
||||
Makes a POST request to the URL specified and posts the payload
|
||||
that gets passed in. The content type header gets set to the
|
||||
specified content type.
|
||||
"""
|
||||
|
||||
headers = None
|
||||
if kwargs:
|
||||
if 'headers' in kwargs:
|
||||
headers = kwargs['headers']
|
||||
del(kwargs['headers'])
|
||||
self.logger.debug('Headers passed in:%s' % headers)
|
||||
if url.find('?') >= 0:
|
||||
url = url + '&' + urlencode(kwargs)
|
||||
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
|
||||
request.add_header('Content-Type', contentType)
|
||||
|
||||
# add a user-agent
|
||||
request.add_header('User-Agent', self.user_agent)
|
||||
if headers:
|
||||
for k, v in headers.items():
|
||||
self.logger.debug('Adding header:%s:%s' % (k, v))
|
||||
request.add_header(k, v)
|
||||
|
||||
# create a password manager
|
||||
passwordManager = HTTPPasswordMgrWithDefaultRealm()
|
||||
passwordManager.add_password(None, url, username, password)
|
||||
|
||||
opener = build_opener(SmartRedirectHandler(),
|
||||
DefaultErrorHandler(),
|
||||
ContextualBasicAuthHandler(passwordManager))
|
||||
|
||||
try:
|
||||
return opener.open(request)
|
||||
except HTTPError, e:
|
||||
if e.code is not 201:
|
||||
return e
|
||||
else:
|
||||
return e.read()
|
||||
|
||||
|
||||
class RESTRequest(Request):
|
||||
|
||||
"""
|
||||
Overrides urllib's request default behavior
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
""" Constructor """
|
||||
self._method = kwargs.pop('method', 'GET')
|
||||
assert self._method in ['GET', 'POST', 'PUT', 'DELETE']
|
||||
Request.__init__(self, *args, **kwargs)
|
||||
|
||||
def get_method(self):
|
||||
""" Override the get method """
|
||||
return self._method
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,174 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = ../build
|
||||
SOURCEDIR = .
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MyTestProject.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MyTestProject.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/MyTestProject"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MyTestProject"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
@ -0,0 +1,58 @@
|
|||
..
|
||||
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.
|
||||
|
||||
About Apache Chemistry cmislib
|
||||
==============================
|
||||
The goal of this project is to create a CMIS client for Python that can be used to work with any CMIS-compliant repository.
|
||||
|
||||
The library is being developed with the following guidelines:
|
||||
* Developers using this API should be able to work with CMIS domain objects without having to worry about the underlying implementation details.
|
||||
* The library will use the Resftul AtomPub Binding.
|
||||
* The library will conform to the `CMIS spec <http://docs.oasisopen.org/cmis/CMIS/v1.0/cd06/cmis-spec-v1.0.pdf>`_ as closely as possible. Several public CMIS repositories are being used to test the API.
|
||||
* The library should have no hard-coded URL's. It should be able to get everything it needs regarding how to work with the CMIS service from the CMIS service URL response and subsequent calls.
|
||||
* There shouldn't have to be a vendor-specific version of this library. The goal is for it to be interoperable with CMIS-compliant providers.
|
||||
|
||||
Quick Example
|
||||
-------------
|
||||
This should give you an idea of how easy and natural it is to work with the API:
|
||||
>>> cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/cmisatom', 'admin', 'admin')
|
||||
>>> repo = cmisClient.defaultRepository
|
||||
>>> rootFolder = repo.rootFolder
|
||||
>>> children = rootFolder.getChildren()
|
||||
>>> newFolder = rootFolder.createFolder('testDeleteFolder folder')
|
||||
>>> props = newFolder.properties
|
||||
>>> newFolder.delete()
|
||||
|
||||
To-Do's
|
||||
-------
|
||||
Miscellaneous
|
||||
* createDocumentFromSource
|
||||
* getProperties filter
|
||||
* getContentStream stream id
|
||||
|
||||
Unfiling/multifiling support
|
||||
* createDocument without a parent folder (unfiled)
|
||||
|
||||
* The spec does not yet support this. Although the spec does say that a folder ID is optional, it does not specify which URL to post the unfiled document to.
|
||||
|
||||
Policies
|
||||
* Policy object
|
||||
* createPolicy
|
||||
* applyPolicy
|
||||
* removePolicy
|
||||
* getAppliedPolicies
|
|
@ -0,0 +1,62 @@
|
|||
..
|
||||
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.
|
||||
|
||||
Code
|
||||
====
|
||||
|
||||
The :mod:`cmislib.model` Module
|
||||
-------------------------------
|
||||
|
||||
The :mod:`cmislib.model` Module contains all the CMIS domain objects. The ones you will work with are listed as top level package elements. When working with the repository, the first thing you need to do is grab an instance of :class:`cmislib.CmisClient`, passing it the repository endpoint URL, username, and password.
|
||||
|
||||
For example, in Alfresco 4 and higher, the repository endpoint is
|
||||
'http://localhost:8080/alfresco/cmisatom'. In earlier versions of
|
||||
Alfresco, the endpoint is
|
||||
'http://localhost:8080/alfresco/s/api/cmis'. In both cases, the
|
||||
default username and password are 'admin' and 'admin'.
|
||||
|
||||
>>> cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin')
|
||||
|
||||
From there you can get the default repository...
|
||||
|
||||
>>> repo = cmisClient.defaultRepository
|
||||
|
||||
or a specific repository if you know the repository ID.
|
||||
|
||||
>>> repo = cmisClient.getRepository('83beb297-a6fa-4ac5-844b-98c871c0eea9')
|
||||
|
||||
Once you have that, you're off to the races. Use the :class:`cmislib.Repository` class to create new :class:`cmislib.Folder` and :class:`cmislib.Document` objects, perform searches, etc.
|
||||
|
||||
.. automodule:: cmislib.model
|
||||
:members:
|
||||
|
||||
The :mod:`cmislib.net` Module
|
||||
-----------------------------
|
||||
|
||||
The :mod:`cmislib.net` Module contains the classes used by :mod:`cmislib.model.CmisClient` to communicate with the CMIS repository. The most important of which is :class:`cmislib.net.RESTService`.
|
||||
|
||||
.. automodule:: cmislib.net
|
||||
:members: RESTService
|
||||
|
||||
The :mod:`tests` Module
|
||||
-------------------------------
|
||||
|
||||
The :mod:`tests` Module contains unit tests for all classes and methods in :mod:`cmislib.model`. See :ref:`tests` for more information on running tests.
|
||||
|
||||
.. automodule:: tests
|
||||
:members:
|
|
@ -0,0 +1,303 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# CMIS Library documentation build configuration file, created by
|
||||
# sphinx-quickstart on Fri Dec 14 16:13:15 2012.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys, os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
sys.path.append(os.path.abspath('../..'))
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Apache Chemistry cmislib'
|
||||
copyright = u'2013, Apache Software Foundation'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.5'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.5.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = []
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'cmislibdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'cmislib.tex', u'Apache Chemistry cmislib Documentation',
|
||||
u'Jeff Potts', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'cmislib', u'Apache Chemistry cmislib Documentation',
|
||||
[u'Jeff Potts'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'cmislib', u'Apache Chemistry cmislib Documentation',
|
||||
u'Jeff Potts', 'cmislib', 'Python client library for CMIS',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
|
||||
# -- Options for Epub output ---------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Apache Chemistry cmislib Documentation'
|
||||
epub_author = u'Jeff Potts'
|
||||
epub_publisher = u'Jeff Potts'
|
||||
epub_copyright = u'2013, Apache Software Foundation'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or en if the language is not set.
|
||||
#epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
#epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#epub_cover = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_pre_files = []
|
||||
|
||||
# HTML files shat should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
#epub_exclude_files = []
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
|
@ -0,0 +1,81 @@
|
|||
..
|
||||
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.
|
||||
|
||||
===============
|
||||
Developer Guide
|
||||
===============
|
||||
|
||||
This page is for people who wish to contribute code to this project.
|
||||
|
||||
Developer Setup
|
||||
---------------
|
||||
Check out the source from head, switch to the source code's root directory, then run:
|
||||
python setup.py develop
|
||||
|
||||
That will set up this project's src directory in the easy-install.pth file in site-packages.
|
||||
|
||||
Release Process
|
||||
---------------
|
||||
|
||||
Checklist:
|
||||
#. All newly-added code has a unit test
|
||||
#. All tests pass cleanly (or have good reasons for not passing)
|
||||
#. Change setup.cfg to have the appropriate tag ('dev', for example, or '' for a stable release)
|
||||
#. Change setup.py to have the appropriate version number
|
||||
#. Inline comments updated with changes
|
||||
#. Sphinx doc updated with changes
|
||||
#. Docs build cleanly
|
||||
.. code-block:: bash
|
||||
|
||||
cd src/doc/src/
|
||||
make html
|
||||
|
||||
#. pep8 runs without much complaint
|
||||
.. code-block:: bash
|
||||
|
||||
pep8 --ignore=E501,W601 --repeat model.py
|
||||
|
||||
#. pylint runs without much complaint
|
||||
.. code-block:: bash
|
||||
|
||||
pylint --disable=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
|
||||
|
||||
#. All changes checked in
|
||||
#. Tag the release using 'cmislib-[release num]-RC[x]'
|
||||
#. Use the release script to build the release artifacts
|
||||
.. code-block:: bash
|
||||
|
||||
cd dist
|
||||
./release.sh -u jpotts@apache.org
|
||||
|
||||
This will do a 'setup.py bdist sdist' and will then sign all artifacts.
|
||||
|
||||
Note that the artifacts will be named without 'RC[x]'. These are the same artifacts that will be distributed if the vote passes.
|
||||
|
||||
#. Copy files to the Apache server under ~/public_html/chemistry/cmislib/[release num]
|
||||
#. Start vote. Send an email to dev@chemistry.apache.org announcing the vote, highlighting the changes, pointing to the tagged source, and referencing the artifacts that have been copied to the Apache server.
|
||||
#. After 72 hours, if the vote passes, continue, otherwise address issues and start over
|
||||
#. Copy the files to the appropriate Apache dist directory, which is /www/www.apache.org/dist/chemistry/cmislib/[release num]
|
||||
#. Rename the RC tag in source code control
|
||||
#. Update the cmislib home page with download links to the new release
|
||||
#. Upload files to Pypi
|
||||
#. Check the `cheesecake <http://pycheesecake.org/>`_ score
|
||||
.. code-block:: bash
|
||||
|
||||
python cheesecake_index --name=cmislib
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
..
|
||||
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.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
This documentation was generated with `Sphinx <http://sphinx.pocoo.org/>`_. To install Sphinx on Mac OS X using Macports:
|
||||
|
||||
MAC OS X::
|
||||
|
||||
sudo port install py26-sphinx
|
||||
|
||||
Once you've got Sphinx installed, if you need to regenerate the documentation::
|
||||
|
||||
cd /path/to/cmislib/src/doc/src
|
||||
Run either:
|
||||
sphinx-build -b html -d ../build/.doctrees . ../build
|
||||
make html
|
||||
|
||||
The generated HTML will be placed in doc/build::
|
||||
|
||||
firefox file:///path/to/cmislib/src/doc/build/index.html
|
|
@ -0,0 +1,137 @@
|
|||
..
|
||||
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.
|
||||
|
||||
.. _examples:
|
||||
|
||||
========
|
||||
Examples
|
||||
========
|
||||
There's nothing in cmislib that is specific to any particular vendor. Once you give it your CMIS provider's service URL and some credentials, it figures out where to go from there.
|
||||
|
||||
Let's look at some examples using Alfresco's public CMIS repository.
|
||||
|
||||
-----------------------
|
||||
Get a Repository object
|
||||
-----------------------
|
||||
|
||||
#. From the command-line, start the Python shell by typing `python` then hit enter.
|
||||
#. Import the CmisClient:
|
||||
|
||||
>>> from cmislib import CmisClient
|
||||
|
||||
#. Point the CmisClient at the repository's service URL
|
||||
|
||||
>>> client = CmisClient('http://cmis.alfresco.com/cmisatom', 'admin', 'admin')
|
||||
|
||||
#. Get the default repository for the service
|
||||
|
||||
>>> repo = client.defaultRepository
|
||||
>>> repo.id
|
||||
u'83beb297-a6fa-4ac5-844b-98c871c0eea9'
|
||||
|
||||
#. Get the repository's properties. This for-loop spits out everything cmislib knows about the repo.
|
||||
|
||||
>>> repo.name
|
||||
u'Main Repository'
|
||||
>>> info = repo.info
|
||||
>>> for k,v in info.items():
|
||||
... print "%s:%s" % (k,v)
|
||||
...
|
||||
cmisSpecificationTitle:Version 1.0 Committee Draft 04
|
||||
cmisVersionSupported:1.0
|
||||
repositoryDescription:None
|
||||
productVersion:3.2.0 (r2 2440)
|
||||
rootFolderId:workspace://SpacesStore/aa1ecedf-9551-49c5-831a-0502bb43f348
|
||||
repositoryId:83beb297-a6fa-4ac5-844b-98c871c0eea9
|
||||
repositoryName:Main Repository
|
||||
vendorName:Alfresco
|
||||
productName:Alfresco Repository (Community)
|
||||
|
||||
-------------------
|
||||
Folders & Documents
|
||||
-------------------
|
||||
|
||||
Once you've got the Repository object you can start working with folders.
|
||||
|
||||
#. Create a new folder in the root. You should name yours something unique.
|
||||
|
||||
>>> root = repo.rootFolder
|
||||
>>> someFolder = root.createFolder('someFolder')
|
||||
>>> someFolder.id
|
||||
u'workspace://SpacesStore/91f344ef-84e7-43d8-b379-959c0be7e8fc'
|
||||
|
||||
#. Then, you can create some content:
|
||||
|
||||
>>> someFile = open('test.txt', 'r')
|
||||
>>> someDoc = someFolder.createDocument('Test Document', contentFile=someFile)
|
||||
|
||||
#. And, if you want, you can dump the properties of the newly-created document (this is a partial list):
|
||||
|
||||
>>> props = someDoc.properties
|
||||
>>> for k,v in props.items():
|
||||
... print '%s:%s' % (k,v)
|
||||
...
|
||||
cmis:contentStreamMimeType:text/plain
|
||||
cmis:creationDate:2009-12-18T10:59:26.667-06:00
|
||||
cmis:baseTypeId:cmis:document
|
||||
cmis:isLatestMajorVersion:false
|
||||
cmis:isImmutable:false
|
||||
cmis:isMajorVersion:false
|
||||
cmis:objectId:workspace://SpacesStore/2cf36ad5-92b0-4731-94a4-9f3fef25b479
|
||||
|
||||
----------------------------------
|
||||
Searching For & Retrieving Objects
|
||||
----------------------------------
|
||||
|
||||
There are several different ways to grab an object:
|
||||
* You can run a CMIS query
|
||||
* You can ask the repository to give you one for a specific path or object ID
|
||||
* You can traverse the repository using a folder's children and/or descendants
|
||||
|
||||
#. Let's find the doc we just created with a full-text search.
|
||||
|
||||
.. note::
|
||||
Note that I'm currently seeing a problem with Alfresco in which the CMIS service returns one less result than what's really there):
|
||||
|
||||
>>> results = repo.query("select * from cmis:document where contains('test')")
|
||||
>>> for result in results:
|
||||
... print result.name
|
||||
...
|
||||
Test Document2
|
||||
example test script.js
|
||||
|
||||
#. Alternatively, you can also get objects by their path, like this:
|
||||
|
||||
>>> someDoc = repo.getObjectByPath('/someFolder/Test Document')
|
||||
>>> someDoc.id
|
||||
u'workspace://SpacesStore/2cf36ad5-92b0-4731-94a4-9f3fef25b479'
|
||||
|
||||
#. Or their object ID, like this:
|
||||
|
||||
>>> someDoc = repo.getObject('workspace://SpacesStore/2cf36ad5-92b0-4731-94a4-9f3fef25b479')
|
||||
>>> someDoc.name
|
||||
u'Test Document'
|
||||
|
||||
#. Folder objects have getChildren() and getDescendants() methods that will return a list of :class:`CmisObject` objects:
|
||||
|
||||
>>> children= someFolder.getChildren()
|
||||
>>> for child in children:
|
||||
... print child.name
|
||||
...
|
||||
Test Document
|
||||
Test Document2
|
|
@ -0,0 +1,47 @@
|
|||
..
|
||||
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.
|
||||
|
||||
.. cmislib documentation master file, created by
|
||||
sphinx-quickstart on Thu Dec 10 10:12:43 2009.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to the Apache Chemistry cmislib documentation!
|
||||
==================================================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
about.rst
|
||||
install.rst
|
||||
examples.rst
|
||||
code.rst
|
||||
devguide.rst
|
||||
tests.rst
|
||||
docs.rst
|
||||
sample-data.rst
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
..
|
||||
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.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Requirements
|
||||
------------
|
||||
These requirements must be met:
|
||||
- Python 2.6.x
|
||||
- CMIS provider compliant with CMIS 1.0
|
||||
|
||||
Steps
|
||||
-----
|
||||
#. If you don't have `Python <http://www.python.org>`_ installed already, do so.
|
||||
#. If you don't have `setuptools <http://pypi.python.org/pypi/setuptools>`_ installed already, do so.
|
||||
#. Once setuptools is installed, type `easy_install cmislib`
|
||||
#. That's it!
|
||||
|
||||
Once you do that, you should be able to fire up Python on the command-line and import cmislib successfully.
|
||||
|
||||
>>> from cmislib import CmisClient, Repository, Folder
|
||||
|
||||
To validate everything is working, run some :ref:`tests` or walk through some :ref:`examples`.
|
|
@ -0,0 +1,132 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM
|
||||
REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
REM or more contributor license agreements. See the NOTICE file
|
||||
REM distributed with this work for additional information
|
||||
REM regarding copyright ownership. The ASF licenses this file
|
||||
REM to you under the Apache License, Version 2.0 (the
|
||||
REM "License"); you may not use this file except in compliance
|
||||
REM with the License. You may obtain a copy of the License at
|
||||
REM
|
||||
REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
REM
|
||||
REM Unless required by applicable law or agreed to in writing,
|
||||
REM software distributed under the License is distributed on an
|
||||
REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
REM KIND, either express or implied. See the License for the
|
||||
REM specific language governing permissions and limitations
|
||||
REM under the License.
|
||||
REM
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
set SPHINXBUILD=sphinx-build
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\CMISLibrary.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\CMISLibrary.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
os.environ['SPHINXBUILD']="sphinx-build"
|
||||
build_dir = sys.path[0] + "/../build"
|
||||
os.environ['BUILDDIR']=build_dir
|
||||
os.environ['SOURCEDIR']=sys.path[0]
|
||||
# force a clean every time
|
||||
print "Removing build dir: %s" % build_dir
|
||||
os.system("rm -rf " + build_dir)
|
||||
os.system("make -e --makefile=" + sys.path[0] + "/Makefile html")
|
||||
zip_file = sys.path[0] + "/../docs.zip"
|
||||
os.system("rm " + zip_file)
|
||||
os.chdir(build_dir)
|
||||
os.system("zip -r " + zip_file + " *")
|
|
@ -0,0 +1,24 @@
|
|||
..
|
||||
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.
|
||||
|
||||
Sample Data
|
||||
===========
|
||||
|
||||
The /path/to/cmislib/src/data directory contains some sample XML responses from a CMIS service. These are for sample and development purposes and can safely be ignored if you are an end-user of the library.
|
||||
|
||||
In some cases there are two files for the same response. For example, 'types.xml' came from Alfresco while 'types.chemistry.xml' came from the simple Apache Chemistry test server.
|
|
@ -0,0 +1,43 @@
|
|||
..
|
||||
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.
|
||||
|
||||
.. _tests:
|
||||
|
||||
=====
|
||||
Tests
|
||||
=====
|
||||
|
||||
This code includes unit tests. To run the tests::
|
||||
|
||||
cd /path/to/cmislib/tests
|
||||
Edit settings.py
|
||||
Set REPOSITORY_URL, USERNAME, PASSWORD
|
||||
Optionally, set TEST_ROOT_PATH and other settings to meet your needs
|
||||
python cmislibtest.py
|
||||
|
||||
.. note::
|
||||
http://cmis.alfresco.com is a freely-available, hosted CMIS service. If you want to use that for testing, the URL is http://cmis.alfresco.com/s/cmis and the username and password are admin/admin. See the wiki for other known CMIS test servers.
|
||||
|
||||
If everything goes well, you should see::
|
||||
|
||||
Ran X tests in 3.607s
|
||||
|
||||
OK
|
||||
|
||||
.. note::
|
||||
Depending on the implementation of the CMIS provider, you may see errors or failures instead of 'OK'.
|
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
from cmislibtests import *
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -0,0 +1,56 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# 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:8080/chemistry/atom' # Apache Chemistry
|
||||
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://localhost:8080/nuxeo/atom/cmis' # Nuxeo local
|
||||
|
||||
# CMIS repository credentials
|
||||
USERNAME = 'admin' # Alfresco
|
||||
PASSWORD = 'admin' # Alfresco
|
||||
#USERNAME = ''
|
||||
#PASSWORD = ''
|
||||
#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/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'
|
||||
TEST_BINARY_2 = 'sample-a.pdf'
|
||||
# For repositories that support setting an ACL, the name of an existing
|
||||
# principal ID to add to the ACL of a test object. Some repositories care
|
||||
# if this ID doesn't exist. Some repositories don't.
|
||||
TEST_PRINCIPAL_ID = 'tuser1'
|
||||
# For repositories that may index test content asynchronously, the number of
|
||||
# times a query is retried before giving up.
|
||||
MAX_FULL_TEXT_TRIES = 10
|
||||
# The number of seconds the test should sleep between tries.
|
||||
FULL_TEXT_WAIT = 10
|
Loading…
Reference in New Issue