cancel
Showing results for 
Search instead for 
Did you mean: 

trouble getting freemind maps to render in share

ddvorak
Champ in-the-making
Champ in-the-making
We are testing the Community 3.4.a upgrade. We have it installed on a ubuntu server. Freemind maps do not throw errors, but come up totally blank. If I download the file and open it in Freemind it opens and displays correctly on my desktop. I have a feeling maybe don't have something installed correctly or need to install something else. We set up the instance of Alfresco using the linux bundle with tomcat, jdk, openoffice, imageMagick and swftools. I copied the following files from the working 3.3 installation:
/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/site/site.get.js
–>/opt/alfresco-3.4.a/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/site/site.get.js
/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/site/site.get.desc.xml
–>/opt/alfresco-3.4.a/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/site/site.get.desc.xml
/var/lib/tomcat6/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/custom-dashlets (entire directory)
–>/opt/alfresco-3.4.a/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/custom-dashlets
/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/ (entire directory)
–>/opt/alfresco-3.4.a/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/
/var/lib/tomcat6/webapps/share/modules/documentlibrary/visor3.swf
–>/opt/alfresco-3.4.a/tomcat/webapps/share/modules/documentlibrary/visor3.swf

Any help would be greatly appreciated.
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
What do you mean "it doesn't show up"..? What exactly are you trying to achieve?

Thanks,
Mike

ddvorak
Champ in-the-making
Champ in-the-making
This is what it should look like:
[img]http://www.freeimagehosting.net/uploads/fb6df22ae3.jpg[/img]

This is what it looks like now:
[img]http://www.freeimagehosting.net/uploads/59e5a851b0.jpg[/img]

mikeh
Star Contributor
Star Contributor
You're going to have to post some code if you want help.

Also check you can download the .swf from the Repository or whatever is populating that page.

Thanks,
Mike

ddvorak
Champ in-the-making
Champ in-the-making
I can download the file from the repository and open it to my desktop with freemind with no problems. I apologize in advance for the length of the code. Basically what it does is create a set of freemind maps  (auto_main.mm, auto_main_sitecollaborator.mm, auto_main_siteconsumer.mm, auto_main_sitecontributor.mm) from the folder structure in the repository. I am also having issues getting the site.get.js to automatically generate the map when a manager opens the site and there is not already a map in the MM folder (will have to solve that as well, but making the maps show to begin with is more important at this point). Here is the code for site.get.js:

function sortByWeightedFolderNameAsc (doc1, doc2) {
    var i=0, j=0;
    var doc1Type = doc1.type.toString().substr(-6,6);
    var doc2Type = doc2.type.toString().substr(-6,6);
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    var doc1Properties = getProperties(doc1);
    var doc1Weight = doc1Properties["weight"];
    var doc2Properties = getProperties(doc2);
    var doc2Weight = doc2Properties["weight"];
    if ( doc1Type == "folder" && doc2Type != "folder" ) {
        return -1;
    } else if ( doc1Type != "folder" && doc2Type == "folder" ) {   
        return 1;
    } else {   
        if ( doc1Weight < doc2Weight ) {
            return -1;
        } else if ( doc1Weight > doc2Weight ) {   
            return 1;
        } else {
            if ( doc1Prop < doc2Prop ) {
                return -1;
            } else if ( doc1Prop > doc2Prop ) {   
                return 1;
            } else {
                return 0;
            }
        }
    }
}   
   
function sortByWeightedFolderNameDesc (doc1, doc2) {
    var doc1Type = "";
    var doc2Type = "";
    if ( doc1.type.toString().length > 6 )
        doc1Type = doc1.type.toString().substr(-6,6);
    if ( doc2.type.toString().length > 6 )
        doc2Type = doc2.type.toString().substr(-6,6);
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    if ( doc1Type != 'folder' && doc2Type == 'folder' ) {
        return -1;
    } else if ( doc1Type == 'folder' && doc2Type != 'folder' ) {   
        return 1;
    } else {   
        if ( doc1Weight > doc2Weight ) {
            return -1;
        } else if ( doc1Weight < doc2Weight ) {   
            return 1;
        } else {
            if ( doc1Prop > doc2Prop ) {
                return -1;
            } else if ( doc1Prop < doc2Prop ) {   
                return 1;
            } else {
                return 0;
            }
        }   
    }
}   
   
