WebShare UB+ User manual


7 WebShare File Server

"websharesrv" is the WebShare File Server, a native program running on the machine which can also host the HELIOS EtherShare/PCShare file servers, and is controlled by the HELIOS Service Controller (see Base manual). It spawns a separate process for each user login.

The WebShare File Server offers various and versatile user and document management features, including e-mail notification on user login, additional customization in WebShare action scripts, etc.

7.1 User configuration file

"HELIOSDIR/var/conf/webshare.passwd" is the user configuration file of the WebShare File Server. Along with the password of every user, it stores the individual settings of every user. Specifications made in the "My User Preferences" administration window ( 5.6 "My User Preferences") are stored in this file:

heliosuser::::zs=1,nocp=1:::
martin::::zs=1,nocp=0:::
ws1:md5_dd1c91f5d657b421c339592f:demo::zs=1,nocp=1:::

Each line in "webshare.passwd" starts with the user name followed by several fields which are separated by colons. The first (user name) and third (user ID) field must be set, the other fields may remain blank.

Field Explanation
1. User name Virtual User or Host User
2. Password Password in clear text or MD5 hash code of UTF-8 clear text password.
A string starting with md5_ is a crypted password for Virtual Users. For Virtual Users this field must include a password entry. For Host Users this field may be empty if there is no additional WebShare password set and the HELIOS host password is used. We recommend to set a different password, though.
3. Run as user An empty field identifies a host user. For virtual users this field contains the name of the host user the virtual user is mapped to.
4. Field Expiry date This field contains the user expiry date/time in the format: dd-MMM-yyyy-kk-mm

For example: 28-Feb-2004-14-21

The Expiry date is entered in the Expires field in the "User Administration" window according to the syntax specified by the preference DateFormat (7.5 "Preference keys").
5. Field Comma-separated flags
"zs" (zipstream)
"nocp" (cannot change password)
"pt" (privileged transfer)
"br" (branding)
For all preferences: 1=TRUE; 0=FALSE

Exception: "br" (branding)=<branding_name>

Example:
If zipstream is enabled, this field shows "zs=1", otherwise "zs=0". If there is no entry, zipstream is enabled.
6. Field Client encoding for uploads/downloads
7. Field E-mail address of user

This has to be a fully specified e-mail address, e.g.: username@mycompany.com
8. Field Comment
Make sure that the comment does not contain special characters like a colon (":"). These will be replaced with "_" in order to keep "webshare.passwd" compatible.

7.2 WebShare utility programs

Note: "zipstream" and "unzipstream" are located in the "HELIOSDIR/bin" directory. All other scripts described in this section reside in "HELIOSDIR/etc/webshare".

7.2.1 zipstream

This utility creates a Zip archive to which files and folders can be added in a compressed form. The advantages over the Zip program are that there are no temporary files created during compression, and file downloads can commence immediately without waiting for the Zip archive to be created. Special file attributes like creation date, Mac type and creator and resource fork are encoded into MacBinary, which is preserved in the compressed Zip archive. UTF-8 is always the encoding used for file/folder name representation in the file system. The encoding used for file/folder name representation in the Zip archive can be specified to match the client computer system, e.g. MacRoman, PC850, ISO8859-1, UTF-8, etc.

Usage:

zipstream [options] file
zipstream -h (for help info)

Example:

Create an Zip archive named "archive.zip" and add file1, file2, dir1 and dir2 to the archive:

zipstream -f archive.zip file1 file2 dir1 dir2

Example:

Create an Zip archive and pipe it into the tar application:

zipstream file1 file2 dir1 dir2 | tar cvf test.tar -

The following options may be used with "zipstream":

-f

Write the Zip archive to the file instead of writing to "stdout".

-C

Input files are read from this directory.

-l

Zip compression level. Valid levels are from 1 (best speed) to 9 (best compression). The default level is 6.

-c

Encoding used for file names in Zip archive. The default encoding is UTF8. Use uniconv -l to list all available encodings.

"zipstream" is called with this option by the WebShare File Server when an encoding is selected via the Download Encoding pop-up menu in the "User Administration" or "My User Preferences" window.

Note: The server volume encoding for "zipstream" is always assumed to be UTF-8. Non UTF-8 volumes are not supported by "zipstream".
-S

Print estimated Zip archive size to "stdout" (8 byte integer, network byte order).

-s

Print estimated Zip archive size to "stdout" (4 byte integer, network byte order).

-b

Write output in blocks of n kBytes. The default is 32 kB.

-n

No Zip streaming format.

"zipstream" is called with this option by the WebShare File Server when the checkbox Zip Streaming Format is not checked.

-m

Encode the data and resource fork of a Mac file to MacBinary.

-t

Include file comments in MacBinary (works only together with the -m option).

-r

Preserve ".rsrc" directories. By default, ".rsrc" directories are skipped when creating the Zip archive. This option has no effect if -m is set.

-e

Add report file "DownloadLog.txt" to Zip archive containing file access errors and, if -v is also set, verbose information.

-v

