elog2labfolder/_build/latex/elog2labfolder.tex
changeset 13 a21f3604f1db
parent 11 ccfe3c7fa0d2
child 15 523ca1dfd077
equal deleted inserted replaced
12:d0f2a667d9d5 13:a21f3604f1db
    53 \setcounter{tocdepth}{1}
    53 \setcounter{tocdepth}{1}
    54 
    54 
    55 
    55 
    56 
    56 
    57 \title{Labfolder at FHI Documentation}
    57 \title{Labfolder at FHI Documentation}
    58 \date{Feb 05, 2018}
    58 \date{Feb 07, 2018}
    59 \release{1.0}
    59 \release{1.0}
    60 \author{Stefan Weiher}
    60 \author{Stefan Weiher}
    61 \newcommand{\sphinxlogo}{\vbox{}}
    61 \newcommand{\sphinxlogo}{\vbox{}}
    62 \renewcommand{\releasename}{Release}
    62 \renewcommand{\releasename}{Release}
    63 \makeindex
    63 \makeindex
   196     \PYG{n}{ProxyPassReverse} \PYG{o}{/} \PYG{n}{http}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{l+m+mf}{141.14}\PYG{o}{.}\PYG{l+m+mf}{138.230}\PYG{p}{:}\PYG{l+m+mi}{9091}\PYG{o}{/}
   196     \PYG{n}{ProxyPassReverse} \PYG{o}{/} \PYG{n}{http}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{l+m+mf}{141.14}\PYG{o}{.}\PYG{l+m+mf}{138.230}\PYG{p}{:}\PYG{l+m+mi}{9091}\PYG{o}{/}
   197 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{VirtualHost}\PYG{o}{\PYGZgt{}}
   197 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{VirtualHost}\PYG{o}{\PYGZgt{}}
   198 \end{sphinxVerbatim}
   198 \end{sphinxVerbatim}
   199 
   199 
   200 
   200 
       
   201 \chapter{Printing via CUPS and attaching files to labfolder logbooks}
       
   202 \label{\detokenize{installation_cups:printing-via-cups-and-attaching-files-to-labfolder-logbooks}}\label{\detokenize{installation_cups::doc}}
       
   203 If you want to print a webpage as PDF and send it to onf of labfolder’s logbooks you could create a CUPS printer for each logbook that uses the labfolder API to attach this PDF to a newly created entry. First, you need to install CUPS on the virtual machine that runs labfolder:
       
   204 
       
   205 \fvset{hllines={, ,}}%
       
   206 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   207 \PYG{n}{sudo} \PYG{n}{apt}\PYG{o}{\PYGZhy{}}\PYG{n}{get} \PYG{n}{install} \PYG{n}{cups} \PYG{n}{cups}\PYG{o}{\PYGZhy{}}\PYG{n}{client} \PYG{n}{cups}\PYG{o}{\PYGZhy{}}\PYG{n}{bsd}
       
   208 \end{sphinxVerbatim}
       
   209 
       
   210 Next, you need to configure \sphinxcode{/etc/cups/cupsd.conf}. This is how it looks like on \sphinxstyleemphasis{lftest}:
       
   211 
       
   212 \fvset{hllines={, ,}}%
       
   213 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   214 \PYG{c+c1}{\PYGZsh{} Sample configuration file for the CUPS scheduler.  See \PYGZdq{}man cupsd.conf\PYGZdq{} for a}
       
   215 \PYG{c+c1}{\PYGZsh{} complete description of this file.}
       
   216 
       
   217 \PYG{c+c1}{\PYGZsh{} Log general information in error\PYGZus{}log \PYGZhy{} change \PYGZdq{}warn\PYGZdq{} to \PYGZdq{}debug\PYGZdq{}}
       
   218 \PYG{c+c1}{\PYGZsh{} for troubleshooting...}
       
   219 \PYG{n}{LogLevel} \PYG{n}{debug}
       
   220 
       
   221 \PYG{c+c1}{\PYGZsh{} Deactivate CUPS\PYGZsq{} internal logrotating, as we provide a better one, especially}
       
   222 \PYG{c+c1}{\PYGZsh{} LogLevel debug2 gets usable now}
       
   223 \PYG{n}{MaxLogSize} \PYG{l+m+mi}{0}
       
   224 
       
   225 \PYG{c+c1}{\PYGZsh{} Administrator user group...}
       
   226 \PYG{n}{SystemGroup} \PYG{n}{lpadmin}
       
   227 \PYG{n}{ServerAdmin} \PYG{n}{weiher}\PYG{n+nd}{@fhi}\PYG{o}{\PYGZhy{}}\PYG{n}{berlin}\PYG{o}{.}\PYG{n}{mpg}\PYG{o}{.}\PYG{n}{de}
       
   228 
       
   229 \PYG{n}{HostNameLookups} \PYG{n}{On}
       
   230 \PYG{n}{ServerAlias} \PYG{o}{*}
       
   231 
       
   232 \PYG{c+c1}{\PYGZsh{} Only listen for connections from the local machine.}
       
   233 \PYG{n}{Listen} \PYG{n}{lftest}\PYG{o}{.}\PYG{n}{rz}\PYG{o}{\PYGZhy{}}\PYG{n}{berlin}\PYG{o}{.}\PYG{n}{mpg}\PYG{o}{.}\PYG{n}{de}\PYG{p}{:}\PYG{l+m+mi}{631}
       
   234 \PYG{n}{Listen} \PYG{o}{/}\PYG{n}{var}\PYG{o}{/}\PYG{n}{run}\PYG{o}{/}\PYG{n}{cups}\PYG{o}{/}\PYG{n}{cups}\PYG{o}{.}\PYG{n}{sock}
       
   235 
       
   236 \PYG{c+c1}{\PYGZsh{} Show shared printers on the local network.}
       
   237 \PYG{n}{Browsing} \PYG{n}{Off}
       
   238 \PYG{n}{BrowseOrder} \PYG{n}{allow}\PYG{p}{,}\PYG{n}{deny}
       
   239 \PYG{n}{BrowseAllow} \PYG{n+nb}{all}
       
   240 \PYG{n}{BrowseLocalProtocols} \PYG{n}{CUPS} \PYG{n}{dnssd}
       
   241 \PYG{n}{BrowseAddress} \PYG{n+nd}{@LOCAL}
       
   242 
       
   243 \PYG{c+c1}{\PYGZsh{} Default authentication type, when authentication is required...}
       
   244 \PYG{n}{DefaultAuthType} \PYG{n}{Basic}
       
   245 
       
   246 \PYG{c+c1}{\PYGZsh{} Web interface setting...}
       
   247 \PYG{n}{WebInterface} \PYG{n}{Yes}
       
   248 
       
   249 \PYG{c+c1}{\PYGZsh{} Restrict access to the server...}
       
   250 \PYG{o}{\PYGZlt{}}\PYG{n}{Location} \PYG{o}{/}\PYG{o}{\PYGZgt{}}
       
   251   \PYG{n}{Satisfy} \PYG{n}{All}
       
   252   \PYG{n}{Allow} \PYG{n}{localhost}
       
   253   \PYG{n}{Allow} \PYG{l+m+mf}{141.14}\PYG{o}{.}\PYG{o}{*}
       
   254   \PYG{n}{Allow} \PYG{l+m+mf}{172.16}\PYG{o}{.}\PYG{o}{*}
       
   255   \PYG{n}{Allow} \PYG{l+m+mf}{192.}\PYG{o}{*}
       
   256   \PYG{n}{Allow} \PYG{n+nb}{all}
       
   257   \PYG{c+c1}{\PYGZsh{} Allow shared printing and remote administration...}
       
   258   \PYG{n}{Order} \PYG{n}{allow}\PYG{p}{,}\PYG{n}{deny}
       
   259   \PYG{n}{Allow} \PYG{n+nb}{all}
       
   260 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{Location}\PYG{o}{\PYGZgt{}}
       
   261 
       
   262 \PYG{c+c1}{\PYGZsh{} Restrict access to the admin pages...}
       
   263 \PYG{o}{\PYGZlt{}}\PYG{n}{Location} \PYG{o}{/}\PYG{n}{admin}\PYG{o}{\PYGZgt{}}
       
   264   \PYG{n}{Order} \PYG{n}{deny}\PYG{p}{,}\PYG{n}{allow}
       
   265   \PYG{n}{Satisfy} \PYG{n}{All}
       
   266   \PYG{n}{AuthType} \PYG{n}{Basic}
       
   267   \PYG{n}{Require} \PYG{n}{user} \PYG{n+nd}{@SYSTEM}
       
   268   \PYG{n}{Deny} \PYG{n}{All}
       
   269   \PYG{n}{Allow} \PYG{n}{localhost}
       
   270   \PYG{n}{Allow} \PYG{l+m+mf}{141.14}\PYG{o}{.}\PYG{o}{*}
       
   271   \PYG{n}{Allow} \PYG{l+m+mf}{172.16}\PYG{o}{.}\PYG{o}{*}
       
   272 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{Location}\PYG{o}{\PYGZgt{}}
       
   273 
       
   274 \PYG{c+c1}{\PYGZsh{} Restrict access to configuration files...}
       
   275 \PYG{o}{\PYGZlt{}}\PYG{n}{Location} \PYG{o}{/}\PYG{n}{admin}\PYG{o}{/}\PYG{n}{conf}\PYG{o}{\PYGZgt{}}
       
   276   \PYG{n}{Order} \PYG{n}{deny}\PYG{p}{,}\PYG{n}{allow}
       
   277   \PYG{n}{AuthType} \PYG{n}{Default}
       
   278   \PYG{n}{Require} \PYG{n}{user} \PYG{n+nd}{@SYSTEM}
       
   279   \PYG{n}{Satisfy} \PYG{n}{All}
       
   280   \PYG{n}{Require} \PYG{n}{user} \PYG{n}{root}
       
   281   \PYG{n}{Deny} \PYG{n}{All}
       
   282   \PYG{n}{Allow} \PYG{l+m+mf}{127.0}\PYG{o}{.}\PYG{l+m+mf}{0.1}
       
   283   \PYG{n}{Allow} \PYG{l+m+mf}{141.14}\PYG{o}{.}\PYG{o}{*}
       
   284   \PYG{n}{Allow} \PYG{l+m+mf}{172.16}\PYG{o}{.}\PYG{o}{*}
       
   285 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{Location}\PYG{o}{\PYGZgt{}}
       
   286 
       
   287 \PYG{c+c1}{\PYGZsh{} Set the default printer/job policies...}
       
   288 \PYG{o}{\PYGZlt{}}\PYG{n}{Policy} \PYG{n}{default}\PYG{o}{\PYGZgt{}}
       
   289   \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{c+c1}{\PYGZsh{} probably as in the original}
       
   290 \PYG{o}{\PYGZlt{}}\PYG{o}{/}\PYG{n}{Policy}\PYG{o}{\PYGZgt{}}
       
   291 \end{sphinxVerbatim}
       
   292 
       
   293 Now, you need to create a file system that will hold all CUPS printers, For example, the printers belonging to the logbooks \sphinxstyleemphasis{FEL/operating} and \sphinxstyleemphasis{FEL/installation} could be put in \sphinxcode{/usr/local/labfolder/printers/FEL}. Copy the lplisten script from the git repository \sphinxcode{https://github.molgen.mpg.de/weiher/elog2labfolder.git} to \sphinxcode{/usr/local/labfolder/printers/FEL/operating} and to \sphinxcode{.../FEL/installation}. Also, create a pipe that redirects the printer input to the lplisten script:
       
   294 
       
   295 \fvset{hllines={, ,}}%
       
   296 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   297 /usr/local/labfolder/printers/FEL/operating\PYGZdl{} mkfifo prnt
       
   298 \end{sphinxVerbatim}
       
   299 
       
   300 Adapt rights and ownership of lplisten and prnt:
       
   301 
       
   302 \fvset{hllines={, ,}}%
       
   303 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   304 \PYGZdl{} chmod 744 lplisten
       
   305 \PYGZdl{} chmod 666 prnt
       
   306 \PYGZdl{} chown lp:lpadmin lplisten prnt
       
   307 \end{sphinxVerbatim}
       
   308 
       
   309 Add the labfolder user to the lpadmin group in /etc/group:
       
   310 
       
   311 \fvset{hllines={, ,}}%
       
   312 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   313 \PYG{n}{lpadmin}\PYG{p}{:}\PYG{n}{x}\PYG{p}{:}\PYG{l+m+mi}{115}\PYG{p}{:}\PYG{n}{labfolder}
       
   314 \end{sphinxVerbatim}
       
   315 
       
   316 Now, create the CUPS printers via the web interface at \sphinxcode{http://lftest.rz-berlin.mpg.de:631/} (as configured in cupsd.conf). For example, the \sphinxstyleemphasis{operating} printer points at \sphinxcode{FEL/operating/prnt}. The ready configured printer looks like this in the web interface:
       
   317 
       
   318 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=1.000\linewidth]{{cups_print_operating}.png}\hspace*{\fill}}
       
   319 
       
   320 To prevent \sphinxcode{DENIED} errors from apparmor install and set the following:
       
   321 
       
   322 \fvset{hllines={, ,}}%
       
   323 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   324 \PYG{n}{sudo} \PYG{n}{apt}\PYG{o}{\PYGZhy{}}\PYG{n}{get} \PYG{n}{install} \PYG{n}{apparmor}\PYG{o}{\PYGZhy{}}\PYG{n}{utils} \PYG{n}{apparmor}\PYG{o}{\PYGZhy{}}\PYG{n}{profiles}
       
   325 \PYG{n}{sudo} \PYG{n}{aa}\PYG{o}{\PYGZhy{}}\PYG{n}{complain} \PYG{n}{cupsd}
       
   326 \end{sphinxVerbatim}
       
   327 
       
   328 Restart the CUPS server:
       
   329 
       
   330 \fvset{hllines={, ,}}%
       
   331 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   332 \PYGZdl{} service cupsd restart
       
   333 \end{sphinxVerbatim}
       
   334 
       
   335 Start the lplisten script in the background:
       
   336 
       
   337 \fvset{hllines={, ,}}%
       
   338 \begin{sphinxVerbatim}[commandchars=\\\{\}]
       
   339 /usr/local/labfolder/printers/FEL/operating\PYGZdl{} ./lplisten \PYGZam{}
       
   340 \end{sphinxVerbatim}
       
   341 
       
   342 The last thing you need to do is to set up a printer \sphinxstyleemphasis{operating} on your local machine. In Ubuntu Gnome hit Alt+F2 keys and enter \sphinxcode{system-config-printer}. In this printer config interface add a new printer \sphinxstyleemphasis{operating} as follows:
       
   343 
       
   344 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer01}.png}\hspace*{\fill}}
       
   345 
       
   346 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer02}.png}\hspace*{\fill}}
       
   347 
       
   348 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer03}.png}\hspace*{\fill}}
       
   349 
       
   350 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer04}.png}\hspace*{\fill}}
       
   351 
       
   352 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer05}.png}\hspace*{\fill}}
       
   353 
       
   354 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer06}.png}\hspace*{\fill}}
       
   355 
       
   356 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{create_local_printer07}.png}\hspace*{\fill}}
       
   357 
       
   358 
   201 \chapter{Groups, ownership and sharing in labfolder}
   359 \chapter{Groups, ownership and sharing in labfolder}
   202 \label{\detokenize{groups:groups-ownership-and-sharing-in-labfolder}}\label{\detokenize{groups::doc}}
   360 \label{\detokenize{groups:groups-ownership-and-sharing-in-labfolder}}\label{\detokenize{groups::doc}}
   203 As labfolder user you can create groups (ultimately: group projects) and private projects. In \sphinxstyleemphasis{Manage \textgreater{} Projects} you see all projects that you own and that you are a member of.
   361 As labfolder user you can create groups (ultimately: group projects) and private projects. In \sphinxstyleemphasis{Manage \textgreater{} Projects} you see all projects that you own and that you are a member of.
   204 
   362 
   205 
   363 
   270 Version 2 is still in the development phase.
   428 Version 2 is still in the development phase.
   271 
   429 
   272 
   430 
   273 \section{Export}
   431 \section{Export}
   274 \label{\detokenize{import_export:export}}
   432 \label{\detokenize{import_export:export}}
   275 Exporting projects (or just single entries) is possible in three different formats: PDF, XHTML and JSON. The export as PDF can be done from within a project …
   433 Exporting projects (or just single entries) is possible in three different formats: PDF, XHTML and JSON. The \sphinxstylestrong{export as PDF} can be done from within a project …
   276 
   434 
   277 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_of_projects}.png}\hspace*{\fill}}
   435 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_of_projects}.png}\hspace*{\fill}}
   278 
   436 
   279 … or from the project overview (\sphinxstyleemphasis{Manage \textgreater{} Projects}):
   437 … or from the project overview (\sphinxstyleemphasis{Manage \textgreater{} Projects}):
   280 
   438 
   281 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_of_projects2}.png}\hspace*{\fill}}
   439 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_of_projects2}.png}\hspace*{\fill}}
   282 
   440 
   283 The XHTML export can be done via the settings:
   441 The \sphinxstylestrong{XHTML export} can be done via the settings:
   284 
   442 
   285 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_xhtml}.png}\hspace*{\fill}}
   443 \noindent{\hspace*{\fill}\sphinxincludegraphics[width=0.700\linewidth]{{export_xhtml}.png}\hspace*{\fill}}
   286 
   444 
   287 However, to use this type of export it has to be installed first in the \sphinxstyleemphasis{Manage \textgreater{} Apps} section. By means of the XHTML export all projects that one owns will be exported. A detailled selection of projects or entries to be exported is not possible. As soon as the export process is finished a download link appears in the settings in \sphinxstyleemphasis{Data exports}. The downloadable ZIP file contains all images and files along with an index.html file that contains information about all entries. You could open and view the index.html file in a browser similar to the view in labfolder.
   445 However, to use this type of export it has to be installed first in the \sphinxstyleemphasis{Manage \textgreater{} Apps} section. By means of the XHTML export all projects that one owns will be exported. A detailled selection of projects or entries to be exported is not possible. As soon as the export process is finished a download link appears in the settings in \sphinxstyleemphasis{Data exports}. The downloadable ZIP file contains all images and files along with an index.html file that contains information about all entries. You could open and view the index.html file in a browser similar to the view in labfolder.
   288 
   446 
   289 The JSON export is only useable via the API endpoint \sphinxcode{GET /entries}. However, at the moment the response only contains useful information such as dates and tags. The author name is hidden behind the author ID and the entry text content is completely missing.
   447 The \sphinxstylestrong{JSON export} is only useable via the API endpoint \sphinxcode{GET /entries}. However, at the moment the response only contains useful information such as dates and tags. The author name is hidden behind the author ID and the entry text content is completely missing.
   290 
   448 
   291 
   449 
   292 \chapter{Importing projects from e.g. the ELOGbook to Labfolder at the FHI}
   450 \chapter{Importing projects from e.g. the ELOGbook to Labfolder at the FHI}
   293 \label{\detokenize{importing_from_elog:importing-projects-from-e-g-the-elogbook-to-labfolder-at-the-fhi}}\label{\detokenize{importing_from_elog::doc}}
   451 \label{\detokenize{importing_from_elog:importing-projects-from-e-g-the-elogbook-to-labfolder-at-the-fhi}}\label{\detokenize{importing_from_elog::doc}}
   294 The ELOG entries of a certain project need to be exported as \sphinxstyleemphasis{Raw} which looks like this:
   452 The ELOG entries of a certain project need to be exported as \sphinxstyleemphasis{Raw} which looks like this:
   328 \fvset{hllines={, ,}}%
   486 \fvset{hllines={, ,}}%
   329 \begin{sphinxVerbatim}[commandchars=\\\{\}]
   487 \begin{sphinxVerbatim}[commandchars=\\\{\}]
   330 \PYGZdl{} git clone https://github.molgen.mpg.de/weiher/elog2labfolder.git
   488 \PYGZdl{} git clone https://github.molgen.mpg.de/weiher/elog2labfolder.git
   331 \end{sphinxVerbatim}
   489 \end{sphinxVerbatim}
   332 
   490 
   333 The script \sphinxstyleemphasis{elog2labfolder.py} 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 \sphinxstyleemphasis{myPythonAPIv1.py} and \sphinxstyleemphasis{myPythonAPIv2.py}. 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. \sphinxstyleemphasis{getListOfAuthors.py} gives you a list of all authors in a raw ELOG export file.
   491 The script \sphinxstyleemphasis{elog2labfolder.py} 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 \sphinxstyleemphasis{myPythonAPIv1.py} and \sphinxstyleemphasis{myPythonAPIv2.py}. 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. \sphinxstyleemphasis{getListOfAuthors.py} gives you a list of all authors that are mentioned in a raw ELOG export file.
   334 
   492 
   335 
   493 
   336 \section{Alternatives to the manipulating the labfolder DB on MySQL level}
   494 \section{Alternatives to manipulating the labfolder DB on MySQL level}
   337 \label{\detokenize{importing_from_elog:alternatives-to-the-manipulating-the-labfolder-db-on-mysql-level}}
   495 \label{\detokenize{importing_from_elog:alternatives-to-manipulating-the-labfolder-db-on-mysql-level}}
   338 As mentioned previously: a few methods in the python API use a direct manipulation of the labfolder DB via MySQL queries. These methods are:
   496 As mentioned previously: a few methods in the python API use a direct manipulation of the labfolder DB via MySQL queries. These methods are:
   339 \begin{itemize}
   497 \begin{itemize}
   340 \item {} 
   498 \item {} 
   341 \sphinxstyleemphasis{createUserAccount(email, author, entryContent, verboseOutput, cursor, db)}: 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.
   499 \sphinxstyleemphasis{createUserAccount(email, author, entryContent, verboseOutput, cursor, db)}: If an author of an ELOG logbook entry does not yet have 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) beforehand and enabled again after the setting process is finished.
   342 
   500 
   343 \item {} 
   501 \item {} 
   344 \sphinxstyleemphasis{updateAuthor(userID, blockID, cursor, db)}: Update the author of an entry. With the script \sphinxstyleemphasis{elog2labfolder.py} 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 \sphinxstyleemphasis{userID}.
   502 \sphinxstyleemphasis{updateAuthor(userID, blockID, cursor, db)}: Update the author of an entry. With the script \sphinxstyleemphasis{elog2labfolder.py} 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 \sphinxstyleemphasis{userID}.
   345 
   503 
   346 \item {} 
   504 \item {} 
   347 \sphinxstyleemphasis{updateDateAndTime(date, blockID, cursor, db)}: Similar to \sphinxstyleemphasis{updateAuthor()} 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.
   505 \sphinxstyleemphasis{updateDateAndTime(date, blockID, cursor, db)}: Similar to \sphinxstyleemphasis{updateAuthor()} 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 in labfolder are the time and date when the import took place.
   348 
   506 
   349 \end{itemize}
   507 \end{itemize}
   350 
   508 
   351 The labfolder support suggested the following alternative involving using the labfolder API:
   509 The labfolder support suggested the following alternative involving using the labfolder API:
   352 \begin{itemize}
   510 \begin{itemize}
   353 \item {} 
   511 \item {} 
   354 … siehe E-Mail (gesendet) vom 15.12. …
   512 User account: A user account can be created via the API 2 endpoint \sphinxcode{/auth/signup}. The password will be an encrypted dummy password. In order for this to work the LDAP authentication must be turned off when this endpoint is called. After the account creation LDAP authentication should be turned on again. Once the true user of this account logs in labfolder will ignore the dummy password and check the entered password against the password stored in LDAP.
       
   513 
       
   514 \item {} 
       
   515 Author: To create a labfolder entry by using the original entry’s author needs a special work-around. \sphinxstylestrong{First, make sure to prevent labfolder users from accessing labfolder for the time of the import.} Then, manually change all user passwords in the DB to the same (encrypted) password. Switch off the LDAP authentication and restart labolder. Now, import entry by entry and get a new login token for each new entry. It is only possible to get login tokens for all users because they all have the same known password. If the author of the entry to be imported does not exist yet in the DB you need to create an account via the API 2 endpoint \sphinxcode{/auth/signup}. Now you reopen the access to the labfolder instance and switch on LDAP again restarting labfolder afterwards. The users can login using their FHI credentials no matter the “universal” password in the DB. If LDAP authentication is not turned on the users could do a password recovery on the login screen and re-set their password to their liking.
       
   516 
       
   517 \item {} 
       
   518 Date and time: Since you cannot change creation and modification time stamp of an entry via the API you could instead create custom dates during the import of an entry. The original entry creation timestamp could be “Original entry creation” followed by the creation time and date of the import. All entries can be filtered and searched by the custom dates.
   355 
   519 
   356 \end{itemize}
   520 \end{itemize}
   357 
   521 
   358 
   522 
   359 
   523