function sortByFolderNameAsc (doc1, doc2) {
    var doc1Type = "";
    var doc2Type = "";
    doc1Type = doc1.type.toString().substr(-6,6);
    doc2Type = doc2.type.toString().substr(-6,6);
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    if ( doc1Type == "folder" && doc2Type != "folder" ) {
        return -1;
    } else if ( doc1Type != "folder" && doc2Type == "folder" ) {   
        return 1;
    } else {   
        if ( doc1Prop < doc2Prop ) {
            return -1;
        } else if ( doc1Prop > doc2Prop ) {   
            return 1;
        } else {
            return 0;
        }
    }
}   
   
function sortByFolderNameDesc (doc1, doc2) {
    var doc1Type = "";
    var doc2Type = "";
    doc1Type = doc1.type.toString().substr(-6,6);
    doc2Type = doc2.type.toString().substr(-6,6);
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    if ( doc1Type != 'folder' && doc2Type == 'folder' ) {
        return -1;
    } else if ( doc1Type == 'folder' && doc2Type != 'folder' ) {   
        return 1;
    } else {   
        if ( doc1Prop > doc2Prop ) {
            return -1;
        } else if ( doc1Prop < doc2Prop ) {   
            return 1;
        } else {
            return 0;
        }
    }
}   

function sortByNameAsc (doc1, doc2) {
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    if ( doc1Prop < doc2Prop ) {
        return -1;
    } else if ( doc1Prop > doc2Prop ) {   
        return 1;
    } else {
        return 0;
    }
}   
   
function sortByNameDesc (doc1, doc2) {
    var doc1Prop = doc1.properties["name"];
    var doc2Prop = doc2.properties["name"];
    if ( doc1Prop > doc2Prop ) {
        return -1;
    } else if ( doc1Prop < doc2Prop ) {   
        return 1;
    } else {
        return 0;
    }
}   

function getProperties (doc) {
    var mapProperties = new Array();
    var mapProperty = new Array();   // temp var for mapProperties
    for (var k = 0; k < doc.tags.length; k++) {
        mapProperty = doc.tags[k].split("=");
        mapProperties[mapProperty[0].toLowerCase()] = mapProperty[1];
    }
    return mapProperties;
}   

    var iconNames = [
                     'ksmiletris', 'smily_bad', 'gohome', 'help', 'pencil', 'bell', 'penguin', 'idea', 'licq', 'password', 'korn', 'desktop_new', 'xmag', 'clanbomber', 'flag', 'knotify',
                     'inner_link', 'mm_link2', 'back', 'Mail', 'Note', 'Atrs', 'kaddressbook', 'forward', 'attach', 'mm_link', 'stop', 'messagebox_warning', 'bookmark', 'wizard', 'button_ok', 'button_cancel',
                     'full_1', 'full_2', 'full_3', 'full_4', 'full_5', 'full_6', 'full_7'
                     ];
    var iconTagNames = [
                        "iamhappy", "iamnotamused", "home", "question", "toberefined", "bell", "linux", "idea", "nice", "key", "mailbox", "donotforget", "tobediscussed", "dangerous", "redflag", "music",
                        "innerlink", "mmlink2", "back", "mail", "note", "list", "phone", "forward", "attach", "mmlink", "stop", "important", "excellent", 'magic', "ok", "notok",
                        "priority1", "priority2", "priority3", "priority4", "priority5", "priority6", "priority7"
                        ];
    var iconTitle = new Array();
    for (var i=0; i < iconTagNames.length; i++) {
        iconTitle[ iconTagNames[i] ] = iconNames[ i ];
    }       
    var siteRoles = [ 'sitemanager', 'sitecollaborator', 'sitecontributor', 'siteconsumer' ];   
   
