Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG, Page 1 of 6  Not logged in ELOG logo
ID Date Author Author Email Category Subject Status Last Revisiondown
  49   Wed May 11 09:35:23 2016 Hanno Perreyhanno.perrey@nuclear.lu.seScriptRe: Re: Custom input forms implementationStableWed May 11 09:43:34 2016 by Hanno Perrey
Stefan Ritt wrote:

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

Thank you very much for this nice example!

I found a little issue with newer ELOG versions: if the authentication is done via session cookies, the submission of the checklist will fail with the error "Cannot open file passwd". This is actually misleading as the cause of the error is the empty user name submitted (since the cookie storing user name and pwd hash is never created) and not the password file itself. This can be worked around by removing the user name and pwd fields in the html form before submitting in case there is a SID cookie around.

The attached shiftcheck.html contains this workaround and seems to be functioning fine on my installation (ELOG 3.1.0).

 

Cheers,

Hanno

Attachment 1: shiftcheck.html
  152   Wed Mar 4 18:40:57 2020 Laurent Jean-Rigaudlollspam@free.frOtherRe: Re: RPM build process enhancementsStableWed Mar 4 18:45:05 2020 by Laurent Jean-Rigaud

Sorry, the patch is malformed for the template file. Check PJ.

Bye,

Laurent

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

2nd patch for RPM build which adds :

  • dynamic build options for krb5/ldap/pam/ssl support :
    • for git / non rpm users : 
      • buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
    • for rpm users using SRPMS (dependances are managed) :
      • rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
  • dynamic 2 last changelog entries :
    • last with build information with
      • dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
      • build options list (KBR5, LDAP, PAM, SSL)
    • before last for product changelog of current ELOG version-release
  • customrel flag for local rebuild :
    • release = %elogrel%{?customrel}%{?dist)
    • so custom builder can add --define 'customrel NSA'  at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
  • elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
  • buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).

 

Tested on EL6 and EL7 x86_64 :-)

Bye

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

I enclosed a patch for RPM build process available on GIT.

changes :

  • rpmbuild :
    • checks if provider or custom build (the rm/mv are done on your computers only :-))
    • call rpmbuild with version / release given as parameters
  • elog.spec :
    • last changelog entry date is set to build date
    • build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
    • elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists

 

Todo:

  • add RPMbuild options for ldap/pam/...
  • enclosed git log in changelog automatically (the dream :-))

 

 

Attachment 1: elog.spec.template
# ELOG weblog application
# rpmbuild -ba --define 'elogver 3.1.4' --define 'elogrel 2' --with ssl --with pam --with ldap --with krb5 --define 'factorydate date'
 
# define date of build for changelog and default release
%define build_timestamp %(LC_TIME=C date '+%a %b %d %Y')
%{!?factorydate: %define factorydate %build_timestamp}

# default version and release
%{!?elogver: %define elogver __ELOGVER__ }
%{!?elogrel: %define elogrel __ELOGREL__ }
# default release is build date
%{!?elogrel: %define elogrel %{build_timestamp} }

# Build options :
# Read: If neither macro exists, then add the default definition.
%{?_with_krb5: %define _with_krb5 USEKRB5=1}
%{?_with_ldap: %define _with_ldap USELDAP=1}
%{?_with_pam: %define _with_pam USEPAM=1}
%{?_with_ssl: %define _with_ssl USESSL=1}
# Default build options are with SSL 
%{!?_with_ssl: %{!?_without_ssl: %define _with_ssl USESSL=1}}
# builder info
%define whoami %(eval who am i | awk '{print $1}')
%define HOSTNAME %(hostname)
%{!?packager: %define packager %{whoami} %{whoami}@%{HOSTNAME}}

