Home - Key Concepts

Model Summary Window Template (MSWT)

NOTE: The information in this section will be most useful to advanced MindModel users.

What is a Model Summary Window Template?

A Model Summary Window Template (MSWT) is a template that specifies the appearance and content of a report that will be displayed in the Model Summary Window.

For more information on the Model Summary Window, refer to the section: MindModel Windows: Model Summary Window.

By "appearance" we mean the font, font size, color, page layout, etc. of the report.

By "content" we mean the information (words and numbers) that appear in the report.

When would I use the Model Summary Window?

You would use the Model Summary Window (MSW) when you need to create a report that brings together information from different parts of your model.

For example, if you wanted to create a report that showed all the departments in your company, all the employees that work for each department, and some specific information about each employee, you would use the MSW.

If instead you wanted to create a report that showed information about one department or one employee, you would use the Noun Summary Window.  For more information on the Noun Summary Window, refer to the section: MindModel Windows: Noun Summary Window.

 

An Example

Let's take a look at an example of a Model Summary Window Template (MSWT).

We'll begin by taking a look at the report defined by the MSWT.

The report, which is displayed in the Model Summary Window, looks like this:

How to Open the Model Summary Window (MSW)

This report is based on a sample model called "AcmeTech.min".  This sample model contains information on a fictional company called "AcmeTech".

To open the sample model, use the "File Menu: Open Model" command.

The AcmeTech.min sample model is located at: C:\Program Files\MindModel\Sample Models.

Once you have opened the sample model, choose "Model Summary Window" from MindModel's View Menu.  MindModel will open the Model Summary Window.

To display the report, you may have to choose "AcmeTech Departments Report" from the drop-down menu in the upper left-hand corner of the window.  Click the small black triangle to open the drop-down menu.

Now that you've opened the report, you may want to use the Print button to print the report.  This way, you can refer to it while we work through the template.

Software Requirements

The Model Summary Window requires that MSXML software be installed on your computer.  If MSXML is not installed on your computer, you will see a dialog that looks something like this when you try to open the Model Summary Window:

If you don't see this dialog when you try to open the MSW, you're all set.  Skip to the next part of this section and keep reading.

If you do see this dialog, you can click "OK" to have MindModel point a browser window to a web page on Microsoft's web site that will allow you to install the MSXML software.  There is no charge for this software.

If you want to know more about MSXML, refer to the section: Key Concepts: MSXML.

 

The Structure of a Model Summary Window Template (MSWT)

Before we look at the template itself, let's step back for a moment and consider the structure of a MSWT.

A MSWT has two goals:

1) Goal #1: To specify what information should appear on the report.

2) Goal #2: To specify the appearance of the report.

 

Goal #1

To achieve Goal #1 (information), MSWT's use XML Templates.

For information on XML Templates, refer to the section: Key Concepts: XML Template.

XML Templates allow you to specify exactly which information from your model you want to appear in your report.

 

Goal #2

To achieve Goal #2 (appearance), MSWT's use HTML.

As you may already know, HTML is a page description language originally designed for creating web pages.

HTML is a world-wide standard, so there are many tools and tutorials at your disposal which can help you create HTML pages.  A quick trip to a search engine (such as http://www.google.com) will turn up numerous links to free HTML tutorials and free or inexpensive HTML editors (software for creating HTML pages).

You can use any HTML editor you like to create HTML pages to use as Model Summary Window Templates.

This documentation will not attempt to teach you HTML.  Before reading further in this section, please become familiar with HTML, including the use of basic style sheets (CSS).

 

So how do I put it all together?

So we've learned that Model Summary Window Templates (MSWT's) use XML Templates to specify what information will go into the report, and HTML to specify what the report will look like.

How do you put it all together?  Let's look at an example.

Since the example we're going to look at is fairly long, we won't re-print it here.  To get a printout of the entire example MSWT, follow these steps:

1) Open the Model Summary Window and load the "AcmeTech Departments Report" as explained in the preceding sections.

2) Click the "Export Template" button at the top of the Model Summary Window.

MindModel will open a dialog which will allow you to save the MSWT as an HTML file.

Name the MSWT "AcmeTech Template" and save it on your Desktop.

NOTE: Do not use the "Save As" button to save the template.  The "Save As" button is used to save the completed report.  The "Export Template" button is used to save the MSWT.

3) In Windows Explorer, double-click the "AcmeTech Template" file you saved on your Desktop in step #2.  Your web browser (Internet Explorer, Netscape, etc.) will open the template file.

4) In Internet Explorer, choose "Source" from the View menu to view the source for the template.  If you're using another browser, use that browser's command to view source.

The browser will open a text file containing the source of the template.

