<commit_before><!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IBM Data Merge Utility</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link href="css/style.css" rel="stylesheet">
</head>
	<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
        	<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapse">
            	<span class="sr-only">Toggle navigation</span>
                <span class="glyphicon glyphicon-arrow-down"></span>
                MENU
           </button>   
         <div class="navbar-header">
        	<a class="navbar-brand" href="#"><img src="images/IBMlogo.png"></a>
        </div>                         
        <div class="collapse navbar-collapse" id="collapse">  
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/">Home</a></li>
                <li><a href="/UserGuide.html">User Guide</a></li>        
                <li><a href="/AdminGuide.html">Admin Guide</a></li>        
                <li><a href="/DevGuide.html">Dev Guide</a></li>        
                <li class="active"><a href="/Training.html">Training</a></li>        
                <li><a href="/idmu/status/">Status</a></li>        
                <li><a href="/editor/src/html/app.html">Templates</a></li>        
            </ul>
        </div>
    </nav> 
<body>    
<div class="container">    
<h1><a id="top">IBM Data Merge Utility - Training</a></h1>            		
        <ol class="nav nav-pills nav-stacked">
            <li><a href="#Lesson1"><strong>Lesson 1. Creating, Merging and Copying Templates</strong></a></li>
            <li><a href="#Lesson2"><strong>Lesson 2. The Require Directive</strong></a></li>
            <li><a href="#Lesson3"><strong>Lesson 3. Replace Row directive</strong></a></li>
            <li><a href="#Lesson4"><strong>Lesson 4. Replace Column directive</strong></a></li>
            <li><a href="#Lesson5"><strong>Lesson 5. Replace Value directive</strong></a></li>
            <li><a href="#Lesson6"><strong>Lesson 6. Insert Subs directive</strong></a></li>
            <li><a href="#Lesson7"><strong>Lesson 7. Insert Subs by Column Value</strong></a></li>
            <li><a href="#Lesson8"><strong>Lesson 8. The Default sub-template</strong></a></li>
            <li><a href="#Lesson9"><strong>Lesson 9. Insert Subs from Tag data</strong></a></li>
        </ol>
   
<section id="Lesson1">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 1 - Introduction - Creating and Copying templates</a></h3>
	<p>See <a href="/">the home page</a> Overviews for information on IDMU and the Template Editor</p>
	<p><b>Creating a new template</b> To create a new template click on the Add button in the template editor, use the collection "training" and the name "lesson" Leave the Column Value empty for now, we'll deal with that when we get to inserting sub-templates.</p> 
	<p>After clicking on "ok" you should now have an empty training.lesson. template. NOTE: If you added a template to an existing collection you may not be placed back in your new template automatically as the template cover flow reverts back to the first template in the cover flow after a new or save action.</p>
	Let's enter a simple html hello world page for out template content. Enter the following content and then click on Save.</p>
<textarea cols="70" rows="7"><html>
	<head></head>
	<body>
		Hello World
	</body>
