Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 763 of 796  Not logged in ELOG logo
ID Date Icon Authordown Author Email Category OS ELOG Version Subject
  69353   Fri Apr 23 20:08:10 2021 Question Andreas Luedekeandreas.luedeke@psi.chQuestionAllV3.1.4How to format a column in list display?
There is the nice conditional formatting feature for List display:
Cell Style <attribute> <value> = <style>
I would like to use it without conditions: some attributes should always be formatted in a specific way.
 
Specifically I want a generated attribute (combined from other attributes) to be display in monospace font.
The "Format Pikett = 0, attribname, messagelist" works nicely for the single entry display (pik1), but not for List view (pik-list).

Would it be possible to create a new command "List format <attribute> = <css_class_name>,<css_class_value>,<width>,<size>", or is there another way to achieve this?

  69370   Mon Jun 14 17:25:02 2021 Idea Andreas Luedekeandreas.luedeke@psi.chBug reportAllV3.1.4Bug Report with CSS includes (was Re: How to format a column in list display?)

Okay, found some solution for my problem:

List Change Pikett = <div class="pikett">$Pikett</div>
CSS=pikett.css

And file themes/default/pikett.css contains:

.pikett {
  background-color:white;
  font-size:16px;
  font-family:monospace;
  text-align:left;
}

That works like a charm - until I log in to the logbook. Then the include of the CSS in the header is garbled with some "prefix" of random chars:

<link rel="stylesheet" type="text/css" href="elog.css">
<link rel="stylesheet" type="text/css" href="`=T ýpikett.css">

And a quick check in the source code shows some bad code:

L7615: function "show_html_header"

         rsprintf("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s%s\">\n", css_base, css);

Here css_base is a not initialized local variable of the function. In fact the above line is the only reference of that variable char css_base[1000].

The bug is still present in elog-3.1.4-611489b

 

Andreas Luedeke wrote:
There is the nice conditional formatting feature for List display:
Cell Style <attribute> <value> = <style>
I would like to use it without conditions: some attributes should always be formatted in a specific way.
 
Specifically I want a generated attribute (combined from other attributes) to be display in monospace font.
The "Format Pikett = 0, attribname, messagelist" works nicely for the single entry display (pik1), but not for List view (pik-list).

Would it be possible to create a new command "List format <attribute> = <css_class_name>,<css_class_value>,<width>,<size>", or is there another way to achieve this?

 

  69371   Mon Jun 14 18:06:06 2021 Idea Andreas Luedekeandreas.luedeke@psi.chCommentLinux | AllV3.1.4Re: Request: make $text available for "subst"

I should tell that I found a simpler way to achieve the same:
I suppress the "text" field and use a single line text input field instead.
The single line input in "free text" modes just contains "<br>" : I would have had to use those in the text field anyway.

Andreas Luedeke wrote:

Hi Stefan,
no problem: if I just strip all newlines from the $text field (in HTML you use <br> anyway, the newline has no function apart from whitespace), and my multiline attribute is fine to go.
I do not intend to make the attribute editable: it is just used for display. Because that allows me to create the attribute either from free text or from combining other fields - depending on conditional attributes.

As a special feature you could strip all newlines beforehand, when providing the $text for subst statements.

Cheers, Andreas

Stefan Ritt wrote:

Sure, attributes can be shown multi-line, but they cannot be stored in the elog internal database. The database is a very old design and only allows for single line attributes. Just look at a YYMMDDa.log file and you will see that. I would have to change the database format to somethign more advanced like XML, but that would take me a couple of weeks or months.

Soooorrryy! ;-)

Andreas Luedeke wrote:

While the input widget of text attributes is a single line, they can easily be multi-line in the display - when you use HTML at least.
And of course the user can parse the text field and generate a single line, if he wants to.
If you leave it to me, I'll create wonderful applications to that feature :-)

Please? ;-)

Stefan Ritt wrote:

$text is the full body text and can go over many lines. Since attributes are restricted to single lines, it's not possible to substitute them with the body text.

Stefan

Andreas Luedeke wrote:

Hi Stefan,

I've just tried to read the $text with subst into another field and failed.
It looks like $text is only available for the execution of shell scripts in the "execute new|edit|delete = <script>" command.

Could that be added? I can think of a multitude of applications:

  • In my case I want to fill an attribute X either with free text or generated from other fields. The list view will show just X and not how it was generated.
  • I could fill an attribute automatically with the character length of the text.
  • I could parse the text in a shell script and set other attributes according to the content.

Thank you for considering it.

Cheers, Andreas

 

 

 

 

 

  69388   Sat Aug 28 21:32:09 2021 Warning Andreas Luedekeandreas.luedeke@psi.chBug reportLinuxELOG V3.1.4Adding entries without being logged in stopped working with attachments
Hi Stefan (et al),
we have several logbooks that allow to add new entries without logging in first.
That still works, as long as these entries don't have any attachments.
As soon as there is an attachment you are asked to login in the web interface.

I hope that this is not an intentional feature, but a bug?
Several of our software tools now fail to submit elog entries.

 
The problem occured when we upgraded to ELOG V3.1.4-2e1708b.
Version elog-3.1.4-611489b did not show this behaviour.

Kind Regards
Andreas
  69398   Thu Oct 21 00:42:42 2021 Reply Andreas Luedekeandreas.luedeke@psi.chInfoLinuxUnknownRe: How to access PSI Elog data from other web clients

