LinkScan

LinkScan for Unix. Reference Manual.

Section 12

  Previous   Contents   Next   Help   Reference   HowTo   Card 

Advanced, Custom and Command Line Reports

This Section covers:

  1. Customizing the appearance of LinkScan Menus and Reports
  2. Adding hyperlinks to other applications
  3. Mailing LinkScan reports from a browser
  4. Customizing the LinkScan SiteMap and TapMap
  5. Customizing the LinkScan Status Codes
  6. Creating Reports from the Command Line

12.1 Customizing the appearance of LinkScan Menus and Reports

You may change the appearance of the LinkScan Menus and Reports by creating one or more of the following header/footer files in the LinkScan installation directory:

The link*.* files are used when interactive reports are displayed or static reports are written to disk. The mail*.* files are used when the report is automatically sent via e-mail. The *.html files are used for HTML formatted reports and the *.txt files for plain ASCII text reports.

The *.html files may contain any valid HTML and they will be inserted at the top and bottom of each Menu and Report, respectively. The files linkhead.html and mailhead.html should include at least the following tags:


<html><head>
<title>Your title here</title>
</head><body><nobr>

There is no need to close out the <body> or <html> tags in linkfoot.html or mailfoot.html. LinkScan will always insert a Copyright notice and version stamp after the main body of the report and close out the document with </body></html>.

12.2 Adding hyperlinks to other applications

If the following optional directives are specified in linkscan.cfg, LinkScan will add [Edit] hyperlinks at various points throughout the reports:


Editlink = http://foo/bar.cgi?Url=!URL&Cap=!CAP&Status=!STAT
Editdoc  = http://foo/bar.cgi?Url=!URL&Cap=!CAP&Status=!STAT

The linking URL is constructed from the Editlink and Editdoc settings. Those settings may include the optional tokens !URL, !CAP or !STAT.

These tokens are replaced with %encoded strings containing:

In the case of Internal links (same scheme/host/port as Homeurl) the URL is relative. e.g.

http://foo/bar.cgi?Url=resume.html&Cap=My%20Resume&Status=200

In the case of External links, the URL is absolute. e.g.

http://foo/bar.cgi?Url=http://www.example.com/xyz%3F123&Cap=External=&Status=404

12.3 Mailing LinkScan reports from a browser

A user viewing any LinkScan report with a browser may send a copy of that report to any valid e-mail address.

To enable this feature, you must:

12.4 Customizing the LinkScan SiteMap and TapMap

LinkScan incorporates features that enable the automatic generation of customized, publication quality tables of contents for your Projects. Two types of Maps may be created:

When creating Maps based on Link Order, the presence of cross-links may distort the structure of the report in ways which you find undesirable. Therefore, LinkScan incorporates features that enable you to "manipulate" or override the LinkScan algorithm.

You may customize the structure and content of the SiteMap/TapMap with the following commands in the linkscan.cfg configuration files. Note the the Mapmove command only affects Maps based on Link Order (not the Maps based on Directory Structure).


Mapdefaulttitle [ string ] [ !PATH | !FILE ] [ string ]
Mapinclude relative-path-expression
Maphide relative-path-expression
Maptitle relative-path, Alternative Title
Mapmove relative-path, relative-path, position, [Alternative Title]

By default, all HTML type files are included on the SiteMap/TapMap. The Mapinclude and Maphide commands may be used to modify this behavior as illustrated in the following example:


Examples:

Mapdefaulttitle Pathname: !PATH; Filename: !FILE
Mapinclude .*
Maphide (?i).*\.(gif|jpg)$
Maphide first-doc.html#Top
Maptitle second-doc.html, An Alternative Title for second-doc.html
Mapmove third-doc.html, index.html, 5, Alternative Title

The above example will:

Note that the Mapinclude and Maphide commands accept Regular Expressions. The Mapdefaulttitle, Maptitle and Mapmove commands require exact values.

12.5 Customizing the LinkScan Status Codes

Each link validated by LinkScan is assigned a specific LinkScan Error or Status Code. And, every Status Code is associated with a Severity. You may customize the Severity associated with any Status Code by using the Statuscode command. The command syntax is:


Statuscode statuscode, severitycode

The following Severity codes are valid:

Symbol Code Severity Explanation
* 0 Unknown: LinkScan has not tested or was unable to test this link
* 1 Error: LinkScan found a hard error on this link
* 2 Possible Error: There may be a problem with this link. It should be retested at a later time
* 3 Warning: LinkScan found something unusual about this link. Manual inspection highly recommended
* 4 Advisory: This link is probably ok, but manual inspection recommended
* 5 No Error: This is a good link

Examples:

Statuscode = 301,3    # 301 (Moved Permanently) from Error to Warning
Statuscode = 7,4      #   7 (Orphaned HTML File) to Advisory
Statuscode = 8,4      #   8 (Orphaned non-HTML File) to Advisory

The above commands will downgrade all 301 status codes from Errors to Warnings, and all Orphaned Files from Warnings to Advisories.

12.6 Creating Reports from the Command Line

Command line reports are provided to address the following requirements:

To enable command line reporting, you must create an environment variable called linkscan and set it to any non-null value. Depending on your system/shell the command is:

Unix users may wish to add the appropriate command to their .login or .cshrc files so that the environment variable is automatically initialized at each login.

When LinkScan Reports are generated via the normal browser-based interface, users select the type and style of report by completing and submitting normal HTML forms. Other techniques are required in order to make these selections from the command line interface and several options are provided:

  1. You may specify your selections in a configuration file. An example file with sensible defaults -- linkscan.rep -- is placed in each Project directory automatically.

  2. You may also select a specific report using the interactive browser-based interface and copy/paste the URL to the command line interface (since your selections are already embedded within the name-value pairs on the query string).

Simply execute the program linkscan.cgi and it will prompt you for some or all of the following parameters:

Alternatively, you may specify any or all of these parameters on the command line, as shown by the -help switch:

web:/usr/local/www/data/linkscan> perl linkscan.cgi -help

LinkScan Version 12.4
Copyright 1997-2013 Electronic Software Publishing Corporation

USAGE: linkscan  {-help} {-type type} {-project name} {-owner owner}
                 {-repfile file} {-query string} {-outfile path}
                 {-tty} {-mailto address} {-format n}

-help            Displays this message
-type type       Select report type
-project name    Specify a LinkScan Project
-owner owner     Specify a LinkScan Owner
-repfile file    Specify a filename with the reporting options
-query string    Specify all options in the form of an encoded URL
-outfile path    Specify an output filename
-tty             Output to terminal
-mailto address  Send report to email address
-format n        1=Full HTML; 2=HTML; 3=Plain; 4=text

Detailed Help [Y/N]:

Where the parameter to -type is one of:


Examples:

perl linkscan.cgi -type d -project default -outfile myreport.html

perl linkscan.cgi -query 

Also see the Sections of this Manual covering LinkScan Dispatch and LinkScan QuickCheck. Note there is no command-line interface to LinkScan TapMap due to its interactive nature.

LinkScan for Unix. Reference Manual. Section 12. Advanced, Custom and Command Line Reports
LinkScan Version 12.4
© Copyright 1997-2013 Electronic Software Publishing Corporation (Elsop)
LinkScan™ and Elsop™ are Trademarks of Electronic Software Publishing Corporation

  Previous   Contents   Next   Help   Reference   HowTo   Card