</html></textarea>

	<p><b>Merging a Template</b> now you can click on the "Merge" button and a new browser window will open with the merge output. 
	In this case a simple web page with "Hello World" will be the output.
	Notice the url that was used to get that merge output, http://yourhost:port/merge?DragonFlyFullName=training.lesson. 
	Since we used the "text/plain" rest api, the result will be rendered as a text document, to see it in your browser rendered
	as a html document, change the url to http://yourhost:port/merge/training.lesson 
	</p>
	
	<p><b>Template Properties and Saving a copy of a template</b> If you click on the template name in the editor, the template properties pane will
	be opened showing you the name, output file, description and directives for the template. If you change the template name to lesson0 and 
	click on "Save" a copy of the current template will be saved as training.lessson0. but after the save the editor will revert back to the 
	first template in the cover flow, so you will have to click the right or left cover flow buttons to see the new template.</p>
	
	<p><b>Using merge tags</b> The most fundamental aspect of the merge utility is a global search / replace of "tags" with your data. 
	Tags are values wrapped in {brackets} that are placed in your template, and data is loaded into a find/replace hash
	that is processed over the template during the merge. Edit the content of our training.lesson. template be "Hello {NAME} and then
	save the template and Merge it. You should get a new window in your browser that says "Hello {NAME}". 
    </p>
    
    <p>Now change the url to add the NAME parameter as in:  
    http://yourhost:port/merge?DragonFlyFullName=training.lesson1.<b>&amp;NAME=Joe</b> then press enter to get the merge output again. 
	This time you should get a page back that says Hello Joe, this is pretty basic, but it's the foundation of more advanced processing. </p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson2">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 2 - The Require Directive</a></h3>
    <p><image align="right" src="images/requireName.png"/>
    Starting with our template from Lesson 1, let's add a Require Directive to the template to indicate that we should prompt for a NAME value if it is not provided.
    <ul>
    	<li>First click on the template name to show the template properties pane</li>
    	<li>now click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Require Tags" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new "Require Tags" entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
    </p>
    
    <p>If the system templates have been loaded you should get an error page that indicates that NAME is a required value 
    for the merge. Enter a name in the field provided an click on submit to merge the template with the NAME
    value you provided. You can use your browser to view the source of the form that is used to submit the merge to see how easy
    it is to create a form that submits a merge with input data. 
	</p>    
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson3">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 3 - The Replace Row Directive</a></h3>
	<p><image align="right" src="images/replaceRow.png"/><b>A note on Directives and Data Sources.</b> We will be using CSV data providers during the training exercise
	with Static Data. These directives could also be used to retrieve this data from a URL, or from data in a tag. 
	The corresponding JDBC directives work in exactly the same way, but they allow you to use a SQL Query to select
	the data for processing. </p>
	 
	<p>You can use the replace row directives to add replace values to the search/replace hash based on column names and 
	values in a single-row of data. Starting from our template created in lesson 2, update the content with the data shown below.</p>
	<textarea cols="60" rows="7"><html>
	<head></head>
	<body>
		Hello {NAME} with {EMPLOYER} from {CITY}! 
	</body>
</html></textarea>
    <p>
    Now add a Replace Row Directive to the template to get values for the NAME, EMPLOYER and CITY tags.
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the (X) next to the Require Directive (we are going to get the NAME from our directive)</li>
    	<li>Drag the "Add Replace from CSV Row" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson4">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 4 - The Replace Column Directive</a></h3>
	<p>Sometimes we have data in two columns (a From and To column) rather than a single row with column names. The Replace Column
	directives allow you to use this data as well.</p>

    <p><image align="right" src="images/replaceCol.png"/>
    Now let's add a Replace Column Directive to the template to get values for the NAME, EMPLOYER and CITY tags.</p>
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the (x) to delete the Replace Row directive from the previous exercise.</li>
    	<li>Drag the "Add Replace from CSV Column" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
    <p>Note that we again provided that data as "Static" data for the directive. The same rules for retrieveing data from a URL or Tag
    apply, and of course the Replace from SQL Column directive allows you to access JDBC data.   
	</p>    
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson5">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 5 - The Replace Value Directive</a></h3>
	<p><image align="right" src="images/replaceValue.png"/>The replace value directive may seem pointless at first, but we will see how it can be used in combination with the 
	Insert Sub-Template directives to facilitate list separator and terminator differences. First, let's add the following
	to the template.</p>
	<textarea cols="70" rows="7"><html>
	<head></head>
	<body>
		Hello {NAME} with {EMPLOYER} from {CITY}{COMA} glad you could make it. 
	</body>
</html></textarea>
    <p>Let's add a simple Replace Value directive to replace {COMA} with a ,    </p>
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Add Replace Value" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson6">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 6 - The Insert Subs Directive</a></h3>
	<p><image align="right" src="images/insertSubs1.png"/>The insertion of sub-templates is driven by tabular data, and a new sub-template is inserted at a book-mark
	for each row of data in the data table. Inserting of sub-templates is done when the Insert Directive works with the
	book-marks during the merge process. </p>
    <p>First, let's create our Insert Subs directive.    </p> 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Insert Subtemplates from CSV Data" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
	<p>Now, edit the template to add the text shown below</p> 
	<textarea cols="70" rows="11"><html>
	<head></head>
	<body>
		<p>Hello {NAME} with {EMPLOYER} from {CITY}!</br>
		Your training schedule is shown below</p>
		<table>
			<tr><th>Class</th><th>Room</th><th>Time</th></tr>
			
		</table>
	</body>
