The Mindjet Labs

Hands-on MindManager
Welcome to The Mindjet Labs Sign in | Join | Help
in Search

The Organizational Irritant

The File Explorer Map Part - Just Deep Enough

The other day, a co-worker sent me a mail like this:

Hey Beavis:
How come that All Files and Folders map part you showed me only goes two folders deeper than the starting folder?"

The story behind this mail is recounted in a previous post in this blog.  The story behind why this coworker calls me "Beavis" is one I can't recall at the moment, if I ever knew. 

In the "The File Explorer Map Part - How Deep is Deep?" blog post, I made a general (and somewhat lame) request for a modified File Explorer Map Part that would allow the user to set the recursion depth, and hence the depth of the file/folder topic sub-tree rooted in the map part.

Well, like a scab or blister or some other blemish, I couldn't leave the problem alone.

In my installation of MindManager Pro 6 (6.2.399, service pack 2) the macro script that animates the File Explorer Map Part variants is located at  <ProgramFiles>\Mindjet\MindManager 6\Generic Smart Map Part\File Explorer\ENU\scripts\Refresh.mmbas
where <ProgramFiles> is the usual "C:\Program Files" folder. The File Explorer map parts are actually variations on one Generic Smart Map Part (GSMP) implementation. 

By way of background, the Generic Smart Map Part is a MindManager add-in that will use the Windows Registry and MindManager Map Part information to locate macro scripts, making calls into those scripts at specific points in the lifecycle of a Map Part instance.  Each set of scripts is associated with a specific Map Part.

The lifecycle points involving GSMP macro scripts are fairly straightforward. One point is the first insertion of the map part, another is upon refresh of the map part, and still another is associated with Topic context menu commands associated with instances of the map part in the map document.  By default, the File Explorer Map Part adds a "Convert to Regular" context menu command that turns the map part and its children into normal Map document Topics.

It turns out that the MindManager macro language can support user dialogs with a basic set of dialog controls: static text, checkboxes, edit boxes, drop-down lists, combo boxes,and the like.  There's even a handy User Dialog editor in the macro development editor under the Edit->User Dialog menu command.  The macro language help topics "Begin Dialog Definition" and "DialogFunc Prototype" provide some bare bones information on using this MindManager macro language feature.

I was mildly disappointed after reading the distribution copy of Refresh.mmbas animating the File Explorer map part. The Description.mmbas script used a localizable string  from the Language.mmbas module, but a number of English Language string constants still appeared in Refresh.mmbas. In addition, the recursion depth of the folders was controlled by literal constants.  Further, there are several unmet error cases (try a hyperlink pointing at www.mindjet.com, for example) and some tortured logic trying to decide if the hyperlink held by the parent topic of the File Explorer map part is referencing a file, a folder or something else.

I reined in my editorial shrew and resisted the impulse to completely rewrite Refresh.mmbas.  Rather, I modified it in the following ways:

  • added a custom attribute to carry folder depth
  • added a Topic map part context menu item to get folder depth from user (set every time the refresh routine runs)
  • set the Description and Convert to Regular Topic map part context menu items to reference the right scripts
  • added a MsgBox call in the QuitOnException exit point
  • added "No Hyperlink" and "Hyperlink does not point into file system" tests and error messages
  • used the language.mmbas module to carry all the constants used in error messages, user prompts and topic attribute identification
  • added logic and error messages to detect some missing or invalid parent Topic Hyperlink cases

All this involved writing a new script called FolderDepth.mmbas to carry the user dialog to set the folder depth. This script includes a test to validate the user-supplied folder depth against maximum and minimum values. Since there is apparently no convenient way to force the user entry to consist of digits only, this test has to accommodate arbitrary non-numeric characters.

So now I can set a folder depth to control the recursion that builds the child topics beneath a File Explorer Map part.  If you want this code, see the Modified File Explorer Map Part download, and follow the installation directions.  However, use it at your own risk.  I'd like to hear your reactions, good or bad, but I can't promise to fix every possible problem.  See the readme.txt file in the download for a description of installation, use and returning to the original File Explorer Map Part functionality.

 

Published Saturday, April 14, 2007 11:10 PM by dethomas
Filed under: , ,

Comments

 

Michael Deutch said:

Hey, this is great information. I can't wait to test it out for one of my project maps.

April 22, 2007 10:30 AM
 

The Organizational Irritant said:

There is no painless way to start this post, so I&#39;ll just leap in and thrash about. This blog has

October 6, 2007 9:53 PM
Anonymous comments are disabled

About dethomas

So who is this dethomas guy anyway? Here's a capsule bullet point summary:
  • Midwestern white boy, ex-busboy, stock-clerk, grinder, welder and English major, now laboring lo these many years in the fields of awkward stone that characterize software development.
  • 20+ years of software development experience - CPM/Apple/Unix/DOS during the Reagan years, embedded systems before the term was common, Windows development since the first Clinton administration.
  • Mechanical engineering undergrad degree, showing that early success in thermodynamics is not necessarily a good thing. But the Apollo workstations running UNIX were cool.
  • Engineering master's degree with a control systems emphasis, demonstrating that publishing in IEEE Transactions is cool, but not necessarily a good thing.
  • Employed by an industrial electronics company as a principal engineer. Distinguished by several innovation awards, several software patents, and for once having used the word "Byzantine" in a requirements specification.
  • Learned FORTRAN on punch cards, learned Pascal, BASIC and APL to do numerical analysis in several fields of engineering, learned assembly, C, C++ and Java to write software for several embedded systems, custom applications and shrink-wrapped software products.
  • Has considerable exposure to a variety of technologies, including networking, databases, graphics libraries, linear programming, compilers, non-linear control systems, real-time operating systems, fuzzy logic, neural networks, UML, .Net, XML, OPC, WSI, WSDL and WWF. (On that last one, WWF, dethomas is convinced he did time in high school with a guy who went on to success in the Mexican pro wrestling circuit under the name "el Queso Grande.")
  • Wide exposure to Microsoft Windows products and operating system editions as both user and developer, relative indifference to web technology and the dot com boom until the dust settled.
  • Has a cable modem, but no cable TV service. Which is a philosophical statement of sorts. Television is bad for you, the Internet is not. Or at least not yet.