1

Closed

Missing version number in import/export

description

We should have a base class implementing an inner node version.
Closed May 14, 2013 at 9:16 PM by sebastienros

comments

CSADNT wrote Apr 1, 2013 at 10:02 AM

Adding 2 virtual methods in ContentPartDriver<> to WriteSchemaVersion and ReadSchemaVersion would simply do it. The Importing will receive as a new parameter the version read and maintain compatibility code... nothing broken.
Classical.

sebastienros wrote Apr 16, 2013 at 8:33 PM

We don't understand what version you are talking about. Could you give us an example ?

CSADNT wrote Apr 16, 2013 at 9:30 PM

Something as in migration but in code, no nee for db.
Export write a versinned xml structure, the the last structure version, just a node name <version> with a number.
If you need to change something in the part, you increment the export version numer and write new struct.

Import reads all the versions, keeping the history, could be just a switch case based on the version node value.
We could say that the old import will be version 0, the new versionned import will contain an int parameter, the version.

CSADNT wrote Apr 17, 2013 at 5:15 PM

Sorry for bad writing from mobile, hope this is still understandable

CSADNT wrote Apr 17, 2013 at 5:33 PM

<Orchard>
<Recipe>
<Name>Generated by Orchard.ImportExport</Name>
<Author>admin</Author>
</Recipe>
<PartsVersions>
<Orders version='2' />
<TheThing version='10' />
</PartsVersions>
<Metadata>
<Types>
</Types>
<Parts>
</Parts>
</Metadata>
<Data>
</Data>