create new tag
, view all tags
Mail disabled on twiki.org  
Phone disabled on twiki.org  

Sean Morgan

Agree to Code
of Conduct
Hear from:  
Watchlist Changes of Sean:
Info None (empty watchlist)
Arrow right More watchlist details
Tag Cloud of Sean:
Unrecognized action

Contents of this topic

1. How to move components after using the Windows Installer

UPDATE (2008-08-27): I've changed my mind about using TWikiWebRoot since the extension installers assume everything is under Twiki/. I haven't changed revised this document to reflect that. frown

The Windows Installer works very well: I was up and running in minutes. And because it uses ActiveStatePerl, it was much faster than TWiki 4.1 (with Cygwin) that I installed by hand. Kudos!

Unfortunately, it puts everything on the "C:\" drive, which doesn't always work in enterprise environments (sysadmins often like to keep that drive isolated to the OS only). It took me a while to get everything working with a different drive. Here's how I did it.

1.1. Parameters

I chose to start by creating a development instance (at D:\Dev)
then copy that to create the production instance (at D:\Prd).
YMMV, so you may use this form to customize those values.

Field Default Value Custom Value
Host host.company.com
Drive D:
Dev directory (*) Dev
Prd directory (*) Prd
Dev port 88
Prd port (assumed to be on port 80)
* = you may use a deeper path here (e.g., Data\Dev), but do not put a space in any directory name or you will run into trouble.

1.2. Related Links

1.3. Installation & Migration Steps

Step 1) Take a Backup

As with any upgrade, this is step 1. The server should be backed up automatically: this step is to create a local copy to allow for a quicker recovery, if/when needed. Simply right-click and ZIP the following directories: twiki\ and apache\

Step 2) Install

The install ran very cleanly for me (as someone else wrote, it's a "spousal install": just say 'yes' to all the prompts).
  • The versions of the components currently provided by the Windows Installer are as follows:
    • apache_2.2.4-win32-x86-no_ssl.msi
    • grep-2.5.1-2-bin.exe
    • ActivePerl-

After checking that it works, stop Apache and proceed to the next step.

Step 3) After Running the Installer

  1. If you are creating a Dev instance, change the port that Apache is using:
    • D:\Dev\Apache\conf: change port 80 to 88 (two locations).
    • D:\Dev\TWiki\lib\LocalLib.cfg: $TWiki::cfg{DefaultUrlHost} = 'http://host.company.com:88';
  2. Move the following directories:
Installer Location New Location
C:\Perl D:\Dev\Perl
C:\Program Files\Apache Software Foundation\Apache2.2 D:\Dev\Apache
C:\Program Files\GnuWin32 D:\Dev\GnuWin32
C:\Program Files\TWiki\twiki D:\Dev\TWiki
(recommended) \TWiki\bin and TWiki\pub D:\Dev\TWikiWebRoot
My explanation for the recommendation on that last move appears at TWiki:Codev/WindowsInstallCookbookComments (dated 12 Mar 2008).
  1. The start menu for Apache was in the home directory of the installer's account (the other components were OK). So move these to the corresponding locations for "All Users", and edit each shortcut to use the new D:\Dev location:
    • C:\Documents and Settings\<my_user>\Start Menu\Programs\Apache HTTP Server 2.2.4
    • C:\Documents and Settings\<my_user>\Start Menu\Programs\Startup\Monitor Apache Servers
  2. Edit Apache httpd.conf to use the new D:\Dev location
  3. Edit D:\Dev\Apache\conf\twiki.conf (I moved it up from the \extras subdirectory, and change httpd.conf to point to the new location).
  4. Re-install the Apache service to use the new location:
     cd D:\Dev\Apache\bin httpd.exe -k uninstall -n "Apache2" httpd.exe -k install -n "Apache-Dev"
  5. Change start of Path: D:\Dev\Perl\site\bin;D:\Dev\Perl\bin;D:\Dev\GnuWin32\bin;
  6. Edit D:\Dev\TWikiWebRoot\bin\LocalLib.cfg
    # REQUIRED # The absolute path to the 'lib' directory in your installation. $twikiLibPath = 'D:\Dev\TWiki\lib';
  7. Rewrite the shebang lines using the follow code (stolen from post-install.pl). Save as "D:\Dev\TWikiWebRoot\bin\shebang", and execute it with "D:/Dev/perl/bin/perl shebang". After confirming success, delete the '~' files.
     #!D:/Dev/perl/bin/perl #redo the perl shebangs for all scripts my $twikiBin = 'D:\\Dev\\TWikiWebRoot\\bin'; opendir(DIR, $twikiBin); my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { next if ( ($file eq '.') || ($file eq '..') || ($file eq 'logos') ); print "\n fixing shebang on cgi: $file"; $cmd = 'D:\\Dev\\perl\\bin\\perl -pi~ -e "s/c:\/perl\/bin\/perl/D:\/Dev\/perl\/bin\/perl/" "'.$twikiBin.'\\'.$file.'"'; `$cmd`; }
  8. Fix path errors and warnings in http://host.company.com:88/bin/configure, and check other EXPERT values (view source afterwards to check that got them all. Alternatively edit LocalLib.cfg again, but I prefer to use configure whenever possible):
    • Passwords: {Htpasswd}{FileName}
    • Store settings: {RCS}{EgrepCmd} and {RCS}{FgrepCmd}
    • Miscellaneous settings: {TemplatePath} this is a LONG field with several values that need to be changed
    • Miscellaneous settings: {MimeTypesFileName}
  9. Start up Apache! If the service throws an error, start it from the command line to see what error is. If you're used to Apache 1.3, a different procedure is required to test Apache 2.2 in the console:
    • to test the config: D:\Dev\Apache\bin\httpd.exe -w -t -f "D:\Dev\Apache\conf\httpd.conf" -d "D:\Dev\Apache\."
    • To start it: D:\Dev\Apache\bin\httpd.exe -w -f "D:\Dev\Apache\conf\httpd.conf" -d "D:\Dev\Apache\."

