By referencing the template instead of the "initial_uri" (Forms
composer), the backend is able to more precisely identify the correct
HTML file for any given template. It also makes handling of reply
templates much easier.
In addition to a less complex implementation, this simplifies the API as
we no longer need to supply the frontend with URIs for all HTML
variants. We also get increased performance because of the simplified
file search, and by not having to parse reply templates upfront.
This also opens up the possibility of serving a specialized HTML-based
composer for text-only templates in the future, without having to change
the existing frontend.
Some templates references HTML Forms and reply templates located in
adjecent folders, without specifying a relative path. Examples of this
can be found in `MAPPING-GIS FORMS`.
Forms-enabled templates is not written with a CLI user in mind. By
echoing the template line before prompting for a <Var ...>, it will
hopefully be possible to understand the meaning of the variable (by
context).
Also apply a hack to refresh the regular expressions used by
varReplacer, to avoid prompting for the same variable multiple times.
(HTML) Forms is an extension of the Templates feature in RMS Express.
Templates are the .txt files. Some templates support HTML forms,
indicated by the Template Control Field `Form`.
This was making the code more complex, as it made an unnecessary
fragmentation between the cli composer and the web gui. Many of the
fields exposed via the web api was in fact unused.
Improved error handling, more efficient search and make sure we don't
escape the Forms root directory. Also adds debug logging and fixes some
reply templates we missed before.
Add support for parsing To/Cc fields and passing an array
of addresses back to the compose window.
Improve handling of Msg. As per the templates [spec][]:
> Msg: -- Start of message body. All text following Msg: is placed in the body of the message.
and a few templates have text and variables on the same line as the "Msg:".
Therefore, simply strip out the Msg: and use that to mark the rest of
the template as being part of the body.
[spec]: http://www.philsherrod.com/Winlink/RMS_Express_Message_Templates.pdf
[Changed "var inBody = true" to "inBody := true" per Martin's
suggestion]
Signed-off-by: Corey Minyard <cminyard@mvista.com>
By doing graceful shutdown, we're able to properly close all of the open
resources such as modem connections and ongoing sessions.
This will allow transport drivers controlling stateful TNCs (e.g.
ptc-go) to recover the initial TNC state before termination.
Resolves#314
* Deprecate `forms_path` in the config file and replace with `--forms` flag
* Clean up `optionsSet()` to show correct defaults
* Clean up places that detected when `forms_path` was not configured (before it had a default)
Resolves https://github.com/la5nta/pat/issues/287
* Replace(..., -1) with ReplaceAll
* Variable names hiding packages
* Error messages start with lowercase and no end punctuation
* Don't `defer` in a loop
* Etc.