On 3/22/07, Simone Deponti <[EMAIL PROTECTED]> wrote:
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.

Cool

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.

PageTemplates have 2 rendering modes: HTML and XML. The HTML Mode
lowercases attribute names, the XML mode doesn't. HTML mode is used
unless the template starts with a proper XML prolog: <?xml
version="1.1"?> and similar.

In short: put a XML prolog at the start of your template and be done with it.

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.

Sounds too much like implicit hackery to me. Vocabularies can
distinguish between the value and the title, so why not set the value
of 'All platforms' to the empty string? That's how LinguaPlone treats
content as 'All languages', and makes for easy catalog searching too.

This avoids us to have to migrate all the content on plone.org when we
deploy it.

Avoiding migrations is nobel, but putting hacks into the code like
a-starting-dash-means-not-all-platforms is not worth it, IMO.

--
Martijn Pieters

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to