From: Asheesh L. <as...@cr...> - 2008-06-19 22:47:43
|
I'm improving the SMW CSV query printer we're working on at CC (source is in the CC_SMW_Extensions repository at code.creativecommons.org's git; if we didn't announce it before, ask - I'm happy to write more about it later). For our CSV printer, I figured - if a page has two values for a property, they should show up in the same column of a spreadsheet joined by "," rather than in separate columns. So I began to change the CSV Query Printer to keep track of which property name it was printing. However, in abstract SMWDataValue $object->m_property is *protected*. So I can't read it. So my query printer can't tell what property it is printing, and therefore can't specially handle this case. Why is it protected? Can a get_property_name() method be added? Am I handling this wrong? -- Asheesh. -- When taxes are due, Americans tend to feel quite bled-white and blue. |
From: Asheesh L. <as...@cr...> - 2008-06-23 19:04:09
Attachments:
getPropertyName.patch
|
I'm attaching a very short patch that creates getPropertyName() in the SMW_DataValue.php file. This is useful for custom query printers that need to know the name of the property they are reading (to, for example, detect properties with more than one value, as the CSV query printer needs). Permission is granted to re-use this under the same terms as the current SMW codebase. Please commit! -- Asheesh. -- Did I do an INCORRECT THING?? |
From: Asheesh L. <as...@cr...> - 2008-06-28 03:05:40
|
On Mon, 23 Jun 2008, Asheesh Laroia wrote: > I'm attaching a very short patch that creates getPropertyName() in the > SMW_DataValue.php file. Please still commit this - it turns out to be useful for another extension of mine. > This is useful for custom query printers that need to know the name of > the property they are reading (to, for example, detect properties with > more than one value, as the CSV query printer needs). For what it's worth, I don't need the patch for CSV query printer in the end - I fixed the bug based on a careful reading of QP_Table! (-: -- Asheesh. -- When you try to make an impression, the chances are that is the impression you will make. |