Opened 7 years ago

Last modified 4 months ago

#1304 assigned enhancement

Implement tags related XMLRPC methods

Reported by: nixar Owned by: hasienda
Priority: normal Component: TagsPlugin
Severity: normal Keywords: tags xml rpc xmlrpc
Cc: osimons Trac Release: 0.11


Suggested methods:

void setTags(pagename)
string getTags(pagename)
void addTag(pagename,tagname)
array searchTags(tagquery)

Attachments (1)

20140418_xmlrpc-handler.patch (4.5 KB) - added by hasienda 4 months ago.
preliminary changes for adding a tags XMLRPC handler

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by jimbydamonk

hey, check this out TracTagsXmlrpcPlugin.

comment:2 Changed 7 years ago by athomas

  • Status changed from new to assigned

jimbydamonk: Nice! It'd be good to have the support in the core code, I'll look into adding it.

comment:3 Changed 3 years ago by rjollos

  • Cc pkline hasienda added

comment:4 Changed 23 months ago by rjollos

  • Cc pkline removed

#2822 closed as a duplicate.

comment:5 Changed 23 months ago by rjollos

  • Trac Release changed from 0.10 to 0.11

comment:6 Changed 4 months ago by hasienda

  • Cc osimons added; hasienda removed
  • Owner changed from athomas to hasienda

Note that TracTagsXmlrpcPlugin branch has been developed for Trac 0.10 and never changed after initial release.

While it looks like it could still work with Trac 0.11 or later, its tag system support is for tractags<=0.5. Obsolete as it is, there is not much to reuse from this plugin anymore.

I'll finally depreciate TracTagsXmlrpcPlugin after adding the XMLRPC functionality requested here.

Changed 4 months ago by hasienda

preliminary changes for adding a tags XMLRPC handler

comment:7 Changed 4 months ago by hasienda

Because I'm new to the RPC topic I would value code review, thoughts and suggestions on my proposed changes (untested), before I apply them to trunk.

comment:8 Changed 4 months ago by hasienda

Progressing. Seems like XMLRPC has some limitations I need deal with. According to my initial tests it cannot transfer any object. A few standard objects (like 'string', 'list', 'dict') are supported, 'tractags.api.Counter' (custom dict object) or 'set' object are not. This requires some type conversations.

Not sure, how to handle this one:

Trac[xml_rpc] ERROR: Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/tracrpc/", line 158, in _rpc_process
    result = (XMLRPCSystem(self.env).get_method(method_name)(req, args))[0]
  File "build/bdist.linux-i686/egg/tracrpc/", line 197, in __call__
    result = self.callable(req, *args)
  File "build/bdist.linux-i686/egg/tractags/", line 70, in getTags
    return self.tag_sys.get_tags(req, Resource(realm, id))
  File "build/bdist.linux-i686/egg/tractags/", line 459, in get_tags
    .get_resource_tags(req, resource, when=when))
ServiceException: get_resource_tags() got an unexpected keyword argument 'when'

It doesn't like the extra argument that is implicitly added in the call signature of get_tags(). But what shall I do about it? Other calls to that method inside TagsPlugin work just fine.

comment:9 Changed 4 months ago by hasienda

Found this statement: XMLRPC does not allow passing parameters by name, only positional parameters.

So this is not specific to xmlrpclib but due to the specification, and using methods with keyword arguments is expected to fail. Consequently I need to work around and partially rewrite affected methods.

comment:10 Changed 4 months ago by hasienda

In 13858:

TagsPlugin: Add component for RPC access to tag system methods, refs #1304.

Add Comment

Modify Ticket

as assigned .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.