elog2labfolder/_build/html/importing_from_elog.html
changeset 11 ccfe3c7fa0d2
child 15 523ca1dfd077
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/elog2labfolder/_build/html/importing_from_elog.html	Mon Feb 05 16:51:33 2018 +0100
@@ -0,0 +1,132 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Importing projects from e.g. the ELOGbook to Labfolder at the FHI &#8212; Labfolder at FHI 1.0 documentation</title>
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="prev" title="Import and export of projects and entries" href="import_export.html" />
+   
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
+  
+  
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
+
+  </head>
+  <body>
+  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="importing-projects-from-e-g-the-elogbook-to-labfolder-at-the-fhi">
+<h1>Importing projects from e.g. the ELOGbook to Labfolder at the FHI<a class="headerlink" href="#importing-projects-from-e-g-the-elogbook-to-labfolder-at-the-fhi" title="Permalink to this headline">¶</a></h1>
+<p>The ELOG entries of a certain project need to be exported as <em>Raw</em> which looks like this:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span>$@MID@$: 12
+Date: Tue, 03 Dec 2013 12:15:14 +0100
+Author: Wieland Schöllkopf
+Author Email: mailto:wschoell@fhi-berlin.mpg.de
+Category: Shift summary
+Subject: 1st solid-state experiment with FHI FEL
+Severity: DOCU
+Keywords:
+Record date: 1386069171
+Attachment:
+Encoding: HTML
+========================================
+&lt;p&gt;Today Alex Paarmann and Marc Herzog are measuring in the wavelength range from 10 to 20 micron with a 0.5 mm thick GGG (Gadolinium Gallium Garnet, &lt;a title=&quot;Gadolinium&quot; href=&quot;http://en.wikipedia.org/wiki/Gadolinium&quot;&gt;Gd&lt;/a&gt;&lt;sub&gt;3&lt;/sub&gt;&lt;a title=&quot;Gallium&quot; href=&quot;http://en.wikipedia.org/wiki/Gallium&quot;&gt;Ga&lt;/a&gt;&lt;sub&gt;5&lt;/sub&gt;&lt;a title=&quot;Oxygen&quot; href=&quot;http://en.wikipedia.org/wiki/Oxygen&quot;&gt;O&lt;/a&gt;&lt;sub&gt;12&lt;/sub&gt;). Electron energy is set to 26 MeV.&lt;/p&gt;
+</pre></div>
+</div>
+<p>The entry shown above looks like this in the ELOG webinterface:</p>
+<a class="reference internal image-reference" href="_images/elog_entry.png"><img alt="_images/elog_entry.png" class="align-center" src="_images/elog_entry.png" style="width: 100%;" /></a>
+<p>What is noticeable is that the ELOG export comes with an “ö” instead of an “ö”. Interestingly, if only entries done by Wieland are exported the export file has UTF-8 encoding which can actually print German “Umlaute” (ö, ä, ü). If, however, all entries are exported the encoding changes to an encoding that cannot handle e.g. “ö”.</p>
+<p>After importing the above ELOG entry into labfolder this entry appears like that:</p>
+<a class="reference internal image-reference" href="_images/entry_after_import.png"><img alt="_images/entry_after_import.png" class="align-center" src="_images/entry_after_import.png" style="width: 100%;" /></a>
+<div class="section" id="using-python-to-import-from-elog-to-labfolder">
+<h2>Using python to import from ELOG to labfolder<a class="headerlink" href="#using-python-to-import-from-elog-to-labfolder" title="Permalink to this headline">¶</a></h2>
+<p>There is a GitHub project containing a python program for importing a raw (see the export example above) ELOG project. Get the project files by typing:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span>$ git clone https://github.molgen.mpg.de/weiher/elog2labfolder.git
+</pre></div>
+</div>
+<p>The script <em>elog2labfolder.py</em> is meant to be executed from remote, that is, not on the machine on which labfolder is running. A prerequisit is the python MySQLDB package because for a few methods the labfolder API cannot be used, instead, direct manipulation of the labfolder MySQL database is needed. The actual labfolder API is applied in the methodes collected in <em>myPythonAPIv1.py</em> and <em>myPythonAPIv2.py</em>. Mostly, API version 2 is used but adding text at the end of an entry can only be accomplished by using the version 1 API call. <em>getListOfAuthors.py</em> gives you a list of all authors in a raw ELOG export file.</p>
+</div>
+<div class="section" id="alternatives-to-the-manipulating-the-labfolder-db-on-mysql-level">
+<h2>Alternatives to the manipulating the labfolder DB on MySQL level<a class="headerlink" href="#alternatives-to-the-manipulating-the-labfolder-db-on-mysql-level" title="Permalink to this headline">¶</a></h2>
+<p>As mentioned previously: a few methods in the python API use a direct manipulation of the labfolder DB via MySQL queries. These methods are:</p>
+<ul class="simple">
+<li><em>createUserAccount(email, author, entryContent, verboseOutput, cursor, db)</em>: If an author of an ELOG logbook entry has not yet a labolder account this account is created on the fly by setting a default (encrypted) password. This password is irrelevant because labfolder checks the entered password with the one from the LDAP server. Note: when setting a password in the DB labfolder’s LDAP authentication needs to be disabled (FEATURE_LDAP_AUTHENTICATION=false) and enabled again after the setting process is finished.</li>
+<li><em>updateAuthor(userID, blockID, cursor, db)</em>: Update the author of an entry. With the script <em>elog2labfolder.py</em> an entry is created with the author that is the person whose labfolder credentials are used to get the login token. Via this method the true author can be set to the passed in <em>userID</em>.</li>
+<li><em>updateDateAndTime(date, blockID, cursor, db)</em>: Similar to <em>updateAuthor()</em> this method sets the creation and modification date to the creation time and date of the entry to be imported. This is necessary because otherwise creation and modification date are the time and date of the import of the entry.</li>
+</ul>
+<p>The labfolder support suggested the following alternative involving using the labfolder API:</p>
+<ul class="simple">
+<li>… siehe E-Mail (gesendet) vom 15.12. …</li>
+</ul>
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper"><div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+      <li>Previous: <a href="import_export.html" title="previous chapter">Import and export of projects and entries</a></li>
+  </ul></li>
+</ul>
+</div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="search.html" method="get">
+      <div><input type="text" name="q" /></div>
+      <div><input type="submit" value="Go" /></div>
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="footer">
+      &copy;2018, Stefan Weiher.
+      
+      |
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.6</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
+      
+      |
+      <a href="_sources/importing_from_elog.rst.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>
\ No newline at end of file