Import using Import/Export module example please - My attempt folows

Aug 17, 2011 at 10:10 PM

Hello,

I have a number of taxonomies that I desire to bring into orchard and am not having any success in getting the Import/Export module to bring this information into Orchard (it is based off the export of my "Equipment-Navigation" taxonomy). 

<?xml version="1.0"?>
<Orchard>
  <Recipe>
    <Name>Import Taxonomies</Name>
    <Description>Import Taxonomies</Description>
    <Author>Me</Author>
    <WebSite></WebSite>
    <Tags></Tags>
    <Version>1.0</Version>
  </Recipe>

  <Data>
    <Equipment-Navigation Id="/Route.Slug=1.0t-mri" Status="Published">
      <CommonPart Owner="/User.UserName=admin" CreatedUtc="2011-08-16T20:44:45Z" PublishedUtc="2011-08-16T20:59:37Z" ModifiedUtc="2011-08-16T20:44:45Z" />
      <BodyPart Text="&lt;p&gt;This is a placeholder for 1.0T MRI&lt;/p&gt;" />
      <RoutePart Title="1.0T MRI" Slug="1.0t-mri" Path="equipment/mri/1.0t-mri" />
    </Equipment-Navigation>
    <Equipment-Navigation Id="/Route.Slug=mri-machines" Status="Published">
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=equipment" CreatedUtc="2011-08-17T19:55:30Z" PublishedUtc="2011-08-17T19:55:30Z" ModifiedUtc="2011-08-17T19:55:30Z" />
      <BodyPart />
      <RoutePart Title="MRI Machines" Slug="mri-machines" Path="equipment/mri-machines" />
    </Equipment-Navigation>
    <Equipment-Navigation Id="/Route.Slug=0.5t-mri-machines" Status="Published">
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=mri-machines" CreatedUtc="2011-08-17T19:55:30Z" PublishedUtc="2011-08-17T19:55:30Z" ModifiedUtc="2011-08-17T19:55:30Z" />
      <BodyPart />
      <RoutePart Title="0.5T MRI Machines" Slug="0.5t-mri-machines" Path="equipment/mri-machines/0.5t-mri-machines" />
    </Equipment-Navigation>
    <Equipment-Navigation Id="/Route.Slug=1.0t-mri-machines" Status="Published">
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=mri-machines" CreatedUtc="2011-08-17T19:58:29Z" PublishedUtc="2011-08-17T19:58:29Z" ModifiedUtc="2011-08-17T19:58:29Z" />
      <BodyPart />
      <RoutePart Title="1.0T MRI Machines" Slug="1.0t-mri-machines" Path="equipment/mri-machines/1.0t-mri-machines" />
    </Equipment-Navigation>
  </Data>

</Orchard>
I have tried debugging through the issue but have not been successful. Thanks for any working example you can provide or any indication of where I am not utilizing Import/Export properly.

 

Aug 17, 2011 at 10:11 PM

Have you tried to use the latest source code version ?

Aug 18, 2011 at 4:31 PM

Wow, I see you have done a LOT of work in the source code. I am going to go ahead and make another try at it now with the source code and will let you know.

If no one has yet said it, thanks for this excellent module - it is very well done. I love that it has services available (i.e. that it is intuitively extensible). I am working on a module that will require the use of your module - I trust that is okay. The premise is a hierarchy of users. I intend to call it Groups module. The goal will be to have users have the ability to belong in a group (or multiple groups), belong in teams (which will exist under groups), or belong in a user hierarchy (which will exist under groups). The final piece would be to allow for Roles within the Groups. All of this would be generic so other developers could tap into it - similar to how you have made Taxonomies. I was building this from scratch but realize that you have a lot of the work already done. If you do not want me requiring your module, let me know and I will continue from scratch.

On a side note, I did have one other bug when attaching a taxonomy to a Content Type. In the event I was just creating the content, if I selected any taxonomy field values and pressed save, the content was saved, but the taxonomy association did not exist. So, I would go back into the content and associate the content to the taxonomy and press update - this works every time. I am assuming it is a primary key/timing issue and that the taxonomy is not getting the primary key back from the content in order to complete the association. I will be looking to see if your source code resolves this and will provide the response here for others to know.

Thanks again.