Display verbose information on "stderr" or, if -e is also set, write verbose information to "DownloadLog.txt" in the Zip archive.

-x

Generate Mac OS X 10.3 (or newer) Finder compatible Zip archives. Such Zip archives are also compatible with Safari, so that no additional archiving software is needed.

-z

Resolve symbolic links, add files into Zip archive.

7.2.2 unzipstream

The "unzipstream" utility expands Zip files and decodes MacBinary files.

By default it reads a Zip or MacBinary file from "stdin". The -f option can be used to specify a Zip or MacBinary input file. Output files are stored under the names defined in the Zip or MacBinary file. If the input file is not a Zip or MacBinary file, it will be written to "stdout" or to the file specified by the -o option. The -C option specifies the destination directory for stored files. The -n option specifies the name of a notification script that will be called whenever a file is being written to disk. The script will be called with two parameters: the temporary file name and the original file name.

Usage:

unzipstream [options] file
unzipstream -h (for help info)

Examples:

List the Zip archive, assuming Windows (PC850) encoding:

unzipstream -l -c PC850 -f archive.zip

Extract the Zip archive which was created by DropZip, assuming Mac (MacRoman) encoding:

unzipstream -c MacRoman -f archive.zip

Extract all files in "abc.zip" to the directory "/data/zips":

unzipstream -f abc.zip -C /data/zips
Note: The server volume encoding where Zip files are unpacked is always assumed to be UTF-8. Non
UTF-8 volumes are not supported by "unzipstream".

The following options may be used with "unzipstream":

-f

Read the Zip archive instead of reading from "stdin".

-o

Output file name. This is only used if the input file is not a Zip or MacBinary file.

-C

Output files are written to this directory.

-c

Encoding used for file names in Zip archive. The default encoding is UTF8.

Use uniconv -l to list all available encodings.

-r

Preserve ".rsrc" directories. By default, files in ".rsrc" directories are not extracted from the Zip archive.

Note: To prevent inconsistencies between information stored in the desktop databases of an HELIOS volume and the files/folders on this volume, do not upload or extract a Zip archive with ".rsrc" directories directly into an active HELIOS volume. Make sure to use the HELIOS "dt" tools (see Base manual).
-n

Name of a notification script that will be called after a file is extracted. The script is called with the following parameters:

-m

Specify the MIME type of the input file.

If -m is given, "unzipstream" does not check the header of the input file to determine the file type. Currently, the only known MIME type is "application/x-macbinary".

-l

List files instead of extracting them.

-u

Unhide "dot files" by replacing the leading dot with an underscore.

Example:

.DS_Store is represented as _DS_Store

-v

Display verbose information on "stderr".

Please note that if a Zip file on its part contains Zip files in the archive, these will not be further expanded.

The "dt" command will automatically be used within most WebShare scripts and utility programs to ensure that all changes are applied to data and resource parts of files and folders. In doing so, HELIOS volume specific requirements are met.

Note: Customizing the "Perl" utility scripts should never be done in the original script file. Instead, copy the script into the "HELIOSDIR/var/webshare" directory. WebShare automatically looks first in "var/webshare" for all scripts and uses "etc/webshare" only as a fallback if the script is not available in "var/webshare".

7.2.3 wscommon.pm

This file is a Perl library module which is included by all WebShare Perl scripts. It contains, for example, information on other installed HELIOS products, etc.

7.2.4 Action script environment variables

