Comment 2 for bug 525371

Revision history for this message
Adi Roiban (adiroiban) wrote : Re: API for reading POTemplates details

I have started this work by exporting only the POTemplates attributes. It is mainly the table from +templates.

I added an „all_potemplates” attribute to each series (right now only distroseries, but productseries will follow), that will list all templates from that series

ie: https://launchpad.dev/api/beta/ubuntu/hoary/all_potemplates

The link to a potemplate, is similar to the normal web URL:
https://launchpad.dev/api/beta/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/

------------------------------------------------------------------

These are the exported attributes:
active: True
all_pofiles_collection_link: https://launchpad.dev/api/beta/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/all_pofiles
description: None
exported_in_languagepacks: True
format: PO format
id: 4
languages_count: 2
last_update: 2005-05-06 21:12:13.908028+00:00
messages_count: 22
name: evolution-2.2
owner_link: https://launchpad.dev/api/beta/~rosetta-admins
path: po/evolution-2.2.pot
priority: 100
translation_domain: evolution-2.2

---------------------

The sourcepackage component name is not included as this is something very specific to Ubuntu.
I think we can have a method on a distroseries to return a list of templates that are not in main.

ie: https://launchpad.dev/api/beta/ubuntu/hoary?ws.op=getNonMainTemplates

----------------------

I would like to include the translationtarget... but since it can be IProductSeries or ISourcePackage I don't know how to declare it in lazr.restful.

Maybe we should export the sourcepackage_name as a new IPOTemplate attribute.

------------------------

all_pofiles attribute is there as an idea of how we can link pofiles.
Most probably we can not export it in API, for now.

----------------------------

The IRosettaStats is not of much use for IPOTemplate and for API in general as most of it's methods are language dependent and ... well, they are methods and we can not export them as IPOTemplate or IPOFile attributes.

This is why I skiped the first step suggested by Danilo.

----------------------------

As a next step (a new bug / new branch) I think that I should try to implement the getPOFilesWithStatistics() method on a series, as suggested by Danilo.

When you have time, please take a look at this comment and the attached branch and let me know about your feedback.

Cheers