Name:       elog
Summary:    elog is a standalone electronic web logbook
Version:    %elogver
Release:    %elogrel%{?customrel}%{?dist}
License:    GPL
Group:      Applications/Networking
Source:     http://elog.psi.ch/elog/download/elog-%{elogver}-%{elogrel}.tar.gz
Vendor:     Stefan Ritt <stefan.ritt@psi.ch>
URL:        http://elog.psi.ch/elog
BuildRoot:  /tmp/%{name}-root
Prefix:     /usr/local
# Add build dependencies for pam, ssl and ldap features if enabled.
# Note: Tag tokens must start at beginning-of-line.
#
# Read: If feature is enabled, then add the build dependency.
%{?_with_krb5:BuildRequires: krb5-devel}
%{?_with_krb5:Requires: krb5-libs}
%{?_with_ldap:BuildRequires: openldap-devel >= 2.4.1}
%{?_with_ldap:Requires: openldap >= 2.4.1}
%{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
%{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}

%description
ELOG is part of a family of applications known as weblogs. 
Their general purpose is : 

1. To make it easy for people to put information online in a chronological
   fashion, in the form of short, time-stamped text messages ("entries") 
   with optional HTML markup for presentation, and optional file attachments 
   (images, archives, etc.) 

2. To make it easy for other people to access this information through a 
   Web interface, browse entries, search, download files, and optionally add, 
   update, delete or comment on entries. 

ELOG is a remarkable implementation of a weblog in at least two respects : 

- Its simplicity of use: you don't need to be a seasoned server operator 
and/or an experimented database administrator to run ELOG ; one executable 
file (under Unix or Windows), a simple configuration text file, and it works. 
No Web server or relational database required. It is also easy to translate 
the interface to the appropriate language for your users. 

- Its versatility: through its single configuration file, ELOG can be made 
to display an infinity of variants of the weblog concept. There are options 
for what to display, how to display it, what commands are available and to whom, 
access control, etc. Moreover, a single server can host several weblogs, and 
each weblog can be totally different from the rest. 

%changelog
* %{build_timestamp} %{packager} %{version}-%{release}
- rebuild with option(s): %{?_with_krb5:KRB5 }%{?_with_ldap:LDAP }%{?_with_pam:PAM }%{?_with_ssl:SSL}

* %{factorydate} Stefan Ritt <stefan.ritt@psi.ch> %{version}-%{release}
- Updated from git 
* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
- Made adjustments for new elog server and RH7
* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
- Added BuildRequires, thanks to Stefan Roiser from CERN
* Fri Oct 21 2005 Stefan Ritt <stefan.ritt@psi.ch>
- Added resources/ directory
* Fri Mar 14 2003 Stefan Ritt <stefan.ritt@psi.ch>
- Added %post to change ownership of elog files
* Thu Jan 30 2003 Stefan Ritt <stefan.ritt@psi.ch>
- Added installation of man pages, thanks to Serge Droz <serge.droz@psi.ch>
* Tue Aug 13 2002 Stefan Ritt <stefan.ritt@psi.ch>
- Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr]
* Tue Jun 18 2002 Stefan Ritt <stefan.ritt@psi.ch>
- Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/
* Tue Jun 18 2002 Serge Droz <serge.droz@psi.ch>
- Update to 2.0.0
* Mon Jun  3 2002 Serge Droz <serge.droz@psi.ch>
- Update to 1.3.6 
* Fri May 31 2002 Serge Droz <serge.droz@psi.ch>
- Initial RPM


%prep
%setup -q

%pre
%{_sbindir}/groupadd -r elog 2>/dev/null || :
%{_sbindir}/useradd -d / -s /bin/false \
   -g elog -M -r elog 2>/dev/null || :

%build
make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init

%install
make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir}

