Archive for August, 2010
A sample Python library for the Nuxeo Content Automation JSON-RPC API
I have created a sample Python library to illustrate the use of the
Content Automation JSON-RPC API (described here:
https://doc.nuxeo.com/display/NXDOC/REST+API).
The project, which is only illustrative and not officially supported by
Nuxeo, lives here:
http://bitbucket.org/sfermigier/nuxeo-automation-clients/
Here are the functions that have been implemented so far:
def create(self, ref, type, name=None, properties=None):
def update(self, ref, properties=None):
def setProperty(self, ref, xpath, value):
def delete(self, ref):
def getChildren(self, ref):
def getParent(self, ref):
def lock(self, ref):
def unlock(self, ref):
def move(self, ref, target, name=None):
def copy(self, ref, target, name=None):
def fetch(self, ref):
def query(self, query, language=None):
def getBlob(self, ref):
def attachBlob(self, ref, blob):
And here is a sample interactive session to illustrate its use:
% python
Python 2.6.5 (r265:79063, Jul 18 2010, 11:41:34)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> URL = "http://localhost:8080/nuxeo/site/automation/"
>>> LOGIN = 'Administrator'
>>> PASSWD = 'Administrator'
>>> … Read more