Hello all, A couple of days ago, Limi allowed me to merge my doap-support branch of PSC back into trunk. Tonight I did it, with a single commit to make it easier to revert back in case of trouble. A short changelog was included in the svn comment on the commit, however, I will post here a more detailed explanation of the changes for future reference aswell (I hope this is the right list).
Okay, shortly, I have made PloneSoftwareCenter able to export data using DOAP (http://www.usefulinc.com/doap/). The rdf feed would be accessible through <url of product>/doap.rdf. The changes made are: 1. Added two views, project_doap_view and doap.rdf. The latter is directly callable and avoids using a zpt to render the XML, this is because: a) I needed the correct mimetype. b) the zpt seemingly converted all the attributes to lowercase (and the DOAP guys said this was not so good). c) I'm planning to switch the XML generation from using xml.minidom to using rdflib. The views all come with added tests. 2. My view makes a special handling of the availablePlatforms attribute inside SoftwareCenter. This because, in DOAP, if a product is available for all platforms, thus not being restricted to just a subset of the possible platforms, it should not carry any information about the platforms (and not carrying an information that says "I'm available for all platforms"). So, I had to somewhat distinguish between a platform attribute that carries the meaning of "All platforms" (be it written like that or "All the platforms" or whatever) and hence I decided to treat the first element in availablePlatforms as the element that carries the meaning of "All platforms". If one doesn't want to have an attribute that carries such meaning, simply puts a minus sign (-) as first line. FileLink and DownloadableFiles, in the methods that return the vocabulary, filter that minus and do not make it available for selection. This avoids us to have to migrate all the content on plone.org when we deploy it. However, this is not an optimal solution, as there are two cases I do not cover: a) If someone has two attributes that carry the meaning of "usable on all platforms": e.g., I might have a "JAR File" and a "Source file" platform. b) In case we have the "minus" platform. Hehe, ok, that was a bad attempt to make some humour. That's all. I'm not a very experienced plone developer, and as much as I tried not to make errors, some might have slipped in: so would be cool if someone could give a look at it and "review" the code. Also don't be afraid to revert back the change if you feel it shouldn't be on trunk (because there are errors etc), the code won't be lost since there's still my branch. Best regards Simone _______________________________________________ Product-Developers mailing list [email protected] http://lists.plone.org/mailman/listinfo/product-developers