%post
chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/etc/rc.d/init.d/elogd
%{_mandir}/man1/*
%{_mandir}/man8/*
%doc	README COPYING doc
%defattr(-,elog,elog)
%prefix/bin/*
%prefix/sbin/elogd
%prefix/elog/resources
%prefix/elog/ssl
%prefix/elog/themes
%prefix/elog/scripts
%prefix/elog/logbooks
%config(noreplace) %prefix/elog/elogd.cfg
  151   Mon Mar 2 14:31:12 2020 Laurent Jean-Rigaudlollspam@free.frOtherRe: RPM build process enhancementsStableWed Mar 4 18:40:40 2020 by Laurent Jean-Rigaud

Hi Stefan,

2nd patch for RPM build which adds :

  • dynamic build options for krb5/ldap/pam/ssl support :
    • for git / non rpm users : 
      • buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
    • for rpm users using SRPMS (dependances are managed) :
      • rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
  • dynamic 2 last changelog entries :
    • last with build information with
      • dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
      • build options list (KBR5, LDAP, PAM, SSL)
    • before last for product changelog of current ELOG version-release
  • customrel flag for local rebuild :
    • release = %elogrel%{?customrel}%{?dist)
    • so custom builder can add --define 'customrel NSA'  at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
  • elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
  • buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).

 

Tested on EL6 and EL7 x86_64 :-)

Bye

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

I enclosed a patch for RPM build process available on GIT.

changes :

  • rpmbuild :
    • checks if provider or custom build (the rm/mv are done on your computers only :-))
    • call rpmbuild with version / release given as parameters
  • elog.spec :
    • last changelog entry date is set to build date
    • build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
    • elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists

 

Todo:

  • add RPMbuild options for ldap/pam/...
  • enclosed git log in changelog automatically (the dream :-))

 

Attachment 1: elog-git_dd35f04ec8effce1c12927078a9efb59822ceb3f-add_use_options.diff
diff --git a/Makefile b/Makefile
index d8eecba..87cb502 100644
--- a/Makefile
+++ b/Makefile
@@ -23,16 +23,32 @@ RCDIR      = $(ROOT)/etc/rc.d/init.d
 SRVDIR     = $(ROOT)/usr/lib/systemd/system
 
 # flag for SSL support
+ifdef USESSL
 USE_SSL    = 1
+else
+USE_SSL    = 0
+endif
 
 # flag for Kerberos support, please turn on if you need Kerberos
+ifdef USEKRB5
+USE_KRB5   = 1
+else
 USE_KRB5   = 0
+endif
 
 # flag for LDAP support, please turn on if you need LDAP
+ifdef USELDAP
+USE_LDAP   = 1
+else
 USE_LDAP   = 0
+endif
 
 # flag for PAM support, please turn on if you need PAM
+ifdef USEPAM
+USE_PAM    = 1
+else
 USE_PAM    = 0
+endif
 
 #############################################################
 
diff --git a/buildrpm b/buildrpm
index 1c0b9bc..8dde819 100755
--- a/buildrpm
+++ b/buildrpm
@@ -1,17 +1,38 @@
 #!/bin/csh
-# Usage: build [-n] <version> <release>
+# Usage: build [-n] <version> <release> [-krb5] [-ldap] [-pam] [-ssl]
 # Build ELOG distribution
 
 if ($#argv < 2) then
-  echo "Usage: build <version> <release>"
+  echo "Usage: build <version> <release> [-krb5] [-ldap] [-pam] [-ssl]"
   exit
 endif
  
 set version = $argv[1]
 set release = $argv[2]
+set i = 0
+set BUILDOPTS=""
+foreach argument ($argv)
+  set i=`expr $i + 1`
+  if ($i <= 2) continue
+  switch ($argument)
+    case "-ldap":
+       set BUILDOPTS="$BUILDOPTS --with ldap"
+       breaksw
+    case "-pam":
+       set BUILDOPTS="$BUILDOPTS --with pam"
+       breaksw
+    case "-ssl":
+       set BUILDOPTS="$BUILDOPTS --with ssl"
+       breaksw
+    case "-krb5":
+       set BUILDOPTS="$BUILDOPTS --with krb5"
+       breaksw
+  endsw
+end
+
 set dist = `rpm --eval %{\?dist}`
 set dir = /tmp/elog-$version
-set archive = elog-$version.tar.gz
+set archive = elog-$version-$release.tar.gz
 
 # create temporary directory
 rm -Rf $dir
@@ -65,7 +86,8 @@ rm -Rf $dir
 
 # transfer archive
 echo Transfer archive...
-mkdir -p ~/rpmbuild/SOURCES && cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz
+[ ! -d ~/rpmbuild/SOURCES ] && mkdir -p ~/rpmbuild/SOURCES 
+cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version-$release.tar.gz
 
 # if running on at PSI copy to download area
 if (`hostname` == 'elog01.psi.ch') then
@@ -75,6 +97,8 @@ if (`hostname` == 'elog01.psi.ch') then
     cp -v /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
     cp -vf doc/ChangeLog ~ritt/html/elog/download/ChangeLog
   endif
+  # define Factory Packager
+  set BUILDOPTS="${BUILDOPTS} --define \"packager Stefan Ritt <stefan.ritt@psi.ch>\""
 endif
 rm -f /tmp/$archive
 
@@ -83,8 +107,13 @@ rm -f ~/rpmbuild/RPMS/*/elog*${version}-${release}*.rpm
 rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm
 
 # building RPMs
+cp elog.spec.template ~/rpmbuild/SPECS/elog.spec
+sed -i "s/__ELOGVER__/${version}/;s/__ELOGREL__/${release}/" ~/rpmbuild/SPECS/elog.spec
 echo Build RPMs...
-rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $?
+set factorydate = `env LC_TIME=C date '+%a %b %d %Y'`
+rpmbuild -ba ${BUILDOPTS} --define "factorydate ${factorydate}" \
+	--define "version ${version}" --define "elogrel ${release}" \
+	~/rpmbuild/SPECS/elog.spec || exit $?
 
 # if running on at PSI copy to download area
 if (`hostname` == 'elog01.psi.ch') then
diff --git a/elog.spec b/elog.spec
deleted file mode 100755
index 8397eab..0000000
--- a/elog.spec
+++ /dev/null
@@ -1,107 +0,0 @@
-# ELOG weblog application
-# rpmbuild -ba --define 'version 3.1.4' --define 'release 2' --define "date $(LC_TIME=En date '+%a %b %d %Y')" elog.spec
- 
-#define	date	$(LC_TIME=En date '+%a %b %d %Y')      
-%define build_timestamp %(LC_TIME=En date '+%a %b %d %Y')
-
-Name:       elog
-Summary:    elog is a standalone electronic web logbook
-Version:    %version
-Release:    %release%{?dist}
-License:    GPL
-Group:      Applications/Networking
-Source:     http://elog.psi.ch/elog/download/elog-%{version}.tar.gz
-Vendor:     Stefan Ritt <stefan.ritt@psi.ch>
-URL:        http://elog.psi.ch/elog
-BuildRoot:  /tmp/%{name}-root
-Prefix:     /usr/local
-BuildRequires: openssl-devel >= 0.9.8e
-
-%description
-ELOG is part of a family of applications known as weblogs. 
-Their general purpose is : 
-
-1. To make it easy for people to put information online in a chronological
-   fashion, in the form of short, time-stamped text messages ("entries") 
-   with optional HTML markup for presentation, and optional file attachments 
-   (images, archives, etc.) 
-
-2. To make it easy for other people to access this information through a 
-   Web interface, browse entries, search, download files, and optionally add, 
-   update, delete or comment on entries. 
-
-ELOG is a remarkable implementation of a weblog in at least two respects : 
-
-- Its simplicity of use: you don't need to be a seasoned server operator 
-and/or an experimented database administrator to run ELOG ; one executable 
-file (under Unix or Windows), a simple configuration text file, and it works. 
-No Web server or relational database required. It is also easy to translate 
-the interface to the appropriate language for your users. 
-
-- Its versatility: through its single configuration file, ELOG can be made 
-to display an infinity of variants of the weblog concept. There are options 
-for what to display, how to display it, what commands are available and to whom, 
-access control, etc. Moreover, a single server can host several weblogs, and 
-each weblog can be totally different from the rest. 
-
-%changelog
-* %{build_timestamp} Stefan Ritt <stefan.ritt@psi.ch> %version-%release
-- Updated from git 
-* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
-- Made adjustments for new elog server and RH7
-* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
-- Added BuildRequires, thanks to Stefan Roiser from CERN
-* Fri Oct 21 2005 Stefan Ritt <stefan.ritt@psi.ch>
-- Added resources/ directory
-* Fri Mar 14 2003 Stefan Ritt <stefan.ritt@psi.ch>
-- Added %post to change ownership of elog files
-* Thu Jan 30 2003 Stefan Ritt <stefan.ritt@psi.ch>
-- Added installation of man pages, thanks to Serge Droz <serge.droz@psi.ch>
-* Tue Aug 13 2002 Stefan Ritt <stefan.ritt@psi.ch>
-- Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr]
-* Tue Jun 18 2002 Stefan Ritt <stefan.ritt@psi.ch>
-- Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/
-* Tue Jun 18 2002 Serge Droz <serge.droz@psi.ch>
-- Update to 2.0.0
-* Mon Jun  3 2002 Serge Droz <serge.droz@psi.ch>
-- Update to 1.3.6 
-* Fri May 31 2002 Serge Droz <serge.droz@psi.ch>
-- Initial RPM
-
-
-%prep
-%setup -q
-
-%pre
-%{_sbindir}/groupadd -r elog 2>/dev/null || :
-%{_sbindir}/useradd -d / -s /bin/false \
-   -g elog -M -r elog 2>/dev/null || :
-
-%build
-make CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
-sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
-
-%install
-make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir}
-
-%post
-chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-/etc/rc.d/init.d/elogd
-%{_mandir}/man1/*
-%{_mandir}/man8/*
-%doc	README COPYING doc
-%defattr(-,elog,elog)
-%prefix/bin/*
-%prefix/sbin/elogd
-%prefix/elog/resources
-%prefix/elog/ssl
-%prefix/elog/themes
-%prefix/elog/scripts
-%prefix/elog/logbooks
-%config(noreplace) %prefix/elog/elogd.cfg
diff --git a/elog.spec.template b/elog.spec.template
--- a/elog.spec.template
+++ b/elog.spec.template
0a1,139
> # ELOG weblog application
> # rpmbuild -ba --define 'elogver 3.1.4' --define 'elogrel 2' --with ssl --with pam --with ldap --with krb5 --define 'factorydate date'
>  
> # define date of build for changelog and default release
> %define build_timestamp %(LC_TIME=C date '+%a %b %d %Y')
> %{!?factorydate: %define factorydate %build_timestamp}
> 
> # default version and release
> %{!?elogver: %define elogver __ELOGVER__ }
> %{!?elogrel: %define elogrel __ELOGREL__ }
> # default release is build date
> %{!?elogrel: %define elogrel %{build_timestamp} }
> 
> # Build options :
> # Read: If neither macro exists, then add the default definition.
> %{?_with_krb5: %define _with_krb5 USEKRB5=1}
> %{?_with_ldap: %define _with_ldap USELDAP=1}
> %{?_with_pam: %define _with_pam USEPAM=1}
> %{?_with_ssl: %define _with_ssl USESSL=1}
> # Default build options are with SSL 
> %{!?_with_ssl: %{!?_without_ssl: %define _with_ssl USESSL=1}}
> # builder info
> %define whoami %(eval who am i | awk '{print $1}')
> %define HOSTNAME %(hostname)
> %{!?packager: %define packager %{whoami} %{whoami}@%{HOSTNAME}}
> 
> Name:       elog
> Summary:    elog is a standalone electronic web logbook
> Version:    %elogver
> Release:    %elogrel%{?customrel}%{?dist}
> License:    GPL
> Group:      Applications/Networking
> Source:     http://elog.psi.ch/elog/download/elog-%{elogver}-%{elogrel}.tar.gz
> Vendor:     Stefan Ritt <stefan.ritt@psi.ch>
> URL:        http://elog.psi.ch/elog
> BuildRoot:  /tmp/%{name}-root
> Prefix:     /usr/local
> # Add build dependencies for pam, ssl and ldap features if enabled.
> # Note: Tag tokens must start at beginning-of-line.
> #
> # Read: If feature is enabled, then add the build dependency.
> %{?_with_krb5:BuildRequires: krb5-devel}
> %{?_with_krb5:Requires: krb5-libs}
> %{?_with_ldap:BuildRequires: openldap-devel >= 2.4.1}
> %{?_with_ldap:Requires: openldap >= 2.4.1}
> %{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
> %{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}
> 
> %description
> ELOG is part of a family of applications known as weblogs. 
> Their general purpose is : 
> 
> 1. To make it easy for people to put information online in a chronological
>    fashion, in the form of short, time-stamped text messages ("entries") 
>    with optional HTML markup for presentation, and optional file attachments 
>    (images, archives, etc.) 
> 
> 2. To make it easy for other people to access this information through a 
>    Web interface, browse entries, search, download files, and optionally add, 
>    update, delete or comment on entries. 
> 
> ELOG is a remarkable implementation of a weblog in at least two respects : 
> 
> - Its simplicity of use: you don't need to be a seasoned server operator 
> and/or an experimented database administrator to run ELOG ; one executable 
> file (under Unix or Windows), a simple configuration text file, and it works. 
... 74 more lines ...
  9   Wed Jul 7 18:19:10 2004 Steve Jonessteve.jones@freescale.comScriptGeneric Unix elogd init scriptStableWed Jul 7 18:19:38 2004 by Steve Jones
The elogd.init script that ships in the elog distribution is Linux centric.
 This script is written to work in a generic Unix environment under 'sh' -
no frills!
Attachment 1: elogd.init
#!/bin/sh

# description: Start elog
# elog can have multiple instances run on the same server, pointing to different logbook areas.  This start
# script should be run from the root of each different elog area.

ELOGD="/_TOOLS_/dist/gnu-elog-2.5.3/sparc-sun-solaris2.8/bin/elogd"
ELOGDIR="/proj/sysadmin/ess/www/elog"
HOSTNAME=`hostname`

# Check for the config file
if [ ! -f $ELOGDIR/elogd.cfg ]; then
    exit 0
fi


# See how we were called.
case "$1" in
  start)
        if [ -f $ELOGDIR/elogd-$HOSTNAME.pid ] ; then
	   pid=`cat ./elogd-$HOSTNAME.pid`
	   if [ -d /proc/$pid ] ; then
	     echo "elogd already running"
	     exit 1
	   fi
	fi
####################################
# The full path *must* be specified
	echo "Starting elogd: "
	$ELOGD -f $ELOGDIR/elogd-$HOSTNAME.pid -c $ELOGDIR/elogd.cfg -D  > /dev/null 2>&1 &
	RETVAL=$?
        if [ $RETVAL -eq 0  ] ; then 
          echo "elog started" 
        else
          echo "Failed to start elog"
        fi
	echo
	;;
  stop)
     echo ""
      if [ -f $ELOGDIR/elogd-$HOSTNAME.pid ] ; then
        echo "Stopping elogd: "
        kill `cat $ELOGDIR/elogd-$HOSTNAME.pid`
	rm -f $ELOGDIR/elogd-$HOSTNAME.pid
        echo "elog stopped"
        echo
     else
        echo "No elogd running?"
	echo "Failed to start elog"
	echo
     fi
     
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit 0

  27   Tue Jan 29 23:18:39 2008 Diogo Alvesdiogomiguelalves@gmail.comScriptMultiple file upload for FirefoxStableWed Jan 30 07:56:53 2008 by Stefan Ritt

Here's a firefox extension that works extremely well if one uses drag n'drop to upload several attachment files at once:

 

https://addons.mozilla.org/en-US/firefox/addon/219

 

  47   Sun Aug 23 21:27:00 2015 Daniel Sajdykdaniel.sajdyk@gmail.comTheme/SkinSimple themeBetaTue Sep 1 07:39:45 2015 by Daniel Sajdyk

Hello. 

I did simple theme for ELOG called "dansaj". 

This is verision which I did for my ELOG, and if you have troubles in other configurations, please let me know, and we will correct it. 

Vectors versions of icons you can find in oryginals folder (if you want to transform it). 

The most current version you can download from my blog - Elog theme, czyli skórka, albo temat.

Regards

Daniel.

Attachment 1: choose_elog.png
choose_elog.png
Attachment 2: entry.png
entry.png
Attachment 3: Full.png
Full.png
Attachment 4: login.png
login.png
Attachment 5: Summary.png
Summary.png
Attachment 6: Threaded_demo_logbook.png
Threaded_demo_logbook.png
Attachment 7: dansaj.7z
Attachment 8: Threaded.png
Threaded.png
  17   Mon Oct 10 18:47:09 2005 Exaos LeeExaos.Lee@gmail.comScriptHow to run elogd on Gentoo LinuxStableTue Oct 11 08:06:55 2005 by Stefan Ritt
I have created some scripts for running elogd on Gentoo Linux. Please untar the attachment and read the file "elogd_gentoo_readme". Any comment is welcomed.
Attachment 1: elogd_gentoo.tar.gz
  35   Tue May 24 22:43:38 2011 JacekKdoctor99@poczta.onet.plScriptJavascript verification of simple attributes with regexpBetaTue May 24 22:46:38 2011 by JacekK

Hi,

I added possibility for a new verification of required fields in generated Javascript "function chkform()". To do this I added new logbook option "ValidPattern", in which you can set regular expression for an attribute, for example

ValidPattern HexDigits=[0-9a-fA-F]+

If there is a pattern set for required field, then in chkform() function is generated additional verification, if value of the field matches validation regexp.

Changes I made should not decrease performance of elogd. Let me know please if you can add it to regular version.

 

Jacek

Attachment 1: JScriptREVerify.patch
Index: elogd.c
===================================================================
--- elogd.c	(revision 2414)
+++ elogd.c	(working copy)
@@ -74,6 +74,8 @@
 char attr_list[MAX_N_ATTR][NAME_LENGTH];
 char attr_options[MAX_N_ATTR][MAX_N_LIST][NAME_LENGTH];
 int attr_flags[MAX_N_ATTR];
+/** Validation pattern for attribute, to test if it contains expected value */
+char attr_valid_pattern[MAX_N_ATTR][NAME_LENGTH];
 
 char attr_list_default[][NAME_LENGTH] = { "Author", "Type", "Category", "Subject", "" };
 
