diff -r 02a3741242b2 -r 57431f642e82 elog2labfolder/_build/html/_sources/importing_from_elog.rst.txt --- a/elog2labfolder/_build/html/_sources/importing_from_elog.rst.txt Mon Jun 04 13:54:51 2018 +0200 +++ b/elog2labfolder/_build/html/_sources/importing_from_elog.rst.txt Mon Jun 04 16:38:36 2018 +0200 @@ -1,6 +1,27 @@ Importing projects from e.g. the ELOGbook to Labfolder at the FHI ================================================================= +This is how you generally do it:: + + + 1. In labfolder, create a new group project. + 2. Get the ELOG logbook "operating" and export it as RAW. Remember where you've put the text file with the raw output and the directory with attachments files. + 3. Only once: Get the elog2labfolder repository from github. + 4. Adapt elog2labfolder.py to your needs. Specify the name of the project that you created previously. + 4. Run elog2labfolder.py + +These steps are explained in more detail in the following. + + +Creating a group project +------------------------ + +As the group admin (or one of the admins) in labfolder create a group project, for example, "operating" in a group named "FEL". You are now the owner of this project. Make sure you don't have several projects of the same name in one group. + + +Entries from ELOG +----------------- + The ELOG entries of a certain project need to be exported as *Raw* which looks like this:: $@MID@$: 12 @@ -41,6 +62,32 @@ The script *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 *myPythonAPIv1.py* and *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. *getListOfAuthors.py* gives you a list of all authors that are mentioned in a raw ELOG export file. +To finally import an ELOG logbook to a labfolder project you need to run ``$ python elog2labfolder.py``. Prior to this you need to make some changes to the header of the file, that is, these lines:: + + ### Set the hostname + #hostname = 'lftest' + hostname = 'labfolder' + + if hostname == 'lftest': + server = 'http://' + hostname + '.rz-berlin.mpg.de:9091' + elif hostname == 'labfolder': + server = 'https://' + hostname + '.rz-berlin.mpg.de:9091' + + ### The entries will be created using the following labfolder account which specifies the author of the entry. During the creation process, however, the entry's author ID will be changed to the real author's ID if the real author is already contained in the user table of the labfolder DB. + email = 'weiher@fhi-berlin.mpg.de' + password = getpass.getpass('Enter the labfolder password associated with ' + emailAddress+': ') + + ### Specify the absolute path to the raw ELOG export file. + elogExportFile = '/home/stefan/Dokumente/labfolder/OperatingLogbook_exportRaw_ORIGINAL.txt' + + ### Full path to where the attachments of the logbook to be imported are stored: + attachmentsDirectory = '/home/stefan/Dokumente/labfolder/Operating/' + + ### Project name in labfolder + projectName = 'operating' + + + Alternatives to manipulating the labfolder DB on MySQL level ------------------------------------------------------------