redirect2web

Package: WA2L/WinTools 1.2.08
Section: General Commands (1)
Updated: 30 June 2017
Index Return to Main Contents

 

NAME

redirect2web - redirect to web server based on local selected file

 

SYNOPSIS

WA2LWinTools/bin/redirect2web [ -h | -i | -u | -V ]

redirect2web [ -t ][ -m mapfile ][ -f filename ]

 

AVAILABILITY

WA2L/WinTools

 

DESCRIPTION

With the redirect2web command a user can be supported when files are migrated from local- respectively network drive based locations to a web server, as 'Microsoft™ SharePoint'.

When a selected file is sent to the redirect2web command a web browser is started with a location resolved based on a map file.

In the map file redirect2web.map source file locations can be mapped to target web URL locations using regular expressions.

As soon as a rule in the map file matches to the selected file, the related target definition is loaded into a web browser to visualize to the user where his files he previously has used from the network drive have been saved on the web service.

The use of regular expressions in the matching rules allows to efficiently define mappings.

The redirect2web command should be installed to the 'Send To' context menu in 'Microsoft™ Windows Explorer' for most convenient usage. To do so, invoke redirect2web -i once.

Doing this, the user right clicks a file or folder in 'Microsoft™ Windows Explorer', continues with → 'Send To' → redirect2web and is then redirected to the correct new target location of the file.

 

OPTIONS

-h
usage message.

-i
install the redirect2web command as menu point 'redirect2web' to the 'Send To' context menu in 'Windows Explorer'.

-u
uninstall the redirect2web shortcut from the 'Send To' context menu in 'Windows Explorer'.

-V
print program version.

-m mapfile
location of the map file when not saved to the default location in etc/. The map file can also be defined in the etc/redirect2web.cfg file using the MAPFILE=file setting. The -m option has preference over the setting in the configuration file and its purpose is mostly in testing new map files.

If the mapfile contains spaces, it has to be surrounded by double quotes (e.g. "map file" ).

-f filename
filename (including path) of the file to be mapped to a target (web) location. The command can handle files on letter drives (e.g. c:\subdir\file.txt , c:\subdir\ ) and UNC format (e.g. \\fileserver\share\subdir\file.txt , \\fileserver\share\subdir\ ).

If the filename contains spaces, it has to be surrounded by double quotes (e.g. "file name" ).

-t
test the map file.

The filename to test if it matches to the desired rule can be provided thru the -f filename option:

  redirect2web -t -f aCalculation.xlsx

or thru stdin and the use of the -f - option:

  type filelist.txt | redirect2web -t -f -

To catch the output for further processing as a csv file output, redirect stdout to a target file:

  type filelist.txt | redirect2web -t -f - > result.txt

To perform a regression test of a file list (check.txt) where the first column in this example holds the rule identifier of the map file redirect2web.map that is expected to match and the 2nd holds a file name, as:

  EXMP-01;g:\acct\LToons\afile.xlsx
  EXMP-01;g:\acct\LToons\subdir\afile.xlsx
  EXMP-12;g:\cust\ABC\subdir\afile.xlsx

and the related map file, invoke:

  cut -d; -f2 check.txt | redirect2web -t -f - | cut -d; -f3 > result.txt

  cut -d; -f1 check.txt > reference.txt && fc reference.txt result.txt

If the fc (file compare) command does not find a difference between the reference.txt and the result.txt all tests are as expected.

The cut -d; -f2 command prints the 2nd field ( -f2 ) of the semicolon delimited ( -d; ) check.txt file.

The cut command is in the %PATH% when using the wtshell(1m), else it can be found in the lib/ directory of the WA2L/WinTools package.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

4
usage message displayed.

5
version message displayed.

 

FILES

etc/redirect2web.cfg
optional configuration file for redirect2web. See: redirect2web.cfg(4) for more information.

etc/redirect2web.map
configuration file for redirect2web to map source to destination locations. See: redirect2web.map(4) for more information.

lib/redirect2web.html
example notification file to display when no mapping was found for a certain file.

lib/redirect2web.cfg
example configuration file.

lib/redirect2web.map
example map file.

 

EXAMPLES

-

 

SEE ALSO

wintoolsintro(1), cut(1), redirect2web.cfg(4), redirect2web.map(4), config(1m), wtshell(1m)

 

NOTES

-

 

BUGS

-

 

AUTHOR

redirect2web was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2020 Christian Walther

This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:32:50 GMT, September 14, 2024