I strongly recommend you use virtualenv. Assuming you do that, the steps to install are:
- Create a directory somewhere, suppose it is alfresco-oauth.
- cd into alfresco-oauth and make a virtual environment by typing: virtualenv env
- Now activate your virtual environment by typing: source ./env/bin/activate
- This script requires oauth2client. The easiest way to install this is to type: easy_install oauth2client
Now you're ready to configure your application key and secret.
You need to know your Alfresco Cloud API key and secret. Go snag those and come back.
- Edit client_secrets.json.sample.
- For client_id, specify your API key
- For client_secret, specify your secret
- Leave everything else alone and save as client_secrets.json
If you are going to run cmis_create_document.py, you must edit the script to set: NETWORK = 'alfresco.com' SITE = 'alfresco-api-demo' # A site that already exists FOLDER_NAME = 'test folder' # Name of a test folder to create FILE = '/Users/jpotts/Documents/sample/sample-a.pdf' # Name of a file to upload FILE_TYPE = 'application/pdf' # Mimetype of the file
- Execute the script
- The script will invoke your default browser and ask you to grant access to the application.
- After you grant access, the script will continue to run. The script currently spits out your home network and a list of sites in your home network.
- The credential will be persisted to your keychain (untested on Windows!)