License Templates Help
Name:License Templates
Version:0.4
Last update:2019-10-17 13:28:44





The License Templates package creates license templates for insertion into document windows. These templates can be modified to suit your particular tastes. You can also add new license templates.
Other AlphaTcl packages use the list of defined templates to insert them into windows; see the Document Projects Help and the Electric Menu Help for more information.

Default Licenses

Several licenses are defined by default; click here to list them and display the current template(s) in a new window. You can modify these templates as much as you want.

Modifying Templates

If you're not satisfied with the content of a default template, you can easily modify it. Click here to do so.
When you are satisfied with your template, simply save the file. The next time that some AlphaTcl code needs to get the template it will read the contents of this file, ignoring any comments and leading blank lines.
All of your modified license templates are stored as files in Alpha's Support folder.
See the Template Substitutions section below for advanced tips.

Adding New Templates

If you want to add a new license template without changing any of the current defaults, click here.
You will be prompted for a new license name, and a new file will be created in your Support folder. You might want to use an existing template as an example.
All of your personal license templates are stored as files in Alpha's Support folder.
See the Template Substitutions section below for advanced tips.

Restoring Templates

If you want to restore a default license template, simply remove the modified Support file. Click here to do so.
If this was a default license defined by this package, the default version will then be restored. If it was a new license template added by you, it will be lost forever.

Template Substitutions

The template that is returned to any calling procedure is in an electric format that can specify template prompts and fancy substitutions. For example, anything that is surrounded by •bullets• is considered to be a prompt, as in
•author•
The [license::getTemplate] procedure goes even further, and attempts to replace some of these hints with information that is relevant to the current user. This routine makes use of the package Identities ; you can use the Alpha ↣ Preferences ↣ Identities menu to set your name, e-mail address, etc. and this information will be used (when it is available) to create a better license template. When none is available, the hint is retained as a template prompt. Some common substitutions that you can add to your template include
•author•
•organisation•
•address•
•email•
•www•
•author_initials•
•year•
Or, since you are modifying the template for your personal use, you could simply hard-wire those values as desired.
Some additional template substitutions which are always available include
•tail•
•path•
which refer to the name and path of the active window.

Advanced Substitutions

You might find that you have additional common user information fields that you would like to include in your template, such as an original year in which a suite of files was created. Using the package Identities , you can easily add any arbitrary field and value. Open a prefs.tcl file, and add a line formatted like this
    userInfo::addInfo <field> <value>
as in
    userInfo::addInfo "orig_year" "1997"
Now your template can include "•orig_year•" and the string "1997" will be automatically substituted.
If you are in need of additional template substitutions that are more contextual, such as the •path• and •tail• examples above, feel free to contact this package's maintainer for some tips on how to create them.

System Administrator Notes

A sysadmin can over-ride the default license templates or add new ones to be made available by adding files to the Templates/Licenses folder in the $SUPPORT(local) directory. The user will still be able to over-ride these system additions, but the sysadmin's modifications/additions will always be used by default.

Developer Notes

To make use of this package, you should first confirm that it exists:
    alpha::package exists licenseTemplates
Use the proc [license::listTypes] for a list of the current templates.
Use the proc [license::getTemplate <type>] to get the electric template.

Known problems

Please report any problem or bug you encounter to Alpha's Bug Tracker.
Source code can be found in elecTemplates.tcl, code contributions are always welcome.

License and Disclaimer

Copyright (c) 2006-2019, Craig Barton Upright.
All rights reserved.
The License Templates package is free software and distributed under the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CRAIG BARTON UPRIGHT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.