</html></textarea>

	<p>The template editor currently does not provide any way to remove a book-mark once a template has been saved, so let's make a 
	quick copy of the template in it's current state, we'll use it in the next exercises. Let's save this as lesson6a.</p>

	<p>There should now be an Insert Template button below your template.</p>
    
	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark.png"/>Now position your cursor in the blank line just before the &lt;/table&gt; tag, and
    click the Insert Template button and provide the information shown at the right. After clicking the insert button you 
    will see the book-mark data in the template. When you click save the book-mark will be replaced by a sub-template cover flow.</p>
    
    <p>Now enter the following in the sub-template content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
	</textarea>
    
    <p>A merge should now show you that the sub-template was inserted 3 times, each time with the replace values from the 
    row that drove the insertion. Note also that the COMA replace "empty" on the last row that was inserted. 
    This is because we specified the COMA tag as a "Not-Last" tag on the insert directive.</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson7">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 7 - Insert Subs by Column Value</a></h3>
	<p>Start by navigating to our saved lesson6a template, and saving it back as lesson</p>

    <p>Edit the content of the static data on our insert subs directive to contain</p>
    <textarea cols="70" rows="5">CLASS,ROOM,TIME,TYPE,ID,PW
Introduction to IDMU,101,8:30AM,Lecture,,
IDMU Administration,102,9:30AM,Lecture,,
Advanced Template Design,200,11:00AM,Lab,student1,passw0rd</textarea> 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the Insert directive entry and copy the content above into the static content field.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    </p>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark2.png"/>Now position your cursor in the blank line before the close table tag, and
    click the Insert Template button and provide the information shown at the right. After clicking the insert button you 
    will see the book-mark data in the template. When you click save the book-mark will be replaced by a sub-template cover flow.</p>
    
    <p>Next create a new template in the collection training, with a name of subtemplate2 and a column value of Lecture and 
	enter the following in the content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
		<tr><td colspan="3">Note: Lecture doors are closed when the class begins, please be on time</td></tr>	
	</textarea>
    
    <p>Now create another new template in the collection training, with a name of subtemplate2 and a column value of Lab and 
	enter the following in the content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
		<tr><td colspan="3">Note: Your lab ID is {ID} and your password is {PW}</td></tr>	
	</textarea>
    
	<p>When looking at the lesson template, you should now be able to scroll the sub-template cover flow back and forth to see the different sub-templates that will be inserted
	at that point. By merging the lesson template you will see that the sub-template used for each row of data was varied based on the data we provided.    
	</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson8">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 8 - Default Sub-Templates</a></h3>
	<p>Edit the static data used in Lesson 7 to include the following values
	</p>
	<textarea cols="70" rows="6">CLASS,ROOM,TIME,TYPE,ID,PW
