ORM Solutions

[ Log In ]

Viewing .orm files on the web

The .orm file viewers (tools/orm.aspx and tools/ormPrint.aspx) load and render model files on the client browser. For remote .orm files (available from a URL), this requires a cross-site scripting call to download the specified file. Web developers (and virus developers) play many games to enable cross-site scripting, but the most direct approach is for the server to add additional response headers to the downloaded files.

Successful viewing of .orm files across the broadest range of browsers requires two changes:
  • The Access-Control-Allow-Origin needs to be set to *, http://www.ormsolutions.com, or http://ormsolutions.com. You should be able to limit this setting to the directory that contains your .orm files. See information about enabling this setting at enable-cors.org.
  • The MIME type for the .orm file extension should be set to text/xml. Most hosting systems will allow you to set this through a web interface. Note that most browsers will work without this, but it doesn't hurt to be accurate. Modifying your .orm files to have an .xml extension on the server has the same effect.
Note: I haven't succeeded in specifying multiple origins in the same control list on IIS 7.5, but that doesn't mean it can't be done. You should be able to specify "http://www.ormsolutions.com http://ormsolutions.com" as the header value to limit scripting access to the ORM viewers. If this doesn't work, then list one of the site variants (choose with 'www.' or without 'www.') and make sure your links to ormsolutions.com match the URL style listed in your access control headers.
The file viewers support three query arguments:
  • The model argument takes the full URL for a model file (required).
  • The diagram argument takes the name of the diagram to use as the initial displayed diagram (does not apply to ormPrint).
  • The scale argument sets a base scale. This is multiplied by the percentage in the zoom dropdown and the browser zoom level. The default value is 1.2, which gives the size closest to the default NORMA zoom.
So, assuming that ORMSITE is correctly configured, http://ormsolutions.com/tools/orm.aspx?model=http://ORMSITE/ORMFiles/sample.orm&diagram=Main would open the sample.orm file and display Main diagram (or the first diagram if Main is not found). You can link this page directly, or use it as the source of an iFrame if you want to display an embedded diagram.