View unanswered posts | View active topics It is currently Sat Nov 21, 2009 7:53 am



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
 OID to GUID? 
Author Message

Joined: Tue Aug 07, 2007 1:28 pm
Posts: 6
Location: Atlanta, GA
Post OID to GUID?
How can I programmatically convert a topic OID to a GUID?

MM does this nicely in the GUI with the "Copy as Hyperlink" command on the topic context menu, but as far as I can tell, this function is not available through the API. I do not need to create a GUID--I need to convert the existing OID to a guid. Like this:
OID for a topic = "3DLHM/BCokaqGKl/tYq9Qw=="
GUID for the same topic = {33C732DC-42F0-46A2-AA18-A97FB58ABD43}

There has to be an algorithm for this, but it isn't obvious to me. Does anyone know?

In case you're wondering, I need the URL hyperlink to link to a topic from another app. It works great once I get the hyperlink, but I just can't figure out how to get it through the API.


Sun Mar 16, 2008 3:50 pm
Profile

Joined: Tue Aug 07, 2007 1:28 pm
Posts: 6
Location: Atlanta, GA
Post I found the answer
OK--I found my own answer. The OID is a Base64String. You need to convert it to an array of bytes from which you then create a GUID.

In VB.NET, you do it like this:
'Create the GUID from the OID
Dim tGuid As New Guid(Convert.FromBase64String(Topic.Guid))

'Then use this to create an HTML Link just like you get from Ctrl-Alt-C:
Replace("mj-map:///" & MMApp.ActiveDocument.FullName & "#oid={" & tGuid.ToString.ToUpper & "}", " ", "%20")


Mon Mar 17, 2008 2:13 pm
Profile

Joined: Wed Jan 21, 2009 5:37 am
Posts: 2
Post GUID to OId
Hi friends,

I am using Mindmanager 8. I am creating an xml version for the mmap file by using MindmanagerDocument.xml.

MindManager.Application mmApp = new MindManager.Application();
mmApp.Visible = false;
MindManager.Document mmDocument = mmApp.AllDocuments.Open(@"E:\Departments.mmap", "", true);
string docXml = mmDocument.Xml;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(docXml);
xmlDoc.Save(@"E:\DocMap.xml");

Now I want to add a new Topic node to this DocMap.Xml.I am serializing the MindManager.Topic through Xml Serialization. For this I need to specify the attributes OId,Dirty,Gen and all the attributes. I am not sure on How to generate OID from Guid,Dirty,Gen?

Please help.

R.Saranya.


Wed Jan 21, 2009 5:50 am
Profile
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.