1.4. Cutover Steps

This section is only tangentially related to the Windows Installer. I'm including it here since it involves another directory set-up and Apache reconfig, similar to what was done above.
In my case, I had a production instance of a previous release already running on port 80. So I temporarily made the new development instance into the production instance. Then I created an upgraded production by copying Dev. Then I swapped the ports one last time, so that Dev was no longer production, and production was running on its proper port.
  1. Take another backup
  2. Refresh content from production (easier said than done).
  3. Redirect Apache to use the secondary directory (D:\Dev):
    1. Swap ports (80 <-> 88)
    2. {DefaultUrlHost} = 'http://host.company.com';
    3. Configure $TWiki::cfg{PermittedRedirectHostUrls} = 'http://localhost,http://host.company.com';
    4. To avoid port contention, stop BOTH Apache servers before starting both.
  4. After test period, create prod instance:
    • Copy D:\Dev (to "copy of Dev", and rename it) to D:\Prd. Insted of using File Explorer I probably should have used the more reliable XCOPY command, because when I ran a WinDiff comparison on the two sets of directories, it turns out it failed to copy some bin\ files: attach, change, and configure.
    • Remove read-only flag on D:\Prd and change owner to SYSTEM
    • Edit D:\Prd\Apache\conf\httpd.conf to use D:\Prd\ and port 80
    • Edit D:\Prd\Apache\conf\twiki.conf to use D:/Prd
    • Edit D:\Prd\TWikiWebRoot\bin\LocalLib.cfg to use D:\Prd * Edit D:\Prd\TWiki\lib\LocalLib.cfg :
      • $TWiki::cfg{DefaultUrlHost} = 'http://host.company.com:81';
      • Dev -> Prd (17 instances)
    • Copy Apache start menu and edit shortcut properties
    • Install an Apache service to use the new location:
       cd D:\Prd\Apache\bin httpd.exe -k install -n "Apache-Prd"
    • Change start of Path: D:\Prd\Perl\site\bin;D:\Prd\Perl\bin;D:\Prd\GnuWin32\bin;
    • As before, rewrite the shebang lines, but substituting Prd for Dev. Save as "D:\Prd\TWikiWebRoot\bin\shebang", and execute it with "D:/Prd/perl/bin/perl shebang". After confirming success, delete the '~' files (it's easiest to search the directory for that then delete).
       #!D:/Prd/perl/bin/perl #redo the perl shebangs for all scripts my $twikiBin = 'D:\\Prd\\TWikiWebRoot\\bin'; opendir(DIR, $twikiBin); my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { next if ( ($file eq '.') || ($file eq '..') || ($file eq 'logos') ); print "\n fixing shebang on cgi: $file"; $cmd = 'D:\\Prd\\perl\\bin\\perl -pi~ -e "s/D:\/Dev/D:\/Prd/" "'.$twikiBin.'\\'.$file.'"'; `$cmd`; }
    • Start the new Apache service, test it.
  5. You're now ready to do the actual cutover, by redirecting the production Apache server to primary Prd directory. For each instance:
    • Edit D:\<INST>\Apache\conf to change port 80 <-> 81 (two locations).
    • Edit D:\<INST>\TWiki\lib\LocalLib.cfg like so: $TWiki::cfg{DefaultUrlHost} = 'http://host.company.com[:PORT]';
    • Restart Apache. To avoid the possibility of port contention, stop BOTH Apache servers before starting both.

2. How I Set-up ActionTracker

Others have provided some of the bells & whistles here (and many more besides) by providing code modifications attached to the plug-in's dev topic. However I was leery to use those because it appears that they haven't been incorporated into the main development stream. I also prefer to 'configure' rather than 'customize' whenever possible to minimize my pain on upgrades.

Here are some key main points on my implementation:

2.1. A Form to Add an Action (with selectable names and a nice calendar)

As delivered, the plug-in has no input form, you are expected to edit the text version of the page to add action items. Anticipating that my users would have an issue with that, I came up with this form:

Adding an Action

This isn't just to pretty up the page (though it does that), it also helps with data integrity in that the names and dates get properly formed.

Components of this were 'borrowed' from:

The components were combined with these template definitions: Show Hide

  <!-- calendar stylesheet -->
  <link rel="stylesheet" type="text/css" media="all" href="/pub/TWiki/JSCalendarContrib/calendar-win2k-cold-1.css" title="win2k-cold-1" />

  <!-- main calendar program -->
  <script type="text/javascript" src="/pub/TWiki/JSCalendarContrib/calendar.js"></script>

  <!-- language for the calendar -->
  <script type="text/javascript" src="/pub/TWiki/JSCalendarContrib/lang/calendar-en.js"></script>

  <!-- the following script defines the Calendar.setup helper function, which makes
       adding a calendar a matter of 1 or 2 lines of code. -->
  <script type="text/javascript" src="/pub/TWiki/JSCalendarContrib/calendar-setup.js"></script>

%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
|  <label for="action_who">Action for</label>| <select name="action_who"><option>---</option> %SEARCH{"%META:FORM.*[U]serForm" web="%MAINWEB%" type="regex" topic="*" casesensitive="on" nonoise="on" format="<option>$topic</option>" sort="topic" excludetopic="Test*, TWiki*" separator=" "}%</select> |
|  <label for="action_due">Due date</label>| <input type="text" name="action_due" id="f_date" readonly="1" size="10" /><img src="/pub/TWiki/JSCalendarContrib/img.gif" id="f_trigger" style="cursor: pointer; border: 1px solid blue;" title="Date selector" onmouseover="this.style.background='blue';" onmouseout="this.style.background=''" /> |
|  <label for="action_comment">Description</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="action_comment" id="action_comment" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> |
|| <input %DISABLED% type="submit" class="twikiButton" value="Add action" /> |

<script type="text/javascript">
        inputField     :    "f_date",     // id of the input field
        ifFormat       :    "%Y-%m-%d",   // format of the input field (was "%B %e, %Y)
        button         :    "f_trigger",  // trigger for the calendar (button ID)
        align          :    "Tl",         // alignment (defaults to "Bl")
        singleClick    :    true

%TMPL:DEF{OUTPUT:sm_action}%%POS:BEFORE%%AC%NOP%TION{who="%URLPARAM{"action_who"}%" due="%URLPARAM{"action_due"}%"}% %URLPARAM{"action_comment" newline="<br />"}% %ENDACTION%

See the reference links above for instructions and examples of how implement the templates.

Then to add this form to one of your pages and start tracking action items, add these two lines (#ActionTarget should appear on a line by itself, with no spaces).

#ActionTarget %COMMENT{type=sm_action target="#ActionTarget"}% 

That's it, and that's all. The Power of TWiki!

Update: From HowToRetrieveListOfValidUsers:

The cool-utility to add action items using the interface was having problems becuase of the following
a. Had to include %INCLUDE{"%SYSTEMWEB%/JSCalendarContribInline"}% in the template
b. Had to update the image source to src="%PUBURL%/%SYSTEMWEB%/JSCalendarContrib/img.gif
Not sure if these changes were required because of some incorrectness on my setup..but any felt like letting you know about these so that you can decide if they are valid or not

-- SrikanthKrishnamachary - 30 Apr 2008

2.2. Closing the Pop-Up Window

From TWiki:Plugins.ActionTrackerPluginDev:
The popup window not closing is freaking out the casual users, especially since some of them use the largest font available in IE on a 15" monitor. They don't get the new window filling up their screen :-). Would it be possible to explain how to modify something to allow 'unsafe' window closing?

-- JosMaccabiani - 24 May 2006

My colleagues likes the action tracker but they often complain about the fact that you have to click a link, a new page opens, you edit, you submit, and you have to close the resulting page and refresh the original. Eliminating some of these steps is a big wish.

-- KennethLavrsen - 02 Dec 2005

Of course you can change the plug-ins preferences to not use new windows (Set ACTIONTRACKERPLUGIN_USENEWWINDOW = 0). But that creates a problem when an action item appears in several topics, such as TWiki:Sandbox.MeetingMinutes (where an item is updated and carried forward to the next week), or on a project page as well as the assignees home page. In that case, after editing an item, the users expect to be taken back to the page they were on. But it doesn't do that: because the edits to an item are stored on the page where the action item was created, they can find themselves on a completely different page. Using the pop-up hides that problem, since the users usually closed that page anyway.

You can work-around this by adding the following script to topics where items are created. You do not need to put the script on every other topic that displays the items and where the edits are launched from (it doesn't hurt if you do, but it won't accomplish anything either). If you have used a template (e.g., MeetingViewTemplate), just put it in there, and you're done.

<script language='JavaScript' type='text/javascript'>
   // If arrived here (which is possibly an old meeting) from the
   // action editor, the data has already been successfully saved.
   // So it is now safe to reload the opener, and close this window.
   myRegExp = /.*\/bin\/edit\/.*\?.*;atp_action=\d*;.*/;
   if (document.referrer.match(myRegExp)) {
      window.opener.location.reload(true); // 'true' forces the cache to be ignored

2.3. Stylesheet Tweaks

Despite my rant against customization above, I customized \twiki\pub\TWiki\ActionTrackerPlugin\styles.css to add borders to the table cells in search results:
.atpSearch td {
padding:2px 5px;
border-right: 1px solid #AAA; /* CUSTOMIZED */
border-bottom: 1px solid #AAA; /* CUSTOMIZED */
vertical-align: top; /* CUSTOMIZED */

2.4. Sortable Columns

From TWiki:Plugins.ActionTrackerPluginDev:
My ActionSearch tables are not sortable by column is this a bug or per spec?

-- JosMaccabiani - 09 Feb 2007

Jos, it's per spec. The action tracker generates HTML tables, not TWiki tables, so the tables are not sortable by TablesPlugin. It's a tradeoff.

-- CrawfordCurrie - 22 Feb 2007

Understood, Crawford. But once users get used that feature, they expect to see it everywhere. So here's a work-around that can be used in implementation:

  1. For the column headers that you are using, add your own hyperlink to set a URL parameter with the desired sort order, e.g.,:
    * Set ACTIONTRACKERPLUGIN_TABLEHEADER = |<a style="color:white;" href=%SCRIPTURL%/view/%WEB%/%TOPIC%?action_sort=$due>Due date</a>|<a  style="color:white;" href=%SCRIPTURL%/view/%WEB%/%TOPIC%?action_sort=$text>Description</a>|<a style="color:white;" href=%SCRIPTURL%/view/%WEB%/%TOPIC%?action_sort=$uid>(edit)</a>|
  2. Detect that parameter and assign it to a TWikiVariable (usually the default order is $due, but here it's changed to $uid).
    * Set ACTIONTRACKERPLUGIN_SORTORDER = %IF{"defined action_sort" then="%URLPARAM{action_sort}%" else="$uid"}% 
  3. Use the sort order:
     %ACTIONSEARCH{state="open" topic="%TOPIC%.*" sort="%ACTIONTRACKERPLUGIN_SORTORDER%"}% 


  • Step 1 should be done in the topic with the ACTIONSEARCH rather than defined globally. Otherwise all such column headers would show hyperlinks, but they only work if steps 2 and 3 are also done in the topic. In that case, Step 1 should be hidden in HTML comment tags.
  • Step 2 must be done in the topic with the ACTIONSEARCH. It should be hidden in HTML comment tags.
  • Steps 2 and 3 may be combined in one line.
  • If the topic contains more than one ACTIONSEARCH, as written, the same sort order is imposed on them all. You could use different parameters for each table if needed.


Sean, you received a TWikiHeart for helping out the TWikiCommunity in the Support web.

-- PeterThoeny - 13 May 2008

My Personal Preferences

  • Show tool-tip topic info on mouse-over of WikiWord links, on or off:

  • Preference for the editor, default is the WYSIWYG editor. The options are raw, wysiwyg:
    • Set EDITMETHOD = wysiwyg

  • More preferences TWiki has system wide preferences settings defined in TWikiPreferences. You can customize preferences settings to your needs: To overload a system setting, (1) do a "raw view" on TWikiPreferences, (2) copy a Set VARIABLE = value bullet, (3) do a "raw edit" of your user profile page, (4) add the bullet to the bullet list above, and (5) customize the value as needed. Make sure the settings render as real bullets (in "raw edit", a bullet requires 3 or 6 spaces before the asterisk).

Related Topics

Edit | Attach | Watch | Print version | History: r26 < r25 < r24 < r23 < r22 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r26 - 2011-07-26 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.