Scroll to navigation

DACSTRANSFORM(1) DACS Commands Manual DACSTRANSFORM(1)

NAME

dacstransform - rule-based document transformation

SYNOPSIS

dacstransform [dacsoptions[1]] [-admin] [-ct str] [-docs dir] [-f] [-F field_sep] [-fd domain] [-fh hostname] [-fj jurname]
[-fn fedname] [-h | -help] [-i ident] [-il ident] [-ilg ident] [-ieuid]
[-ieuidg] [-iuid] [-insert] [-iuidg] [-lg] [-name str] [-prefix str] [-roles roles_vfs] [-rprefix regex] [-rsuffix regex] [-suffix str] [{-r | -rulesrules_uri]
[-var name=value] [-x] [--] {- | file}

DESCRIPTION

This program is part of the DACS suite.

dacstransform supplies the functionality of dacs_transform from the command-line. Because the two programs are almost identical, please refer to dacs_transform(8)[2] for details.

If the program is executed through the system's "#!" mechanism (execve(2)[3]), one or more command line arguments can be given:

#!/usr/local/dacs/bin/dacstransform -Dfoo=val -ct ''
Hello, world
Bye

Such programs always use the script file as input, therefore no expression or other file can be specified on the "#!" line.


Note

The program has some limitations, including missing configuration capabilities and features, that might be expected in a production version but which have not yet been implemented.

OPTIONS

The arguments are processed as they are examined (left-to-right) and their ordering can be significant. Command line arguments override DACS configuration (see below).

Please refer to dacscheck(1)[4] for a description of the flags related to setting identities and DACS context. If no identity is specified, the program will use the values of the environment variables REMOTE_USER and DACS_ROLES if they are available and valid.

The following command line flags are recognized:

-ct str

Set the MIME Content-Type to str. The default is not to emit this header.

-docs dir

Set the directory containing the documents to dir - the file argument will be relative to dir. If dir is the empty string, however, this mapping will not be performed. The mapping is also disabled if the -f is given or if the standard input is read. This argument overrides any configuration of transform_docs or default behaviour.

-f

Disable input file location mapping.

-h
-help

Prints the usage blurb, which includes a listing of the program's defaults.

-insert dir

If a relative path is given for the value of a filename attribute with the insert, insertv, or expand directive, prefix the relative path with the string dir.

-name str

The name of the input document is str. This is used to associate a rule with the document; that is, it is matched against a rule's service or delegate element. By default, it is the name of the input file or the path component of the input URI. If the effective name does not begin with a slash character, one is prepended. The argument should probably be given if the standard input is being read.

-prefix str

A directive is introduced by str appearing at the beginning of an input line. The default is "<--DACS ".

-suffix str

A directive is terminated by str appearing at the end of a directive line. The default is "-->".

-r rules_uri
-rules rules_uri

The location of the ruleset to be applied to the document, as a DACS VFS URI.

-rprefix regex

A line whose beginning matches regex introduces a directive. This overrides the default and any -prefix flag. IEEE Std 1003.2 ("POSIX.2") "extended" regular expressions are supported (regex(3)[5]).

-rsuffix regex

A directive is terminated by a string that matches regex, followed immediately by the end of the line. This overrides the default and any -suffix flag. IEEE Std 1003.2 ("POSIX.2") "extended" regular expressions are supported (regex(3)[5]).

-var name=value

Add a variable definition to the DACS namespace. The variable ${DACS::name} will be assigned the string value. The name must be syntactically valid. This flag is equivalent to the dacsoptions[1] flag -Dname=value. This flag may be repeated. It is best to avoid the variable name stdin, which has a special purpose. If name is defined more than once its value is indeterminate.

In a directive, an attribute value that is enclosed within backtick quotes is evaluated as an expression, which may include variable references. Variables from the Env namespace and, if available, the Conf are also instantiated. The current directive's attributes are accessible in the Attr namespace; these attribute values are unevaluated and quoted.

-x

Run as a command, not a web service. This is often required when dacstransform is run as a CGI program.

--

Flags end. An input source argument may follow.

After the flags, the input source can be specified. By default, or if - is given, the standard input is read, otherwise file is read.

Whitespace is not ignored at the beginning or end of an input line with respect to directive prefix and suffix matching.

Configuration

Configuration variables can be set to change some of the program's defaults, but each one is overridden if a value is also given on the command line:

transform_docs: This is the full pathname of the root directory in which original documents are kept. By default, the program will use a subdirectory ${Conf::DACS_HOME}dacs_transform/docs. (default: /usr/local/dacs/dacs_transform/docs)


Security
Change the default with care. In the absence of an appropriate access control rule, setting the pathname to "/" or the empty string, would provide access to any file on the server that can be read by this web service.

transform_acls: This is the VFS specification for the rules. By default, the program will use ${Conf::DACS_HOME}dacs_transform/acls. (default: [transform-acls]dacs-fs:/usr/local/dacs/dacs_transform/acls)

transform_annotation: This is the annotation to interpolate in redacted text instead of the default.

transform_prefix: Instead of the default prefix string used to introduce a directive, the value of this variable is used. It must appear at the beginning of a line.

transform_suffix: Instead of the default string used to end a directive, the value of this variable is used.

transform_rprefix: A line whose beginning matches the specified regular expression introduces a directive.

transform_rsuffix: The end of a directive is found by matching the specified regular expression.

DIAGNOSTICS

The program exits 0 if everything was fine, 1 if an error occurred.

SEE ALSO

dacs_transform(8)[2], dacs.exprs(5)[6], dacs.acls(5)[7]

AUTHOR

Distributed Systems Software (www.dss.ca[8])

COPYING

Copyright © 2003-2018 Distributed Systems Software. See the LICENSE[9] file that accompanies the distribution for licensing information.

NOTES

1.
dacsoptions
2.
dacs_transform(8)
3.
execve(2)
4.
dacscheck(1)
5.
regex(3)
6.
dacs.exprs(5)
7.
dacs.acls(5)
8.
www.dss.ca
9.
LICENSE
08/23/2020 DACS 1.4.40