function processNode (folderPath, parentProperties, roleNumber) {
    var folder = companyhome.childByNamePath(folderPath);
    var docs = folder.children.sort(sortByWeightedFolderNameAsc);
    var name = "";
    var childName = "";
    var contentType = "";
    var typeLength = "";
    var nodeRefNum = "";
    var arrayNodeRefNum;
    var sp = "  ";
    var sp2 = sp + sp;
    var sp3 = sp + sp2;
    var sp4 = sp2 + sp2;
    var line = "\r\n";
    var line2 = line + line;
    var sharp_linear_4 = "<edge STYLE='sharp_linear' WIDTH='4' />";
    var font1 = "<font BOLD='true' NAME='Clarendon' SIZE='18'/>";
    var i=0, j=0, k=0;
    var result = "";
    var numChildren = 0;
    var numFile = 0;
    var indFile = 0;
    var childFolder = "";
    var prePath = "/share/proxy/alfresco/api/node/content/";
    var mapProperties = new Array();
   
    for (i = 0; i < docs.length; i++) {
        name = docs[i].properties["name"];
        contentType = docs[i].type;
        mapProperties = getProperties (docs[i]);
        for ( var propName1 in parentProperties ) {
            if ( mapProperties[propName1] == null || mapProperties[propName1].length == 0 ) {
                mapProperties[propName1] = parentProperties[propName1];
            }
        }           
        var accessNumber = ( mapProperties["access"] ) ? siteRoles.indexOf(String(mapProperties["access"]).toLowerCase()) : 100;
        var edgeline = "<edge COLOR='";
        edgeline += ( mapProperties["edge_color"] ) ?  mapProperties["edge_color"] : "#808080";
        edgeline += "' STYLE='";
        edgeline += ( mapProperties["edge_style"] ) ?  mapProperties["edge_style"] : "sharp_linear";
        edgeline += "' WIDTH='";
        edgeline += ( mapProperties["edge_width"] ) ?  mapProperties["edge_width"] : "2";
        edgeline += "' />";
        sharp_linear_4 = edgeline;
        var fontProp = "<font BOLD='";
        fontProp += ( mapProperties["font_bold"] ) ?  mapProperties["font_bold"] : "false";
        fontProp += "' ITALIC='";
        fontProp += ( mapProperties["font_italic"] ) ?  mapProperties["font_italic"] : "false";
        fontProp += "' NAME='";
        fontProp += ( mapProperties["font_name"] ) ?  mapProperties["font_name"] : "Clarendon";
        fontProp += "' SIZE='";
        fontProp += ( mapProperties["font_size"] ) ?  mapProperties["font_size"] : "18";
        fontProp += "' COLOR='";
        fontProp += ( mapProperties["font_color"] ) ?  mapProperties["font_color"] : "#000000";
        fontProp += "' />";
        font1 = fontProp;
        var iconProp = ( mapProperties["icon"] ) ?  iconTitle[ mapProperties["icon"] ] : "";
        if ( (mapProperties["exclude"] == null || mapProperties["exclude"] != 'true') &&
             (name.length != 36 || name.split("-").length != 5) &&
             (accessNumber > roleNumber || accessNumber == roleNumber) ) {
               
            if ( contentType.toString().substr(-6,6)=="folder" ) {
                if ( name != "MM" ) {
                    childFolder = companyhome.childByNamePath( folderPath + "/" + name );
                    numChildren = childFolder.children.length;
                    if ( numChildren > 1 ) {
                        numFile = 0;
                        for (j = 0; j < numChildren; j++) {
                            if ( childFolder.children[j].type.toString().substr(-6,6) != "folder" ) {
                                indFile = j;
                                numFile++;
                            }   
                        }   
                        if ( numFile == 1 && childFolder.children[0].properties["name"] != "Thumbs.db" ) {
                            childName = childFolder.children[0].properties["name"];
                            nodeRefNum = childFolder.children[indFile].nodeRef;
                           
                            if ( childName.toString().substr(-3,3)==".mm" ) {
                                arrayNodeRefNum = nodeRefNum.toString().split("/");
                                if ( arrayNodeRefNum.length > 1 ) {
                                    nodeRefNum = arrayNodeRefNum[arrayNodeRefNum.length-1];
                                }
                                nodeRefNum = "../" + nodeRefNum + "/" + childName;
                            } else {   
                                nodeRefNum = nodeRefNum.toString().replace(":/", "");
                                nodeRefNum = prePath + nodeRefNum + "/" + childName;
                            }   
                           
                            result += sp2 + sharp_linear_4 + line + sp2 + "<node BACKGROUND_COLOR='";
                            result += ( mapProperties["background_color"] ) ?  mapProperties["background_color"] : "#33ff66";
                            result += "' COLOR='";
                            result += ( mapProperties["color"] ) ?  mapProperties["color"] : "#000000";
                            result += "' LINK=_dq_" + nodeRefNum + "_dq_ TEXT=_dq_" + name;
                            result += "_dq_ STYLE='";
                            result += ( mapProperties["style"] ) ?  mapProperties["style"] : "bubble";
                            result += "' FOLDED='";
                            result += ( mapProperties["folded"] ) ?  mapProperties["folded"] : "true";
                            result += "' POSITION='";
                            result += ( mapProperties["position"] ) ?  mapProperties["position"] : "right";
                            result += "' HGAP='";
                            result += ( mapProperties["hgap"] ) ?  mapProperties["hgap"] : "50";
                            result += "' VGAP='";
                            result += ( mapProperties["vgap"] ) ?  mapProperties["vgap"] : "116";
                            result += "' VSHIFT='";
                            result += ( mapProperties["vshift"] ) ?  mapProperties["vshift"] : "0";
                            result += "' >" + line;
                            if ( iconProp != "" ) {
                                result += sp2 + "<icon BUILTIN='" + iconProp + "'/>" + line;
                            }   
                            result += sp2 + font1 + line;
                            result += processNode( folderPath + "/" + name, mapProperties, roleNumber );
                            if ( docs[i].properties.description ) {
                                result += sp2 + "<richcontent TYPE='NOTE'><html><head/><body><p align='left'>" + docs[i].properties.description + "</p></body></html></richcontent>" + line;
                            }
                            result += sp2 + "</node>" + line;
                        } else {               
                            result += sp2 + sharp_linear_4 + line + sp2 + "<node BACKGROUND_COLOR='";
                            result += ( mapProperties["background_color"] ) ?  mapProperties["background_color"] : "#33ff66";
                            result += "' COLOR='";
                            result += ( mapProperties["color"] ) ?  mapProperties["color"] : "#000000";
                            result += "' TEXT=_dq_" + name;
                            result += "_dq_ STYLE='";
                            result += ( mapProperties["style"] ) ?  mapProperties["style"] : "bubble";
                            result += "' FOLDED='";
                            result += ( mapProperties["folded"] ) ?  mapProperties["folded"] : "true";
                            result += "' POSITION='";
                            result += ( mapProperties["position"] ) ?  mapProperties["position"] : "right";
                            result += "' HGAP='";
                            result += ( mapProperties["hgap"] ) ?  mapProperties["hgap"] : "50";
                            result += "' VGAP='";
                            result += ( mapProperties["vgap"] ) ?  mapProperties["vgap"] : "116";
                            result += "' VSHIFT='";
                            result += ( mapProperties["vshift"] ) ?  mapProperties["vshift"] : "0";
                            result += "' >" + line;
                            if ( iconProp != "" ) {
                                result += sp2 + "<icon BUILTIN='" + iconProp + "'/>" + line;
                            }   
                            result += sp2 + font1 + line;
                            result += processNode( folderPath + "/" + name, mapProperties, roleNumber );
                            if ( docs[i].properties.description ) {
                                result += sp2 + "<richcontent TYPE='NOTE'><html><head/><body><p align='left'>" + docs[i].properties.description + "</p></body></html></richcontent>" + line;
                            }
                            result += sp2 + "</node>" + line;
                        }   
                    } else if ( numChildren > 0  && childFolder.children[0].type.toString().substr(-6,6) != "folder" ) {
                        childName = childFolder.children[0].properties["name"];
                        nodeRefNum = childFolder.children[0].nodeRef;

                        if ( childName.toString().substr(-3,3)==".mm" ) {
                            arrayNodeRefNum = nodeRefNum.toString().split("/");
                            if ( arrayNodeRefNum.length > 1 ) {
                                nodeRefNum = arrayNodeRefNum[arrayNodeRefNum.length-1];
                            }
                            nodeRefNum = "../" + nodeRefNum + "/" + childName;
                        } else {   
                            nodeRefNum = nodeRefNum.toString().replace(":/", "");
                            nodeRefNum = prePath + nodeRefNum + "/" + childName;
                        }   
                       
                        result += sp2 + sharp_linear_4 + line + sp2 + "<node BACKGROUND_COLOR='";
                        result += ( mapProperties["background_color"] ) ?  mapProperties["background_color"] : "#33ff66";
                        result += "' COLOR='";
                        result += ( mapProperties["color"] ) ?  mapProperties["color"] : "#000000";
                        result += "' LINK=_dq_" + nodeRefNum + "_dq_ TEXT=_dq_" + name;
                        result += "_dq_ STYLE='";
                        result += ( mapProperties["style"] ) ?  mapProperties["style"] : "bubble";
                        result += "' FOLDED='";
                        result += ( mapProperties["folded"] ) ?  mapProperties["folded"] : "true";
                        result += "' POSITION='";
                        result += ( mapProperties["position"] ) ?  mapProperties["position"] : "right";
                        result += "' HGAP='";
                        result += ( mapProperties["hgap"] ) ?  mapProperties["hgap"] : "50";
                        result += "' VGAP='";
                        result += ( mapProperties["vgap"] ) ?  mapProperties["vgap"] : "116";
                        result += "' VSHIFT='";
                        result += ( mapProperties["vshift"] ) ?  mapProperties["vshift"] : "0";
                        result += "' >" + line;
                            if ( iconProp != "" ) {
                                result += sp2 + "<icon BUILTIN='" + iconProp + "'/>" + line;
                            }   
                        result += sp2 + font1 + line;
                        result += processNode( folderPath + "/" + name, mapProperties, roleNumber );
                        if ( docs[i].properties.description ) {
                            result += sp2 + "<richcontent TYPE='NOTE'><html><head/><body><p align='left'>" + docs[i].properties.description + "</p></body></html></richcontent>" + line;
                        }   
                        result += sp2 + "</node>" + line;
                    } else {
                        result += sp2 + sharp_linear_4 + line + sp2 + "<node BACKGROUND_COLOR='";
                        result += ( mapProperties["background_color"] ) ?  mapProperties["background_color"] : "#33ff66";
                        result += "' COLOR='";
                        result += ( mapProperties["color"] ) ?  mapProperties["color"] : "#000000";
                        result += "' TEXT=_dq_" + name;
                        result += "_dq_ STYLE='";
                        result += ( mapProperties["style"] ) ?  mapProperties["style"] : "bubble";
                        result += "' FOLDED='";
                        result += ( mapProperties["folded"] ) ?  mapProperties["folded"] : "true";
                        result += "' POSITION='";
                        result += ( mapProperties["position"] ) ?  mapProperties["position"] : "right";
                        result += "' HGAP='";
                        result += ( mapProperties["hgap"] ) ?  mapProperties["hgap"] : "50";
                        result += "' VGAP='";
                        result += ( mapProperties["vgap"] ) ?  mapProperties["vgap"] : "116";
                        result += "' VSHIFT='";
                        result += ( mapProperties["vshift"] ) ?  mapProperties["vshift"] : "0";
                        result += "' >" + line;
                        if ( iconProp != "" ) {
                            result += sp2 + "<icon BUILTIN='" + iconProp + "'/>" + line;
                        }   
                        result += sp2 + font1 + line;
                        result += processNode( folderPath + "/" + name, mapProperties, roleNumber );
                        if ( docs[i].properties.description ) {
                            result += sp2 + "<richcontent TYPE='NOTE'><html><head/><body><p align='left'>" + docs[i].properties.description + "</p></body></html></richcontent>" + line;
                        }   
                        result += sp2 + "</node>" + line;
                    }   
                }               
            } else if ( name != "Thumbs.db" ) {
                nodeRefNum = docs[i].nodeRef;
                if ( name.toString().substr(-3,3)==".mm" ) {
                    arrayNodeRefNum = nodeRefNum.toString().split("/");
                    if ( arrayNodeRefNum.length > 3 ) {
                        nodeRefNum = arrayNodeRefNum[3];
                    }
                    nodeRefNum = "../" + nodeRefNum + "/" + name;
                } else {   
                    nodeRefNum = nodeRefNum.toString().replace(":/", "");
                    nodeRefNum = "/share/proxy/alfresco/api/node/content/" + nodeRefNum + "/" + name;
                }
                result += sp2 + sharp_linear_4 + line + sp2 + "<node BACKGROUND_COLOR='";               
                result += ( mapProperties["background_color"] ) ?  mapProperties["background_color"] : "#33ff66";
                result += "' COLOR='";
                result += ( mapProperties["color"] ) ?  mapProperties["color"] : "#000000";
                result += "' LINK=_dq_" + nodeRefNum + "_dq_ TEXT=_dq_";
                result += ( mapProperties["text"] ) ?  mapProperties["text"] : name;
                result += "_dq_ STYLE='";
                result += ( mapProperties["style"] ) ?  mapProperties["style"] : "bubble";
                result += "' POSITION='";
                result += ( mapProperties["position"] ) ?  mapProperties["position"] : "right";
                result += "' HGAP='";
                result += ( mapProperties["hgap"] ) ?  mapProperties["hgap"] : "50";
                result += "' VGAP='";
                result += ( mapProperties["vgap"] ) ?  mapProperties["vgap"] : "15";
                result += "' VSHIFT='";
                result += ( mapProperties["vshift"] ) ?  mapProperties["vshift"] : "0";
                result += "' >" + line;
                if ( iconProp != null && iconProp != "" ) {
                    result += sp2 + "<icon BUILTIN='" + iconProp + "'/>" + line;
                }   
                if ( docs[i].properties.description ) {
                    result += sp2 + "<richcontent TYPE='NOTE'><html><head/><body><p align='left'>" + docs[i].properties.description + "</p></body></html></richcontent>" + line;
                }   
                result += sp4 + sharp_linear_4 + line + sp2 + font1 + line + sp3 + "</node>" + line;
            }  // eof else       

        }  // eof if exclude == 'true'       
    }  // eof for i
   
    return result;
}   