There is a python API to access ELOG via HTTP: https://github.com/paulscherrerinstitute/py_elog

Lin Wang wrote:

We want to develop separate mobile web pages for the web applications deployed at CSNS accelerator, including the PSI Elog.

In Elog, is there RESTful API or HTTP/JSON or HTTP/XML interface for other web clients to access?

Or is there any workaround?

 

  69399   Thu Oct 21 11:00:46 2021 Warning Andreas Luedekeandreas.luedeke@psi.chBug reportLinux3.1.4-2e1708bRedirect in Execute new needs space after ">"

EDIT: forget the tip below. Instead just call script files: inline scripting in the ELOG config shows very strange behavior. Doing the same in external scripts works reliable.

 

I just spend an hour searching for a problem. To avoid others to spend the hour again, here's a little "special behaviour" of shell execution in ELOG you should know about:

If you want to do redirect to a file in a shell execution, put a space before and after the redirecting. The following does not work:

Execute new = if ! [ -z "$CampaignID" ] ; then echo "$CampaignID" >/usr/local/elog/logbooks/elog-campaign.default ; fi

You will not get an error message, but the file is not created. But if you add a space it will work as expected:

Execute new = if ! [ -z "$CampaignID" ] ; then echo "$CampaignID" > /usr/local/elog/logbooks/elog-campaign.default ; fi

It is not really a bug; if you know about it, then it is not a big deal: hence this entry here. I saw this behavior on a Linux RHEL7 system.

In case you are wondering: I use this to create a default for the field CampaignID, to be used for new entries in combination with a Preset:

Preset CampaignID = $shell( if [ -r /usr/local/elog/logbooks/elog-campaign.default ] ; then cat /usr/local/elog/logbooks/elog-campaign.default;fi )
  69400   Thu Oct 21 11:15:20 2021 Idea Andreas Luedekeandreas.luedeke@psi.chRequestAll3.1.4How about string constants in config files?

My config files are often large and use some shell scripting. In these shell scripting part I interact with files and execute scripts in specific folder.
It would be nice to have the ability to define for example a file path once and reuse it in different parts of the config file. It would help to make config files cleaner. For example:

Constant c_cid = "/usr/local/elog/logbooks/elog-campaignID.default"
Execute new = if ! [ -z "$CampaignID" ] ; then echo "$CampaignID" > $c_cid; fi

Preset CampaignID = $shell( if [ -r $c_cid ] ; then cat $c_cid; else echo None > $c_cid; echo None; fi )

  69430   Tue Dec 7 11:56:37 2021 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux3.1.4Re: Unclear how to use the command line tool /usr/bin/elog

If you need HTTPS then you must specify the "-s" option.

You could have looked into the help of the elog command:

> elog -h
elogd 3.1.4 built Jun 14 2021, 18:01:54 revision 611489b
usage: elog
elog -h <hostname> [-p port] [-d subdir]
                              Location where elogd is running
     -l logbook/experiment    Name of logbook or experiment
     -s                       Use SSL for communication
     [-v]                     For verbose output
     [-u username password]   User name and password
     [-f <attachment>]        (up to 50 attachments)
     -a <attribute>=<value>   (up to 50 attributes)
     [-r <id>]                Reply to existing message
     [-q]                     Quote original text on reply
     [-e <id>]                Edit existing message
     [-w <id>|last]           Download existing message (last message)
     [-x]                     Suppress email notification
     [-n 0|1|2]               Encoding: 0:ELcode,1:plain,2:HTML
     -m <textfile>] | <text>
Arguments with blanks must be enclosed in quotes
The elog message can either be submitted on the command line, piped in like
"cat text | elog -h ... -l ... -a ..." or in a file with the -m flag.
Multiple attributes and attachments can be supplied

 
Jose Caballero wrote:

Hi Stefan,

Here is the, I believe, relevant part of the output:

-------------------------------------------------

Response received:
HTTP/1.1 404 Not Found
Date: Tue, 07 Dec 2021 07:26:07 GMT
Server: Apache/2.4.6 (Scientific Linux) OpenSSL/1.0.2k-fips PHP/5.4.16
Content-Length: 204
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /LogBook/ was not found on this server.</p>
</body></html>

-------------------------------------------------

Note that the URL https://elog-1.matrix.com/LogBook/ exists and works. That's how we create all our log entries via web browser. 

 

Thanks,

Jose

 

Stefan Ritt wrote:

Please issue the elog command with an added "-v" flag and post the output here.

Stefan

Jose Caballero wrote:

Hello,

 

I am trying first time to use the tool /usr/bin/elog. From the documentation is not clear to if everything must be in quotes or not, if every attribute requires -a.

Here is how my attempt looks like (changing actual data by fake one):

      /usr/bin/elog -h elog-1.matrix.com -l LogBook -u jcaballero mypassword -a Team='Team Name Here' Category='Category Here' -a 'Affected service'='Name of affected service here' -a Criticality=Normal -a 'Oncall Documentation'='No modifications required' -a Subject='here is the subject line' 'here is the text'

I just get "Error transmitting message". 

Attributes Team and Category are of checkbox type. Attributes Criticality and Oncall Documentation are of radio type.

What is wrong with my command attempt?

 

Thanks a lot in advance.

Cheers,

Jose

 

 

 

 

 

 

ELOG V3.1.5-2eba886