ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
69060
|
Mon Nov 18 16:58:21 2019 |
| Roger Kalt | roger.kalt@psi.ch | Info | Linux | 3.1.4 | Example scripts how to migrate or combine logbooks |
Attached the shell scripts using awk and sed how I have migrated two separated logbooks into one single and how I re-adjusted certain attributes. |
Attachment 1: run_modif.sh
|
#!/bin/bash
# KR84, 28.10.2019
# the input files are the exported XML files from ELOG -> Finden
# search in XML for sring between <DATE> and </DATE>
# and replace with: <DATE> and </DATE><When> and </When>
echo "converting export_rf.xml ..."
cat ./export_rf.xml |
sed 's/<Personnel\(.*\)Personnel>/<Author\1Author>/g' |
sed 's/<DATE\(.*\)DATE>/<DATE\1DATE>\n\t\t<When\1When>/g' |
sed 's/<Subject>\(.*\)<\/Subject>/<Title>\1<\/Title><Entry_Type><\/Entry_Type>/g' |
sed '/<Machine>SwissFEL<\/Machine>/ {N;N; s/<Machine>SwissFEL<\/Machine>.*<Domain>OBLA<\/Domain>.*<Section>TRFCB/<Machine>OBLA<\/Machine>\n\t\t<Domain>All<\/Domain>\n\t\t<Section>TRFCB/g}' |
sed 's/<When>Mon, /<When>/g' |
sed 's/<When>Tue, /<When>/g' |
sed 's/<When>Wed, /<When>/g' |
sed 's/<When>Thu, /<When>/g' |
sed 's/<When>Fri, /<When>/g' |
sed 's/<When>Sat, /<When>/g' |
sed 's/<When>Sun, /<When>/g' |
sed '/<When>.*<\/When>/{s/ Jan 20/.01./g}' |
sed '/<When>.*<\/When>/{s/ Feb 20/.02./g}' |
sed '/<When>.*<\/When>/{s/ Mar 20/.03./g}' |
sed '/<When>.*<\/When>/{s/ Apr 20/.04./g}' |
sed '/<When>.*<\/When>/{s/ May 20/.05./g}' |
sed '/<When>.*<\/When>/{s/ Jun 20/.06./g}' |
sed '/<When>.*<\/When>/{s/ Jul 20/.07./g}' |
sed '/<When>.*<\/When>/{s/ Aug 20/.08./g}' |
sed '/<When>.*<\/When>/{s/ Sep 20/.09./g}' |
sed '/<When>.*<\/When>/{s/ Oct 20/.10./g}' |
sed '/<When>.*<\/When>/{s/ Nov 20/.11./g}' |
sed '/<When>.*<\/When>/{s/ Dec 20/.12./g}' |
sed 's/ +0100<\/When>/<\/When>/g' |
sed 's/ +0200<\/When>/<\/When>/g' > export_rf_modified.xml
# sed 's/ Jan 20/.01./g' |
# sed 's/ Feb 20/.02./g' |
# sed 's/ Mar 20/.03./g' |
# sed 's/ Apr 20/.04./g' |
# sed 's/ May 20/.05./g' |
# sed 's/ Jun 20/.06./g' |
# sed 's/ Jul 20/.07./g' |
# sed 's/ Aug 20/.08./g' |
# sed 's/ Sep 20/.09./g' |
# sed 's/ Oct 20/.10./g' |
# sed 's/ Nov 20/.11./g' |
# sed 's/ Dec 20/.12./g' |
# search in XML and add offset to all IDs because they shall not overlap when merged.
echo "converting export_llrf.xml ..."
cat ./export_llrf.xml | sed 's/<Subject>\(.*\)<\/Subject>/<Entry_Type><\/Entry_Type>\n\t\t<Status><\/Status>\n\t\t<Title>\1<\/Title>\n\t\t<Inv_ID><\/Inv_ID>/g' > export_llrf_modified1.xml
cat ./export_llrf_modified1.xml | awk -F'\t\t<MID>|</MID>||' '{ if ($2!="") {print "\t\t<MID>"$2+2016"</MID>"} else { print $1} }' > export_llrf_modified2.xml
cat ./export_llrf_modified2.xml | awk -F'\t\t<REPLY_TO>|</REPLY_TO>||' '{ if ($2!="") {print "\t\t<REPLY_TO>"$2+2016"</REPLY_TO>"} else { print $1} }' > export_llrf_modified3.xml
cat ./export_llrf_modified3.xml | awk -F'\t\t<IN_REPLY_TO>|</IN_REPLY_TO>||' '{ if ($2!="") {print "\t\t<IN_REPLY_TO>"$2+2016"</IN_REPLY_TO>"} else { print $1} }' > export_llrf_modified.xml
rm -rf ./export_llrf_modified1.xml ./export_llrf_modified2.xml ./export_llrf_modified3.xml
cat ./export_llrf_modified.xml |
sed '/<Machine>SwissFEL<\/Machine>/ {N;N; s/<Machine>SwissFEL<\/Machine>.*<Domain>Test Systems<\/Domain>.*<Section>TRFCB/<Machine>OBLA<\/Machine>\n\t\t<Domain>All<\/Domain>\n\t\t<Section>TRFCB/g}' |
sed 's/<When>Mon /<When>/g' |
sed 's/<When>Tue /<When>/g' |
sed 's/<When>Wed /<When>/g' |
sed 's/<When>Thu /<When>/g' |
sed 's/<When>Fri /<When>/g' |
sed 's/<When>Sat /<When>/g' |
sed 's/<When>Sun /<When>/g' |
sed 's/-Jan-/.01./g' |
sed 's/-Feb-/.02./g' |
sed 's/-Mar-/.03./g' |
sed 's/-Apr-/.04./g' |
sed 's/-May-/.05./g' |
sed 's/-Jun-/.06./g' |
sed 's/-Jul-/.07./g' |
sed 's/-Aug-/.08./g' |
sed 's/-Sep-/.09./g' |
sed 's/-Oct-/.10./g' |
sed 's/-Nov-/.11./g' |
sed 's/-Dec-/.12./g' |
sed 's/ +0100<\/When>//g' |
sed 's/ +0200<\/When>//g' |
sed 's/<\/When>/:00<\/When>/g' |
sed 's/<When>-:00<\/When>/<When><\/When>/g' > export_llrf_modified_datetime.xml
echo "export_llrf_modified_datetime.xml need manual edit for empty <When></When>"
|
Attachment 2: generate_import_llrf_fwd.sh
|
#!/bin/bash
# KR84, 28.10.2019
# generate emtpy auto-fwd text for LLRF for 3100 entries and offset of 2000
echo "generated import_llrf_fwd.xml"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > import_llrf_fwd.xml
echo "<ELOG_LIST>" >> import_llrf_fwd.xml
declare -i ID
declare -i IDNEW
for ID in {1..3013}
do
IDNEW=$ID+2016
echo -e "\t<ENTRY>" >> import_llrf_fwd.xml
echo -e "\t\t<MID>${ID}</MID>" >> import_llrf_fwd.xml
echo -e "\t\t<DATE>Mon, 28 Oct 2019 20:00:00 +0200</DATE>" >> import_llrf_fwd.xml
# echo -e "\t\t<DATE>28.10.2019 20:00:00</DATE>" >> import_llrf_fwd.xml
echo -e "\t\t<ATTACHMENT></ATTACHMENT>" >> import_llrf_fwd.xml
echo -e "\t\t<ENCODING>HTML</ENCODING>" >> import_llrf_fwd.xml
echo -e "\t\t<When>28.10.2019 20:00:00</When>" >> import_llrf_fwd.xml
# echo -e "\t\t<When>1572289200</When>" >> import_llrf_fwd.xml
echo -e "\t\t<Author>Kalt Roger (KR84)</Author>" >> import_llrf_fwd.xml
echo -e "\t\t<Machine>SwissFEL</Machine>" >> import_llrf_fwd.xml
echo -e "\t\t<Domain></Domain>" >> import_llrf_fwd.xml
echo -e "\t\t<Section></Section>" >> import_llrf_fwd.xml
echo -e "\t\t<System></System>" >> import_llrf_fwd.xml
echo -e "\t\t<Subsystem></Subsystem>" >> import_llrf_fwd.xml
echo -e "\t\t<Subject>Automatic forward</Subject>" >> import_llrf_fwd.xml
echo -e "\t\t<TEXT><meta http-equiv="refresh" content="0; URL='https://elog-gfa.psi.ch/SwissFEL+RF/${IDNEW}'" /></TEXT>" >> import_llrf_fwd.xml
echo -e "\t</ENTRY>" >> import_llrf_fwd.xml
done
echo "</ELOG_LIST>" >> import_llrf_fwd.xml
|
517
|
Wed Mar 31 04:22:57 2004 |
| Robin Peterson | robin.h.peterson@state.or.us | Info | Windows | 2.5.2 | Using Javascript files |
I develop multiple client server apps and web apps deployed on intranets. I
need my users to send me bugs with screenshots attached.
So I'm interested in auto opening a new elog page in an embedded browser and
automatically doing an attachment. I've seen a couple messages about
recently added Javascript hooks (message 465). The message specified a URL
that would fire off javascript(http://localhost/demo/?cmd=New&js=test.js).
Now apparently that wasn't fully working or at least you couldn't bring up
multiple alerts. Has that been fixed, or is it just a problem with alerts?
Can I write a url that has my attributes, plus a short js script that just
adds an attachment?
Anyhow, any info on where this functionality is would be appreciated. I'm
going back to my mgmt for signoff on using this, and if I get it (fairly
high probability), then I'll have a coder start implementing it. :-)
BTW, great tool! Very clean design.
Cheers,
Robin |
68097
|
Wed Aug 19 17:08:56 2015 |
| Richard Stamper | richard.stamper@stfc.ac.uk | Info | Windows | 3.x.y | Compiling for Windows |
I am interested in using LDAP authentication for elogd on Windows for which it looks like I need to compile from source, enabling LDAP in the make file.
Does anyone have advice on build environments for Windows in which they have had success making elog? Free ones preferably, such as Cygwin. |
65742
|
Fri Feb 15 15:46:38 2008 |
| Richard Ecclestone | richard.ecclestone@cern.ch | Info | Windows | ELOG V2.7. | Re: Message ID and trouble ticketing system |
lance wrote: |
Stefan Ritt wrote: |
lance wrote: |
I am trying to create a trouble ticket system however when you do a reply you get a new message ID. I was hoping to use the message ID as a ticket number and just wanted to use the reply as an append to the orginal message id, however each reply creates a new message id. This would be a nightmare to track and if I closed the ticket I would have to close every log entry related to this.
Does anyone know how to either make the reply and appended reply (appended to the orignal message id) or how to create a field that automatically gives it a new trouble ticket number.
Has anyone configured a trouble ticket system that I could look at to get some ideas?
|
First of all, ELOG has been designed having shift logbooks in mind, so it probably will never be a perfect trouble ticket system. Nevertheless, there are some options which can help in that respect:
- Use attributes Ticket and Status
- Preset Ticket with a running ticket number via
Preset ticket = TCK-#####
This will increment the 5-digit ticket number whenever you create a new ticket, but will not update it when you do a reply
-
Use Status to determine the status of the whole trouble ticket chain (initial entry plus replies)
Options Status = open, closed
Preset Status = open
-
Once a ticked chain is closed, do the following:
- Go to the threaded list display
- Click on Select
- Select the trouble ticket chain
- Click on Edit
- Now change Status from "Open" to "Closed"
This will then modify the Status of the whole chain from "Open" to "Closed"
|
Stefan,
Thanks for this, I had already implemented the Preset Ticket Nr = TT-##### but I didnt use the threaded and Select to close the ticket, very nice tip thanks. I think this program can be have several uses, and working very well. The trouble ticketing will work for us.
Once again thanks for the very speedy support.
Lance
|
Hi
I tried the 'Preset ticket = TCK-#####' method to create unique numbers for our application. This worked very nicely until we replied to a earlier message, if we then create a new message the system creates a sequential number after the last message number we replied to. For example if we have 10 messages. If someone replies to message number #2 then when a new record is created it is then assigned number #3 not #11, thus making a duplicate entry for #3.
Any ideas?
Cheers Richard |
68517
|
Wed Dec 21 20:15:19 2016 |
| rahul bhandari | rbhandari@winnipeg.ca | Info | Windows | 3.1.2 | Elog source code giving errors when compiling about missing header files |
I downloaded the source code from the git repository which contained the new fix that was made for the missing username-crash error. I tried compiling the elogd.c file using a GCC compiler and it gave an error about missing header files. It first gave an error about netdb.h file and when I commented that header file call, it gave further errors for other header files. I do not really understand why it gives an error about that. |
432
|
Wed Sep 17 16:06:09 2003 |
| R. Beekman | rbeekman@hiscom.nl | Info | | | ELOG v2.3.9 CSS cross-reference (used for skins) |
Contribution available for all who wants to make SKIN for ELOG!
You are invited to benefit from this free info!
Just click on the "Contributions" tab to find the info (look for ID6).
Or... goto http://midas.psi.ch/elogdemo/Contributions/6 |
66575
|
Wed Nov 4 00:58:00 2009 |
| Richard Stamper | r.stamper@rl.ac.uk | Info | Windows | 2.7.7 | Problems zooming elog pages in Internet Explorer - a possible fix |
Internet Explorer fails to display correctly some aspects of pages generated by elog when the zoom functionality is used (Ctrl + and Ctrl -). This is really a bug in the IE renderer rather than elog, but since IE can be persuaded to do better relatively easily it might be worth making some minor changes to make elog more robust when used with the buggy Microsoft browser.
The problem I encountered was initially with the multiple checkboxes for an Moptions attribute, but I noticed later it also affects the logbook tabs at the top of the screen. If you start creating a submission to this forum in IE (7 or earlier, at least) you can see the problem; when zooming, the text labels and the checkboxes do not scale together so start overlapping, and the same happens with the logbook tabs and the text links on them. The problem is apparently to do with a proprietary IE concept called "layout" - see http://www.satzansatz.de/cssd/onhavinglayout.html for details - and IE struggles when some elements do not have the hasLayout property set to "true".
The fix is to coerce elements to have the hasLayout element set to "true" by giving them some benign CSS property. The best I can find is to set "display: inline-block" for some of the key elements, and this can be done by modifying default.css rather than the elogd.c code.
Adding
span {
display: inline-block;
}
to default.css (e.g. just after the default style definition for the "td" element) and adding
display: inline-block;
to the style sets for the .sltab and .ltab classes (generic, not those specific to the "a" element) seems to prevent IE doing bad things with the display when zooming without messing up the display in Firefox. I have not tested this comprehensively or in any other browsers, but I thought it might be worth passing on.
Cheers,
Richard Stamper |
67054
|
Sat Apr 23 08:56:26 2011 |
| Pelle | pelle@sm4xiu.eu | Info | Linux | 2,3.8 | Re: elog2sql - a script to convert elog logbooks to a MySQL database |
I know this thread was started 2003 but if anyone have this MySQL export script please attach it to this thread.
Thanks,
Pelle |