#!/bin/sh
#
# @package      hubzero-filexfer
# @file         exportfile
# @author       Michael McLennan <mmclennan@purdue.edu>
# @author       Derrick Kearney <dsk@purdue.edu>
# @author       Nicholas J. Kisseberth <nkissebe@purdue.edu>
# @copyright    Copyright (c) 2004-2011 Purdue University. All rights reserved.
# @license      http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3
#
# Copyright (c) 2004-2011 Purdue University
# All rights reserved.
#
# This file is part of: The HUBzero(R) Platform for Scientific Collaboration
#
# The HUBzero(R) Platform for Scientific Collaboration (HUBzero) is free
# software: you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# HUBzero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# HUBzero is a registered trademark of Purdue University.
#

# ----------------------------------------------------------------------
#  USAGE: exportfile ?options? file file ...
#
#    options:
#      -h or --help
#        Prints a help message.
#
#      -t or --timeout <seconds>
#        Forget about the file after this timeout.  Default is 300
#        seconds (5 mins).
#
#      -d or --delete
#        Delete the file after the timeout or when the server is shut
#        down.
#
#      -m or --message
#        File containing a fragment of HTML text that will be displayed
#        above the download.  It might say "Here is your data," or
#        "If you use this data, please cite this source."
#
#      -f or --format <type>
#        Choices are "raw" and "html".  Default is "raw".  The "html"
#        format causes the server to rewrite links embedded within
#        the HTML, so that images can be displayed and links can be
#        traversed properly.
#
#      --
#        Remaining arguments are treated as file names, even if they
#        start with a -.
#
#  This is the client that users invoke to transfer files from their
#  session to their desktop.  The client tries to connect to a server
#  to handle the transfer.  If necessary, the client tries to spawn
#  the server and then connect to it.  The server uses the "clientaction"
#  program to open a web page on the client's desktop to download the
#  file.
#
#  Note that the file can be any file in the user's home directory,
#  and therefore is not deleted unless specifically instructed to do
#  so via the --delete option.
#\
source /etc/environ.sh
#\
use -e -r rappture
#\
exec tclsh /apps/filexfer/exportfile.tcl "$@"