@@ -7033,7 +7035,7 @@
 
 int scan_attributes(char *logbook)
 /* scan configuration file for attributes and fill attr_list, attr_options
- and attr_flags arrays */
+ and attr_flags and attr_valid_pattern arrays */
 {
    char list[10000], str[NAME_LENGTH], str2[NAME_LENGTH], type[NAME_LENGTH],
        tmp_list[MAX_N_ATTR][NAME_LENGTH];
@@ -7062,11 +7064,20 @@
          }
       }
 
-      /* get options lists for attributes */
+      /* get options lists and validation patterns for attributes */
       memset(attr_options, 0, sizeof(attr_options));
+      memset(attr_valid_pattern, 0, sizeof(attr_valid_pattern));
       for (i = 0; i < n; i++) {
          n_options = 0;
 
+         sprintf(str, "ValidPattern %s", attr_list[i]);
+         if (getcfg(logbook, str, list, sizeof(list)))
+         {
+            strncpy(attr_valid_pattern[i], list, sizeof(attr_valid_pattern[i])-1);
+            attr_valid_pattern[i][sizeof(attr_valid_pattern[i])-1] = 0;
+            attr_flags[i] |= AF_HAS_VALID_PATT;
+         }
+
          sprintf(str, "Options %s", attr_list[i]);
          if (getcfg(logbook, str, list, sizeof(list)))
             n_options = strbreak(list, attr_options[i], MAX_N_LIST, ",", FALSE);
@@ -9650,6 +9661,17 @@
             rsprintf("    document.form1.%s.focus();\n", ua);
             rsprintf("    return false;\n");
             rsprintf("  }\n");
+            if (attr_flags[i] & AF_HAS_VALID_PATT) 
+            {
+              sprintf(str, loc("var validPatt=new RegExp(\"%s\");"), attr_valid_pattern[i]);
+              rsprintf("  %s\n", str);
+              rsprintf("  if (!validPatt.test(document.form1.%s.value)) {\n", ua);
+              sprintf(str, loc("Invalid value for attribute '%s'"), attr_list[i]);
+              rsprintf("    alert(\"%s\");\n", str);
+              rsprintf("    document.form1.%s.focus();\n", ua);
+              rsprintf("    return false;\n");
+              rsprintf("  }\n");
+            }
          }
       }
 
