This describes a modification to the HTML report template which adds a link to each diagram which allows feedback to be provided by email on the diagram being viewed. The email captures the comments together with diagram identity and a hyperlink back to the diagram being commented on.
Specifically the email generated by the hyperlink provides:
- a hyperlink to the diagram commented on
- the GUID
- diagram author name
- diagram modification date
- feedback comment
Modify the HTML Report Template
- Under the Resources pane select the Web Style Templates
- Right-click to select 'Create HTML Template'
- Give it a suitable name.
- Under the list of templates that appear in the left pane select 'Body - Diagram'
- Somewhere around line 4 you will see
<div class="PageBody">
#IMAGE#
<div class="ObjectTitle">#NAME# : #TYPE# diagram</div>
- Insert the following javascript
<script type="text/javascript">
//-----------------------------------
function feedbackEmailLink(emailAddress,guidString,title,modified,author,modelRootToIndexHTM)
{
var oGuid=guidString.substring(1,guidString.length-1);
//url for EA object of form http://path/path/path/Index.htm?guid=xxxxxxxxxxxx
var oURL=modelRootToIndexHTM +'/index.htm?guid=' + oGuid;
var eMailSubject='subject=Feedback on - '+ title +' - by '+ author;
var bodyNewLine='%0A';
var objectHyperlinkString = oURL;
var eMailBody='Diagram Title - ' +title +bodyNewLine + 'ID - ' + oGuid + bodyNewLine + 'URL - ' + oURL + bodyNewLine +'Author - ' + author + bodyNewLine + 'Modified Date - ' + modified + bodyNewLine+ bodyNewLine + 'Feedback Comment' + bodyNewLine ;
var eMailLinkText='<a href="mailto:'+emailAddress+'?'+ eMailSubject+ '&body='+eMailBody + '">Send feedback on this view</a>';
return eMailLinkText;
}
//-----------------------------------
</script>
- Look further down until you see the following:
<tr>
<td width="15%" class="ObjectDetailsTopic">Modified:</td>
<td width="85%" class="ObjectDetailsValue">#MODDATE#</td>
</tr>
- After this point you want to insert a new row into the table with the link to create the feedback email. Paste the following afterwards:
<tr id="contact">
<td width="15%" class="ObjectDetailsTopic">Feedback:</td>
<td width="85%" class="ObjectDetailsTopic">
<script type="text/javascript">
document.write(feedbackEmailLink('YOUR_EMAIL','#GUID#','#NAME#','#MODDATE#','#AUTHOR#','http://YOUR_URL'));
</script>
</td>
</tr>
- replacing YOUR_EMAIL with the email address you want it to go to and YOUR_URL with the base URL (folder in which the index.html of the exported model sits)
- Save the modified template.
Use of the Template
- In the Project Browser select the folder/package to be exported
- Right-click and select Documentation | HTML Report
- In the Generate HTMl Report window that appears select the Style drop-down list and select the template you've just saved.
That's it!
The End Result
and when the reader clicks on the link he/she gets:
Other Possibilities
You can also use the same method to display a permalink (url) for each diagram so that visitors can link directly to a specific diagram.
This can be seen in an online repository http://trak-community.org/TRAK_Demo_Repository/