Book a Demo

Author Topic: HTML Report - Javascript hooks for Diagram IDs ??  (Read 3692 times)

rocketman

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
HTML Report - Javascript hooks for Diagram IDs ??
« on: January 21, 2012, 01:18:41 am »
Problem: I'm trying to connect database entries (or CSV output) to corresponding diagrams in EA's HTML report.  I would like to print this data in a tabular format below the diagram in the HTML.

Proposed Solution: In the HTML/Javascript that EA generates, I can put the CSV data into arrays and write the arrays to screen as a table, but I need a way to reference which diagram is currently being displayed in order to find/write the corresponding table of data.  I assumed I could put a GUID entry into the database and then print the corresponding data when the GUID of that diagram is currently being displayed, but I found 2 problems:
1. Do diagrams have GUIDs or just the diagram objects?
2. I can't find a Javascript variable or similar that is being set to a GUID or unique ID of the diagram to use as a hook

There may be a plug-in or similar that actively connects databases to EA projects, which would probably work too.  However, I assumed I'd be able to at least reference the IDs of diagrams in the HTML after the report has been generated.

Any help, suggestions, or pointers would be appreciated...

Newbie,
rocketman

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: HTML Report - Javascript hooks for Diagram IDs
« Reply #1 on: January 21, 2012, 01:47:20 am »
I'm not sure if will help but you can add ?guid=<diagram guid> to your exported model url to go straight to a diagram in the html portal. The diagram guid is displayed under the Advanced section on each page of the export...

There are also javascript functions related to all of this in the exported js file that you might be able to treak to your purpose - but i'm not clear exactly what it is ?

Regards,

Jon.

rocketman

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: HTML Report - Javascript hooks for Diagram IDs
« Reply #2 on: January 21, 2012, 05:52:03 am »
Thanks for the help, Jon.  Unfortunately, during normal navigation, the URL doesn't change...

In the "HTML Template Fragments" there is a #GUID# defined as a "Diagram GUID" and a #GUID# defined as a "Element GUID".  I assume there is no difference between the two (i.e. that all browser objects have a GUID), but I'm not positive...

Also, I've seen the "diagram GUID" in the Advanced section of the HTML report.  Oddly, inside EA, the properties tab will show me the GUID of any object other than a diagram; I'm not sure why the diagram properties don't show up when selected.

Anywho, the XML produced in the HTML report and the javascript seem to mention and use the GUID to some degree, but I can't figure out where or now to tie in and use the GUID of the currently displayed diagram.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: HTML Report - Javascript hooks for Diagram IDs
« Reply #3 on: January 23, 2012, 10:03:29 pm »
Yes it sounds like what you will need to do is create your JavaScript to extract your data and give it an argument (say the #GUID# as discussed above) then add a call to your script into the Body- Diagram html fragment. Unfortunately my JavaScript skills are non-existent...

Regards,

Jon

rocketman

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: HTML Report - Javascript hooks for Diagram IDs
« Reply #4 on: January 27, 2012, 08:37:44 am »
I ended up going into the HTML template and adding a javascript variable definition to just create the variable I needed since I couldn't figure out how to access one IF it existed...

In the Body Diagram:

Code: [Select]
var GUID = "#GUID#";
That way the HTML document generator will create a variable on each page with the GUID of the diagram...