On Tue, Aug 31, 2010 at 11:12 AM, Jawwad Jawwad <[email protected]> wrote:
>
> hi,

Hello ! Sorry for the delay.

> i did the following points as far:
>
> Installed TracGViz

ok

> enabled tracgviz.rpc.ReportRPC

ok

> allowed anonymous: XML_RPC

ok

> and GVIZ_VIEW

no need to, but anyway ...

>  now i don't know how to call these functions (self.getAll(), self.get() etc) 
> appropriately?? as i mentioned in my last posts, i want to call these 
> functions using drupal (eventually php). Can you please help me? i used for 
> example like this:
>
>                      $output 
> =xmlrpc('http://localhost/trac/testprojekt/rpc','self.getAll()');

I'm not in mood of writing PHP code (damn!, it's so unreadable ... )
but below you'll see how to do it using Python (just use the most
suitable values according to your
particular needs).

Hints:
  - http://localhost/trac/testprojekt/rpc should only work if you're using
    XmlRpcPlugin 1.1.0 . For versions <= 1.0.6 you should use
    http://localhost/trac/testprojekt/xmlrpc . What version are you using ?
  - What's **self**.getAll() for ?

{{{
#!python

>>> from xmlrpclib import ServerProxy as SP
>>> p = SP('http://localhost:8000/xmlrpc')
>>> p.report.getAll()
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> pprint(p.report.get(1))
{'description': '\n * List all active tickets by priority.\n * Color
each row based on priority.\n',
 'id': 1,
 'query': "\nSELECT p.value AS __color__,\n   id AS ticket, summary,
component, version, milestone, t.type AS type, \n   owner, status,\n
time AS created,\n   changetime AS _changetime, description AS
_description,\n   reporter AS _reporter\n  FROM ticket t\n  LEFT JOIN
enum p ON p.name = t.priority AND p.type = 'priority'\n  WHERE status
<> 'closed'\n  ORDER BY CAST(p.value AS int), milestone, t.type,
time\n",
 'title': 'Active Tickets'}
>>> pprint(p.report.execute(1)[:3])
[{'__color__': '2',
  '_changetime': 1241338765,
  '_description': 'Do it',
  '_reporter': 'olemis',
  'component': 'component2',
  'created': 1241338699,
  'milestone': 'milestone3',
  'owner': 'somebody',
  'status': 'new',
  'summary': 'Another baby in the here',
  'ticket': 2,
  'type': 'enhancement',
  'version': '2.0'},
 {'__color__': '2',
  '_changetime': 1251196256,
  '_description': 'Description 3',
  '_reporter': 'anonymous',
  'component': '',
  'created': 1251196256,
  'milestone': 'milestone3',
  'owner': 'tester',
  'status': 'new',
  'summary': 'Ticket 3',
  'ticket': 7,
  'type': 'enhancement',
  'version': '2.0'},
 {'__color__': '3',
  '_changetime': 1251195593,
  '_description': 'Description 1',
  '_reporter': 'murphy',
  'component': 'component1',
  'created': 1251195593,
  'milestone': '',
  'owner': 'murphy',
  'status': 'new',
  'summary': 'Ticket 1',
  'ticket': 4,
  'type': 'defect',
  'version': '1.0'}]

}}}

>              Thank you very much for your help in advance.

:o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to