ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
69320
|
Mon Mar 22 19:59:13 2021 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Request | Linux | All | V3.1.4 | Re: Request: make $text available for "subst" |
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
|
|
|
69321
|
Tue Mar 23 13:42:27 2021 |
| Sebastian Schenk | sebastian.schenk@physik.uni-halle.de | Request | Linux | All | V3.1.4 | Re: Request: make $text available for "subst" |
I am not Stefan, but maybe I can add to this issue.
Personally I think it is not a good way to dump all the information into the text field and try to let the server parse it.
This could be archived more simply by using e.g. the python elog scripts or using the elog command tool to directly submit well structured elog entires.
As you have mentioned you could use the "execute new|edit|delete" commands to do the things you want to do.
Let the called script fetch the elog entry and alter it in the way you like and resubmit the entry.
(You have to make sure to don't generate a endless loop and you have to proably have to use a forwarding script as the elog "execute" command waits for finished execution).
This way you don't touch the 1500 characters limit of passing $text to the execute command.
Also the point "filling an attribute X with free text" needs some kind of (extended) parsing, which isn't possible with the subst command.
In our elog we such an attribute X, which is in some conditions filled with a set of other attributes and on other conditions just a normal input field, so the user could type custom text in.
"fill an attribute automatically with the character length of the text" could be done with the above mentioned execute command or it could be done on the clientside (e.g. browser using javascript or if automatically generated by a script, then directly by the script)
I hope it helps to build our application.
Best wishes,
Sebastian
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
|
|
69324
|
Wed Mar 24 10:06:26 2021 |
| Stefan Ritt | stefan.ritt@psi.ch | Request | Linux | All | V3.1.4 | Re: Request: make $text available for "subst" |
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
|
|
|
|
69332
|
Wed Mar 24 22:09:56 2021 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Request | Linux | All | V3.1.4 | Re: Request: make $text available for "subst" |
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
|
|
|
|
|
69400
|
Thu Oct 21 11:15:20 2021 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Request | All | 3.1.4 | How 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 )
|
69492
|
Wed Mar 9 16:25:31 2022 |
| Edmund Hertle | edmund.blomley@kit.edu | Request | All | 3.1.4 | Use different HTML class for drafts compared to not existing entries |
Right now a Draft shows a red error indication, that the entry is currently a draft. For the CSS styling it uses the HTML class="errormsg". The same class is also used if an entry does not exist.
Would it be possible for the draft version to use a different HTML class (for example class="draftmsg")? It can also use the same visual style (or making it yellow would probably also work)
The reason is that the py_elog Interface uses the class="errormsg" to determine if an entry does not exist ( https://github.com/paulscherrerinstitute/py_elog/blob/master/elog/logbook.py#L394 ) and refuses to return the content for this entry. One could possibly fix that also on the py_elog part, but it would probably at least require parsing of actual text (which might make problems for translated pages). Alternativley one could also look for the edit button, but maybe a small change on the elog server side is the simplest solution to this problem?
|
69515
|
Wed Apr 20 14:19:08 2022 |
| Antonio Bulgheroni | antonio.bulgheroni@gmail.com | Request | Windows | 3.1.4 | Dynamic substitution with date |
Dear all,
I would need your help with an incremental index with date information.
I want to have an incremental number made by the last two digits of the year, the two digits of the month and an incremental four digits number.
Subst Number = %y%m####
The problem is that I don't want to have the incremental number reset to zero every new month, but rather only once a year. Is it something like this possible?
Thanks for your help!
toto
|
69574
|
Thu Oct 20 10:04:51 2022 |
| Finn Junker | fj@tvis.net | Request | Windows | 3-1-4 | Up to date windows version |
Dear Developers
I know this topic i on and off in this forum but it seems the only updated versions of Elog are in the linux binaries. Have anybody been able to compile a windows versions since 2018?
Kind Regards Finn |