Aug 18, 2011 at 6:03 PM

Good news on 1 out of the 2.  By downloading and using your source code, I have been able to complete the import int my taxonomy.  In addition, I am sure someone else will desire to do this so below is the import XML for setting up a multiple level hierarchy.

Bad news on the second point though, if my taxonomy is attached to a contentpart, when I go to add new content, the taxonomy does not stick.  Here is an example (in text) of what I mean:

  • Title: Testing Taxonomy
  • Permalink: testing-taxonomy
  • Parts Navigation Taxonomy:
    • Level 1: Check the box
      • Level 2: Check the box

When I press Save button, the Title and Permalink are saved properly. Hoewver, the Parts Navigation Taxonomy is not saved (either of the terms).  Thanks for letting me know if this is something you already know about and have a possible solution in place, otherwise I will look further in the code to see if I can find the issue (assuming it is fixable).

Now here is the import XML (that works for my arrangement):

<?xml version="1.0"?>
<Orchard>
  <Recipe>
    <Name>Import Taxonomies</Name>
    <Description>Import Taxonomies</Description>
    <Author>me</Author>
    <WebSite>mywebsite</WebSite>
    <Tags></Tags>
    <Version>1.0</Version>
  </Recipe>

  <Data>
    <Parts-Navigation Id="/Route.Slug=level-1" Status="Published">
      <RoutePart Title="Level 1" Slug="level-1" Path="parts/level-1" />
      <TermPart Count="0" Selectable="true" Weight="1" TaxonomyId="/Route.Slug=parts" Path="" />
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=parts" CreatedUtc="2011-08-16T20:45:41Z" PublishedUtc="2011-08-18T16:14:35Z" ModifiedUtc="2011-08-16T20:45:41Z" />
      <BodyPart Text="&lt;p&gt;This is a placeholder for level 1&lt;/p&gt;" />
    </Parts-Navigation>
    <Parts-Navigation Id="/Route.Slug=level-2" Status="Published">
      <RoutePart Title="Level 2" Slug="level-2" Path="parts/level-1/level-2" />
      <TermPart Count="0" Selectable="true" Weight="1" TaxonomyId="/Route.Slug=parts" Path="/Route.Slug=level-1" />
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=level-1" CreatedUtc="2011-08-18T15:59:05Z" PublishedUtc="2011-08-18T16:14:35Z" ModifiedUtc="2011-08-18T15:59:05Z" />
      <BodyPart Text="&lt;p&gt;This is a placeholder for level 2&lt;/p&gt;" />
    </Parts-Navigation>
	<Parts-Navigation Id="/Route.Slug=level-3" Status="Published">
      <RoutePart Title="Level 3" Slug="level-3" Path="parts/level-1/level-2/level-3" />
      <TermPart Count="0" Selectable="true" Weight="0" TaxonomyId="/Route.Slug=parts" Path="/Route.Slug=level-1,/Route.Slug=level-2" />
      <CommonPart Owner="/User.UserName=admin" Container="/Route.Slug=level-2" CreatedUtc="2011-08-18T16:32:44Z" PublishedUtc="2011-08-18T16:32:44Z" ModifiedUtc="2011-08-18T16:32:44Z" />
      <BodyPart Text="&lt;p&gt;This is a placeholder for level 3&lt;/p&gt;" />
    </Parts-Navigation>
  </Data>
    
</Orchard>

 

Aug 18, 2011 at 6:17 PM

Are you using the source code version ?

Aug 18, 2011 at 6:26 PM

Yes, my last comment (with the successful import but without any success in saving the taxonomy term) was done using the source code version (latest release).

Aug 18, 2011 at 6:45 PM

"Source code version/Latest Release" doesn't make sense to me :/

To be perfectly clear, what changeset number are you synced with ?

Aug 18, 2011 at 7:00 PM

Sorry, I did not know there was a change set number available.  I am on f0b67b2e4114.  I guess this was the latest revision for the default branch (as I just used the Download link). 

Would you like me to grab 7e31342ea495 and give that one a try?

Aug 18, 2011 at 7:09 PM

Yes, please use this changeset (dev branch) and I think it should work, Be carefull, this version had breaking changes, you need a new Orchard install, you can't upgrade from an existing taxonomy installation.