5) Print the source file.

 

Step-by-step Through the Template

Let's go step-by-step through the template you just printed.

Starting from the top of the file, ignore everything from:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

to right before:

<HEAD>

All this stuff at the top of the file is necessary, but we don't need to look at it in detail.  Just add it to your templates, at the top of the file, before your <HEAD> element.  This pre-<HEAD> stuff will be the same for every template.

 

The <HEAD> Element

The <HEAD> Element in the template (everything between "<HEAD>" and "</HEAD>", inclusive) contains three elements:

1) <TITLE>

2) <STYLE>

3) <META>

 

1) The <TITLE> Element

The <TITLE> element is used to identify the MSWT to MindModel.  Each MSWT must contain a <TITLE> element.

The contents of the <TITLE> element, in this case "AcmeTech Departments Report", is the name that the Model Summary Window will use to identify the MSWT to you.

For example, this is the name that you will see in MSW drop-down menu:

Each MSWT must contain an unique <TITLE> element.  So if you create two different MSWT's, give them each a different name using the <TITLE> element.

 

2) The <STYLE> Element

The <STYLE> element is important.

The <STYLE> element contains the definitions of the CSS styles you will use in your report.

The <STYLE> element in our sample MSWT contains five style definitions: .reportTitle, .deptName, .personName, .skills and .software.

When you create your MSWT, you decide how many styles you wish to include in the report.  We've decided to include five styles, so we created five style definitions.

By creating these five style definitions, we've given ourselves the ability to set the font, size, color, etc. of those five types of information in the report.

If we finish the report and decide we want to make the report title larger, we just change the .reportTitle style definition.  The same goes for the other four style definitions.

Many HTML editors contain powerful tools for editing style definitions.  Once you've created a basic MSWT and used the "Save As" button to save the report, you can open the report in your HTML editor and manipulate the styles.  Once you've figured out how you'd like the report to look, you can copy the style definitions from the report back to the MSWT and run the report again.

 

3) The <META> Element

Don't worry about the contents or meaning of the <META> element.

Just include this element:

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

after the <STYLE> element in your MSWT's.

 

The <BODY> Element

So far we've seen how the <TITLE> element identifies the MSWT and the <STYLE> element defines the styles that will be used in the report.

The <BODY> element contains the report itself.

The <BODY> element in a MSWT contains two types of information:

1) HTML

2) <xml> elements

 

HTML in the <BODY> Element

The <BODY> element in your MSWT can contain as much HTML as you want.

This simply means that you can include as much explanatory text, headings, or any other content you'd like to see in your report in the <BODY> element.

For example, the first element in the <BODY> element in our sample report is:

<P class=reportTitle>AcmeTech Departments Report</P>

This element tells the browser to display the words "AcmeTech Departments Report" using the style we defined and named "reportTitle".

You could include as much of this type of text in your report as you want.  You can style the text any way you want.  You can use the WYSIWYG (what you see is what you get) features of your HTML editor to create this section of the MSWT.

We understand that using HTML and style sheets (CSS) makes creating reports sound daunting to some users.  On the other hand, by using this worldwide standard for page layout, you can take advantage of all the power and flexibility of standard HTML editors (such as Dreamweaver, CoffeeCup, etc.) to create your reports.

 

<xml> elements in the <BODY> Element

This is the tricky part of creating MSWT's, but once you've learned how to do it, you'll have the power to create a very wide variety of reports.

The <xml> elements in MSWT's contain <mmxml> elements.

So the <xml> elements look something like this:

<xml>

<mmxml>

<!-- the mmxml stuff goes here -->

</mmxml>

</xml>

 

We set it up this way because the browser (Internet Explorer, etc.) wants to see something it recognizes.  Internet Explorer recognizes <xml> elements.

We then put <mmxml> elements inside the <xml> elements because <mmxml> elements are the standard way within MindModel to specify data you want to extract from a model.

On a separate note, remember that XML is case-sensitive, so use "<xml>" and "<mmxml>", and not "<XML>" or "<MMXML>".

 

The Home Stretch

At this point, there are only two things left for you know about MSWT's:

1) How <mmxml> elements work

2) How <mmxml> elements work with style sheet definitions (CSS) to add style to your reports

 

1) How <mmxml> elements work

<mmxml> elements are exactly the same as the contents of XML Templates.

For information on how XML Templates work, refer to the section: Key Concepts: XML Templates.

 

Just to review, we'll discuss how the <mmxml> elements in the "AcmeTech Departments Report" work.

The goal of the report is to show all the departments in AcmeTech, the people who work for each department, and the skills and software packages for each person.

The "AcmeTech Departments Report" title at the top of the report is HTML.

