How to configure a Viewer for the SAM/ELN Server
Client configuration
If you wish to specify the mimetype for a file that you are loading through the ELN client, you can do this in the eln.ini file located in your user home directory. By default, files of unknown type are loaded with the mimetype application/x-eln-% fileextension %.
To configure a new type, add a line to eln.ini of the format: 'extension_for_mimetype|' <% resulting mime type %>'=.'<% extension of the incoming file %>
Example for a .txt file - extension_for_mimetype|text/plain=.txt
Server configuration
In order to register the viewers on the server you will need to modify two different files stored on the server, you can upload the modified files to the server through a webDAV client, or if you are using windows you can set up a 'network place' to the location on the server where the files are uploaded to. Below are the files and the changes needed:
-
/config/Translators.xml - Add an element similar to the one below, the dc:format should be the same as the elntype property on the data that you wish to have translated. You can view this in the client by right-clicking on the node and selecting properties. The href values for the bfd/xslt translator elements should be the names of the bfd or xslt translator files that you want to be used in the translation. They should be uploaded to the server under /config/transformers. There are three different types of translators currently available, bfd, xslt, ans web-service translations. In the future we will also provide instructions for setting up web service translations.
<SAM:inputtype> <DC:format>application/x-eln-pnl</DC:format> <SAM:translation title="Simple View" inputtype="data"> <DC:format>text/html</DC:format> <SAM:bfd_translator xlink:href="PNLDataDesc.xml" /> <SAM:xslt_translator xlink:href="PNLDataDisplay.xsl" /> <!--(not both translators are required, often only the xslt is used)--> </SAM:translation> </SAM:inputtype> -
/eln/config/ELNViewerMap.xml - Add an element similar to the one below, the dc:format should correspond with the one that you added in Translators.xml and the title of the translator used should correspond with the title of the translation in Translators.xml.
<SAM:inputtype> <DC:format>application/x-eln-pnl</DC:format> <SAM:translation> <DC:format>text/html</DC:format> <SAM:translatorused xlink:title="Simple View" /> </SAM:translation> </SAM:inputtype> - /config/transformers - this is where you upload your custom XSLT and BFD translator files.