function main()
{
    // Get the shortname
    var shortName = url.extension;
   
    // Get the site
    var site = siteService.getSite(shortName);
   
    if (site != null)
    {
        // Pass the site to the template
        model.site = site;
    }
    else
    {
        // Return 404
        status.setCode(404, "Site " + shortName + " does not exist");
        return;
    }
    var role = site.getMembersRole(person.properties.userName).toLowerCase();
    var roleNumber = siteRoles.indexOf(String(role));
    if ( roleNumber > 0 )
        return;
   
    var folderPath = "Sites/" + shortName + "/documentLibrary";
    var MM = companyhome.childByNamePath(folderPath + "/MM");
    var mmProperties = new Array();
    mmProperties = getProperties( MM );
    var mmFontSize = ( mmProperties["font_size"] ) ?  mmProperties["font_size"] : "24";
    var mmBackgroundColor = ( mmProperties["background_color"] ) ?  mmProperties["background_color"] : "#FFFFFF";
   
    for (var ind = 0; ind < 4; ind++) {
        if (ind == 0) {
            var sitemap5 = companyhome.childByNamePath("Sites/" + shortName + "/documentLibrary/MM/auto_main.mm");
        } else {
            var sitemap5 = companyhome.childByNamePath("Sites/" + shortName + "/documentLibrary/MM/auto_main_" + siteRoles[ind] + ".mm");
        }
        var result="";
        var parentProperties = new Array();  // inherited mapProperties
        if (sitemap5 == null) {
            if (ind == 0) {
                var sitemap5 = MM.createFile("auto_main.mm");
            } else {
                var sitemap5 = MM.createFile("auto_main_" + siteRoles[ind] + ".mm");
            }
            result = "<map>\r\n  <node TEXT=_dq_        " + site.title + "        _dq_ BACKGROUND_COLOR='" + mmBackgroundColor + "' STYLE='bubble' VGAP='25'>\r\n";
            result += "<edge COLOR='#808080' STYLE='sharp_linear' WIDTH='4'/>";
            result += "<font BOLD='true' NAME='Century Schoolbook' SIZE='" + mmFontSize + "'/>";
       
            result +=  processNode (folderPath, parentProperties, ind);
            result += "  </node>\r\n</map>";
            result = result.replace(/&/g,'&amp;');
            sitemap5.content = result.replace(/_dq_/g,'\"');
        } else if ( mmProperties["auto"] && mmProperties["auto"] == "true" ) {       
            result = "<map>\r\n  <node TEXT=_dq_        " + site.title + "        _dq_ BACKGROUND_COLOR='" + mmBackgroundColor + "' STYLE='bubble' VGAP='25'>\r\n";
            result += "<edge COLOR='#808080' STYLE='sharp_linear' WIDTH='4'/>";
            result += "<font BOLD='true' NAME='Century Schoolbook' SIZE='" + mmFontSize + "'/>";
       
            result +=  processNode (folderPath, parentProperties, ind);
            result += "  </node>\r\n</map>";
            result = result.replace(/&/g,'&amp;');
            sitemap5.content = result.replace(/_dq_/g,'\"');
        }   
        sitemap5.properties.content.encoding = "UTF-8";
        sitemap5.properties.content.mimetype = "text/plain";
        sitemap5.properties.title = "freemindmap";
        sitemap5.properties.description = "Automatic Map File";
        sitemap5.save();
    }
    return;
}

main();   

stevegreenbaum
Champ in-the-making
Champ in-the-making
If you are trying to have a Freemind map appear in the document preview screen in Share, one of the OOTB transformers would need to create a swf from the MM file format.  I'm not familiar with Freemind, but I don't recall there being a utility to convert it on the fly in Share.