<statementNounList>

The <definition> element named "deptsInModel" uses the statementNounList operator to find a list of organizations that match the statementPattern "organization|?|is of type|organization type|department".

In a simple case, the statementNounList operator would return a list of department names, separated by a comma, with a period at the end.

The list would look something like this:

Administration Department, Building Services, Data Processing.

 

In our case, we want to use the statementNounList operator to do something a bit fancier.

We use the statementNounList operator to find the departments, but we use the <hideNounList> operator to hide the list of departments.

What does this mean?  statementNounList finds the departments, but doesn't display them.  Instead it uses the <forEachNounCallFunction> element to specify what to do with each of the departments.  In our case, it displays a summary of the department, which includes the department name, employees for the department, and info for each employee.

So if we don't use <hideNounList>, we get a list of department names.  This is good if what we want is a simple list of names.  In our case, we want to do something (create a summary) for each of the names, so we hide the list and let the summary function (deptSummary) display the department name and related info.

The deptSummary Function

As we discussed above, the deptsInModel function calls the deptSummary function to display a summary of the department.

The deptSummary function uses the "concatenate" operator to string together the name of the department and a list of people who work for the department.

deptSummary uses the "nounName" operator to display the name of the department.

deptSummary uses the "peopleWorkForDept" function to display the employee summary.

The peopleWorkForDept Function

The peopleWorkForDept function is pretty similar to the deptsInModel function that the report uses to find the departments and summarize them.

peopleWorkForDept uses the statementNounList operator to find the people who work for the department.  It also uses the <hideNounList> element to hide the list and the <forEachNounCallFunction> operator to call the "personSummary" function, which creates a summary of each person.

In turn, the personSummary function uses the "concatenate" operator to create a summary of the person.

Isn't This Kind of Complicated?

Yes and no.  Yes, the MSWT has a lot of parts and each of them has to be done correctly.

On the other hand, the complexity of the MSWT is proportional to the power of the report.

The report has three levels of information: departments, people, people summaries.

The MSWT has three levels of functions: deptsInModel, peopleWorkForDept, personSummary.

The fact that functions call functions which in turn call functions is confusing to some people.  However, after doing this sort of thing, whether in MindModel or some other software, many people become comfortable with the process.

If you wanted to add another level to the report, you could add another function.  For example, you could list some specific information about the software packages or skills associated with the person.

Yes, the MSWT has many parts, but each part represents something MindModel needs to know from you, the report designer, to produce the report.

Once you get used to creating the <mmxml> functions, you can copy/paste and modify them to create a very wide array of reports.

Once you learn <mmxml>, which is the same thing as creating XML Templates, you can customize the Noun Summary Window and create customized emails.

 

2) How <mmxml> elements work with style sheet definitions (CSS) to add style to your reports

OK, so you understand that MSWT's are built by combining HTML files containing style sheets with <mmxml> elements that extract data from your model.

But how do <mmxml> elements connect with style sheets, and what's all the "#lt#p class=" junk in the MSWT?

Here goes.  The final piece in the MSWT puzzle...

The best way to understand how <mmxml> elements and style sheets go together is to think about what the HTML/CSS code will look like in the final report.

Remember that the AcmeTech Departments Report contains a list of all departments, the people in each department, and a summary of each person.

When you look at the printed report, you'll see that the department names are displayed in a larger font than the person names.  The departments names are also boldface and indented.

If you use the "Save As" button in the Model Summary Window to save the HTML version of the report, you'll see the following HTML code for the first department name:

<BLOCKQUOTE>

<P class=deptName>AT: Administration Dept</P>

</BLOCKQUOTE>

 

So how did the Model Summary Window Template (MSWT) produce this HTML code?

To find out, let's look at the <mmxml> function that produced the HTML code: deptSummary.

The deptSummary function looks like this:

<definition>

<name>deptSummary</name>

<operator>concatenate</operator>

 

<value>

<operator>nounName</operator>

 

<before>#lt#blockquote#gt##lt#p class="deptName"#gt#</before>

<after>#lt#/p#gt##lt#/blockquote#gt##newline##newline#</after>

</value>

 

<value>

<operator>definedInXML</operator>

 

<name>peopleWorkForDept</name>

<before>#lt#blockquote#gt#</before>

<after>#lt#/blockquote#gt#</after>

</value>

</definition>

 

What do we have here?  Let's look at this function element by element.

The <definition> element tells MindModel that this is the definition of a function.

The <name> element gives the name of the function: deptSummary.

The <operator> element ("concatenate") tells MindModel to string together a number of values (in this case, two) to produce the result of the function.