Introduction to IDMU,101,8:30AM,Lecture,,
IDMU Administration,102,9:30AM,Lecture,,
Advanced Template Design,200,11:00AM,Lab,student1,passw0rd
Background,Hotel Lounge,7:00PM,Social,,</textarea>
	<p>Now merge the lesson template and notice that the "Social" class does not show up. This is because the value "Social" is not in 
	the sub-template cover flow, so the "default" template (the sub-template with an empty "Column Value" in it's name) was used with empty content.</p>

	<p>Place this text in the "default" template and run the merge again to see where the default values are used.</p>
	<textarea cols="70" rows="2">		<tr><td colspan="3">THIS IS THE DEFAULT TEMPLATE</td></tr>	</textarea>

	<p>If you want to get an error message from the merge instead of using a "Default" template, you can delete the default template. 
	Navigate to the training.subtemplate2 sub-template and remove it, then navigate back to the lesson template and merge again. 
	You should get a merge excecption indicating that the required template was not found.</p> 

	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson9">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 9 - Insert Subs from Tag</a></h3>
	<p>The insert subs from tag directive allows you to insert sub-templates based on a replace value in the find/replace hash. 
	Start by creating an empty lesson template, click on Add, and use the training collection and the lesson template name.
	Note that this erased the existing lesson template (without a warning) - be careful of this when adding new templates.</p>
    
    <p><image align="right" src="images/require2.png"/>First let's create a Require directive for an OPTIONS value. 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Require Tags" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    </p>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/insertTag.png"/>Create our Insert Subs from Tag directive. 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Insert Subtemplates from Tag Data" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    Note that we used a condition of "Exists". This will insert one-sub template if the specified tag exists in the replace stack. 
    The other options allow you to insert if a tag Does Not exist, contains an empty value, or a non-empty value.</p>

	<p>Now, edit the template to add the text shown below.</p> 
	<textarea cols="70" rows="9"><html>
	<head></head>
	<body>
		<p>The options are</p>
		<ul>
		
		</ul>
	</body>
</html></textarea>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark3.png"/>Now position your cursor on the empty line in the template content
    and click on Insert Template and provide the information at the right and click insert and save. 
    Then add the following content to the sub-template and save the sub-template and perform a merge. You will be prompted 
    by the require directive to provide a value for OPTIONS and should see that value in the merge output.</p>
    <textarea cols="70" rows="2"><li>{OPTIONS}</li></textarea> 
	
	<p>Now go back and edit the Insert from Tag directive, and check the "List?" and save and merge the template. This time
	enter a coma seperated list of values in the OPTIONS field, and note that a sub-template was inserted for each value.</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	

</section>    	
<hr style="clear:both;"/>

</div><!--end of container-->
<!--javascript-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>src="js/myscript.js"</script>
</body>
</html>
<commit_msg>added content disposition to plain-text response<commit_after><!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IBM Data Merge Utility</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link href="css/style.css" rel="stylesheet">
</head>
	<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
        	<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapse">
            	<span class="sr-only">Toggle navigation</span>
                <span class="glyphicon glyphicon-arrow-down"></span>
                MENU
           </button>   
         <div class="navbar-header">
        	<a class="navbar-brand" href="#"><img src="images/IBMlogo.png"></a>
        </div>                         
        <div class="collapse navbar-collapse" id="collapse">  
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/">Home</a></li>
                <li><a href="/UserGuide.html">User Guide</a></li>        
                <li><a href="/AdminGuide.html">Admin Guide</a></li>        
                <li><a href="/DevGuide.html">Dev Guide</a></li>        
                <li class="active"><a href="/Training.html">Training</a></li>        
                <li><a href="/idmu/status/">Status</a></li>        
                <li><a href="/editor/src/html/app.html">Templates</a></li>        
            </ul>
        </div>
    </nav> 
<body>    
<div class="container">    
<h1><a id="top">IBM Data Merge Utility - Training</a></h1>            		
        <ol class="nav nav-pills nav-stacked">
            <li><a href="#Lesson1"><strong>Lesson 1. Creating, Merging and Copying Templates</strong></a></li>
            <li><a href="#Lesson2"><strong>Lesson 2. The Require Directive</strong></a></li>
            <li><a href="#Lesson3"><strong>Lesson 3. Replace Row directive</strong></a></li>
            <li><a href="#Lesson4"><strong>Lesson 4. Replace Column directive</strong></a></li>
            <li><a href="#Lesson5"><strong>Lesson 5. Replace Value directive</strong></a></li>
            <li><a href="#Lesson6"><strong>Lesson 6. Insert Subs directive</strong></a></li>
            <li><a href="#Lesson7"><strong>Lesson 7. Insert Subs by Column Value</strong></a></li>
            <li><a href="#Lesson8"><strong>Lesson 8. The Default sub-template</strong></a></li>
            <li><a href="#Lesson9"><strong>Lesson 9. Insert Subs from Tag data</strong></a></li>
        </ol>
   
<section id="Lesson1">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 1 - Introduction - Creating and Copying templates</a></h3>
	<p>See <a href="/">the home page</a> Overviews for information on IDMU and the Template Editor</p>
	<p><b>Creating a new template</b> To create a new template click on the Add button in the template editor, use the collection "training" and the name "lesson" Leave the Column Value empty for now, we'll deal with that when we get to inserting sub-templates.</p> 
	<p>After clicking on "ok" you should now have an empty training.lesson. template. NOTE: If you added a template to an existing collection you may not be placed back in your new template automatically as the template cover flow reverts back to the first template in the cover flow after a new or save action.</p>
	Let's enter a simple html hello world page for out template content. Enter the following content and then click on Save.</p>
<textarea cols="70" rows="7"><html>
	<head></head>
	<body>
		Hello World
	</body>
</html></textarea>

	<p><b>Merging a Template</b> now you can click on the "Merge" button and a new browser window will open with the merge output. 
	In this case a simple web page with "Hello World" will be the output. 
	</p>
	
	<p><b>Template Properties and Saving a copy of a template</b> If you click on the template name in the editor, the template properties pane will
	be opened showing you the name, output file, description and directives for the template. If you change the template name to lesson0 and 
	click on "Save" a copy of the current template will be saved as training.lessson0. but after the save the editor will revert back to the 
	first template in the cover flow, so you will have to click the right or left cover flow buttons to see the new template.</p>
	
	<p><b>Using merge tags</b> The most fundamental aspect of the merge utility is a global search / replace of "tags" with your data. 
	Tags are values wrapped in {brackets} that are placed in your template, and data is loaded into a find/replace hash
	that is processed over the template during the merge. Edit the content of our training.lesson. template be "Hello {NAME} and then
	save the template and Merge it. You should get a new window in your browser that says "Hello {NAME}". 
    </p>
    
    <p>Now change the url to add the NAME parameter as in:  
    http://yourhost:port/merge?DragonFlyFullName=training.lesson1.<b>&amp;NAME=Joe</b> then press enter to get the merge output again. 
	This time you should get a page back that says Hello Joe, this is pretty basic, but it's the foundation of more advanced processing. </p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson2">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 2 - The Require Directive</a></h3>
    <p><image align="right" src="images/requireName.png"/>
    Starting with our template from Lesson 1, let's add a Require Directive to the template to indicate that we should prompt for a NAME value if it is not provided.
    <ul>
    	<li>First click on the template name to show the template properties pane</li>
    	<li>now click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Require Tags" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new "Require Tags" entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
    </p>
    
    <p>If the system templates have been loaded you should get an error page that indicates that NAME is a required value 
    for the merge. Enter a name in the field provided an click on submit to merge the template with the NAME
    value you provided. You can use your browser to view the source of the form that is used to submit the merge to see how easy
    it is to create a form that submits a merge with input data. 
	</p>    
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson3">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 3 - The Replace Row Directive</a></h3>
	<p><image align="right" src="images/replaceRow.png"/><b>A note on Directives and Data Sources.</b> We will be using CSV data providers during the training exercise
	with Static Data. These directives could also be used to retrieve this data from a URL, or from data in a tag. 
	The corresponding JDBC directives work in exactly the same way, but they allow you to use a SQL Query to select
	the data for processing. </p>
	 
	<p>You can use the replace row directives to add replace values to the search/replace hash based on column names and 
	values in a single-row of data. Starting from our template created in lesson 2, update the content with the data shown below.</p>
	<textarea cols="60" rows="7"><html>
	<head></head>
	<body>
		Hello {NAME} with {EMPLOYER} from {CITY}! 
	</body>
</html></textarea>
    <p>
    Now add a Replace Row Directive to the template to get values for the NAME, EMPLOYER and CITY tags.
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the (X) next to the Require Directive (we are going to get the NAME from our directive)</li>
    	<li>Drag the "Add Replace from CSV Row" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson4">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 4 - The Replace Column Directive</a></h3>
	<p>Sometimes we have data in two columns (a From and To column) rather than a single row with column names. The Replace Column
	directives allow you to use this data as well.</p>

    <p><image align="right" src="images/replaceCol.png"/>
    Now let's add a Replace Column Directive to the template to get values for the NAME, EMPLOYER and CITY tags.</p>
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the (x) to delete the Replace Row directive from the previous exercise.</li>
    	<li>Drag the "Add Replace from CSV Column" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
    <p>Note that we again provided that data as "Static" data for the directive. The same rules for retrieveing data from a URL or Tag
    apply, and of course the Replace from SQL Column directive allows you to access JDBC data.   
	</p>    
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson5">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 5 - The Replace Value Directive</a></h3>
	<p><image align="right" src="images/replaceValue.png"/>The replace value directive may seem pointless at first, but we will see how it can be used in combination with the 
	Insert Sub-Template directives to facilitate list separator and terminator differences. First, let's add the following
	to the template.</p>
	<textarea cols="70" rows="7"><html>
	<head></head>
	<body>
		Hello {NAME} with {EMPLOYER} from {CITY}{COMA} glad you could make it. 
	</body>
</html></textarea>
    <p>Let's add a simple Replace Value directive to replace {COMA} with a ,    </p>
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Add Replace Value" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    	<li>And now click on merge again to see the results</li>
    </ul> 
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
</section>    

<section id="Lesson6">                        
	<hr style="clear:both;"/>
	<h3><a id="">Lesson 6 - The Insert Subs Directive</a></h3>
	<p><image align="right" src="images/insertSubs1.png"/>The insertion of sub-templates is driven by tabular data, and a new sub-template is inserted at a book-mark
	for each row of data in the data table. Inserting of sub-templates is done when the Insert Directive works with the
	book-marks during the merge process. </p>
    <p>First, let's create our Insert Subs directive.    </p> 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Insert Subtemplates from CSV Data" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
	<p>Now, edit the template to add the text shown below</p> 
	<textarea cols="70" rows="11"><html>
	<head></head>
	<body>
		<p>Hello {NAME} with {EMPLOYER} from {CITY}!</br>
		Your training schedule is shown below</p>
		<table>
			<tr><th>Class</th><th>Room</th><th>Time</th></tr>
			
		</table>
	</body>
</html></textarea>

	<p>The template editor currently does not provide any way to remove a book-mark once a template has been saved, so let's make a 
	quick copy of the template in it's current state, we'll use it in the next exercises. Let's save this as lesson6a.</p>

	<p>There should now be an Insert Template button below your template.</p>
    
	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark.png"/>Now position your cursor in the blank line just before the &lt;/table&gt; tag, and
    click the Insert Template button and provide the information shown at the right. After clicking the insert button you 
    will see the book-mark data in the template. When you click save the book-mark will be replaced by a sub-template cover flow.</p>
    
    <p>Now enter the following in the sub-template content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
	</textarea>
    
    <p>A merge should now show you that the sub-template was inserted 3 times, each time with the replace values from the 
    row that drove the insertion. Note also that the COMA replace "empty" on the last row that was inserted. 
    This is because we specified the COMA tag as a "Not-Last" tag on the insert directive.</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson7">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 7 - Insert Subs by Column Value</a></h3>
	<p>Start by navigating to our saved lesson6a template, and saving it back as lesson</p>

    <p>Edit the content of the static data on our insert subs directive to contain</p>
    <textarea cols="70" rows="5">CLASS,ROOM,TIME,TYPE,ID,PW
Introduction to IDMU,101,8:30AM,Lecture,,
IDMU Administration,102,9:30AM,Lecture,,
Advanced Template Design,200,11:00AM,Lab,student1,passw0rd</textarea> 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Click on the Insert directive entry and copy the content above into the static content field.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    </p>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark2.png"/>Now position your cursor in the blank line before the close table tag, and
    click the Insert Template button and provide the information shown at the right. After clicking the insert button you 
    will see the book-mark data in the template. When you click save the book-mark will be replaced by a sub-template cover flow.</p>
    
    <p>Next create a new template in the collection training, with a name of subtemplate2 and a column value of Lecture and 
	enter the following in the content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
		<tr><td colspan="3">Note: Lecture doors are closed when the class begins, please be on time</td></tr>	
	</textarea>
    
    <p>Now create another new template in the collection training, with a name of subtemplate2 and a column value of Lab and 
	enter the following in the content area, and click on "Save" </p>
	<textarea cols="70" rows="2">		<tr><td>{CLASS}</td><td>{ROOM}</td><td>{TIME}{COMA}</td></tr>
		<tr><td colspan="3">Note: Your lab ID is {ID} and your password is {PW}</td></tr>	
	</textarea>
    
	<p>When looking at the lesson template, you should now be able to scroll the sub-template cover flow back and forth to see the different sub-templates that will be inserted
	at that point. By merging the lesson template you will see that the sub-template used for each row of data was varied based on the data we provided.    
	</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson8">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 8 - Default Sub-Templates</a></h3>
	<p>Edit the static data used in Lesson 7 to include the following values
	</p>
	<textarea cols="70" rows="6">CLASS,ROOM,TIME,TYPE,ID,PW
Introduction to IDMU,101,8:30AM,Lecture,,
IDMU Administration,102,9:30AM,Lecture,,
Advanced Template Design,200,11:00AM,Lab,student1,passw0rd
Background,Hotel Lounge,7:00PM,Social,,</textarea>
	<p>Now merge the lesson template and notice that the "Social" class does not show up. This is because the value "Social" is not in 
	the sub-template cover flow, so the "default" template (the sub-template with an empty "Column Value" in it's name) was used with empty content.</p>

	<p>Place this text in the "default" template and run the merge again to see where the default values are used.</p>
	<textarea cols="70" rows="2">		<tr><td colspan="3">THIS IS THE DEFAULT TEMPLATE</td></tr>	</textarea>

	<p>If you want to get an error message from the merge instead of using a "Default" template, you can delete the default template. 
	Navigate to the training.subtemplate2 sub-template and remove it, then navigate back to the lesson template and merge again. 
	You should get a merge excecption indicating that the required template was not found.</p> 

	<div class="footerLink"><a href="#Top">Back To Top</a></div>	
    	
</section>    
<section id="Lesson9">                        
<hr style="clear:both;"/>
<h3><a id="">Lesson 9 - Insert Subs from Tag</a></h3>
	<p>The insert subs from tag directive allows you to insert sub-templates based on a replace value in the find/replace hash. 
	Start by creating an empty lesson template, click on Add, and use the training collection and the lesson template name.
	Note that this erased the existing lesson template (without a warning) - be careful of this when adding new templates.</p>
    
    <p><image align="right" src="images/require2.png"/>First let's create a Require directive for an OPTIONS value. 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Require Tags" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    </p>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/insertTag.png"/>Create our Insert Subs from Tag directive. 
    <ul>
    	<li>If the template properties pane is not visible, click on the template name to show it</li>
    	<li>Click on the "configure" button to show the Directives Editor pane</li>
    	<li>Drag the "Insert Subtemplates from Tag Data" directive from the list on the left to the list on the right to add it to the template.</li>
    	<li>Now click on the new directive entry and provide the information shown at theright.</li>
    	<li>Click on Save, then on Back, then on Save again to save the template
    </ul> 
    Note that we used a condition of "Exists". This will insert one-sub template if the specified tag exists in the replace stack. 
    The other options allow you to insert if a tag Does Not exist, contains an empty value, or a non-empty value.</p>

	<p>Now, edit the template to add the text shown below.</p> 
	<textarea cols="70" rows="9"><html>
	<head></head>
	<body>
		<p>The options are</p>
		<ul>
		
		</ul>
	</body>
</html></textarea>

	<hr style="clear:both;"/>
    <p><image align="right" src="images/bookmark3.png"/>Now position your cursor on the empty line in the template content
    and click on Insert Template and provide the information at the right and click insert and save. 
    Then add the following content to the sub-template and save the sub-template and perform a merge. You will be prompted 
    by the require directive to provide a value for OPTIONS and should see that value in the merge output.</p>
    <textarea cols="70" rows="2"><li>{OPTIONS}</li></textarea> 
	
	<p>Now go back and edit the Insert from Tag directive, and check the "List?" and save and merge the template. This time
	enter a coma seperated list of values in the OPTIONS field, and note that a sub-template was inserted for each value.</p>
	<div class="footerLink"><a href="#Top">Back To Top</a></div>	

</section>    	
<hr style="clear:both;"/>

</div><!--end of container-->
<!--javascript-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>src="js/myscript.js"</script>
</body>
</html>

{'fraction_non_alphanumeric': 0.11234559381685184, 'fraction_numerical': 0.007820946334506475, 'mean_word_length': 3.4100223168999797, 'pattern_counts': {'":': 0, '<': 1097, '<?xml version=': 0, '>': 1097, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6777342', 'n_tokens_mistral': 13239, 'n_tokens_neox': 12482, 'n_words': 5667}