How to rearrange Icon and Tag Groups in Map Index

  • 2
  • Idea
  • Updated 4 years ago
At the request of some other folks, I am writing down the method I used to rearrange the Icon and Tag Groups within the Map Index. This is most certainly an unsanctioned method for manipulating your Map, so buyer (or practitioner) beware.

NOTE: Your map should be backed up before attempting any of this because XML is rather easily messed up and it could completely corrupt your map if you cut and paste the wrong thing. That said, this process is fairly straight forward if you stick to the steps.

I am going to put each step of the process as a separate reply in this thread in case there are questions on particular parts - you can put comments in the proper place :)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes

Posted 4 years ago

  • 2
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
First, you'll need to get a program that can manipulate XML, which the core document in your map – Document.xml – is made out of.


I had considered using a free tool (XML Notepad by Microsoft, for example - http://www.microsoft.com/en-us/downlo...) to do this manipulation, but to be honest it makes a lot more sense to use a more fully functional tool instead.


My tool of choice is Oxygen XML. You can get a 30 day, fully functioning trial here: http://www.oxygenxml.com/register.html.

The tutorial is made with Oxygen XML.
(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
You’ll also need a program that can manipulate ZIP files, like WinZIP (http://www.winzip.com/win/en/landing/...), or my personal favorite, WinRAR (http://www.rarlab.com ).

This tutorial is made with WinRAR.
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
The assumptions:


I am using a map named TestMap.mmap, located in a folder on my Desktop called “Test”. Here is what we are starting with:




.. and so, without further ado, here are the steps:
(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
I found, after the fact, that I couldn't edit my original post and I forgot a critical ease-of-use note that belongs at the beginning of this process.

Considering that you are trying to rearrange the Map Index content, it would be really helpful to have a screenshot or manual list of what order everything is in BEFORE you start.

Secondly, I would suggest creating a manual list of what order you want everything to be in AFTER your process is all done; Since you won't be able to open the map mid-process, making these lists before hand will make your life infinitely easier - especially if, like me, you have 50 groups to rearrange!
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 1: Create a COPY of your map.


Seriously, you don't want to have no way back in case you mess things up. I don't want you to have to go begging to one of the great support folks because you missed this step.
(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 2: Rename your .mmap file to .zip.

Did you know that every map is actually a ZIP file? Now you know. We are going to rename my demo file from TestMap.mmap to TestMap.zip.

Confirm the prompt about the file rename by clicking "Yes".
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 3: Extract the archive content from your .mmap.

Right click on your file, and making the following selections to extract the content to a new folder named after the source ZIP file.

Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 4: Inspect the extracted contents.


Ensure that there is both a FOLDER named TestMap, and your original (unaltered) map file in the source directory (Test, in my case), like this:




Open the TestMap folder, and check out the contents. The ONLY file we will be touching is the Document.xml source file:

(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
THIS IS WHERE THE REAL WORK BEGINS.

STEP 5: Open Document.xml in your XML editor of choice (see my preferences above).

NOTE: In OxygenXML editor you will get a warning about the long length of the lines, which you can safely click "Continue" on.

In order to make the document about 1,000 times easier to work with, I always make it a habit of MAKING THE PROGRAM format the document. IN OxygenXML, click the icon shown below, whichappears right above the raw XML text:




Wallah! Clean looking raw XML.
(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 6: Inspect EVERYTHING before touching ANYTHING.

OK, now that we are all set up, you will need to take a look at the existing file setup so that you can get your bearings. Get out your screenshot or list of your ORIGNAL map index contents so you can see where they “come from” during this step.

Here is my map’s initial index. The yellow Tag Groups are what I am going to rearrange in this tutorial so that they are listed in numerical order: One, Two, Three.



In OxygenXML editor, there is a small tool pane called the “Outline”, located in the lower left hand side of the interface, which is where all of your editing will take place. Here it is:



The Icon Groups and Tag Groups are stored next to each other in two “peer” sections of the map. The rearrangement of either content is an identical process, but for the sake of simplicity I am going to focus on the Tag group in my tutorial.

Navigate to the section of the map by clicking the arrows next to the following nodes:

ap:Map (probably already expanded by default)
ap:MarkerSetGroup (the parent of the Icon and Tag Groups)

At this point you should see this, below.



The sections you could be interested in are highlighted in yellow, ap:IconMarkerSets and ap:TextLabelMarkerSets.

ap:IconMarkerSets contain the Icon Groups, which use the graphical icons. The ap:TextLabelMarkerSets contain the text-based Tag Group contents.
(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 7: Get Ready to rearrange the Groups.

This is the most dangerous part of the process, because it is the most likely to accidentally be done incorrectly
Because I am interested in rearranging the Tag Groups, I need to expand the ap:TextLabelMarkerSets node to expose the three groups I have created before the tutorial began.



These three highlighted notes correspond to the three Tag Groups I highlighted at the beginning of the tutorial: “One”, “Two”, and “Three”, which are, currently, out of order in the index.

So, the question is this: how do I know which one is which – they all look the same!

This is where the different programs handle editing differently, and your steps WILL be different if you are not using OxygenXML editor. In OxygenXML, it is a simple process. Simply click on each one of the ap:TextLabelMarkerSet nodes, in turn, and the editor will automatically bring the content into focus, and highlight in blue, in the main editing interface.

When I click on the first ap:TextLabelMarkerSet in the list (from the top), this is what gets highlighted in the main editor window:



Notice that the red-circled section shows that the “Name” attribute of this group is “Three”, which is in fact what I would expect from my original map design. You can also look just down the page and see the next group name, in yellow highlight, “One”. Clicking on the second node in the Outline would highlight that content, and so forth.

Get ready to hold your breath because the next step makes and commits the changes!
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 8: Rearrange the groups.

OK, so we are finally there!

Take a look back at your notes or screenshot to see which order your groups need to be in. We are going to “drag and drop” the groups from one location to another.

NOTE: Do NOT try and cut-and-paste this operation! Do the drag-and-drop method. It is far too easy to mess up XML (this comes from an experienced developer who is speaking from experience)

Since we are already familiar with the order of the groups because of the previous step’s inspection, we can just start putting things in the right location. Read all of the following description BEFORE doing anything!

In the OxygenXML editor, Outline pane, left-click and HOLD the node you want to drag. You will see a small black underline appear, which indicates where the content would be placed if you let go of the left mouse button. Move your mouse until the black indicator line appears where it should be located and let go of the mouse.

NOTE: You may find that pausing even for a moment over another node will automatically expand it’s content. Don’t worry about it – just keep your eye on the location it should be put.

The drop location SHOULD look like this (black UNDERLINE) – it means it will be put BETWEEN the two nodes it appears BETWEEN:



The drop location SHOULD NOT look like this (black OUTLINE) – this indicates the content will be put INTO the node it is hovering over!



FINALLY let go of the content when it appears in the right place.

Click through each of the ap:TextLabelMarkerSets nodes and glance over at the “Name” property as shown above to verify that the content has been properly rearranged. If not, move it again.

Rinse and repeat as needed.
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
I find that moving BEFORE the FIRST node, or AFTER the LAST node can be tricky. The editor gets a little finicky and you have to be prepared to undo (Ctrl-Z) if it doesn't go well.

For that reason, I prefer to move the items from either end INTO THE MIDDLE, instead of the other way around, if at all possible. It may not be., depending on your initial group order.
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
STEP 9: Put Humpty-Dumpty back together (aka Save, Rename and Verify reordered map)

Now that all the edits have been made, Save the Document.xml file and confirm changes. Close your editing program.

From within the TestMap folder in Windows Explorer, select all files and folders, using Ctrl-A. You should see all files selected:



Without clicking on anything first, right-click on the highlighted files, and from the context menu, select “Add to archive” from the WinRAR menu, as shown below.



You can consolidate the last two steps, which is creating a new archive file from all of the existing contents using the ZIP format, and renaming the new ZIP file with a .mmap extension. By default, WinRAR will name the new archive file for the directory name it is currently in. You can changes as necessary. You can also rename the file extension to .mmap after creating the archive if you feel more comfortable doing that.

Here are those selections in my Save dialog when consolidating those two steps:



After that you should see the newly modified map file in the same folder:



At this point it is a fully functional, normal map that can be opened and inspected within MindManager! You may want/need to give it a new name, then put it back in the original folder, one directory up, so that the relative hyperlinks don’t get messed up, but that is all on you.

Here is the final, reordered Map Index content:

Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
Now, get off the computer and go play with the kids, your spouse, the dog, or anything that doesn't require such attention to detail and AC power!

I hope this will prove helpful, and maybe we will see a native editor in future versions of MM.
Photo of Alex Gooding

Alex Gooding, Champion

  • 872 Posts
  • 220 Reply Likes

Hi Mike,

Thanks for sharing this - you've obviously put a lot of work into it. I'll have a play with it in a few days when I have a bit more time.

I agree that it would be nice to have a native XML editor in MM, though for the time being I'd be happy with a simple facility to sort and rearrange marker and tag groups!


(Edited)
Photo of Alex Gooding

Alex Gooding, Champion

  • 872 Posts
  • 220 Reply Likes

Actually I think I may have just found a way to rearrange marker groups in the Map Index without using XML.

Assume you have three tag groups in the Map Index named and ordered the same way Mike has used in his example:

  • Three
  • One
  • Two

To move group Three to the bottom, first copy the group and then delete it, confirming that yes you do want to delete the whole group.

Then go to the green plus sign at the top of the Map Index tab and click on Paste Marker Group. Icon and Tag groups are always pasted at the bottom of the relevant section, so your tag groups should now be ordered as follows:

  • One
  • Two
  • Three

The main limitations with this approach are that you have to do this one group at a time and that you can only sort by pasting the copied groups to the bottom of the list. Therefore, if you had four groups which were ordered:

  • Two
  • Four
  • One
  • Three

- you would start by copying, deleting and pasting group Two at the bottom, do the same for group Three and then finally deal with group Four to get them in the correct order.

The other thing is that you have to remember always to copy the group, then delete. If you fail to copy first the group is gone forever, so it's probably wise to save a copy of the map before you start the reordering process.

(Edited)
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
That's a great idea too Alex. I didn't even realize you could copy a group :)

I think you are right, the choice of method depends on how many groups you have, and how many copy and paste operations you would need to "bubble sort" them into the right order.

At this point, it only takes me about 5 minutes to do the XML operation I described, so in most cases I would find it easier to stick with my model. That said, multiple options are always better!
Photo of Alex Gooding

Alex Gooding, Champion

  • 872 Posts
  • 220 Reply Likes
Thanks for the feedback - as you say the methods are complementary.

The approach you describe is the way to go if you have a lot of groups and aren't afraid to get your hands dirty with XML. On the other hand if you don't want to play with XML and/or you have only a few groups to organise, the copy-delete-paste method would seem to be the easiest.

I assume the copy group facility is designed primarily for copying between maps and again obviously works best if you have a small number of groups to deal with. I guess that a variation of your XML method could also be used to do this faster too, especially if you had a large number of groups to transfer.