PeterThoeny's answer to
RegeneratingTWikiUsers just made me realise (again, for about the tenth time) that TWiki has an embedded scripting language.
%SEARCH,
%CALC and others can be thought of as calls to script functions.
Given the wealth of experience backing up scripting languages, and most especially the
sh command line, it is interesting to consider what is missing from TWiki scripting.
FWIW here's a few obvious ones that may pique some creativity:
- pipes
- create new version of a topic with %SEARCH > NewTopicName
- pipe a %SEARCH to another %SEARCH
- use pipes to separate function and format e.g.
- search | tabulate{format=""}
- sed
- post-process search results
- globs
- for topic in (*); do
- %SEARCH Web*
- access to cron
Given the number of times I've had to write hack scripts to perform global changes over a range of topics, this is quite interesting. Especially, I suspect, for those poor souls on hosted servers.
--
CrawfordCurrie - 02 Oct 2004
Access to entry points in plugins and core.
It is those aspects that led me to build the
TWikiShell and
TWikiCLI - these provide an interactive and non-interactive command line environments respectively. I've put it on the backburner until time permits.
--
MartinCleaver - 03 Oct 2004
WikiTalk -
FlexWiki Behaviour language. Basically a query mechanism. It is on lines of
FormQueryPlugin. But a language of its own.
http://www.flexwiki.com/default.aspx/FlexWiki.WikITalk
--
VinodKulkarni - 05 Oct 2004
I do appreciate the effort Peter went to answer my question, but, since hacking
UserDotPm as part of the
RegisterCgiScriptRewrite, I find that there is a routine in User.pm that does exactly what I want.
Furthermore, I feel providing proper access to this routine would be preferable to getting end users to deal directly with the file format.
If nothing else it allows the script to check that an entry in Main really is a user and programming language checks could ensure a corresponding entry in
DotHtPassword.
Hopefully the work
RafaelAlvarez was doing to extend the TWikiShell will provide deeper access both on an interactive and a scripting level. As it could also open more of TWiki's internals to outside programmatic access it is likely to also drive a need to reorganise and document the guts of this creature.
--
MartinCleaver - 11 Oct 2004
If you look at what I did in
LocationLocationLocation you will find that the pattern for calling "dynamic internal tags" (tags that take parameters and demand some processing) uses the idea of functions being handlers, that take a fixed parameter list and returns the text that replaces the tag. In theory, any TWiki function that does not record state can be rewritten to this pattern, and thus called from the browser.
--
CrawfordCurrie - 11 Oct 2004
I
dread the idea of an embedded scripting language! Not for the likes of the people in Codev, but for the temptation it presents to the "ordinary" end users, the ones who have a hard enough time remembering not to open attachements and fire off viruses.
--
AntonAylward - 12 Oct 2004
Anton, agreed if the scripting is a security hole. Disagreed if it executes in a safe sandbox like the
SpreadSheetPlugin.
--
PeterThoeny - 12 Oct 2004
or
PerlSamplePlugin, which runs in a
Safe module/compartment
--
WillNorris - 12 Oct 2004