This project is read-only.

Export custom content part 1.6 version

Topics: General
Jul 6, 2013 at 2:29 PM
Edited Jul 6, 2013 at 2:30 PM
I just created an custom content part in my orchard site.
I will like to know if it is possible to export custom content part with the module ( import and export ), when i go to the export page i can not find any content part check box.
Jul 6, 2013 at 4:39 PM
You generally don't export parts, but content types and content, since a part on its own isn't very useful.
You should be able to see your content type with your custom part though.
If your custom part has a record class associated with it, make sure you also implement the Importing and Exporting methods of its driver.
Jul 15, 2013 at 2:59 PM
Just out of interest, if your module has a custom record class that is not an orchard content part (for example the StateRecord class in the Orchard 1-N relationships dock) is there a recommended approach to enable this data to also be included in orchard exports and imports? Is it even possible?
Jul 15, 2013 at 3:39 PM
Definitely possible. You can implement custom steps and handlers:
  • ICustomExportStep - to declare that there's a custom export step
  • IExportEventHandler - to actually export your data
  • IRecipeHandler - to actually import your data
The new Workflows module, where the workflow definitions are not stored as content items but as "regular" records, use this approach. You can find it in the 1.x branch in Orchard,Workflows/ImportExport.