A description of the environment variables may be helpful when customizing WebShare action scripts or utility programs:
Environment variable
Description
WSUserEncoding
E.g. OS Default; Download encoding
WSAccept-Language
E.g. en-us; Default browser language for displaying web pages
WSWindowsEncoding
E.g. PC850; Default Windows encoding
WSStreamingZip
E.g. Yes; Use Zip Streaming format
WSMacintoshEncoding
E.g. MacRoman; Default Mac OS encoding
WSUserId
E.g. 105; Effective user ID of current session
WSGroupId
E.g. 30; Effective group ID of current session
WSUser
Name of logged-in user
WSUserEMail
E-mail address of logged-in user
WSSessionSeq
E.g. 843-64; websharesrv process ID (843) and number of logins (64)
WSClientAddress
IP address of logged-in client
WSPREVIEWDIR
WebShare cache directory path
WSUserAgent
E.g. Mozilla/5.0 (Mac; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113; Browser information
HELIOSDIR
E.g. /usr/local/helios; HELIOS directory path

7.2.5 wscopy.pl

Usage:

wscopy.pl destdir srcdir files...

This program is called by the WebShare File Server every time Copy or Paste function (in the Edit > toolbar menu) is selected. "destdir" specifies the destination directory to which the specified files and folders from the "srcdir" are copied to.

7.2.6 wsmove.pl

Usage:

wsmove.pl destdir srcdir files...

This program is called by the WebShare File Server every time the Move function (in the Edit > toolbar menu) is selected. "destdir" specifies the destination directory to which the specified files and folders from the "srcdir" are moved to.

7.2.7 wsdownload.pl

Usage:

wsdownload.pl srcdir files...

This program is called by the WebShare File Server every time the Download function (in the Transfer > toolbar menu) is selected. The "srcdir" specifies the current directory of the user's web session. The files argument consists of the files and folders which have been selected for download by the user. "wsdownload.pl" uses the WebShare "zipstream" utility to stream an on-the-fly generated Zip archive without temporary files to "stdout". Settings like Zip format, file name encoding, MacBinary support, client platform (Mac or Windows), etc. are automatically determined by the "wsdownload.pl" script.

7.2.8 wsdup.pl

Usage:

wsdup.pl dir files...

This program is called by the WebShare File Server every time the Duplicate function (in the File > toolbar menu) is selected.

7.2.9 wsmkdir.pl

Usage:

wsmkdir.pl dir newdir

This program is called by the WebShare File Server every time the Create Dir function (in the File > toolbar menu) is selected.

7.2.10 wsmv.pl

Usage:

wsmv.pl dir source dest

This program is called by the WebShare File Server every time the Rename function (in the File > toolbar menu) is selected.

7.2.11 wspreview.pl

Usage:

wspreview.pl srcfile srcfiletype dstfiletype previewfile resOptions page antialiasPDF

This program is called by the WebShare File Server every time a file name is clicked in the sharepoint "Name" column in case the preview file does not exist in the cache area.

Parameters:

Name Description
srcfile The complete path name to the image or document the user selected for preview.
srcfiletype The file type of the document from which a preview is to be generated.
dstfiletype The file type of the preview image; usually JPEG or PNG, see 7.4.4 "Generated previews" for details.
previewfile The path name of the preview filename. The filename specifies the preview name to be saved in the preview cache area.
resOptions This parameter specifies the preview options for the ImageServer "layout" command.
Different parameters are split by a "|" character. For example,
"ocoaLigature0 -oxpix=256|-orotate=90|-oflipvertical"ocoaLigature1.
page The page number starting with 1 used for multipage documents.
antialiasPDF "True" or "False" to specify antialiasing for PDF input files.

Note: The following 2 WebShare utility scripts do not require any user authentication.

7.2.12 wsforgotpw.pl

Usage:

wsforgotpw.pl opts...

This program is called by the WebShare File Server every time the Forgot Password? link on the login page is clicked. The following table lists the Perl script field variables in the left column, and on the right the corresponding HTML field entries in the file "ForgotPassword.wod" (see 6.3.2 "Customizing "*.wod" files"). Please note that the Perl script variable names are given and cannot be renamed! If fields are not needed, leave them empty:
wsforgotpw.pl
ForgotPassword.wod
$username
editUser.username
$email
editUser.email
$organization
editUser.organization
$comment
editUser.comment
$field5 - $field10
editUser.field5-10

7.2.13 wsregnewuser.pl

Usage:

wsregnewuser.pl opts...

This program is called by the WebShare File Server every time the Register as a New User link on the login page is clicked. The following table lists the Perl script field variables in the left column, and on the right the corresponding HTML field entries in the file "RegisterNewUser.wod" (see 6.3.2 "Customizing "*.wod" files"). Please note that the Perl script variable names are given and cannot be renamed! If fields are not needed, leave them empty:
wsregnewuser.pl
RegisterNewUser.wod
$username
editUser.username
$password
editUser.password
$verifyPassword
editUser.verifyPassword
$email
editUser.email
$comment
editUser.comment
$organization
editUser.organization
$field7 - $field20
editUser.field7- 20

7.2.14 wsrm.pl

Usage:

wsrm.pl dir files...

This program is called by the WebShare File Server every time the Delete function (in the File > toolbar menu) is selected.

7.2.15 wsperm.pl

Usage:

wsperm.pl dir user group userMode groupMode otherMode recursive files...

This program is called by the WebShare File Server every time the Permissions function (in the File > toolbar menu) is selected.

7.2.16 wsupload.pl

Usage:

wsupload.pl dstdir filesize filename mimetype

This program is called by the WebShare File Server every time the Upload function (in the Transfer > toolbar menu) is selected. "wsupload" receives the upload stream from "stdin" and unpacks the uploading stream in the directory specified by the "dstdir" parameter. The "unzipstream" utility is used as a backend to unpack the data stream on-the-fly. As soon as a file within a Zip stream is detected, the file is saved with a temporary name with the process ID as suffix. For each file in the Zip stream the "wsuploadmv" script is called to rename the file with the process ID suffix to its final name. All this is done on-the-fly while "unzipstream" continues to receive data with additional files within the Zip stream. "wsupload" automatically detects if the upload is done from a Windows or Mac client, and will set up a proper character encoding according to the user and system default settings.

7.2.17 wsuploadmv.pl

Usage:

wsuploadmv.pl dir source dest

This program renames uploaded files from their temporary name to their final name. "wsuploadmv" is a good place to add more processing tasks, e.g. a virus scanning software to verify uploaded files.

7.2.18 WebShare File Server service port

This service displays WebShare File Server user and status information.

After calling localhost with the appropriate port on the command line, you may enter the additional commands users, status, or help to display possible options:

$ socket localhost 2016
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to the HELIOS WebShare File Server service port
help
help - print a list of available commands
quit - close connection
status - show status information
users - show user information
rmcache - remove all cache files
users
# PID User UID Address CRC Login
1 inactive tom 101 192.168.1.2 24c9ce Mon 10:38
1 active joe 108 192.168.1.8 3bffc9d6 Thu 11:23
Summary: 1 active users (1 inactive users)
status
WebShare File Server, Version 2.0.0
Up since: Thu Nov 13 10:25:30 2003
Max users: 2
Max users allowed: 100
Note: For security reasons the "socket" service port only accepts incoming connections on the WebShare File Server, using the localhost address.

7.3 WebShare scripts

7.3.1 Custom scripts

It is possible to include scripts in the WebShare workflow which automate tasks, etc. WebShare comes with some custom scripts ("wslogin.pl", "wsaddshare.pl", "wslogout.pl", "wsemail.pl", and "wspreviewaccess.pl") that have to be customized by the user in order to take effect, and various sample action scripts (see 7.3.3 "Sample action scripts"). The custom scripts are stored in "etc/webshare/samples". In addition, the WebShare utility scripts in "etc/webshare", described in 7.2 "WebShare utility programs", may also be customized.

Note: The standard output size of custom scripts is limited to 64 kB. However, the error output is limited to 2 kB.

Custom scripts become active if copied into the
"var/webshare" directory.

wslogin.pl

This script is called after a successful WebShare login with the parameters:

The script can be customized to perform any desired action upon a user login.

wsaddshare.pl

Every time a WebShare Administrator adds or modifies a sharepoint, the "wsaddshare.pl" script is called. Its parameters are:

By customizing this script, a System Administrator can prevent WebShare Administrators from creating a sharepoint whose path points beyond the administrative (allowed) area. A return value=0 would allow creating a sharepoint or applying changes in a sharepoint, whereas a value0 would deny these actions, while issuing a message to the System Administrator via "stderr".

Example:

#!var/run/runperl -w
# $Id: Kap7_doc.html,v 1.5 2009/06/08 08:04:11 hendrik Exp $
#@(#)HeliosVersion 2.0.0p5 Copyright 2003-2007 HELIOS Software Garbsen
# WebShare sample script to perform any actions or checks whenever
# a new Sharepoint is defined or Sharepoint setting are modified.
# The script must either
# - exit with status 0 to allow saving the Sharepoint, or
# - write an error text to STDERR and exit with status != 0 if
# saving the Sharepoint is not allowed.
#
# NOTE: To use the sample script, copy this file into the
# HELIOSDIR/var/webshare directory, edit it according to your needs,
# and make sure that it is executable.
sub BEGIN {
use vars qw($HELIOSDIR);
my $HELIOSDIR = $ENV{"HELIOSDIR"} or die "HELIOSDIR not set in environment\n";
unshift (@INC, ".", "$HELIOSDIR/etc/webshare", "$HELIOSDIR/etc/perl");
}
use strict;
use wscommon;
use HELIOS::Utils;
if ($#ARGV + 1 != 6) {
print STDERR "Usage: $prog sharename sharepath sharemail shareoptions usermembers groupmembers\n";
exit 1;
}
my $sharename = shift; # Sharepoint Name
my $sharepath = shift; # Sharepoint Path
my $sharemail = shift; # E-Mail on Access
my $shareoptions = shift; # Options, comma separated
my $usermembers = shift; # User Members, comma separated
my $groupmembers = shift; # Group Members, comma separated
# exit 0 without any stderr messages will allow to add the share
exit 0;
# Example: Allow only sharepoint paths starting with "/webshare/" or "/samples/":
my @allowedPaths = ("/webshare/", "/samples/");
foreach my $path (@allowedPaths) {
exit 0 if ($sharepath =~ /^$path/);
}
print STDERR "Adding sharepoint directory $sharepath not allowed!\n";
exit 1;
wslogout.pl

As soon as the user has logged out, this script is called with the following parameters:

This script may be customized, e.g. to clean up directories or to accomplish similar tasks. In contrast to wslogin.pl and wsaddshare.pl, the return value of this script is not interpreted.

wsemail.pl

This action script is called every time a user sends an email via WebShare. The script is called with the parameters:

The Script must exit with status 0 to allow the user sending email or status 1 to deny sending an email.

wspreviewaccess.pl

If a script named "wspreviewaccess.pl" is copied to "HELIOSDIR/var/webshare" it is called every time an image preview is requested.

The script has two arguments:

1. <Pathname> to the image
2. <Pathname> to the cache preview file

This allows precise auditing for third-party scripts which may use this information to get informed about the preview activities.

7.3.2 Debugging WebShare scripts

All WebShare scripts are developed in Perl including the sample scripts. WebShare scripts can be developed in any language, e.g.: shell, PHP, Perl, Java, C/C++, etc. HELIOS prefers Perl because it is very powerful and compatible across different server platforms. This chapter provides guidelines on how to debug Perl scripts to be used as utility and action scripts within WebShare. Make sure to implement and debug your script so that it works in general before you begin debugging it in the WebShare environment.

Environment requirements:
All scripts are assumed to be called with the current directory HELIOSDIR, which is "/usr/local/helios" by default. To be compatible on all platforms without depending on the Perl installation path all WebShare Perl scripts include a #!var/run/runperl in the first line. "runperl" is a symbolic link to the local Perl interpreter. The "runperl" link is automatically created during the WebShare installation. All WebShare default scripts are included in "etc/webshare". Customized scripts should be stored in "var/webshare" to avoid overwriting your scripts during a new installation. Another benefit is that the entire "var" folder contains all customization and settings, which allows easy migration to a different server platform without applying all changes again.

Printing debugging information:
As many scripts produce their output to "stdout" or "stderr", printing script variables will produce mixed output which leads to malfunctions. All HELIOS scripts support debug output into a file by specifying the "DEBUGTTY" environment variable.

A simple debugging session:

# cd /usr/local/helios
# export DEBUGTTY=/dev/tty
# var/webshare/actions/yourscriptname

The above commands allow to test drive the script and to check the results.

A debugging session within a running WebShare File Server:

# cd /usr/local/helios
# bin/srvutil stop websharesrv # to stop the webshare file
server
# export DEBUGTTY=/dev/tty
# sbin/websharesrv

The script will now be called if action or custom scripts are executed by the WebShare File Server. The manual start of the WebShare File Server allows that all output will be printed into the terminal output (using the current tty).

7.3.3 Sample action scripts

As mentioned in 7.3.1 "Custom scripts", WebShare comes with various sample action scripts:

wscheckpdf.pl
wsdu.pl
wsimageinfo.pl
wssendmsg.pl
wsll.pl
wsxpvcollect.pl
wsxpvinfo.pl
wspdfinfo.pl
wscmdargs.pl
wsdialog.pl

Residing in "var/settings/WebShare/Actions/Samples" they must be copied to "var/settings/WebShare/Actions" in order to become available in the Actions > pop-up menu in the toolbar of the sharepoint window (see Actions > in 5.3 "Work in a sharepoint"). In addition, the file access permissions of each action script determines if it is even visible to individual users. See 8.1.7 "Action scripts".

wssendmsg.pl

Action script to send messages from WebShare to all users that are connected via "afpsrv", "pcshare", or "heladmsrv".

wscmdargs.pl

This action script prints out the script arguments and the environment variables.

wsll.pl

This action script lists, by use of the ls -l command (on Windows dir), the content of the current directory:

#!var/run/runperl -w
# $Id: Kap7_doc.html,v 1.5 2009/06/08 08:04:11 hendrik Exp $
#@(#)HeliosVersion 2.0.0p5 Copyright 2003-2007 HELIOS Software Garbsen
#Title=ls -l
# WebShare sample action script to list the content of a directory.
#
# NOTE: To use the sample action, copy this file into the
# HELIOSDIR/var/settings/WebShare/Actions directory, edit it according to your
# needs, and make sure that it is executable.
sub BEGIN {
use vars qw($HELIOSDIR);
$HELIOSDIR = $ENV{"HELIOSDIR"} or die "HELIOSDIR not set in environment\n";
unshift (@INC, ".", "$HELIOSDIR/etc/webshare", "$HELIOSDIR/etc/perl");
}
use strict;
use wscommon;
use HELIOS::Utils;
if ($#ARGV + 1 < 2) {
print STDERR "Usage: $prog dir\n";
exit 1;
}
my $dir = shift; # given directory
my $nfield = shift; # unused content of the input field
if ($^O eq 'MSWin32') {
system("dir", $dir);
} else {
system("ls", "-l", $dir);
}
exit 0;
wsdu.pl

Action script to show disk usage of files by use of the du command.

wsdialog.pl

This two-tier action script first generates a form with customized HTML fields (text fields, buttons, etc.), which are then processed.

Note: The following three scripts require that ImageServer be installed on the same host:
wsimageinfo.pl

Action script to extract information about an image.

wsxpvinfo.pl

Action script to extract information about an XPV document.

wsxpvcollect.pl

Action script to collect the referred data (QuarkXPress or InDesign document and images) from the XPV document. It creates also a report about the used fonts.

Note: The following two scripts require that PDF HandShake be installed on the same host:
wscheckpdf.pl

Action script to preflight a PDF document, using callas software's "pdfInspektor".

wspdfinfo.pl

Action script to extract information about a PDF document.

7.4 Image and document previews

WebShare sharepoints can have the Allow Preview option enabled, which will use HELIOS ImageServer to generate bitmap previews when a user clicks on an image or document. WebShare automatically detects supported image and document types and will present an HTML page containing an image/document preview for a given resolution.

The previews are generated by the "wspreview.pl" script which makes use of the ImageServer image conversion program "layout". All previews will be generated as either JPEG or PNG files in an RGB or grayscale color space.

This script can be modified to change the default behavior. Or it can be used as a template for custom "action scripts", e.g. to create previews with specific ICC profiles.

7.4.1 Image previews via the ImageServer option

The following image input formats are supported:

TIFF, EPSF, DCS-1, DCS-2, Scitex-CT, JPEG, JPEG2000, JBIG2, PICT, Photoshop, BMP and PNG images.

7.4.2 Document previews via ImageServer option

View QuarkXPress document previews for Mac and Windows documents and Adobe InDesign document previews for Mac and Windows documents. For Document previews it is necessary to install the HELIOS Preview XTension or plug-in for QuarkXPress or InDesign, which automatically save together with the document an ".xpv" file containing the document previews. A WebShare user can click on this ".xpv" file to view the document previews of each page.

7.4.3 PDF document previews via PDF HandShake and ImageServer option

Supports all PDF 1.0-1.7 files without passwords.

7.4.4 Generated previews

WebShare generates PNG previews for the following formats:

WebShare generates JPEG previews for the following formats:

All previews which once are generated will be stored in a customizable caching area to allow the reuse of existing rendered previews by other users.

It is possible to customize the preview generation by using different ImageServer parameters in the "wspreview.pl" script, e.g. to specify a different ICC profile for the RGB color space that is used for the previews.

The following resolutions are supported by default:

Additional preview resolutions can be specified as pixel or dpi values in the "Server Preferences" administration window. The customizable resolutions are selectable in the pop-up menu. The preview resolutions should be limited to avoid very large preview images which may take very long to download and display within the browser.

Note: If JavaScript is not enabled, clicking the Go button will start generating the preview specified in the pop-up menu.

7.5 Preference keys

This section lists all the preference keys that are pertinent to the WebShare File Server. Find a description of how to set, view, change or delete preferences, with the HELIOS "prefdump", "prefvalue", and "prefrestore" utility programs in "HELIOS utility programs" in the Base manual.

Important: Make sure that preference keys DO NOT start or end with a slash ("/") character, and note that they are case-sensitive! Also, if any preference key or preference value includes spaces, that key or value must be enclosed in quotes.
Preference
Type Default (""=no preference stored)

7.5.1 WebShare File Server preference keys

Key: Programs/websharesrv/<key>
WrongAuthDelay
int 2

Specifies the time delay in seconds between failed login requests. This helps increase the security against unauthorized logins, e.g. by password robots, which try to match the password by issuing a large number of passwords per second.

AllowForgotPassword
bool FALSE

Determines whether the Forgot Password? link becomes visible in the login window. The setting of this preference reflects the state of the Enable Forgot Password Option checkbox in the "Server Preferences" window (Fig. 7).

AllowRegisterUser
bool FALSE

Determines whether the Register as a New User link becomes visible in the login window. The setting of this preference reflects the state of the Enable Register User Option checkbox in the "Server Preferences" window (Fig. 7).

AllowEMailMessages
bool TRUE

Determines whether the Mail function (in the Edit > toolbar menu) is selected. The settings of this preference reflects the setting of the Enable E-Mail message for Users checkbox in the "Server Preferences" window (Fig. 7).

EnforceCryptedLogin
bool FALSE

With this preference set to TRUE, only encrypted user logins are permitted. For this purpose, JavaScript must be active in the web browser. The setting of this preference reflects the state of the Enforce RSA Crypted Passwords checkbox in the "Server Preferences" window (Fig. 7).

AllowLinkShares
bool FALSE

With this preference set to TRUE, WebShare allows direct URL access from remote clients.

The following keys require a new login to take effect:

logdenied
bool FALSE

If set to TRUE, this parameter lets "websharesrv" append a record to the system messages if, due to the IP access list, access to one or more users has been denied.

TcpRecvSize
int 65536 (64 x 1024)

Specifies the maximum number of TCP data bytes that are passed from the clients to "websharesrv" over the network during a transaction. The number of bytes may need to be limited if the buffer size in the UNIX server is too small. TcpRecvSize can be varied to optimize the data transfer rate.

TcpSendSize
int 65536 (64 x 1024)

Specifies the maximum number of TCP data bytes that are passed from "websharesrv" to the clients over the network during a transaction. The number of bytes may need to be limited if the buffer size in the UNIX server is too small. TcpSendSize can be varied to optimize the data transfer rate.

Note: Changed values in TcpRecvSize and TcpSendSize will automatically be assigned to the WebShare WebObjects Server as well, for the next login.
CacheSize
int 30 (in MB)

Specifies the cache size value of the WebShare File Server for preview files. It corresponds to the Cache Size in MB value in the "WebShare Server Preferences" menu.

Note: The default value for CacheSize is 30 (MB), due to the usually limited disk space in "HELIOSDIR/var". If you change the CacheDir preference to another path, it is recommended to set CacheSize to a value of at least 300 (MB).
AllowHostUsers
bool TRUE

Specifies whether users are allowed to log on to the WebShare File Server with their host login name. The setting reflects that of the Enable WebShare for Host Users checkbox in the "WebShare Server Preferences" menu.

AllowVirtualUsers
bool TRUE

Specifies whether users are allowed to log on to the WebShare File Server with their (virtual) WebShare login name. The setting reflects that of the Enable WebShare for Virtual Users checkbox in the "WebShare Server Preferences" menu.

AdminNotify
str ""

Specifies an e-mail address to which a notification is sent as soon as a client with Admin rights logs on to the WebShare File Server. It corresponds to the E-Mail Notification on Admin Login entry in the "WebShare Server Preferences" menu.

Note: Make sure that the complete receiver account is specified, e.g. webshare@mycompany.com
UserNotify
str ""

Specifies an e-mail address to which a notification is sent as soon as a user logs on to the WebShare File Server. It corresponds to the E-Mail Notification on User Login entry in the "WebShare Server Preferences" menu.

Note: Make sure that the complete receiver account is specified, e.g. webshare@mycompany.com
AllowAllReadWrite
bool FALSE

If set to TRUE, this preference enables the sharepoint preferences AllRead and AllReadWrite. In that case, the additional options Always Allow Reading and Always Allow Read/Write (see 7.5.2 "Sharepoint preference keys") will be shown in the "Sharepoint Administration" window.

Important: It may considerably reduce host security to set the AllowAllReadWrite flag to TRUE because if required, host access rights are bypassed, with all user processes changing to "root" processes!
DateFormat
str "dd MMM yyyy kk:mm"

Specifies the format with which the date is displayed in the directory listing of the "Sharepoint" menu. It corresponds to the Directory Listing Date Format entry in the "WebShare Server Preferences" menu. Also, this preference specifies the required syntax for the Expires field in the "User Administration" window. See Date format in 4.1 "Server Preferences".

mail
bool TRUE

Specifies whether e-mail notification is used at all.

SendMailOnActionScript
bool FALSE

If set to TRUE, this preference sends an e-mail, as soon as a WebShare action script is executed, to the address that is specified in the E-Mail on Access field in the "Sharepoint Administration" window. See EmailAccess.

DefaultWindowsEncoding
str "PC850"

Specifies the default encoding method when downloading files on Windows clients. The setting reflects that of the Default Windows Encoding pop-up menu in the "WebShare Server Preferences" menu.

DefaultMacintoshEncoding
str "MacRoman"

Specifies the default encoding method when downloading files on Mac clients. The setting reflects that of the Default Macintosh Encoding pop-up menu in the "WebShare Server Preferences" menu.

ShowHiddenFiles
bool FALSE

If set to TRUE, hidden files ("dot files" and files which have been marked as hidden in an EtherShare volume) are displayed in a sharepoint directory listing.

HideSpecialFiles
strlist ""

Specifies file names which should always be hidden in a directory listing.

PreviewResolutions
str "36 dpi,72 dpi,96 dpi,
144 dpi,
128 pixel,256 pixel,
512 pixel,768 pixel,
1024 pixel"

Specifies the (comma-separated) pixel/resolution values which are available in the "Sharepoint" preview pop-up menu. The "zoom icon" resolution values are fixed, and are not affected by this preference.

URLWebOnlyUsers
strlist ""

If this preference is set, the specified users have only URL based WebShare web access. See also the AllowLinkShares preference.

URLImageOnlyUsers
strlist ""

If this preference is set, the specified users have only URL based WebShare image fetching access. This allows setting up a special user (real or virtual) for remote URL image-only access. If somebody tries to steal the URL specified user name and password for a manual WebShare login, this will be denied. See also the AllowLinkShares preference.

Important: Specifying the same user name(s) with both preferences URLWebOnlyUsers and URLImageOnlyUsers will cause that the access for the specified user(s) is denied at all - be it via URL share access or manual login. So make sure to use different user names with both preferences!

The following keys require a service restart to take effect:

TcpPort
int 2010

Specifies the WebShare File Server port number. Additional TCP ports (up to a total of five) will automatically be allocated as needed by the WebShare File Server.

Important: The value of the TcpPort preference needs to be identical with the WebShare WebObjects Server preference WSHostPort (6.5 "Preference keys"). If there should be the need to change a value, then make sure that both preference keys are assigned the same value!
TelnetPort
int 2016

Specifies the "telnet" port number of the WebShare File Server.

sessions
int (see text)

Specifies the maximum number of workstations (clients) that are permitted to work on the WebShare File Server simultaneously. This value should normally be the same as the total number of workstations that are connected to the WebShare File Server, and should be less than or equal to the number of sessions allowed by your software license. The default value for sessions is the number of sessions allowed by your software license.

minuid
int see text

Specifies the lowest number allowed for user IDs. All host users which have a lower user ID than that specified by minuid, and all virtual users running as a host user with a user ID lower than that specified by minuid, are not permitted to log in. The default behavior is that all IDs are allowed.

maxuid
int see text

Specifies the highest number allowed for user IDs. All host users which have a higher user ID than that specified by maxuid, and all virtual users running as a host user with a user ID higher than that specified by maxuid, are not permitted to log in. The default behavior is that all IDs are allowed.

ipaccess
str "ipaccess"

Specifies the file containing the access list with the IP addresses which are permitted to log on to "websharesrv".

CacheDir
str "var/tmp/wscache"

Specifies the directory which contains the preview files on the WebShare File Server. It corresponds to the Cache Directory entry in the "WebShare Server Preferences" menu.

Note: This directory must already exist and have rwx
(read-write-execute) permissions for all.
AliasPDF
bool TRUE

If set to FALSE, antialiasing for PDF previews is deactivated.

7.5.2 Sharepoint preference keys

Key: Programs/websharesrv/Shares/<Sharename>/<key>

The following keys take effect immediately:

Path
str ""

Specifies the sharepoint path. It corresponds to the Sharepoint Path entry in "Sharepoint Administration".

Publish
bool TRUE

Specifies whether a sharepoint is published in the "Home" menu. The setting reflects that of the Publish checkbox in the "Sharepoint Administration" window.

EmailAccess
str ""

Specifies an e-mail address for notification mails on user access and action to the selected sharepoint. It corresponds to the E-Mail on Access entry in the "Sharepoint Administration" window. Make sure that the complete receiver account is specified, e.g. webshare@mycompany.com.

CollectMails
bool TRUE

Specifies whether notification mails, as stated in the EmailAccess preference, are issued after the users' logout, which is the default behavior, or after each file download, deletion or upload action that has been done by a user.

Comments
str ""

Specifies a comment on the selected sharepoint. It corresponds to the Comments entry in the "Sharepoint Administration" window.

AllowPreview
bool TRUE

Specifies whether previews of images in the sharepoint are allowed. The setting reflects that of the Allow Preview checkbox in the "Sharepoint Administration" window.

AllowDownload
bool FALSE

Specifies whether downloading files from the sharepoint is allowed. The setting reflects that of the Allow Download checkbox in the "Sharepoint Administration" window.

AllowUpload
bool FALSE

Specifies whether uploading files to the sharepoint is allowed. The setting reflects that of the Allow Upload checkbox in the "Sharepoint Administration" window.

AllowRename
bool FALSE

Specifies whether renaming files and directories in the sharepoint is allowed. The setting reflects that of the Allow Rename checkbox in the "Sharepoint Administration" window. Setting this preference allows changing permissions, too.

AllowCopy
bool FALSE

Specifies whether copying files to the sharepoint and creating directories is allowed. The setting reflects that of the Allow Copy checkbox in the "Sharepoint Administration" window.

AllowDelete
bool FALSE

Specifies whether deleting files in the sharepoint is allowed. The setting reflects that of the Allow Delete checkbox in the "Sharepoint Administration" window.

AllRead
bool FALSE

Specifies whether file read access in the sharepoint is enabled for all users, irrespective of the server file access settings. Read access includes file download and preview. The setting reflects that of the Always Allow Reading checkbox in the "Sharepoint Administration" window. This preference must first be enabled by the WebShare administration preference key AllowAllReadWrite.

AllReadWrite
bool FALSE

Specifies whether file read/write access in the sharepoint is enabled for all users, irrespective of the server file access settings. Read/write access includes file download, upload and preview. The setting reflects that of the Always Allow Read/Write checkbox in the "Sharepoint Administration" window. This preference must first be enabled by the WebShare administration preference key AllowAllReadWrite.

OnlyLayouts
bool FALSE

If set to TRUE, only layouts of the images in the sharepoint can be downloaded. The setting reflects that of the Download Layouts only checkbox in the "Sharepoint Administration" window. For this preference to be enabled, the WebShare File Server preference AllowDownload must be set to TRUE.

Users
strlist ""

Specifies one or more user names for which the sharepoint is available. If no names are specified, the sharepoint is available for all users. It corresponds to entries in Allowed Users in the "Sharepoint Administration" window.

Groups
strlist ""

Specifies one or more group names for whose members the sharepoint is available. If no names are specified, the sharepoint is available for all groups. It corresponds to entries in Allowed Groups in the "Sharepoint Administration" window.

For WebShare, the sharepoint (volume) key is the name of the sharepoint, for example "WebShare Public", whereas for EtherShare and PCShare the volume key is the UNIX directory path, for example "/demovol".

To set up a sharepoint "Mycompany Public", similar to the "WebShare Public" by using "prefvalue", the following prefvalue sequences must be called:

bin/prefvalue -k "Programs/websharesrv/Shares/
Mycompany Public/Path" -t str "/mycompany/public/WebShare"
bin/prefvalue -k "Programs/websharesrv/Shares/
Mycompany Public/AllowDownload" -t bool TRUE
bin/prefvalue -k "Programs/websharesrv/Shares/
Mycompany Public/AllowPreview" -t bool TRUE

By default the Publish flag is on, therefore it need not be specified.


© 2008 HELIOS Software GmbH