Index: elogd.h
===================================================================
--- elogd.h	(revision 2414)
+++ elogd.h	(working copy)
@@ -192,6 +192,7 @@
 #define AF_MUSERLIST         (1<<13)
 #define AF_USEREMAIL         (1<<14)
 #define AF_MUSEREMAIL        (1<<15)
+#define AF_HAS_VALID_PATT    (1<<16)
 
 /* attribute format flags */
 #define AFF_SAME_LINE              1
  44   Tue Jul 8 15:43:21 2014 TimStimpie_s@yahoo.comScriptRe: Custom input forms implementationStableTue Mar 19 13:18:33 2013 by Stefan Ritt


Stefan Ritt wrote:

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png 

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

 

That's awesome!! Didn't know ELOG was still being developed!!  I was looking for this ...been trying this version now with
supplied example but there's files missing which are being referenced from the html file.

Anyway it would be nice to know a little more on how to use this and how it incorporates into ELOG.

Is some more work being done on this version ?

Thankx heaps for this great enhancement although now it's still needs a lot of figuring out on how to do this.
 

  50   Tue Jul 26 10:16:22 2016 Andreas Luedekesimon.ebner@psi.chScriptPython module to read/write/edit/reply/delete ELOG entriesStableTue Jul 26 10:26:34 2016 by Andreas Luedeke
Hello Everybody!
I would just like to inform you that there is a new Python module available to access and work with ELOG (read/write/edit/reply/delete).
Currently the module is only supported for Python version 3. The package is pure Python and has no special dependencies. Therefore you can use the package on any machine.

The documentation you can find on https://github.com/paulscherrerinstitute/py_elog

If you want to install the package in an Anaconda on your local machine just use
conda install -c paulscherrerinstitute elog
(also works from outside PSI - the package is available at https://anaconda.org/paulscherrerinstitute/elog)

If there are issues with the package please use the issue tracker that comes with the github repository
https://github.com/paulscherrerinstitute/py_elog/issues or let me know.
Best
Simon
ELOG V3.1.5-2eba886