[OGo-XML-RPC] Recent XML-RPC Updates
Adam Tauno Williams
xmlrpc@opengroupware.org
Wed, 16 Aug 2006 13:02:29 -0400
For anyone not in the habit of tracking the ChangeLog -
http://www.opengroupware.org/changeblogger/ - this is just an FYI of
numerous patches recently applied to trunk.
* moved isPrivate handling from PersonDocument into CompanyDocument
object to allow for isPrivate in company records (Bug#316) (v5.3.78)
----------------------------------------------------
Should allow you to set private flag on enterprise documents. Currently
testing, there might still be a problem.
* added generic.getTypeById method (Bug#1708) (v5.3.77)
----------------------------------------------------
Allows you to retrieve the document type corresponding to a
pkey/objectId. This is useful especially when working with the obj_link
related actions.
#!/usr/bin/env python
import xmlrpclib
server = xmlrpclib.Server('http://awilliam:fred@localhost/RPC2')
result = server.generic.getTypeById("10003")
print result
result = server.generic.getTypeById("10000")
print result
result = server.generic.getTypeById("43")
print result
Returns:
Team
Person
Unknown
* added access.getACLById method (Bug#1684) (v5.3.76)
----------------------------------------------------
Allows you to retrieve the ACLs applied to an object.
And of the following are valid:
print server.access.getACLById(10120)
print server.access.getACLById("10120")
print server.access.getACLById("27160,10120")
print server.access.getACLById([ 27160 ])
print server.access.getACLById([ "27160", 10120 ])
#!/usr/bin/env python
import xmlrpclib
server = xmlrpclib.Server('http://awilliam:fred@localhost/RPC2')
print server.access.getACLById([ "27160", 10120 ])
Returns:
{'10120': [{'operations': 'wr', 'entityName': 'Team', 'objectId':
25850},
{'operations': 'wr', 'entityName': 'Person', 'objectId':
10120},
{'operations': 'wr', 'entityName': 'Team', 'objectId':
9981},
{'operations': 'w', 'entityName': 'Team', 'objectId':
25920},
{'operations': 'r', 'entityName': 'Team', 'objectId':
9991}],
'27160': [{'operations': 'r', 'entityName': 'Team', 'objectId':
10003},
{'operations': 'wr', 'entityName': 'Team', 'objectId':
9991}]}
NOTE: This is only tested for company objects (contacts & enteprises).
It might work for documents [in projects], it certainly will not work
for appointments.
* added appointment.setPermissions method (Bug#219) (v5.3.75)
-----------------------------------------
Allows you to change the permissions on appointment objects and adds the
"writeAccess" and "accessTeamId" to the appointment document.
"writeAccess" is an array of object id's with write access, and
accessTeamId is the team selected for read access.
#!/usr/bin/env python
import xmlrpclib
server = xmlrpclib.Server('http://awilliam:fred@localhost/RPC2')
result = server.appointment.setPermissions('25730', '10003', [ '9991',
'10003']);
print "Method Result: %s" % result
result = server.appointment.getById("25730")
print "Write Access: %s" % result['writeAccess']
print "Read Access: %s" % result['accessTeamId']
print
result = server.appointment.setPermissions('25730', '9991', '10003');
print "Method Result: %s" % result
result = server.appointment.getById("25730")
print "Write Access: %s" % result['writeAccess']
print "Read Access: %s" % result['accessTeamId']
Returns:
awilliam@aleph:~/OGo/TestScripts/xmlrpcd> ./setPermOnApp.py
Method Result: True
Write Access: ['9991', '10003']
Read Access: 10003
Method Result: True
Write Access: ['10003']
Read Access: 9991
Currently there is a small bug that you can only grant write access to
teams, and not to accounts; it should be possible to mix write access
for either.
* removed duplicate encoding of 'comment' key (Bug#1598) (v5.3.74)
* added appointment.setResources method (Bug#1599) (v5.3.73)
-----------------------------------------------
Allows to associate resources to appointments (by name).
For example:
server.appointment.setResources(25730, "North Conference Room");
server.appointment.setResources(25730, [ "North Conference Room", "Video
Projector #3" ]);
server.appointment.setResources("25730", [ ]);
However the "resourceNames" key is not yet encoded in the appointment
document, so you can't see you changes [ except in the WebUI]. :)
Patch forth-coming.