%META:TOPICINFO{author="MatthiasThullner" date="1198851171" format="1.1" reprev="1.6" version="1.6"}%
%META:TOPICPARENT{name="TWiki2Go"}%
---+ !! !TWiki2GoUpdate
%TOC%

<a name="TWiki2GoUpdateForm"></a>
<noautolink>
<div class="twikiPageForm">
<form id="TWiki2GoUpdateForm" action="%SCRIPTURL%/zz_update_twiki2go%SCRIPTSUFFIX%" >
<table id="TWiki2GoUpdateTable" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td colspan="2" class="twikiFirstRow">
    <input type="submit" class="twikiSubmit" value='%MAKETEXT{"update TWiki2Go"}%' />
  </td>
  <td colspan="2">
    TWiki2Go content can be updated with the content from your intranet TWiki, just press the button
  </td>
</tr>
<tr>
  <td>
    <th class="twikiLast">%MAKETEXT{"Options:"}%</th>
  </td>
  <td class="twikiLast">
    <input type="checkbox" class="twikiCheckbox" id="update_topics" name="update_topics" "checked=\"checked\"" /><label for="update_topics">%MAKETEXT{"update topics"}%</label>
  </td><td>
    <input type="text" class="twikiInputField" id="txt_max_size" name="txt_max_size"  value="50000" size="10" /><label for="txt_max_size"> %MAKETEXT{"max topic size in byte"}%</label>
  </td>
</tr>
<tr>
  <td>
    <th class="twikiLast">%MAKETEXT{""}%</th>
  </td>
  <td class="twikiLast">
    <input type="checkbox" class="twikiCheckbox" id="update_attachments" name="update_attachments" "checked=\"checked\"" /><label for="update_topics">%MAKETEXT{"update attachments"}%</label>
  </td><td>
    <input type="text" class="twikiInputField" id="pub_max_size" name="pub_max_size"  value="50000" size="10" /><label for="pub_max_size"> %MAKETEXT{"max attachment size in byte"}%</label>
  </td>
</tr>
<tr>
  <td>
    <th class="twikiLast">%MAKETEXT{""}%</th>
  </td>
  <td class="twikiLast" colspan="2">
    <input type="text" class="twikiInputField" id="root" name="root"  value="D:/thu2si/TWiki/twiki_mirror_20071221/twiki" size="60" /><label for="root"> %MAKETEXT{"root dir"}%</label>
  </td>
</tr>
<tr>
  <td>
    <th class="twikiLast">%MAKETEXT{""}%</th>
  </td>
  <td class="twikiLast" colspan="2">
    <input type="text" class="twikiInputField" id="destination" name="destination"  value="D:/temp/twiki_test/twiki" size="60" /><label for="destination"> %MAKETEXT{"destination dir"}%</label>
  </td>
</tr>
</table>
</form>
</div>
</noautolink>

---++ Log of last update
%INCLUDE{TWiki2GoUpdateLog}%

---++ Description
Functionality of zz_update_twiki2go.pl

   1 Scan all <web>/WebPreferences for web wide access rigths
   1 Scan all webs to find all topics (i.e. *.txt files) that are not protected by TWikiAccessControl
   1 Update topics in destination
   1 Scan all attachments
   1 Update all attachments (that are attached to topics which are not protected by TWikiAccessControl)


---++ Usage
The script ./bin/zz_update_twiki.pl is used. Up to now it is a pit of a hack :-(

   1 Use zz_update_twiki.pl to copy TWiki topics and attachments to another directory on your server. 
      This can be done regularly with a cron-job.
   1 Create a Windows share on the server, the Windows clients have to map this share to *T:*
   1 The client user can update manually with the 'update TWiki2Go' button above.

---+++ Command line parameters
use a cron job to update the Windows share with the content you want to distribute

|*parameter* |*type*     |*description*                                                           |*default*                                        |
| root             | string    | the path where your original content comes from | T:                                                 |
| destination  | string     | the path where                                                     | C:\temp\TWiki2Go_2\htdocs\twiki |
| sync_all      | bool       | does not consider TWikiAccessControl                  | 0                                           |
| limit             | number  | only update <limit> topics; 0 for no limit; use only for debugging   | 0                                            |         
| limit_pub      | number  | only update <limit_pub> attachments; 0 for no limit; use only for debugging   | 0                                            |         
| txt_maxsize  | number  | only update topics that are smaller than <txt_maxsize>; 0 for no limit  | 50000                                            |         
| pub_maxsize  | number  | only update attachments that are smaller than <pub_maxsize>; 0 for no limit  | 50000                                            |         


---++ TODOs
   * improve script to take over URL parameters
   * different log output when started from command line
   * write log file to diskS

---++ Related topics

   * PublishContrib: add on to create static HTML topics

-- Main.MatthiasThullner - 26 Dec 2007  

---++ Discussion

%COMMENT%