The first <value> element uses the "nounName" operator to display the name of the current noun, which in our case is the name of the department.

The <before> and <after> elements provide the link to the style sheet.

<before> and <after>

In general, the <before> and <after> elements are used to add text before and after the noun name in a <value> element.

So, for example, let's say you wanted the report to contain something like this:

Department: Administration

You might use a <before> element such as:

<before>Department:</before>

This element would tell MindModel to display the word "Department:" before the noun name.

So when MindModel encounters a <before> element, it adds the contents of the element before the value, in this case, before the noun name.

When MindModel encounters an <after> element, it adds the contents of the element after the value, in this case, after the noun name.

Another look at the HTML

So let's take another look at the HTML we want to produce:

 

<BLOCKQUOTE>

<P class=deptName>AT: Administration Dept</P>

</BLOCKQUOTE>

 

From a <mmxml> perspective, this HTML has three parts:

1) <BLOCKQUOTE><P class=deptName>

2) AT: Administration Dept

3) </P></BLOCKQUOTE>

Why three parts?

Because part #2 is the name of the noun.  We need the <operator>nounName<element> to produce the noun name.

So once we've got part #2, we need some stuff before it, and some stuff after it.

#1 is the stuff before it.  #3 is the stuff after it.

So why all the #'s and other funny stuff?

The correct <mmxml> code looks like this:

<before>#lt#blockquote#gt##lt#p class="deptName"#gt#</before>

The first part of the HTML code (#1) looks like this:

<BLOCKQUOTE><P class=deptName>

We'd like to just add "<BLOCKQUOTE><P class=deptName>" as the <before> element, and be done with it.  The problem is that it wouldn't work.

The reason is that the <mmxml> code is XML code.  "<" and ">" are not legal characters in an element value in XML.

If we tried to write the <before> element the simple way, it would look like this:

<before><blockquote><p class="deptName"></before>

This line is not legal XML.

The <before> and </before> tags are OK, but the <blockquote> and <p class="deptName"> tags look like unmatched XML tags.

There is no </blockquote> to go with the <blockquote>.  There is no </p> to go with the <p class="deptName">.

So we need some way to express "<BLOCKQUOTE><P class=deptName>" without using "<" or ">".

That's why we use "#lt#" and "#gt#".

#lt# and #gt#

These two symbols stand for "<" and ">".

#lt# stands for "less than".  #gt# stands for "greater than".

So if we look at the <before> element again:

<before>#lt#blockquote#gt##lt#p class="deptName"#gt#</before>

we see that the #lt# symbols will get replaced with "<" and the #gt# symbols will be replaced with ">".

So the <before> element will be equivalent to:

<before><blockquote><p class="deptName"></before>

without violating any of the rules of XML.

Time to Step Back Again

We've been working with a lot of small details for a while.  Let's step back again, take a look at the big picture, and see if it all makes sense.

We want our report to contain the correct information, and look the way we want it to look.

We use <mmxml> elements (equivalent to XML Templates) to tell MindModel exactly which information we want to include in the report.

We use HTML with CSS (style sheets) to tell the browser (Internet Explorer, Netscape, etc.) which fonts, font sizes, etc. to use where.

We also use HTML to add labels and other static text to the report.  By "static text" we mean text that doesn't change depending on the data in the model.

So we've got HTML text for labels and layout, and <mmxml> elements for data extracted from our model.

We need a simple yet powerful way to apply style information to the data extracted from our model.

We achieve this goal by having <mmxml> add style names and HTML formatting elements (such as "<blockquote>") before and after the data extracted from the model.

So the resulting HTML code looks something like this:

<BLOCKQUOTE>

<P class=deptName>AT: Administration Dept</P>

</BLOCKQUOTE>

 

The "AT: Administration Dept" text was the result of a statementNounList <mmxml> function.  The rest of the HTML code was added by the <before> and <after> operators.

Power Times Two

As we've discussed, Model Summary Window Templates (MSWT's) contain two types of code: HTML and <mmxml>.

HTML (with style sheets) gives you the power to control the appearance of your report.

<mmxml> gives you the power to control which information from your model is displayed in your report.

It takes some time to get used to creating MSWT's, but once you've learned how to create them, you can squeeze the maximum benefit from your data.

Want More?

If you'd like even more information on how to create MSWT's, refer to these sections:

Key Concepts: XML Template (for basic info on <mmxml>)

Key Concepts: <mmxml> Reference (for a complete listing of <mmxml> operators)

Call for Help

If you have trouble creating MSWT's, try starting with a simple one and building up to more complex templates.  If you get stuck, feel free to contact us.  We can help you create your first MSWT.  After that, you'll find it much easier to create additional templates.