ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
1929
|
Thu Sep 7 22:06:00 2006 |
| Arno Teunisse | a.teeling3@chello.nl | Question | Windows | | elog perl script and the command prompt and eof | hello
Just wrote a quick and dirty perl script ( See Attachment ) that let's you enter a record into the database. Put it into the directory where the config file is located. It look's at the "attributes = " and the "required attributes = "
within a section in the elog configuration file. The script is using elog.exe to accomplish this.
One problem with the script is that you must press Control_Z ( ^Z ) to store the data into the database.
Does anybody know how to prevent this ? It works also when redirecting the data into the script with a file input.txt. ( add2elog.pl confgi.cfg logbook < input.txt )
I Know this is NOT an elog question but maybe someone is happy with the script and has the answer for me. |
Attachment 1: add2elog.pl
|
=pod
elog -h hostname [-p port] [-l logbook]
[-w password]
[-u username password]
-a <attribute1>=<value1>
-a <attribute2>=<value2>
...
-f attachment1
-f attachment2
...
-m textfile | text
This little perlscript is intented to enter attributes into elog with elog.exe from
the command line.
The script checks the "attributes" and the "required attributes". When a required
attribute is needed the users sees a "*" after the attributes name.
=cut
if ( $#ARGV <1 ) {
print "Usage : $0 Configfile.cfg logbookname\n";
print "Assumed is that you run this in the directory below the logbooks\n";
print "directory.\n";
exit;
}
$LOGBOOK = $ARGV[1];
chomp $LOGBOOK;
print "Logbook : $LOGBOOK\n";
$INSTALLDIR='c:/program files/elog';
$LOGBOOK_DIR='c:/program files/elog/logbooks';
# $CFGFILE = 'c:/program files/elog/contacts.cfg' ; # can have multiple logbooks
$CFGFILE = $ARGV[0];
chomp $CFGFILE;
print "Config file : $CFGFILE<< \n";
open ( CFG, "< $CFGFILE") or die "could not find config file\n";
while ( <CFG> ) {
# find the logbook section
chomp;
next if not /^[$LOGBOOK\]/;
while (<CFG> ) {
last if /^\s*[.*\]\s*$/ ; # Next section
if ( /^attributes\s*=\s*/i ) {
chomp;
s/\s*$//;
s/^Attributes\s*=\s*//i;
@attributes = split(/\s*,\s*/);
#print "Found it\n";
next;
}elsif ( /^Required\s*Attributes\s*=\s*/i ) {
chomp;
s/\s*$//; # remove the last white space if there is one
s/^Required Attributes\s*=\s*//i;
@RAttributes = split (/\s*,\s*/);
# last; # this assumes that "Required Attributes" comes after "Attributes"
}
}
}
close CFG;
## Nothing usefull found , wrong config file ???
if ( scalar (@attributes) == 0 ){
print "Nothing found\n";
exit;
}
for ( @RAttributes ) {
#print "==>$_<==\n";
$RAttributes{$_} = $_ ;
}
# CHECK the RAttributes hash
#while (( $KEY, $VALUE ) = each %RAttributes ) {
# print "Required Attribute : $VALUE\n";
#}
for ( @attributes ) {
print "$_ " ;
$ATTR = $_;
if ( exists( $RAttributes{$_} )) {
print "* : ";
$flag=1;
} else {
print ": ";
$flag =0;
}
$HASH{$_} = <STDIN> ;
chomp $HASH{$_};
if ( $flag and $HASH{$_} eq "" ) {
while ( $HASH{$_} eq "" ) {
print "This is a Required attribute\n";
print "$ATTR * : " ;
$HASH{$_} = <STDIN> ;
chomp $HASH{$_};
}
}
}
# send the info to the elog server
for ( @attributes ) {
print "\n -a $_=$HASH{$_}\n" ;
if ( defined ( $HASH{$_} )) {
$ATTRIBUTES .= " -a \"${_}=$HASH{$_}\"";
#print "$ATTRIBUTES\n";
}
}
print "\n$ATTRIBUTES\n";
print "\n";
system ( "elog.exe -h localhost -p 80 -l $LOGBOOK $ATTRIBUTES" );
|
2010
|
Thu Oct 19 12:42:42 2006 |
| deletoille | xavier.deletoille@synchrotron-soleil.fr | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
THANKS A LOT |
2041
|
Mon Nov 6 17:13:19 2006 |
| David Egolf | degolf@fujicolor.com | Question | | | Spell check | Sorry if this has been asked.
Is there a spell check that can be implemented in Elog or any recommended add on spell check?
Thanks,
David Egolf |
2103
|
Thu Nov 30 16:07:54 2006 |
| Bertram Metz | bmetz@sbs.com | Question | Linux | 2.6.1-1622 | Re: Email notification (bug tracking system) |
Stefan Ritt wrote: |
Bertram Metz wrote: | Hello,
I'd like to use ELOG like a bug tracking system. I've created an attribute with the name AssignedTo. The attribute type is set to userlist. The value of AssignedTo is set to the full name of the selected user. There is no simple relationship between the full name and the email address on our system. Is it possible to get the email address of a user from the full name?
Attributes = Author, Category, Hardware, Software, Subject, Keywords, Status, AssignedTo
Options Category = Bug Report{1}, Observation{2}, Other{3}
Type AssignedTo = userlist
Show Attributes = Author, Category, Hardware, Software, Subject, Keywords
{1} Show Attributes = Author, Category, Hardware, Software, Subject, Keywords, Status, AssignedTo
Required Attributes = Author, Hardware, Software, Category
Options Status = new, open, confirmed, closed
;the following line does not work, since $AssinedTo contains the full name of the user
Email Category Bug Report = $AssignedTo@company.com
Kind regards,
Bertram |
I implemented the attribute type useremail for you. This can be used like:
Attributes = Author, Catorory, AssignedTo
Type AssignedTo = useremail
Email Category Bug Report = $AssignedTo
You will see only the email address of the people in the list, but since the email address usually contains the name this might be enough. A different system would have been too difficult to implement. The new feature is contained in SVN revision 1754. |
Thank you very much Stefan,
that works fine for me!
Bertram |
2111
|
Sat Jan 13 17:47:45 2007 |
| Exaos Lee | Exaos.Lee@gmail.com | Request | All | | Group definition under top group | Hi, I think, if we can put the "Group xxx = xxx" under some "global xxxx" sections, the configure file will be more clean. Don't you think so? In fact, if the "Group XXX" sections are put under "global XXX" section, the "Top Group XXX" can be ignored. I also found that some options (e.g. "Logbook dir =") under "global" don't work under "global XXX".
Maybe the configure file can be defined more flexible, such as this way:
[global]
Port = 8080
Top configuration = yes
[global Group1]
Group config = group1.cfg
[global Group2]
Group config = group2.cfg
The "group1.cfg" looks like this:
[global]
Top configuration = no
Password file = group1.pwd
Group Linux PCs = Red Hat, Debian, Gentoo
Group Windows PCs = 98, ME, XP, Vista
Group Vista = Home, Pro, Media Center
[Red Hat]
...
|
2175
|
Mon Mar 26 11:45:07 2007 |
| Fergus Lynch | flynch@alternativenetworks.com | Request | Windows | ELOG V2.6. | Global "MOptions" | Hi,
We have ELOG configured for virtually every conceivable use in our IT Operation dept and it is fantastically useful and easy to use. One result of this - naturally! - is that we have quiet a few logbooks.
Many of these logbooks share the same attributes - especially Moptions for equipment lists - which is fine but requires manually copying and pasting Moption lists into multiple logbooks to keep everything synchronized.
Would it be an option to have Global "MOptions" - perhaps configured in the 'global options' file - which can be called up and referenced in all logbooks?
Just an idea -
Cheers
Fergus |
2187
|
Tue Apr 3 17:55:21 2007 |
| Yoshio Imai | | Bug report | Linux | 2.6.4-1826 | Re: Multiple ideas for multiple logbooks |
Stefan Ritt wrote: | Well, you didn't realize, but you were my beta-tester for the keyboard shortcuts . I didn't yet publish it, so you must have gotten this brand new feature from SVN. |
You should really have told me . Actually, I found out about the <Ctrl-C> issue while using this logbook.
Stefan Ritt wrote: | So get the SVN update, and let me know what you think |
Did so, we are running now -1826. I think it is very usable, with maybe one exception (this might be a browser issue, however): When using the shortcuts and/or the ELCode buttons, sometimes the code is generated and the cursor in between the [XX] and [/XX] directive, but sometimes, the whole code directive is selected as if for editing

