You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabrizio giustina (JIRA)" <ji...@apache.org> on 2007/08/24 09:42:30 UTC
[jira] Created: (JCR-1084) Maintan a stable ordering of properties
in xml export
Maintan a stable ordering of properties in xml export
-----------------------------------------------------
Key: JCR-1084
URL: https://issues.apache.org/jira/browse/JCR-1084
Project: Jackrabbit
Issue Type: Improvement
Affects Versions: 1.4
Reporter: fabrizio giustina
Priority: Minor
When exporting to xml (system view, not tested with document view) the order of properties is not consistent.
This is not an issue with the jcr specification, since the order of properties is undefined, but keeping the same (whatever) order in xml export could be useful.
At this moment if you try running a few import->export->import->export roundtrips you will notice that the exported xml often changes. This is an example of the differences you can see:
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>59357999-b4fb-45cd-8111-59277caf14b7</sv:value>
</sv:property>
+ <sv:property sv:name="title" sv:type="String">
+ <sv:value>test</sv:value>
+ </sv:property>
<sv:property sv:name="visible" sv:type="String">
<sv:value>true</sv:value>
</sv:property>
- <sv:property sv:name="title" sv:type="String">
- <sv:value>test</sv:value>
- </sv:property>
If you may need to diff between two exported files that could be pretty annoying, you have no clear way to understand if something has really changed or not.
I would propose to keep ordering consistent between export: an easy way could be sorting properties alphabetically during export.
This behavior has been tested on a recent jackrabbit build from trunk (1.4-SNAPSHOT)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1084) Maintan a stable ordering of properties
in xml export
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1084:
-------------------------------
Component/s: xml
jackrabbit-core
Affects Version/s: (was: 1.4)
Fix Version/s: 1.4
Assignee: Jukka Zitting
Good idea! I'll use a SortedMap for the properties instead of a List of names to avoid the extra getProperty() calls.
> Maintan a stable ordering of properties in xml export
> -----------------------------------------------------
>
> Key: JCR-1084
> URL: https://issues.apache.org/jira/browse/JCR-1084
> Project: Jackrabbit
> Issue Type: Improvement
> Components: jackrabbit-core, xml
> Reporter: fabrizio giustina
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 1.4
>
> Attachments: JCR-1084.diff
>
>
> When exporting to xml (system view, not tested with document view) the order of properties is not consistent.
> This is not an issue with the jcr specification, since the order of properties is undefined, but keeping the same (whatever) order in xml export could be useful.
> At this moment if you try running a few import->export->import->export roundtrips you will notice that the exported xml often changes. This is an example of the differences you can see:
> <sv:property sv:name="jcr:uuid" sv:type="String">
> <sv:value>59357999-b4fb-45cd-8111-59277caf14b7</sv:value>
> </sv:property>
> + <sv:property sv:name="title" sv:type="String">
> + <sv:value>test</sv:value>
> + </sv:property>
> <sv:property sv:name="visible" sv:type="String">
> <sv:value>true</sv:value>
> </sv:property>
> - <sv:property sv:name="title" sv:type="String">
> - <sv:value>test</sv:value>
> - </sv:property>
> If you may need to diff between two exported files that could be pretty annoying, you have no clear way to understand if something has really changed or not.
> I would propose to keep ordering consistent between export: an easy way could be sorting properties alphabetically during export.
> This behavior has been tested on a recent jackrabbit build from trunk (1.4-SNAPSHOT)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1084) Maintan a stable ordering of properties
in xml export
Posted by "fabrizio giustina (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
fabrizio giustina updated JCR-1084:
-----------------------------------
Attachment: JCR-1084.diff
Very simple patch against current 1.4 trunk.
This small change ensures that the order of properties is unchanged in exported xmls by ordering them alphabetically. I've checked that this doesn't break any existing unit test.
> Maintan a stable ordering of properties in xml export
> -----------------------------------------------------
>
> Key: JCR-1084
> URL: https://issues.apache.org/jira/browse/JCR-1084
> Project: Jackrabbit
> Issue Type: Improvement
> Affects Versions: 1.4
> Reporter: fabrizio giustina
> Priority: Minor
> Attachments: JCR-1084.diff
>
>
> When exporting to xml (system view, not tested with document view) the order of properties is not consistent.
> This is not an issue with the jcr specification, since the order of properties is undefined, but keeping the same (whatever) order in xml export could be useful.
> At this moment if you try running a few import->export->import->export roundtrips you will notice that the exported xml often changes. This is an example of the differences you can see:
> <sv:property sv:name="jcr:uuid" sv:type="String">
> <sv:value>59357999-b4fb-45cd-8111-59277caf14b7</sv:value>
> </sv:property>
> + <sv:property sv:name="title" sv:type="String">
> + <sv:value>test</sv:value>
> + </sv:property>
> <sv:property sv:name="visible" sv:type="String">
> <sv:value>true</sv:value>
> </sv:property>
> - <sv:property sv:name="title" sv:type="String">
> - <sv:value>test</sv:value>
> - </sv:property>
> If you may need to diff between two exported files that could be pretty annoying, you have no clear way to understand if something has really changed or not.
> I would propose to keep ordering consistent between export: an easy way could be sorting properties alphabetically during export.
> This behavior has been tested on a recent jackrabbit build from trunk (1.4-SNAPSHOT)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-1084) Maintan a stable ordering of properties
in xml export
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved JCR-1084.
--------------------------------
Resolution: Fixed
Resolved in revision 591404.
> Maintan a stable ordering of properties in xml export
> -----------------------------------------------------
>
> Key: JCR-1084
> URL: https://issues.apache.org/jira/browse/JCR-1084
> Project: Jackrabbit
> Issue Type: Improvement
> Components: jackrabbit-core, xml
> Reporter: fabrizio giustina
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 1.4
>
> Attachments: JCR-1084.diff
>
>
> When exporting to xml (system view, not tested with document view) the order of properties is not consistent.
> This is not an issue with the jcr specification, since the order of properties is undefined, but keeping the same (whatever) order in xml export could be useful.
> At this moment if you try running a few import->export->import->export roundtrips you will notice that the exported xml often changes. This is an example of the differences you can see:
> <sv:property sv:name="jcr:uuid" sv:type="String">
> <sv:value>59357999-b4fb-45cd-8111-59277caf14b7</sv:value>
> </sv:property>
> + <sv:property sv:name="title" sv:type="String">
> + <sv:value>test</sv:value>
> + </sv:property>
> <sv:property sv:name="visible" sv:type="String">
> <sv:value>true</sv:value>
> </sv:property>
> - <sv:property sv:name="title" sv:type="String">
> - <sv:value>test</sv:value>
> - </sv:property>
> If you may need to diff between two exported files that could be pretty annoying, you have no clear way to understand if something has really changed or not.
> I would propose to keep ordering consistent between export: an easy way could be sorting properties alphabetically during export.
> This behavior has been tested on a recent jackrabbit build from trunk (1.4-SNAPSHOT)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.