which prevents from immediately continuing to type (which, I guess, was the idea behind the shortcuts). The behaviour is not completely reproducible, and I have even seen it change during one and the same browser (=firefox) session while working on the same entry (*). I also had it once that the browser out of a sudden completely ignored the ELCode meaning, and instead used <Ctrl-I> for page info and <Ctrl-B> for the history.
(*) It just happened again!
BTW, there are (of course ) two other issues. They are still present in -1826
- one bug was reported by a logbook user: when using the "find" function in a logbook, and selecting one value from the "Author" drop-down list and another from the "Category" drop-down list, the elogd reports no entries found, but when specifying only the "Author" and leaving "Category" blank, many entries are found, including those with the "Category" being looked for. When specifying only the "Category" and leaving the "Author" blank, the elogd also reports no entries found. Has anyone reported a similar behaviour?
- We have one logbook top group for the beamtimes. Under certain conditions, a preset text is to be displayed.
{2&a} Preset Text = resource/text_1.txt
{2&b} Preset Text = resource/text_2.txt
However, the definitions of these conditions have to be repeated for every logbook in the group (putting it only under [global beamtimes] doesn't do it), otherwise they are ignored.
Any idea on these? |
2320
|
Thu Oct 4 12:03:30 2007 |
| Fergus Lynch | flynch@alternativenetworks.com | Request | | ELOG V2.6. | Add date and time stamp to file upload | Hi,
Been using ELOG for a couple of years now and I am very impressed with its functionality.
I would like to request a new feature - add date and time stamp to file upload. We use ELOG (amongst other things!) as a change log and this would really allow allow more accurate records to be kept. For instance we upload router config files (to record changes)and having the exact upload date would be a big enhancement, especially when there are a lot of attachments.
Many Thanks in Advance
Fergus |
|